00001 /* AbiWord 00002 * Copyright (C) 2011 AbiSource, Inc. 00003 * Copyright (C) Ben Martin 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * as published by the Free Software Foundation; either version 2 00008 * of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00018 * 02110-1301 USA. 00019 */ 00020 00021 #ifndef AP_UNIXDIALOG_RDFQUERY_H 00022 #define AP_UNIXDIALOG_RDFQUERY_H 00023 00024 #include "ap_Dialog_RDFQuery.h" 00025 #include "fv_View.h" 00026 00027 class XAP_UnixFrame; 00028 00029 00030 00031 class AP_UnixDialog_RDFQuery: public AP_Dialog_RDFQuery 00032 { 00033 public: 00034 AP_UnixDialog_RDFQuery (XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); 00035 virtual ~AP_UnixDialog_RDFQuery (void); 00036 00037 static XAP_Dialog *static_constructor (XAP_DialogFactory *, 00038 XAP_Dialog_Id id); 00039 00040 virtual void runModeless (XAP_Frame *pFrame); 00041 virtual void notifyActiveFrame (XAP_Frame *pFrame); 00042 virtual void activate (void); 00043 virtual void destroy (void); 00044 00045 void onExecuteClicked(); 00046 void onShowAllClicked(); 00047 00048 00049 const GtkWidget *getWindow (void) { return m_wDialog; } 00050 00051 virtual void clear(); 00052 virtual void addStatement( const PD_RDFStatement& st ); 00053 virtual void addBinding( std::map< std::string, std::string >& b ); 00054 virtual void setStatus( const std::string& msg ); 00055 virtual void setQueryString( const std::string& sparql ); 00056 virtual void setupBindingsView( std::map< std::string, std::string >& b ); 00057 00058 protected: 00059 00060 void _constructWindow (XAP_Frame *pFrame); 00061 void _updateWindow (void); 00062 00063 private: 00064 00065 enum 00066 { 00067 C_SUBJ_COLUMN = 0, 00068 C_PRED_COLUMN, 00069 C_OBJ_COLUMN, 00070 C_COLUMN_COUNT, 00071 C_COLUMN_ARRAY_SIZE = 1024 00072 }; 00073 00074 GtkTreeViewColumn* w_cols[C_COLUMN_ARRAY_SIZE]; 00075 00076 GtkWidget *m_wDialog; 00077 GtkWidget *m_btClose; 00078 GtkWidget *m_btExecute; 00079 GtkWidget *m_btShowAll; 00080 GtkWidget *m_query; 00081 GtkTreeView* m_resultsView; 00082 GtkTreeStore* m_resultsModel; 00083 GtkWidget *m_status; 00084 00085 }; 00086 00087 #endif /* AP_UNIXDIALOG_RDFQUERY_H */ 00088 00089 00090