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_DETAILPAGES_HXX
21 #define INCLUDED_DBACCESS_SOURCE_UI_DLG_DETAILPAGES_HXX
23 #include "adminpages.hxx"
24 #include "charsets.hxx"
25 #include "charsetlistbox.hxx"
26 #include <vcl/field.hxx>
27 #include <vcl/fixed.hxx>
28 #include <vcl/lstbox.hxx>
29 #include <vcl/edit.hxx>
30 #include <vcl/button.hxx>
31 #include "TextConnectionHelper.hxx"
32 #include "admincontrols.hxx"
34 #include <svtools/dialogcontrolling.hxx>
38 // OCommonBehaviourTabPage
39 #define CBTP_NONE 0x00000000
40 #define CBTP_USE_CHARSET 0x00000002
41 #define CBTP_USE_OPTIONS 0x00000004
43 /** eases the implementation of tab pages handling user/password and/or character
44 set and/or generic options input
46 The controls to be used have to be defined within the resource, as usual, but
47 this class does all the handling necessary.
49 class OCommonBehaviourTabPage
: public OGenericAdministrationPage
53 VclPtr
<FixedText
> m_pOptionsLabel
;
54 VclPtr
<Edit
> m_pOptions
;
56 VclPtr
<FixedText
> m_pCharsetLabel
;
57 VclPtr
<CharSetListBox
> m_pCharset
;
59 VclPtr
<CheckBox
> m_pAutoRetrievingEnabled
;
60 VclPtr
<FixedText
> m_pAutoIncrementLabel
;
61 VclPtr
<Edit
> m_pAutoIncrement
;
62 VclPtr
<FixedText
> m_pAutoRetrievingLabel
;
63 VclPtr
<Edit
> m_pAutoRetrieving
;
65 sal_uInt32 m_nControlFlags
;
68 virtual bool FillItemSet (SfxItemSet
* _rCoreAttrs
) SAL_OVERRIDE
;
70 // nControlFlags is a combination of the CBTP_xxx-constants
71 OCommonBehaviourTabPage(vcl::Window
* pParent
, const OString
& rId
, const OUString
& rUIXMLDescription
, const SfxItemSet
& _rCoreAttrs
, sal_uInt32 nControlFlags
);
74 virtual ~OCommonBehaviourTabPage();
75 virtual void dispose() SAL_OVERRIDE
;
77 // subclasses must override this, but it isn't pure virtual
78 virtual void implInitControls(const SfxItemSet
& _rSet
, bool _bSaveValue
) SAL_OVERRIDE
;
80 // <method>OGenericAdministrationPage::fillControls</method>
81 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
83 // <method>OGenericAdministrationPage::fillWindows</method>
84 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
88 class ODbaseDetailsPage
: public OCommonBehaviourTabPage
91 virtual bool FillItemSet ( SfxItemSet
* _rCoreAttrs
) SAL_OVERRIDE
;
93 ODbaseDetailsPage(vcl::Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
94 virtual ~ODbaseDetailsPage();
95 virtual void dispose() SAL_OVERRIDE
;
97 VclPtr
<CheckBox
> m_pShowDeleted
;
98 VclPtr
<FixedText
> m_pFT_Message
;
99 VclPtr
<PushButton
> m_pIndexes
;
104 virtual void implInitControls(const SfxItemSet
& _rSet
, bool _bSaveValue
) SAL_OVERRIDE
;
107 DECL_LINK( OnButtonClicked
, Button
* );
111 class OAdoDetailsPage
: public OCommonBehaviourTabPage
114 OAdoDetailsPage( vcl::Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
118 class OOdbcDetailsPage
: public OCommonBehaviourTabPage
121 virtual bool FillItemSet ( SfxItemSet
* _rCoreAttrs
) SAL_OVERRIDE
;
123 OOdbcDetailsPage( vcl::Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
124 virtual ~OOdbcDetailsPage();
125 virtual void dispose() SAL_OVERRIDE
;
127 virtual void implInitControls(const SfxItemSet
& _rSet
, bool _bSaveValue
) SAL_OVERRIDE
;
129 VclPtr
<CheckBox
> m_pUseCatalog
;
132 // OUserDriverDetailsPage
133 class OUserDriverDetailsPage
: public OCommonBehaviourTabPage
136 virtual bool FillItemSet ( SfxItemSet
* _rCoreAttrs
) SAL_OVERRIDE
;
138 OUserDriverDetailsPage( vcl::Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
139 virtual ~OUserDriverDetailsPage();
140 virtual void dispose() SAL_OVERRIDE
;
142 virtual void implInitControls(const SfxItemSet
& _rSet
, bool _bSaveValue
) SAL_OVERRIDE
;
143 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
144 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
146 VclPtr
<FixedText
> m_pFTHostname
;
147 VclPtr
<Edit
> m_pEDHostname
;
148 VclPtr
<FixedText
> m_pPortNumber
;
149 VclPtr
<NumericField
> m_pNFPortNumber
;
150 VclPtr
<CheckBox
> m_pUseCatalog
;
153 // OMySQLODBCDetailsPage
154 class OMySQLODBCDetailsPage
: public OCommonBehaviourTabPage
157 OMySQLODBCDetailsPage( vcl::Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
160 // OGeneralSpecialJDBCDetailsPage
161 class OGeneralSpecialJDBCDetailsPage
: public OCommonBehaviourTabPage
164 OGeneralSpecialJDBCDetailsPage( vcl::Window
* pParent
165 , const SfxItemSet
& _rCoreAttrs
166 , sal_uInt16 _nPortId
167 , bool bShowSocket
= true
169 virtual ~OGeneralSpecialJDBCDetailsPage();
170 virtual void dispose() SAL_OVERRIDE
;
174 virtual bool FillItemSet( SfxItemSet
* _rCoreAttrs
) SAL_OVERRIDE
;
175 virtual void implInitControls(const SfxItemSet
& _rSet
, bool _bSaveValue
) SAL_OVERRIDE
;
177 DECL_LINK(OnTestJavaClickHdl
,PushButton
*);
178 DECL_LINK(OnEditModified
,Edit
*);
180 VclPtr
<Edit
> m_pEDHostname
;
181 VclPtr
<NumericField
> m_pNFPortNumber
;
182 VclPtr
<FixedText
> m_pFTSocket
;
183 VclPtr
<Edit
> m_pEDSocket
;
185 VclPtr
<FixedText
> m_pFTDriverClass
;
186 VclPtr
<Edit
> m_pEDDriverClass
;
187 VclPtr
<PushButton
> m_pTestJavaDriver
;
189 OUString m_sDefaultJdbcDriverName
;
190 sal_uInt16 m_nPortId
;
195 class MySQLNativePage
: public OCommonBehaviourTabPage
198 MySQLNativePage( vcl::Window
* pParent
,
199 const SfxItemSet
& _rCoreAttrs
);
200 virtual ~MySQLNativePage();
201 virtual void dispose() SAL_OVERRIDE
;
204 VclPtr
<FixedText
> m_pSeparator1
;
205 VclPtr
<MySQLNativeSettings
> m_aMySQLSettings
;
207 VclPtr
<FixedText
> m_pSeparator2
;
208 VclPtr
<FixedText
> m_pUserNameLabel
;
209 VclPtr
<Edit
> m_pUserName
;
210 VclPtr
<CheckBox
> m_pPasswordRequired
;
213 virtual bool FillItemSet( SfxItemSet
* _rCoreAttrs
) SAL_OVERRIDE
;
214 virtual void implInitControls(const SfxItemSet
& _rSet
, bool _bSaveValue
) SAL_OVERRIDE
;
215 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
216 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
220 class OLDAPDetailsPage
: public OCommonBehaviourTabPage
223 virtual bool FillItemSet ( SfxItemSet
* _rCoreAttrs
) SAL_OVERRIDE
;
225 OLDAPDetailsPage( vcl::Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
226 virtual ~OLDAPDetailsPage();
227 virtual void dispose() SAL_OVERRIDE
;
229 virtual void implInitControls(const SfxItemSet
& _rSet
, bool _bSaveValue
) SAL_OVERRIDE
;
231 VclPtr
<Edit
> m_pETBaseDN
;
232 VclPtr
<CheckBox
> m_pCBUseSSL
;
233 VclPtr
<NumericField
> m_pNFPortNumber
;
234 VclPtr
<NumericField
> m_pNFRowCount
;
236 sal_Int32 m_iSSLPort
;
237 sal_Int32 m_iNormalPort
;
238 DECL_LINK( OnCheckBoxClick
, CheckBox
* );
241 // OMozillaDetailsPage Detail page for Mozilla and Thunderbird addressbook
242 class OMozillaDetailsPage
: public OCommonBehaviourTabPage
245 OMozillaDetailsPage( vcl::Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
249 class OTextDetailsPage
: public OCommonBehaviourTabPage
252 virtual bool FillItemSet ( SfxItemSet
* _rCoreAttrs
) SAL_OVERRIDE
;
254 OTextDetailsPage( vcl::Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
255 VclPtr
<OTextConnectionHelper
> m_pTextConnectionHelper
;
258 virtual ~OTextDetailsPage();
259 virtual void dispose() SAL_OVERRIDE
;
260 virtual bool prepareLeave() SAL_OVERRIDE
;
262 virtual void implInitControls(const SfxItemSet
& _rSet
, bool _bSaveValue
) SAL_OVERRIDE
;
263 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
264 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
) SAL_OVERRIDE
;
271 #endif // INCLUDED_DBACCESS_SOURCE_UI_DLG_DETAILPAGES_HXX
273 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */