1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef DBACCESS_SOURCE_UI_UNO_COMPOSERDIALOGS_HXX
29 #define DBACCESS_SOURCE_UI_UNO_COMPOSERDIALOGS_HXX
30 
31 /** === begin UNO includes === **/
32 #ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
33 #include <com/sun/star/container/XNameAccess.hpp>
34 #endif
35 #ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
36 #include <com/sun/star/sdbc/XConnection.hpp>
37 #endif
38 #ifndef _COM_SUN_STAR_SDB_XSINGLESELECTQUERYCOMPOSER_HPP_
39 #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
40 #endif
41 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
42 #include <com/sun/star/beans/XPropertySet.hpp>
43 #endif
44 #ifndef _COM_SUN_STAR_SDBC_XROWSET_HPP_
45 #include <com/sun/star/sdbc/XRowSet.hpp>
46 #endif
47 /** === end UNO includes === **/
48 
49 #ifndef _SVT_GENERICUNODIALOG_HXX_
50 #include <svtools/genericunodialog.hxx>
51 #endif
52 #ifndef _DBAUI_MODULE_DBU_HXX_
53 #include "moduledbu.hxx"
54 #endif
55 #ifndef _DBASHARED_APITOOLS_HXX_
56 #include "apitools.hxx"
57 #endif
58 
59 //.........................................................................
60 namespace dbaui
61 {
62 //.........................................................................
63 
64     //=====================================================================
65     //= ComposerDialog
66     //=====================================================================
67     class ComposerDialog;
68     typedef ::svt::OGenericUnoDialog                                    ComposerDialog_BASE;
69     typedef ::comphelper::OPropertyArrayUsageHelper< ComposerDialog >  ComposerDialog_PBASE;
70 
71     class ComposerDialog
72             :public ComposerDialog_BASE
73             ,public ComposerDialog_PBASE
74     {
75 		OModuleClient m_aModuleClient;
76     protected:
77         // <properties>
78         ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer >
79                         m_xComposer;
80         ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >
81                         m_xRowSet;
82         // </properties>
83 
84     protected:
85         ComposerDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
86         ~ComposerDialog();
87 
88     public:
89         DECLARE_IMPLEMENTATION_ID( );
90 
91         DECLARE_PROPERTYCONTAINER_DEFAULTS( );
92 
93     protected:
94         // own overridables
95         virtual Dialog* createComposerDialog(
96             Window* _pParent,
97             const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
98             const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxColumns
99         ) = 0;
100 
101     private:
102         // OGenericUnoDialog overridables
103         virtual Dialog* createDialog(Window* _pParent);
104     };
105 
106 	//=====================================================================
107 	//= RowsetFilterDialog
108 	//=====================================================================
109     class RowsetFilterDialog : public ComposerDialog
110     {
111     public:
112         RowsetFilterDialog(
113             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
114         );
115 
116         DECLARE_SERVICE_INFO_STATIC( );
117 
118     protected:
119         // own overridables
120         virtual Dialog* createComposerDialog(
121             Window* _pParent,
122             const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
123             const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxColumns
124         );
125 
126         // OGenericUnoDialog overridables
127 		virtual void executedDialog( sal_Int16 _nExecutionResult );
128     };
129 
130 	//=====================================================================
131 	//= RowsetOrderDialog
132 	//=====================================================================
133     class RowsetOrderDialog : public ComposerDialog
134     {
135     public:
136         RowsetOrderDialog(
137             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
138         );
139 
140         DECLARE_SERVICE_INFO_STATIC( );
141 
142     protected:
143         // own overridables
144         virtual Dialog* createComposerDialog(
145             Window* _pParent,
146             const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
147             const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxColumns
148         );
149 
150         // OGenericUnoDialog overridables
151 		virtual void executedDialog( sal_Int16 _nExecutionResult );
152     };
153 
154 //.........................................................................
155 }   // namespace dbaui
156 //.........................................................................
157 
158 #endif // DBACCESS_SOURCE_UI_UNO_COMPOSERDIALOGS_HXX
159 
160 
161