1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: DBSetupConnectionPages.hxx,v $
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"
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 //.........................................................................
52 //.........................................................................
54 class IDatabaseSettingsDialog
;
55 // static OGenericAdministrationPage* CreateDbaseTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
58 //========================================================================
59 //= OSpreadSheetConnectionPageSetup
60 //========================================================================
61 class OSpreadSheetConnectionPageSetup
: public OConnectionTabPageSetup
64 virtual BOOL
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
65 static OGenericAdministrationPage
* CreateSpreadSheetTabPage( Window
* pParent
, const SfxItemSet
& _rAttrSet
);
66 OSpreadSheetConnectionPageSetup(Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
69 CheckBox m_aCBPasswordrequired
;
70 virtual ~OSpreadSheetConnectionPageSetup();
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
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
;
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();
100 DECL_LINK(ImplGetExtensionHdl
, OTextConnectionHelper
*);
103 //========================================================================
104 //= OLDAPConnectionPageSetup
105 //========================================================================
106 class OLDAPConnectionPageSetup
: public OGenericAdministrationPage
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
); }
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
*);
121 FixedText m_aFTHeaderText
;
122 FixedText m_aFTHelpText
;
123 FixedText m_aFTHostServer
;
124 Edit m_aETHostServer
;
125 FixedText m_aFTBaseDN
;
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
140 FixedText m_aHelpText
;
141 MySQLNativeSettings m_aMySQLSettings
;
144 MySQLNativeSetupPage( Window
* _pParent
, const SfxItemSet
& _rCoreAttrs
);
146 static OGenericAdministrationPage
* Create( Window
* pParent
, const SfxItemSet
& _rAttrSet
);
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();
158 DECL_LINK( OnModified
, Edit
* );
161 //========================================================================
162 //= OGeneralSpecialJDBCConnectionPageSetup
163 //========================================================================
164 class OGeneralSpecialJDBCConnectionPageSetup
: public OGenericAdministrationPage
167 OGeneralSpecialJDBCConnectionPageSetup( Window
* pParent
169 , const SfxItemSet
& _rCoreAttrs
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
);
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
;
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
;
206 //========================================================================
207 //= OJDBCConnectionPageSetup
208 //========================================================================
209 class OJDBCConnectionPageSetup
: public OConnectionTabPageSetup
212 OJDBCConnectionPageSetup( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
213 static OGenericAdministrationPage
* CreateJDBCTabPage( Window
* pParent
, const SfxItemSet
& _rAttrSet
);
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
245 OMySQLIntroPageSetup( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
247 static OMySQLIntroPageSetup
* CreateMySQLIntroTabPage( Window
* _pParent
, const SfxItemSet
& _rAttrSet
);
248 ConnectionType
getMySQLMode();
250 void SetClickHdl( const Link
& rLink
) { maClickHdl
= rLink
; }
251 const Link
& GetClickHdl() const { return maClickHdl
; }
252 DECL_LINK(ImplClickHdl
, OMySQLIntroPageSetup
*);
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();
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
285 virtual BOOL
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
286 static OGenericAdministrationPage
* CreateAuthentificationTabPage( Window
* pParent
, const SfxItemSet
& _rAttrSet
);
287 OAuthentificationPageSetup(Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
290 FixedText m_aFTHelpText
;
291 FixedText m_aFTHeaderText
;
292 FixedText m_aFTUserName
;
294 CheckBox m_aCBPasswordRequired
;
295 PushButton m_aPBTestConnection
;
296 virtual ~OAuthentificationPageSetup();
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
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
*);
335 virtual ~OFinalDBPageSetup();
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 //.........................................................................
345 //.........................................................................