1 /* AbiWord
2  * Copyright (C) 2011 AbiSource, Inc.
3  * Copyright (C) Ben Martin
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  * 02110-1301 USA.
19  */
20 
21 #ifndef AP_UNIXDIALOG_RDFQUERY_H
22 #define AP_UNIXDIALOG_RDFQUERY_H
23 
24 #include "ap_Dialog_RDFQuery.h"
25 #include "fv_View.h"
26 
27 class XAP_UnixFrame;
28 
29 
30 
31 class AP_UnixDialog_RDFQuery: public AP_Dialog_RDFQuery
32 {
33 public:
34 	AP_UnixDialog_RDFQuery (XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id);
35 	virtual ~AP_UnixDialog_RDFQuery (void);
36 
37 	static XAP_Dialog *static_constructor (XAP_DialogFactory *,
38 										   XAP_Dialog_Id id);
39 
40 	virtual void runModeless 	   (XAP_Frame *pFrame);
41 	virtual void notifyActiveFrame (XAP_Frame *pFrame);
42 	virtual void activate	 	   (void);
43 	virtual void destroy 		   (void);
44 
45     void onExecuteClicked();
46     void onShowAllClicked();
47 
48 
getWindow(void)49 	const GtkWidget *getWindow (void) { return m_wDialog; }
50 
51     virtual void clear();
52     virtual void addStatement( const PD_RDFStatement& st );
53     virtual void addBinding( std::map< std::string, std::string >& b );
54     virtual void setStatus( const std::string& msg );
55     virtual void setQueryString( const std::string& sparql );
56     virtual void setupBindingsView( std::map< std::string, std::string >& b );
57 
58 protected:
59 
60 	void _constructWindow 	  (XAP_Frame *pFrame);
61 	void _updateWindow		  (void);
62 
63 private:
64 
65     enum
66     {
67         C_SUBJ_COLUMN = 0,
68         C_PRED_COLUMN,
69         C_OBJ_COLUMN,
70 		C_COLUMN_COUNT,
71         C_COLUMN_ARRAY_SIZE = 1024
72 	};
73 
74     GtkTreeViewColumn* w_cols[C_COLUMN_ARRAY_SIZE];
75 
76 	GtkWidget *m_wDialog;
77 	GtkWidget *m_btClose;
78     GtkWidget *m_btExecute;
79     GtkWidget *m_btShowAll;
80     GtkWidget *m_query;
81 	GtkTreeView*  m_resultsView;
82 	GtkTreeStore* m_resultsModel;
83     GtkWidget *m_status;
84 
85 };
86 
87 #endif /* AP_UNIXDIALOG_RDFQUERY_H */
88 
89 
90 
91