1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef DBAUI_DBSETUPCONNECTIONPAGES_HXX
30 #define DBAUI_DBSETUPCONNECTIONPAGES_HXX
32 #include "ConnectionPageSetup.hxx"
34 #include "adminpages.hxx"
35 #include "admincontrols.hxx"
36 #include "curledit.hxx"
37 #include "TextConnectionHelper.hxx"
39 #include <svtools/roadmapwizard.hxx>
40 #include <ucbhelper/content.hxx>
41 #include <vcl/field.hxx>
44 //.........................................................................
48 //.........................................................................
50 class IDatabaseSettingsDialog
;
53 //========================================================================
54 //= OSpreadSheetConnectionPageSetup
55 //========================================================================
56 class OSpreadSheetConnectionPageSetup
: public OConnectionTabPageSetup
59 virtual sal_Bool
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
60 static OGenericAdministrationPage
* CreateSpreadSheetTabPage( Window
* pParent
, const SfxItemSet
& _rAttrSet
);
61 OSpreadSheetConnectionPageSetup(Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
64 CheckBox m_aCBPasswordrequired
;
65 virtual ~OSpreadSheetConnectionPageSetup();
68 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
69 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
70 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
74 //========================================================================
75 //= OTextConnectionPage
76 //========================================================================
77 class OTextConnectionPageSetup
: public OConnectionTabPageSetup
80 virtual sal_Bool
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
81 static OGenericAdministrationPage
* CreateTextTabPage( Window
* pParent
, const SfxItemSet
& _rAttrSet
);
82 OTextConnectionPageSetup( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
83 OTextConnectionHelper
* m_pTextConnectionHelper
;
87 virtual ~OTextConnectionPageSetup();
88 virtual sal_Bool
prepareLeave();
89 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
90 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
91 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
92 bool checkTestConnection();
95 DECL_LINK(ImplGetExtensionHdl
, OTextConnectionHelper
*);
98 //========================================================================
99 //= OLDAPConnectionPageSetup
100 //========================================================================
101 class OLDAPConnectionPageSetup
: public OGenericAdministrationPage
104 virtual sal_Bool
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
105 static OGenericAdministrationPage
* CreateLDAPTabPage( Window
* pParent
, const SfxItemSet
& _rAttrSet
);
106 OLDAPConnectionPageSetup( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
107 virtual Link
getControlModifiedLink() { return LINK(this, OLDAPConnectionPageSetup
, OnEditModified
); }
110 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
111 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
112 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
113 DECL_LINK(OnEditModified
,Edit
*);
116 FixedText m_aFTHeaderText
;
117 FixedText m_aFTHelpText
;
118 FixedText m_aFTHostServer
;
119 Edit m_aETHostServer
;
120 FixedText m_aFTBaseDN
;
122 FixedText m_aFTPortNumber
;
123 NumericField m_aNFPortNumber
;
124 FixedText m_aFTDefaultPortNumber
;
125 CheckBox m_aCBUseSSL
;
128 //========================================================================
129 //= MySQLNativeSetupPage
130 //========================================================================
131 class MySQLNativeSetupPage
: public OGenericAdministrationPage
135 FixedText m_aHelpText
;
136 MySQLNativeSettings m_aMySQLSettings
;
139 MySQLNativeSetupPage( Window
* _pParent
, const SfxItemSet
& _rCoreAttrs
);
141 static OGenericAdministrationPage
* Create( Window
* pParent
, const SfxItemSet
& _rAttrSet
);
144 virtual void fillControls( ::std::vector
< ISaveValueWrapper
* >& _rControlList
);
145 virtual void fillWindows( ::std::vector
< ISaveValueWrapper
* >& _rControlList
);
147 virtual sal_Bool
FillItemSet( SfxItemSet
& _rCoreAttrs
);
148 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
150 virtual Link
getControlModifiedLink();
153 DECL_LINK( OnModified
, Edit
* );
156 //========================================================================
157 //= OGeneralSpecialJDBCConnectionPageSetup
158 //========================================================================
159 class OGeneralSpecialJDBCConnectionPageSetup
: public OGenericAdministrationPage
162 OGeneralSpecialJDBCConnectionPageSetup( Window
* pParent
164 , const SfxItemSet
& _rCoreAttrs
165 , sal_uInt16 _nPortId
166 , sal_uInt16 _nDefaultPortResId
167 , sal_uInt16 _nHelpTextResId
168 , sal_uInt16 _nHeaderTextResId
169 , sal_uInt16 _nDriverClassId
);
170 static OGenericAdministrationPage
* CreateMySQLJDBCTabPage( Window
* pParent
, const SfxItemSet
& _rAttrSet
);
171 static OGenericAdministrationPage
* CreateOracleJDBCTabPage( Window
* pParent
, const SfxItemSet
& _rAttrSet
);
174 virtual sal_Bool
FillItemSet( SfxItemSet
& _rCoreAttrs
);
175 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
176 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
177 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
178 virtual Link
getControlModifiedLink() { return LINK(this, OGeneralSpecialJDBCConnectionPageSetup
, OnEditModified
); }
180 DECL_LINK(OnTestJavaClickHdl
,PushButton
*);
181 DECL_LINK(OnEditModified
,Edit
*);
182 FixedText m_aFTHelpText
;
183 FixedText m_aFTDatabasename
;
184 Edit m_aETDatabasename
;
185 FixedText m_aFTHostname
;
187 FixedText m_aFTPortNumber
;
188 FixedText m_aFTDefaultPortNumber
;
189 NumericField m_aNFPortNumber
;
192 FixedText m_aFTDriverClass
;
193 Edit m_aETDriverClass
;
194 PushButton m_aPBTestJavaDriver
;
196 String m_sDefaultJdbcDriverName
;
197 sal_uInt16 m_nPortId
;
201 //========================================================================
202 //= OJDBCConnectionPageSetup
203 //========================================================================
204 class OJDBCConnectionPageSetup
: public OConnectionTabPageSetup
207 OJDBCConnectionPageSetup( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
208 static OGenericAdministrationPage
* CreateJDBCTabPage( Window
* pParent
, const SfxItemSet
& _rAttrSet
);
211 virtual bool checkTestConnection();
213 virtual sal_Bool
FillItemSet( SfxItemSet
& _rCoreAttrs
);
214 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
215 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
216 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
218 DECL_LINK(OnTestJavaClickHdl
,PushButton
*);
219 DECL_LINK(OnEditModified
,Edit
*);
220 FixedText m_aFTDriverClass
;
221 Edit m_aETDriverClass
;
222 PushButton m_aPBTestJavaDriver
;
227 //========================================================================
228 //= OJDBCConnectionPageSetup
229 //========================================================================
230 class OMySQLIntroPageSetup
: public OGenericAdministrationPage
240 OMySQLIntroPageSetup( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
242 static OMySQLIntroPageSetup
* CreateMySQLIntroTabPage( Window
* _pParent
, const SfxItemSet
& _rAttrSet
);
243 ConnectionType
getMySQLMode();
245 void SetClickHdl( const Link
& rLink
) { maClickHdl
= rLink
; }
246 const Link
& GetClickHdl() const { return maClickHdl
; }
247 DECL_LINK(ImplClickHdl
, OMySQLIntroPageSetup
*);
253 virtual sal_Bool
FillItemSet(SfxItemSet
& _rSet
);
254 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
255 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
256 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
257 virtual ~OMySQLIntroPageSetup();
260 RadioButton m_aRB_ODBCDatabase
;
261 RadioButton m_aRB_JDBCDatabase
;
262 RadioButton m_aRB_NATIVEDatabase
;
263 FixedText m_aFT_ConnectionMode
;
264 FixedText m_aFT_Helptext
;
265 FixedText m_aFT_Headertext
;
267 DECL_LINK(OnSetupModeSelected
, RadioButton
*);
274 //========================================================================
275 //= OAuthentificationPageSetup
276 //========================================================================
277 class OAuthentificationPageSetup
: public OGenericAdministrationPage
280 virtual sal_Bool
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
281 static OGenericAdministrationPage
* CreateAuthentificationTabPage( Window
* pParent
, const SfxItemSet
& _rAttrSet
);
282 OAuthentificationPageSetup(Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
285 FixedText m_aFTHelpText
;
286 FixedText m_aFTHeaderText
;
287 FixedText m_aFTUserName
;
289 CheckBox m_aCBPasswordRequired
;
290 PushButton m_aPBTestConnection
;
291 virtual ~OAuthentificationPageSetup();
294 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
295 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
296 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
301 //========================================================================
302 //= OFinalDBPageSetup
303 //========================================================================
304 class OFinalDBPageSetup
: public OGenericAdministrationPage
307 virtual sal_Bool
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
308 static OGenericAdministrationPage
* CreateFinalDBTabPageSetup( Window
* pParent
, const SfxItemSet
& _rAttrSet
);
310 FixedText m_aFTFinalHeader
;
311 FixedText m_aFTFinalHelpText
;
312 RadioButton m_aRBRegisterDataSource
;
313 RadioButton m_aRBDontregisterDataSource
;
314 FixedText m_aFTAdditionalSettings
;
315 CheckBox m_aCBOpenAfterwards
;
316 CheckBox m_aCBStartTableWizard
;
317 FixedText m_aFTFinalText
;
319 OFinalDBPageSetup(Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
320 sal_Bool
IsDatabaseDocumentToBeRegistered();
321 sal_Bool
IsDatabaseDocumentToBeOpened();
322 sal_Bool
IsTableWizardToBeStarted();
323 void enableTableWizardCheckBox( sal_Bool _bSupportsTableCreation
);
325 /// may be used in SetXXXHdl calls to controls, is a link to <method>OnControlModified</method>
326 Link
getControlModifiedLink() { return LINK(this, OGenericAdministrationPage
, OnControlModified
); }
328 DECL_LINK(OnOpenSelected
, CheckBox
*);
330 virtual ~OFinalDBPageSetup();
333 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
334 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
335 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
338 //.........................................................................
340 //.........................................................................
344 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */