merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / ui / dlg / DBSetupConnectionPages.hxx
blobb8a1d1d78c08ae3cd5e9fa4fbc1104f415b57077
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 #include "adminpages.hxx"
39 #include "admincontrols.hxx"
40 #include "curledit.hxx"
41 #include "TextConnectionHelper.hxx"
43 #include <svtools/roadmapwizard.hxx>
44 #include <ucbhelper/content.hxx>
45 #include <vcl/field.hxx>
48 //.........................................................................
49 namespace dbaui
52 //.........................................................................
54 class IDatabaseSettingsDialog;
55 // static OGenericAdministrationPage* CreateDbaseTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
58 //========================================================================
59 //= OSpreadSheetConnectionPageSetup
60 //========================================================================
61 class OSpreadSheetConnectionPageSetup : public OConnectionTabPageSetup
63 public:
64 virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs );
65 static OGenericAdministrationPage* CreateSpreadSheetTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
66 OSpreadSheetConnectionPageSetup(Window* pParent, const SfxItemSet& _rCoreAttrs);
68 protected:
69 CheckBox m_aCBPasswordrequired;
70 virtual ~OSpreadSheetConnectionPageSetup();
72 protected:
73 virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
74 virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
75 virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
79 //========================================================================
80 //= OTextConnectionPage
81 //========================================================================
82 class OTextConnectionPageSetup : public OConnectionTabPageSetup
84 public:
85 virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs );
86 static OGenericAdministrationPage* CreateTextTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
87 OTextConnectionPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs );
88 OTextConnectionHelper* m_pTextConnectionHelper;
89 private:
91 protected:
92 virtual ~OTextConnectionPageSetup();
93 virtual sal_Bool prepareLeave();
94 virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
95 virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
96 virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
97 bool checkTestConnection();
99 private:
100 DECL_LINK(ImplGetExtensionHdl, OTextConnectionHelper*);
103 //========================================================================
104 //= OLDAPConnectionPageSetup
105 //========================================================================
106 class OLDAPConnectionPageSetup : public OGenericAdministrationPage
108 public:
109 virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs );
110 static OGenericAdministrationPage* CreateLDAPTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
111 OLDAPConnectionPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs );
112 virtual Link getControlModifiedLink() { return LINK(this, OLDAPConnectionPageSetup, OnEditModified); }
114 protected:
115 virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
116 virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
117 virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
118 DECL_LINK(OnEditModified,Edit*);
120 private:
121 FixedText m_aFTHeaderText;
122 FixedText m_aFTHelpText;
123 FixedText m_aFTHostServer;
124 Edit m_aETHostServer;
125 FixedText m_aFTBaseDN;
126 Edit m_aETBaseDN;
127 FixedText m_aFTPortNumber;
128 NumericField m_aNFPortNumber;
129 FixedText m_aFTDefaultPortNumber;
130 CheckBox m_aCBUseSSL;
133 //========================================================================
134 //= MySQLNativeSetupPage
135 //========================================================================
136 class MySQLNativeSetupPage : public OGenericAdministrationPage
138 private:
139 FixedText m_aHeader;
140 FixedText m_aHelpText;
141 MySQLNativeSettings m_aMySQLSettings;
143 public:
144 MySQLNativeSetupPage( Window* _pParent, const SfxItemSet& _rCoreAttrs );
146 static OGenericAdministrationPage* Create( Window* pParent, const SfxItemSet& _rAttrSet );
148 protected:
149 virtual void fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList );
150 virtual void fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList );
152 virtual BOOL FillItemSet( SfxItemSet& _rCoreAttrs );
153 virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
155 virtual Link getControlModifiedLink();
157 private:
158 DECL_LINK( OnModified, Edit* );
161 //========================================================================
162 //= OGeneralSpecialJDBCConnectionPageSetup
163 //========================================================================
164 class OGeneralSpecialJDBCConnectionPageSetup : public OGenericAdministrationPage
166 public:
167 OGeneralSpecialJDBCConnectionPageSetup( Window* pParent
168 , USHORT _nResId
169 , const SfxItemSet& _rCoreAttrs
170 , USHORT _nPortId
171 , USHORT _nDefaultPortResId
172 , USHORT _nHelpTextResId
173 , USHORT _nHeaderTextResId
174 , USHORT _nDriverClassId );
175 static OGenericAdministrationPage* CreateMySQLJDBCTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
176 static OGenericAdministrationPage* CreateOracleJDBCTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
178 protected:
179 virtual BOOL FillItemSet( SfxItemSet& _rCoreAttrs );
180 virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
181 virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
182 virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
183 virtual Link getControlModifiedLink() { return LINK(this, OGeneralSpecialJDBCConnectionPageSetup, OnEditModified); }
185 DECL_LINK(OnTestJavaClickHdl,PushButton*);
186 DECL_LINK(OnEditModified,Edit*);
187 FixedText m_aFTHelpText;
188 FixedText m_aFTDatabasename;
189 Edit m_aETDatabasename;
190 FixedText m_aFTHostname;
191 Edit m_aETHostname;
192 FixedText m_aFTPortNumber;
193 FixedText m_aFTDefaultPortNumber;
194 NumericField m_aNFPortNumber;
197 FixedText m_aFTDriverClass;
198 Edit m_aETDriverClass;
199 PushButton m_aPBTestJavaDriver;
201 String m_sDefaultJdbcDriverName;
202 USHORT m_nPortId;
206 //========================================================================
207 //= OJDBCConnectionPageSetup
208 //========================================================================
209 class OJDBCConnectionPageSetup : public OConnectionTabPageSetup
211 public:
212 OJDBCConnectionPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs );
213 static OGenericAdministrationPage* CreateJDBCTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
215 protected:
216 virtual bool checkTestConnection();
218 virtual BOOL FillItemSet( SfxItemSet& _rCoreAttrs );
219 virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
220 virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
221 virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
223 DECL_LINK(OnTestJavaClickHdl,PushButton*);
224 DECL_LINK(OnEditModified,Edit*);
225 FixedText m_aFTDriverClass;
226 Edit m_aETDriverClass;
227 PushButton m_aPBTestJavaDriver;
232 //========================================================================
233 //= OJDBCConnectionPageSetup
234 //========================================================================
235 class OMySQLIntroPageSetup : public OGenericAdministrationPage
237 public:
238 enum ConnectionType
240 VIA_ODBC,
241 VIA_JDBC,
242 VIA_NATIVE
245 OMySQLIntroPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs);
247 static OMySQLIntroPageSetup* CreateMySQLIntroTabPage( Window* _pParent, const SfxItemSet& _rAttrSet );
248 ConnectionType getMySQLMode();
249 Link maClickHdl;
250 void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
251 const Link& GetClickHdl() const { return maClickHdl; }
252 DECL_LINK(ImplClickHdl, OMySQLIntroPageSetup*);
257 protected:
258 virtual BOOL FillItemSet(SfxItemSet& _rSet);
259 virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
260 virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
261 virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
262 virtual ~OMySQLIntroPageSetup();
264 private:
265 RadioButton m_aRB_ODBCDatabase;
266 RadioButton m_aRB_JDBCDatabase;
267 RadioButton m_aRB_NATIVEDatabase;
268 FixedText m_aFT_ConnectionMode;
269 FixedText m_aFT_Helptext;
270 FixedText m_aFT_Headertext;
272 DECL_LINK(OnSetupModeSelected, RadioButton*);
279 //========================================================================
280 //= OAuthentificationPageSetup
281 //========================================================================
282 class OAuthentificationPageSetup : public OGenericAdministrationPage
284 public:
285 virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs );
286 static OGenericAdministrationPage* CreateAuthentificationTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
287 OAuthentificationPageSetup(Window* pParent, const SfxItemSet& _rCoreAttrs);
289 protected:
290 FixedText m_aFTHelpText;
291 FixedText m_aFTHeaderText;
292 FixedText m_aFTUserName;
293 Edit m_aETUserName;
294 CheckBox m_aCBPasswordRequired;
295 PushButton m_aPBTestConnection;
296 virtual ~OAuthentificationPageSetup();
298 protected:
299 virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
300 virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
301 virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
306 //========================================================================
307 //= OFinalDBPageSetup
308 //========================================================================
309 class OFinalDBPageSetup : public OGenericAdministrationPage
311 public:
312 virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs );
313 static OGenericAdministrationPage* CreateFinalDBTabPageSetup( Window* pParent, const SfxItemSet& _rAttrSet);
315 FixedText m_aFTFinalHeader;
316 FixedText m_aFTFinalHelpText;
317 RadioButton m_aRBRegisterDataSource;
318 RadioButton m_aRBDontregisterDataSource;
319 FixedText m_aFTAdditionalSettings;
320 CheckBox m_aCBOpenAfterwards;
321 CheckBox m_aCBStartTableWizard;
322 FixedText m_aFTFinalText;
324 OFinalDBPageSetup(Window* pParent, const SfxItemSet& _rCoreAttrs);
325 sal_Bool IsDatabaseDocumentToBeRegistered();
326 sal_Bool IsDatabaseDocumentToBeOpened();
327 sal_Bool IsTableWizardToBeStarted();
328 void enableTableWizardCheckBox( sal_Bool _bSupportsTableCreation);
330 /// may be used in SetXXXHdl calls to controls, is a link to <method>OnControlModified</method>
331 Link getControlModifiedLink() { return LINK(this, OGenericAdministrationPage, OnControlModified); }
333 DECL_LINK(OnOpenSelected, CheckBox*);
334 protected:
335 virtual ~OFinalDBPageSetup();
337 protected:
338 virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
339 virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
340 virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
343 //.........................................................................
344 } // namespace dbaui
345 //.........................................................................
347 #endif