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: detailpages.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_DETAILPAGES_HXX_
32 #define _DBAUI_DETAILPAGES_HXX_
34 #ifndef _DBAUI_ADMINPAGES_HXX_
35 #include "adminpages.hxx"
37 #ifndef _DBAUI_CHARSETS_HXX_
38 #include "charsets.hxx"
40 #ifndef CHARSETLISTBOX_HXX
41 #include "charsetlistbox.hxx"
44 #include <vcl/field.hxx>
47 #include <vcl/fixed.hxx>
49 #ifndef _SV_LSTBOX_HXX
50 #include <vcl/lstbox.hxx>
53 #include <vcl/edit.hxx>
55 #ifndef _SV_BUTTON_HXX
56 #include <vcl/button.hxx>
58 #ifndef DBAUI_TEXTCONNECTIONHELPER_HXX
59 #include "TextConnectionHelper.hxx"
62 #include <svtools/dialogcontrolling.hxx>
65 //.........................................................................
68 //.........................................................................
69 //=========================================================================
70 //= OCommonBehaviourTabPage
71 //=========================================================================
72 #define CBTP_NONE 0x00000000
73 #define CBTP_USE_CHARSET 0x00000002
74 #define CBTP_USE_OPTIONS 0x00000004
76 /** eases the implementation of tab pages handling user/password and/or character
77 set and/or generic options input
79 The controls to be used habe to be defined within the resource, as usual, but
80 this class does all the handling necessary.
82 class OCommonBehaviourTabPage
: public OGenericAdministrationPage
86 FixedText
* m_pOptionsLabel
;
89 FixedLine
* m_pDataConvertFixedLine
;
90 FixedText
* m_pCharsetLabel
;
91 CharSetListBox
* m_pCharset
;
93 FixedLine
* m_pAutoFixedLine
;
94 CheckBox
* m_pAutoRetrievingEnabled
;
95 FixedText
* m_pAutoIncrementLabel
;
96 Edit
* m_pAutoIncrement
;
97 FixedText
* m_pAutoRetrievingLabel
;
98 Edit
* m_pAutoRetrieving
;
100 sal_uInt32 m_nControlFlags
;
103 virtual BOOL
FillItemSet (SfxItemSet
& _rCoreAttrs
);
105 OCommonBehaviourTabPage(Window
* pParent
, USHORT nResId
, const SfxItemSet
& _rCoreAttrs
, sal_uInt32 nControlFlags
,bool _bFreeResource
= true);
108 // nControlFlags ist eine Kombination der CBTP_xxx-Konstanten
109 virtual ~OCommonBehaviourTabPage();
111 // must be overloaded by subclasses, but it isn't pure virtual
112 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
114 // <method>OGenericAdministrationPage::fillControls</method>
115 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
117 // <method>OGenericAdministrationPage::fillWindows</method>
118 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
121 //========================================================================
122 //= ODbaseDetailsPage
123 //========================================================================
124 class ODbaseDetailsPage
: public OCommonBehaviourTabPage
127 virtual BOOL
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
129 ODbaseDetailsPage(Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
131 // please add new controls also to <method>fillControls</method> or <method>fillWindows</method>
132 CheckBox m_aShowDeleted
;
134 FixedText m_aFT_Message
;
135 PushButton m_aIndexes
;
141 virtual ~ODbaseDetailsPage();
144 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
145 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
146 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
149 DECL_LINK( OnButtonClicked
, Button
* );
152 //========================================================================
154 //========================================================================
155 class OAdoDetailsPage
: public OCommonBehaviourTabPage
158 virtual ~OAdoDetailsPage();
161 OAdoDetailsPage( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
164 //========================================================================
166 //========================================================================
167 class OOdbcDetailsPage
: public OCommonBehaviourTabPage
170 virtual BOOL
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
172 OOdbcDetailsPage( 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
);
179 CheckBox m_aUseCatalog
;
183 //========================================================================
184 //= OUserDriverDetailsPage
185 //========================================================================
186 class OUserDriverDetailsPage
: public OCommonBehaviourTabPage
189 virtual BOOL
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
191 OUserDriverDetailsPage( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
193 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
194 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
195 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
197 FixedText m_aFTHostname
;
199 FixedText m_aPortNumber
;
200 NumericField m_aNFPortNumber
;
201 CheckBox m_aUseCatalog
;
204 //========================================================================
205 //= OMySQLODBCDetailsPage
206 //========================================================================
207 class OMySQLODBCDetailsPage
: public OCommonBehaviourTabPage
210 OMySQLODBCDetailsPage( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
213 //========================================================================
214 //= OGeneralSpecialJDBCDetailsPage
215 //========================================================================
216 class OGeneralSpecialJDBCDetailsPage
: public OCommonBehaviourTabPage
219 OGeneralSpecialJDBCDetailsPage( Window
* pParent
221 , const SfxItemSet
& _rCoreAttrs
228 virtual BOOL
FillItemSet( SfxItemSet
& _rCoreAttrs
);
229 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
230 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
231 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
233 DECL_LINK(OnTestJavaClickHdl
,PushButton
*);
234 DECL_LINK(OnEditModified
,Edit
*);
237 FixedText m_aFTHostname
;
239 FixedText m_aPortNumber
;
240 NumericField m_aNFPortNumber
;
241 FixedText m_aFTSocket
;
244 FixedText m_aFTDriverClass
;
245 Edit m_aEDDriverClass
;
246 PushButton m_aTestJavaDriver
;
248 String m_sDefaultJdbcDriverName
;
253 //========================================================================
255 //========================================================================
256 class MySQLNativePage
: public OCommonBehaviourTabPage
259 MySQLNativePage( Window
* pParent
,
260 const SfxItemSet
& _rCoreAttrs
);
263 FixedLine m_aSeparator1
;
264 FixedText m_aDatabaseNameLabel
;
265 Edit m_aDatabaseName
;
266 FixedText m_aFTHostname
;
268 FixedText m_aPortNumber
;
269 NumericField m_aNFPortNumber
;
270 FixedText m_aFTSocket
;
273 FixedLine m_aSeparator2
;
274 FixedText m_aUserNameLabel
;
276 CheckBox m_aPasswordRequired
;
279 virtual BOOL
FillItemSet( SfxItemSet
& _rCoreAttrs
);
280 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
281 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
282 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
285 //========================================================================
286 //= OAdabasDetailsPage
287 //========================================================================
288 class OAdabasDetailsPage
: public OCommonBehaviourTabPage
291 virtual BOOL
FillItemSet (SfxItemSet
& _rCoreAttrs
);
293 OAdabasDetailsPage( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
295 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
296 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
297 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
300 FixedText m_aFTHostname
;
303 FixedText m_FT_CACHE_SIZE
;
304 NumericField m_NF_CACHE_SIZE
;
306 FixedText m_FT_DATA_INCREMENT
;
307 NumericField m_NF_DATA_INCREMENT
;
310 FixedText m_FT_CTRLUSERNAME
;
311 Edit m_ET_CTRLUSERNAME
;
312 FixedText m_FT_CTRLPASSWORD
;
313 Edit m_ET_CTRLPASSWORD
;
315 CheckBox m_CB_SHUTDB
;
316 PushButton m_PB_STAT
;
320 DECL_LINK( AttributesChangedHdl
, void * );
321 DECL_LINK( UserSettingsHdl
, void * );
322 DECL_LINK( LoseFocusHdl
, Edit
* );
323 DECL_LINK( PBClickHdl
, Button
*);
326 //========================================================================
328 //========================================================================
329 class OLDAPDetailsPage
: public OCommonBehaviourTabPage
332 virtual BOOL
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
334 OLDAPDetailsPage( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
336 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
337 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
338 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
343 CheckBox m_aCBUseSSL
;
344 FixedText m_aPortNumber
;
345 NumericField m_aNFPortNumber
;
346 FixedText m_aFTRowCount
;
347 NumericField m_aNFRowCount
;
349 sal_Int32 m_iSSLPort
;
350 sal_Int32 m_iNormalPort
;
351 DECL_LINK( OnCheckBoxClick
, CheckBox
* );
354 //========================================================================
355 //= OMozillaDetailsPage Detail page for Mozilla and Thunderbird addressbook
356 //========================================================================
357 class OMozillaDetailsPage
: public OCommonBehaviourTabPage
360 virtual ~OMozillaDetailsPage();
363 OMozillaDetailsPage( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
366 //========================================================================
368 //========================================================================
369 class OTextDetailsPage
: public OCommonBehaviourTabPage
372 virtual BOOL
FillItemSet ( SfxItemSet
& _rCoreAttrs
);
374 OTextDetailsPage( Window
* pParent
, const SfxItemSet
& _rCoreAttrs
);
375 OTextConnectionHelper
* m_pTextConnectionHelper
;
379 String m_aFieldSeparatorList
;
380 String m_aTextSeparatorList
;
383 virtual ~OTextDetailsPage();
384 virtual sal_Bool
prepareLeave();
386 virtual void implInitControls(const SfxItemSet
& _rSet
, sal_Bool _bSaveValue
);
387 virtual void fillControls(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
388 virtual void fillWindows(::std::vector
< ISaveValueWrapper
* >& _rControlList
);
393 //.........................................................................
395 //.........................................................................
397 #endif // _DBAUI_DETAILPAGES_HXX_