1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_DBACCESS_SOURCE_UI_DLG_DBSETUPCONNECTIONPAGES_HXX
21 #define INCLUDED_DBACCESS_SOURCE_UI_DLG_DBSETUPCONNECTIONPAGES_HXX
23 #include "ConnectionPageSetup.hxx"
25 #include "adminpages.hxx"
26 #include "admincontrols.hxx"
27 #include "curledit.hxx"
28 #include "TextConnectionHelper.hxx"
30 #include <svtools/roadmapwizard.hxx>
31 #include <ucbhelper/content.hxx>
32 #include <vcl/field.hxx>
38 // OSpreadSheetConnectionPageSetup
39 class OSpreadSheetConnectionPageSetup
: public OConnectionTabPageSetup
42 virtual bool FillItemSet ( SfxItemSet
* _rCoreAttrs
) SAL_OVERRIDE
;
43 static VclPtr
<OGenericAdministrationPage
> CreateSpreadSheetTabPage( vcl::Window
* pParent
, const SfxItemSet
& _rAttrSet
);
44 OSpreadSheetConnectionPageSetup(vcl::Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
45 virtual ~OSpreadSheetConnectionPageSetup();
46 virtual void dispose() SAL_OVERRIDE
;
49 VclPtr
<CheckBox
> m_pPasswordrequired
;
52 virtual void implInitControls(const SfxItemSet
& _rSet
, bool _bSaveValue
) SAL_OVERRIDE
;
53 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
54 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
58 // OTextConnectionPage
59 class OTextConnectionPageSetup
: public OConnectionTabPageSetup
62 VclPtr
<OTextConnectionHelper
> m_pTextConnectionHelper
;
64 virtual bool FillItemSet ( SfxItemSet
* _rCoreAttrs
) SAL_OVERRIDE
;
65 static VclPtr
<OGenericAdministrationPage
> CreateTextTabPage( vcl::Window
* pParent
, const SfxItemSet
& _rAttrSet
);
66 OTextConnectionPageSetup( vcl::Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
67 virtual ~OTextConnectionPageSetup();
68 virtual void dispose() SAL_OVERRIDE
;
70 virtual bool prepareLeave() SAL_OVERRIDE
;
71 virtual void implInitControls(const SfxItemSet
& _rSet
, bool _bSaveValue
) SAL_OVERRIDE
;
72 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
73 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
74 bool checkTestConnection() SAL_OVERRIDE
;
77 DECL_LINK_TYPED(ImplGetExtensionHdl
, OTextConnectionHelper
*, void);
80 // OLDAPConnectionPageSetup
81 class OLDAPConnectionPageSetup
: public OGenericAdministrationPage
84 virtual bool FillItemSet ( SfxItemSet
* _rCoreAttrs
) SAL_OVERRIDE
;
85 static VclPtr
<OGenericAdministrationPage
> CreateLDAPTabPage( vcl::Window
* pParent
, const SfxItemSet
& _rAttrSet
);
86 OLDAPConnectionPageSetup( vcl::Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
87 virtual ~OLDAPConnectionPageSetup();
88 virtual void dispose() SAL_OVERRIDE
;
89 virtual Link
<> getControlModifiedLink() SAL_OVERRIDE
{ return LINK(this, OLDAPConnectionPageSetup
, OnEditModified
); }
92 virtual void implInitControls(const SfxItemSet
& _rSet
, bool _bSaveValue
) SAL_OVERRIDE
;
93 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
94 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
95 DECL_LINK(OnEditModified
,Edit
*);
98 VclPtr
<FixedText
> m_pFTHelpText
;
99 VclPtr
<FixedText
> m_pFTHostServer
;
100 VclPtr
<Edit
> m_pETHostServer
;
101 VclPtr
<FixedText
> m_pFTBaseDN
;
102 VclPtr
<Edit
> m_pETBaseDN
;
103 VclPtr
<FixedText
> m_pFTPortNumber
;
104 VclPtr
<NumericField
> m_pNFPortNumber
;
105 VclPtr
<FixedText
> m_pFTDefaultPortNumber
;
106 VclPtr
<CheckBox
> m_pCBUseSSL
;
109 // MySQLNativeSetupPage
110 class MySQLNativeSetupPage
: public OGenericAdministrationPage
113 VclPtr
<FixedText
> m_pHelpText
;
114 VclPtr
<MySQLNativeSettings
> m_aMySQLSettings
;
117 MySQLNativeSetupPage( vcl::Window
* _pParent
, const SfxItemSet
& _rCoreAttrs
);
118 virtual ~MySQLNativeSetupPage();
119 virtual void dispose() SAL_OVERRIDE
;
121 static VclPtr
<OGenericAdministrationPage
> Create( vcl::Window
* pParent
, const SfxItemSet
& _rAttrSet
);
124 virtual void fillControls( ::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
125 virtual void fillWindows( ::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
127 virtual bool FillItemSet( SfxItemSet
* _rCoreAttrs
) SAL_OVERRIDE
;
128 virtual void implInitControls(const SfxItemSet
& _rSet
, bool _bSaveValue
) SAL_OVERRIDE
;
130 virtual Link
<> getControlModifiedLink() SAL_OVERRIDE
;
133 DECL_LINK( OnModified
, Edit
* );
136 // OGeneralSpecialJDBCConnectionPageSetup
137 class OGeneralSpecialJDBCConnectionPageSetup
: public OGenericAdministrationPage
140 OGeneralSpecialJDBCConnectionPageSetup( vcl::Window
* pParent
141 , const SfxItemSet
& _rCoreAttrs
142 , sal_uInt16 _nPortId
143 , sal_uInt16 _nDefaultPortResId
144 , sal_uInt16 _nHelpTextResId
145 , sal_uInt16 _nHeaderTextResId
146 , sal_uInt16 _nDriverClassId
);
147 virtual ~OGeneralSpecialJDBCConnectionPageSetup();
148 virtual void dispose() SAL_OVERRIDE
;
149 static VclPtr
<OGenericAdministrationPage
> CreateMySQLJDBCTabPage( vcl::Window
* pParent
, const SfxItemSet
& _rAttrSet
);
150 static VclPtr
<OGenericAdministrationPage
> CreateOracleJDBCTabPage( vcl::Window
* pParent
, const SfxItemSet
& _rAttrSet
);
153 virtual bool FillItemSet( SfxItemSet
* _rCoreAttrs
) SAL_OVERRIDE
;
154 virtual void implInitControls(const SfxItemSet
& _rSet
, bool _bSaveValue
) SAL_OVERRIDE
;
155 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
156 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
157 virtual Link
<> getControlModifiedLink() SAL_OVERRIDE
{ return LINK(this, OGeneralSpecialJDBCConnectionPageSetup
, OnEditModified
); }
159 DECL_LINK(OnTestJavaClickHdl
,PushButton
*);
160 DECL_LINK(OnEditModified
,Edit
*);
161 VclPtr
<FixedText
> m_pHeaderText
;
162 VclPtr
<FixedText
> m_pFTHelpText
;
163 VclPtr
<FixedText
> m_pFTDatabasename
;
164 VclPtr
<Edit
> m_pETDatabasename
;
165 VclPtr
<FixedText
> m_pFTHostname
;
166 VclPtr
<Edit
> m_pETHostname
;
167 VclPtr
<FixedText
> m_pFTPortNumber
;
168 VclPtr
<FixedText
> m_pFTDefaultPortNumber
;
169 VclPtr
<NumericField
> m_pNFPortNumber
;
171 VclPtr
<FixedText
> m_pFTDriverClass
;
172 VclPtr
<Edit
> m_pETDriverClass
;
173 VclPtr
<PushButton
> m_pPBTestJavaDriver
;
175 OUString m_sDefaultJdbcDriverName
;
176 sal_uInt16 m_nPortId
;
179 // OJDBCConnectionPageSetup
180 class OJDBCConnectionPageSetup
: public OConnectionTabPageSetup
183 OJDBCConnectionPageSetup( vcl::Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
184 virtual ~OJDBCConnectionPageSetup();
185 virtual void dispose() SAL_OVERRIDE
;
186 static VclPtr
<OGenericAdministrationPage
> CreateJDBCTabPage( vcl::Window
* pParent
, const SfxItemSet
& _rAttrSet
);
189 virtual bool checkTestConnection() SAL_OVERRIDE
;
191 virtual bool FillItemSet( SfxItemSet
* _rCoreAttrs
) SAL_OVERRIDE
;
192 virtual void implInitControls(const SfxItemSet
& _rSet
, bool _bSaveValue
) SAL_OVERRIDE
;
193 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
194 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
196 DECL_LINK(OnTestJavaClickHdl
,PushButton
*);
197 DECL_LINK(OnEditModified
,Edit
*);
198 VclPtr
<FixedText
> m_pFTDriverClass
;
199 VclPtr
<Edit
> m_pETDriverClass
;
200 VclPtr
<PushButton
> m_pPBTestJavaDriver
;
203 // OJDBCConnectionPageSetup
204 class OMySQLIntroPageSetup
: public OGenericAdministrationPage
214 OMySQLIntroPageSetup( vcl::Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
215 virtual ~OMySQLIntroPageSetup();
216 virtual void dispose() SAL_OVERRIDE
;
218 static VclPtr
<OMySQLIntroPageSetup
> CreateMySQLIntroTabPage( vcl::Window
* _pParent
, const SfxItemSet
& _rAttrSet
);
219 ConnectionType
getMySQLMode();
220 void SetClickHdl( const Link
<OMySQLIntroPageSetup
*, void>& rLink
) { maClickHdl
= rLink
; }
221 DECL_LINK(ImplClickHdl
, OMySQLIntroPageSetup
*);
224 virtual bool FillItemSet(SfxItemSet
* _rSet
) SAL_OVERRIDE
;
225 virtual void implInitControls(const SfxItemSet
& _rSet
, bool _bSaveValue
) SAL_OVERRIDE
;
226 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
227 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
230 VclPtr
<RadioButton
> m_pODBCDatabase
;
231 VclPtr
<RadioButton
> m_pJDBCDatabase
;
232 VclPtr
<RadioButton
> m_pNATIVEDatabase
;
233 Link
<OMySQLIntroPageSetup
*, void> maClickHdl
;
235 DECL_LINK(OnSetupModeSelected
, RadioButton
*);
239 // OAuthentificationPageSetup
240 class OAuthentificationPageSetup
: public OGenericAdministrationPage
243 virtual bool FillItemSet ( SfxItemSet
* _rCoreAttrs
) SAL_OVERRIDE
;
244 static VclPtr
<OGenericAdministrationPage
> CreateAuthentificationTabPage( vcl::Window
* pParent
, const SfxItemSet
& _rAttrSet
);
245 OAuthentificationPageSetup(vcl::Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
246 virtual ~OAuthentificationPageSetup();
247 virtual void dispose() SAL_OVERRIDE
;
250 VclPtr
<FixedText
> m_pFTHelpText
;
251 VclPtr
<FixedText
> m_pFTUserName
;
252 VclPtr
<Edit
> m_pETUserName
;
253 VclPtr
<CheckBox
> m_pCBPasswordRequired
;
254 VclPtr
<PushButton
> m_pPBTestConnection
;
257 virtual void implInitControls(const SfxItemSet
& _rSet
, bool _bSaveValue
) SAL_OVERRIDE
;
258 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
259 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
263 class OFinalDBPageSetup
: public OGenericAdministrationPage
266 virtual bool FillItemSet ( SfxItemSet
* _rCoreAttrs
) SAL_OVERRIDE
;
267 static VclPtr
<OGenericAdministrationPage
> CreateFinalDBTabPageSetup( vcl::Window
* pParent
, const SfxItemSet
& _rAttrSet
);
269 VclPtr
<FixedText
> m_pFTFinalHeader
;
270 VclPtr
<FixedText
> m_pFTFinalHelpText
;
271 VclPtr
<RadioButton
> m_pRBRegisterDataSource
;
272 VclPtr
<RadioButton
> m_pRBDontregisterDataSource
;
273 VclPtr
<FixedText
> m_pFTAdditionalSettings
;
274 VclPtr
<CheckBox
> m_pCBOpenAfterwards
;
275 VclPtr
<CheckBox
> m_pCBStartTableWizard
;
276 VclPtr
<FixedText
> m_pFTFinalText
;
278 OFinalDBPageSetup(vcl::Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
279 virtual ~OFinalDBPageSetup();
280 virtual void dispose() SAL_OVERRIDE
;
281 bool IsDatabaseDocumentToBeRegistered();
282 bool IsDatabaseDocumentToBeOpened();
283 bool IsTableWizardToBeStarted();
284 void enableTableWizardCheckBox( bool _bSupportsTableCreation
);
286 /// may be used in SetXXXHdl calls to controls, is a link to <method>OnControlModified</method>
287 Link
<> getControlModifiedLink() SAL_OVERRIDE
{ return LINK(this, OGenericAdministrationPage
, OnControlModified
); }
289 DECL_LINK(OnOpenSelected
, CheckBox
*);
291 virtual void implInitControls(const SfxItemSet
& _rSet
, bool _bSaveValue
) SAL_OVERRIDE
;
292 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
293 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
300 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */