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_DETAILPAGES_HXX_
30 #define _DBAUI_DETAILPAGES_HXX_
32 #include "adminpages.hxx"
33 #include "charsets.hxx"
34 #include "charsetlistbox.hxx"
35 #include <vcl/field.hxx>
36 #include <vcl/fixed.hxx>
37 #include <vcl/lstbox.hxx>
38 #include <vcl/edit.hxx>
39 #include <vcl/button.hxx>
40 #include "TextConnectionHelper.hxx"
41 #include "admincontrols.hxx"
43 #include <svtools/dialogcontrolling.hxx>
46 //.........................................................................
49 //.........................................................................
50 //=========================================================================
51 //= OCommonBehaviourTabPage
52 //=========================================================================
53 #define CBTP_NONE 0x00000000
54 #define CBTP_USE_CHARSET 0x00000002
55 #define CBTP_USE_OPTIONS 0x00000004
57 /** eases the implementation of tab pages handling user/password and/or character
58 set and/or generic options input
60 The controls to be used habe to be defined within the resource, as usual, but
61 this class does all the handling necessary.
63 class OCommonBehaviourTabPage
: public OGenericAdministrationPage
67 FixedText
* m_pOptionsLabel
;
70 FixedLine
* m_pDataConvertFixedLine
;
71 FixedText
* m_pCharsetLabel
;
72 CharSetListBox
* m_pCharset
;
74 FixedLine
* m_pAutoFixedLine
;
75 CheckBox
* m_pAutoRetrievingEnabled
;
76 FixedText
* m_pAutoIncrementLabel
;
77 Edit
* m_pAutoIncrement
;
78 FixedText
* m_pAutoRetrievingLabel
;
79 Edit
* m_pAutoRetrieving
;
81 sal_uInt32 m_nControlFlags
;
84 virtual sal_Bool
FillItemSet (SfxItemSet
& _rCoreAttrs
);
86 OCommonBehaviourTabPage(Window
* pParent
, sal_uInt16 nResId
, const SfxItemSet
& _rCoreAttrs
, sal_uInt32 nControlFlags
,bool _bFreeResource
= true);
89 // nControlFlags ist eine Kombination der CBTP_xxx-Konstanten
90 virtual ~OCommonBehaviourTabPage();
92 // must be overloaded by subclasses, but it isn't pure virtual
93 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
95 // <method>OGenericAdministrationPage::fillControls</method>
96 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
98 // <method>OGenericAdministrationPage::fillWindows</method>
99 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
102 //========================================================================
103 //= ODbaseDetailsPage
104 //========================================================================
105 class ODbaseDetailsPage
: public OCommonBehaviourTabPage
108 virtual sal_Bool
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
110 ODbaseDetailsPage(Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
112 // please add new controls also to <method>fillControls</method> or <method>fillWindows</method>
113 CheckBox m_aShowDeleted
;
115 FixedText m_aFT_Message
;
116 PushButton m_aIndexes
;
122 virtual ~ODbaseDetailsPage();
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
);
130 DECL_LINK( OnButtonClicked
, Button
* );
133 //========================================================================
135 //========================================================================
136 class OAdoDetailsPage
: public OCommonBehaviourTabPage
139 virtual ~OAdoDetailsPage();
142 OAdoDetailsPage( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
145 //========================================================================
147 //========================================================================
148 class OOdbcDetailsPage
: public OCommonBehaviourTabPage
151 virtual sal_Bool
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
153 OOdbcDetailsPage( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
155 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
156 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
157 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
160 CheckBox m_aUseCatalog
;
164 //========================================================================
165 //= OUserDriverDetailsPage
166 //========================================================================
167 class OUserDriverDetailsPage
: public OCommonBehaviourTabPage
170 virtual sal_Bool
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
172 OUserDriverDetailsPage( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
174 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
175 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
176 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
178 FixedText m_aFTHostname
;
180 FixedText m_aPortNumber
;
181 NumericField m_aNFPortNumber
;
182 CheckBox m_aUseCatalog
;
185 //========================================================================
186 //= OMySQLODBCDetailsPage
187 //========================================================================
188 class OMySQLODBCDetailsPage
: public OCommonBehaviourTabPage
191 OMySQLODBCDetailsPage( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
194 //========================================================================
195 //= OGeneralSpecialJDBCDetailsPage
196 //========================================================================
197 class OGeneralSpecialJDBCDetailsPage
: public OCommonBehaviourTabPage
200 OGeneralSpecialJDBCDetailsPage( Window
* pParent
202 , const SfxItemSet
& _rCoreAttrs
203 , sal_uInt16 _nPortId
209 virtual sal_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
*);
218 FixedText m_aFTHostname
;
220 FixedText m_aPortNumber
;
221 NumericField m_aNFPortNumber
;
222 FixedText m_aFTSocket
;
225 FixedText m_aFTDriverClass
;
226 Edit m_aEDDriverClass
;
227 PushButton m_aTestJavaDriver
;
229 String m_sDefaultJdbcDriverName
;
230 sal_uInt16 m_nPortId
;
234 //========================================================================
236 //========================================================================
237 class MySQLNativePage
: public OCommonBehaviourTabPage
240 MySQLNativePage( Window
* pParent
,
241 const SfxItemSet
& _rCoreAttrs
);
244 FixedLine m_aSeparator1
;
245 MySQLNativeSettings m_aMySQLSettings
;
247 FixedLine m_aSeparator2
;
248 FixedText m_aUserNameLabel
;
250 CheckBox m_aPasswordRequired
;
253 virtual sal_Bool
FillItemSet( SfxItemSet
& _rCoreAttrs
);
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
);
259 //========================================================================
261 //========================================================================
262 class OLDAPDetailsPage
: public OCommonBehaviourTabPage
265 virtual sal_Bool
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
267 OLDAPDetailsPage( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
269 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
270 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
271 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
276 CheckBox m_aCBUseSSL
;
277 FixedText m_aPortNumber
;
278 NumericField m_aNFPortNumber
;
279 FixedText m_aFTRowCount
;
280 NumericField m_aNFRowCount
;
282 sal_Int32 m_iSSLPort
;
283 sal_Int32 m_iNormalPort
;
284 DECL_LINK( OnCheckBoxClick
, CheckBox
* );
287 //========================================================================
288 //= OMozillaDetailsPage Detail page for Mozilla and Thunderbird addressbook
289 //========================================================================
290 class OMozillaDetailsPage
: public OCommonBehaviourTabPage
293 virtual ~OMozillaDetailsPage();
296 OMozillaDetailsPage( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
299 //========================================================================
301 //========================================================================
302 class OTextDetailsPage
: public OCommonBehaviourTabPage
305 virtual sal_Bool
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
307 OTextDetailsPage( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
308 OTextConnectionHelper
* m_pTextConnectionHelper
;
312 String m_aFieldSeparatorList
;
313 String m_aTextSeparatorList
;
316 virtual ~OTextDetailsPage();
317 virtual sal_Bool
prepareLeave();
319 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
320 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
321 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
326 //.........................................................................
328 //.........................................................................
330 #endif // _DBAUI_DETAILPAGES_HXX_
332 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */