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 #ifndef _DBAUI_ADMINPAGES_HXX_
39 #include "adminpages.hxx"
41 #ifndef _UCBHELPER_CONTENT_HXX
42 #include <ucbhelper/content.hxx>
44 #ifndef _DBAUI_CURLEDIT_HXX_
45 #include "curledit.hxx"
47 #ifndef SVTOOLS_INC_ROADMAPWIZARD_HXX
48 #include <svtools/roadmapwizard.hxx>
51 #include <vcl/field.hxx>
53 #ifndef DBAUI_TEXTCONNECTIONHELPER_HXX
54 #include "TextConnectionHelper.hxx"
58 //.........................................................................
62 //.........................................................................
64 class IDatabaseSettingsDialog
;
65 // static OGenericAdministrationPage* CreateDbaseTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
68 //========================================================================
69 //= OSpreadSheetConnectionPageSetup
70 //========================================================================
71 class OSpreadSheetConnectionPageSetup
: public OConnectionTabPageSetup
74 virtual BOOL
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
75 static OGenericAdministrationPage
* CreateSpreadSheetTabPage( Window
* pParent
, const SfxItemSet
& _rAttrSet
);
76 OSpreadSheetConnectionPageSetup(Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
79 CheckBox m_aCBPasswordrequired
;
80 virtual ~OSpreadSheetConnectionPageSetup();
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
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
;
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();
110 DECL_LINK(ImplGetExtensionHdl
, OTextConnectionHelper
*);
113 //========================================================================
114 //= OLDAPConnectionPageSetup
115 //========================================================================
116 class OLDAPConnectionPageSetup
: public OGenericAdministrationPage
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
); }
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
*);
131 FixedText m_aFTHeaderText
;
132 FixedText m_aFTHelpText
;
133 FixedText m_aFTHostServer
;
134 Edit m_aETHostServer
;
135 FixedText m_aFTBaseDN
;
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
150 OGeneralSpecialJDBCConnectionPageSetup( Window
* pParent
152 , const SfxItemSet
& _rCoreAttrs
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
); }
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
;
180 FixedText m_aFTPortNumber
;
181 FixedText m_aFTDefaultPortNumber
;
182 NumericField m_aNFPortNumber
;
183 FixedText m_aFTSocket
;
187 FixedText m_aFTDriverClass
;
188 Edit m_aETDriverClass
;
189 PushButton m_aPBTestJavaDriver
;
191 String m_sDefaultJdbcDriverName
;
197 //========================================================================
198 //= OJDBCConnectionPageSetup
199 //========================================================================
200 class OJDBCConnectionPageSetup
: public OConnectionTabPageSetup
203 OJDBCConnectionPageSetup( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
204 static OGenericAdministrationPage
* CreateJDBCTabPage( Window
* pParent
, const SfxItemSet
& _rAttrSet
);
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
236 OMySQLIntroPageSetup( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
238 static OMySQLIntroPageSetup
* CreateMySQLIntroTabPage( Window
* _pParent
, const SfxItemSet
& _rAttrSet
);
239 ConnectionType
getMySQLMode();
241 void SetClickHdl( const Link
& rLink
) { maClickHdl
= rLink
; }
242 const Link
& GetClickHdl() const { return maClickHdl
; }
243 DECL_LINK(ImplClickHdl
, OMySQLIntroPageSetup
*);
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();
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
276 virtual BOOL
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
277 static OGenericAdministrationPage
* CreateAuthentificationTabPage( Window
* pParent
, const SfxItemSet
& _rAttrSet
);
278 OAuthentificationPageSetup(Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
281 FixedText m_aFTHelpText
;
282 FixedText m_aFTHeaderText
;
283 FixedText m_aFTUserName
;
285 CheckBox m_aCBPasswordRequired
;
286 PushButton m_aPBTestConnection
;
287 virtual ~OAuthentificationPageSetup();
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
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
*);
326 virtual ~OFinalDBPageSetup();
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 //.........................................................................
336 //.........................................................................