update dev300-m58
[ooovba.git] / dbaccess / source / ui / dlg / DBSetupConnectionPages.hxx
blob5813af68c43c0c140036d3b818f540e6cd4645a1
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: DBSetupConnectionPages.hxx,v $
10 * $Revision: 1.9 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef DBAUI_DBSETUPCONNECTIONPAGES_HXX
32 #define DBAUI_DBSETUPCONNECTIONPAGES_HXX
34 #ifndef DBAUI_CONNECTIONPAGESETUP_HXX
35 #include "ConnectionPageSetup.hxx"
36 #endif
38 #ifndef _DBAUI_ADMINPAGES_HXX_
39 #include "adminpages.hxx"
40 #endif
41 #ifndef _UCBHELPER_CONTENT_HXX
42 #include <ucbhelper/content.hxx>
43 #endif
44 #ifndef _DBAUI_CURLEDIT_HXX_
45 #include "curledit.hxx"
46 #endif
47 #ifndef SVTOOLS_INC_ROADMAPWIZARD_HXX
48 #include <svtools/roadmapwizard.hxx>
49 #endif
50 #ifndef _SV_FIELD_HXX
51 #include <vcl/field.hxx>
52 #endif
53 #ifndef DBAUI_TEXTCONNECTIONHELPER_HXX
54 #include "TextConnectionHelper.hxx"
55 #endif
58 //.........................................................................
59 namespace dbaui
62 //.........................................................................
64 class IDatabaseSettingsDialog;
65 // static OGenericAdministrationPage* CreateDbaseTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
68 //========================================================================
69 //= OSpreadSheetConnectionPageSetup
70 //========================================================================
71 class OSpreadSheetConnectionPageSetup : public OConnectionTabPageSetup
73 public:
74 virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs );
75 static OGenericAdministrationPage* CreateSpreadSheetTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
76 OSpreadSheetConnectionPageSetup(Window* pParent, const SfxItemSet& _rCoreAttrs);
78 protected:
79 CheckBox m_aCBPasswordrequired;
80 virtual ~OSpreadSheetConnectionPageSetup();
82 protected:
83 virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
84 virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
85 virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
89 //========================================================================
90 //= OTextConnectionPage
91 //========================================================================
92 class OTextConnectionPageSetup : public OConnectionTabPageSetup
94 public:
95 virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs );
96 static OGenericAdministrationPage* CreateTextTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
97 OTextConnectionPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs );
98 OTextConnectionHelper* m_pTextConnectionHelper;
99 private:
101 protected:
102 virtual ~OTextConnectionPageSetup();
103 virtual sal_Bool prepareLeave();
104 virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
105 virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
106 virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
107 bool checkTestConnection();
109 private:
110 DECL_LINK(ImplGetExtensionHdl, OTextConnectionHelper*);
113 //========================================================================
114 //= OLDAPConnectionPageSetup
115 //========================================================================
116 class OLDAPConnectionPageSetup : public OGenericAdministrationPage
118 public:
119 virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs );
120 static OGenericAdministrationPage* CreateLDAPTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
121 OLDAPConnectionPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs );
122 virtual Link getControlModifiedLink() { return LINK(this, OLDAPConnectionPageSetup, OnEditModified); }
124 protected:
125 virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
126 virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
127 virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
128 DECL_LINK(OnEditModified,Edit*);
130 private:
131 FixedText m_aFTHeaderText;
132 FixedText m_aFTHelpText;
133 FixedText m_aFTHostServer;
134 Edit m_aETHostServer;
135 FixedText m_aFTBaseDN;
136 Edit m_aETBaseDN;
137 FixedText m_aFTPortNumber;
138 NumericField m_aNFPortNumber;
139 FixedText m_aFTDefaultPortNumber;
140 CheckBox m_aCBUseSSL;
144 //========================================================================
145 //= OGeneralSpecialJDBCConnectionPageSetup
146 //========================================================================
147 class OGeneralSpecialJDBCConnectionPageSetup : public OGenericAdministrationPage
149 public:
150 OGeneralSpecialJDBCConnectionPageSetup( Window* pParent
151 , USHORT _nResId
152 , const SfxItemSet& _rCoreAttrs
153 , USHORT _nPortId
154 , USHORT _nDefaultPortResId
155 , USHORT _nHelpTextResId
156 , USHORT _nHeaderTextResId
157 , USHORT _nDriverClassId );
158 static OGenericAdministrationPage* CreateMySQLJDBCTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
159 static OGenericAdministrationPage* CreateMySQLNATIVETabPage( Window* pParent, const SfxItemSet& _rAttrSet );
160 static OGenericAdministrationPage* CreateOracleJDBCTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
161 virtual Link getControlModifiedLink() { return LINK(this, OGeneralSpecialJDBCConnectionPageSetup, OnEditModified); }
164 protected:
167 virtual BOOL FillItemSet( SfxItemSet& _rCoreAttrs );
168 virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
169 virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
170 virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
172 DECL_LINK(OnTestJavaClickHdl,PushButton*);
173 DECL_LINK(OnEditModified,Edit*);
174 FixedText* m_pFTHeaderText;
175 FixedText m_aFTHelpText;
176 FixedText m_aFTDatabasename;
177 Edit m_aETDatabasename;
178 FixedText m_aFTHostname;
179 Edit m_aETHostname;
180 FixedText m_aFTPortNumber;
181 FixedText m_aFTDefaultPortNumber;
182 NumericField m_aNFPortNumber;
183 FixedText m_aFTSocket;
184 Edit m_aETSocket;
187 FixedText m_aFTDriverClass;
188 Edit m_aETDriverClass;
189 PushButton m_aPBTestJavaDriver;
191 String m_sDefaultJdbcDriverName;
192 USHORT m_nPortId;
193 bool m_bUseClass;
197 //========================================================================
198 //= OJDBCConnectionPageSetup
199 //========================================================================
200 class OJDBCConnectionPageSetup : public OConnectionTabPageSetup
202 public:
203 OJDBCConnectionPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs );
204 static OGenericAdministrationPage* CreateJDBCTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
206 protected:
207 virtual bool checkTestConnection();
209 virtual BOOL FillItemSet( SfxItemSet& _rCoreAttrs );
210 virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
211 virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
212 virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
214 DECL_LINK(OnTestJavaClickHdl,PushButton*);
215 DECL_LINK(OnEditModified,Edit*);
216 FixedText m_aFTDriverClass;
217 Edit m_aETDriverClass;
218 PushButton m_aPBTestJavaDriver;
223 //========================================================================
224 //= OJDBCConnectionPageSetup
225 //========================================================================
226 class OMySQLIntroPageSetup : public OGenericAdministrationPage
228 public:
229 enum ConnectionType
231 VIA_ODBC,
232 VIA_JDBC,
233 VIA_NATIVE
236 OMySQLIntroPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs);
238 static OMySQLIntroPageSetup* CreateMySQLIntroTabPage( Window* _pParent, const SfxItemSet& _rAttrSet );
239 ConnectionType getMySQLMode();
240 Link maClickHdl;
241 void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
242 const Link& GetClickHdl() const { return maClickHdl; }
243 DECL_LINK(ImplClickHdl, OMySQLIntroPageSetup*);
248 protected:
249 virtual BOOL FillItemSet(SfxItemSet& _rSet);
250 virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
251 virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
252 virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
253 virtual ~OMySQLIntroPageSetup();
255 private:
256 RadioButton m_aRB_ODBCDatabase;
257 RadioButton m_aRB_JDBCDatabase;
258 RadioButton m_aRB_NATIVEDatabase;
259 FixedText m_aFT_ConnectionMode;
260 FixedText m_aFT_Helptext;
261 FixedText m_aFT_Headertext;
263 DECL_LINK(OnSetupModeSelected, RadioButton*);
270 //========================================================================
271 //= OAuthentificationPageSetup
272 //========================================================================
273 class OAuthentificationPageSetup : public OGenericAdministrationPage
275 public:
276 virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs );
277 static OGenericAdministrationPage* CreateAuthentificationTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
278 OAuthentificationPageSetup(Window* pParent, const SfxItemSet& _rCoreAttrs);
280 protected:
281 FixedText m_aFTHelpText;
282 FixedText m_aFTHeaderText;
283 FixedText m_aFTUserName;
284 Edit m_aETUserName;
285 CheckBox m_aCBPasswordRequired;
286 PushButton m_aPBTestConnection;
287 virtual ~OAuthentificationPageSetup();
289 protected:
290 virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
291 virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
292 virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
297 //========================================================================
298 //= OFinalDBPageSetup
299 //========================================================================
300 class OFinalDBPageSetup : public OGenericAdministrationPage
302 public:
303 virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs );
304 static OGenericAdministrationPage* CreateFinalDBTabPageSetup( Window* pParent, const SfxItemSet& _rAttrSet);
306 FixedText m_aFTFinalHeader;
307 FixedText m_aFTFinalHelpText;
308 RadioButton m_aRBRegisterDataSource;
309 RadioButton m_aRBDontregisterDataSource;
310 FixedText m_aFTAdditionalSettings;
311 CheckBox m_aCBOpenAfterwards;
312 CheckBox m_aCBStartTableWizard;
313 FixedText m_aFTFinalText;
315 OFinalDBPageSetup(Window* pParent, const SfxItemSet& _rCoreAttrs);
316 sal_Bool IsDatabaseDocumentToBeRegistered();
317 sal_Bool IsDatabaseDocumentToBeOpened();
318 sal_Bool IsTableWizardToBeStarted();
319 void enableTableWizardCheckBox( sal_Bool _bSupportsTableCreation);
321 /// may be used in SetXXXHdl calls to controls, is a link to <method>OnControlModified</method>
322 Link getControlModifiedLink() { return LINK(this, OGenericAdministrationPage, OnControlModified); }
324 DECL_LINK(OnOpenSelected, CheckBox*);
325 protected:
326 virtual ~OFinalDBPageSetup();
328 protected:
329 virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
330 virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
331 virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
334 //.........................................................................
335 } // namespace dbaui
336 //.........................................................................
338 #endif