xref: /trunk/main/dbaccess/source/ui/dlg/ConnectionPage.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef DBAUI_CONNECTIONPAGE_HXX
29*cdf0e10cSrcweir #define DBAUI_CONNECTIONPAGE_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #ifndef DBAUI_CONNECTIONHELPER_HXX
32*cdf0e10cSrcweir #include "ConnectionHelper.hxx"
33*cdf0e10cSrcweir #endif
34*cdf0e10cSrcweir #ifndef _DBAUI_ADMINPAGES_HXX_
35*cdf0e10cSrcweir #include "adminpages.hxx"
36*cdf0e10cSrcweir #endif
37*cdf0e10cSrcweir #ifndef _UCBHELPER_CONTENT_HXX
38*cdf0e10cSrcweir #include <ucbhelper/content.hxx>
39*cdf0e10cSrcweir #endif
40*cdf0e10cSrcweir #ifndef _DBAUI_CURLEDIT_HXX_
41*cdf0e10cSrcweir #include "curledit.hxx"
42*cdf0e10cSrcweir #endif
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir //.........................................................................
45*cdf0e10cSrcweir namespace dbaui
46*cdf0e10cSrcweir {
47*cdf0e10cSrcweir //.........................................................................
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir     class IDatabaseSettingsDialog;
50*cdf0e10cSrcweir     //=========================================================================
51*cdf0e10cSrcweir     //= OConnectionTabPage
52*cdf0e10cSrcweir     //=========================================================================
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir     /** implements the connection page of teh data source properties dialog.
55*cdf0e10cSrcweir     */
56*cdf0e10cSrcweir     class OConnectionTabPage : public OConnectionHelper
57*cdf0e10cSrcweir     {
58*cdf0e10cSrcweir         sal_Bool            m_bUserGrabFocus : 1;
59*cdf0e10cSrcweir     protected:
60*cdf0e10cSrcweir         // connection
61*cdf0e10cSrcweir         FixedLine           m_aFL1;
62*cdf0e10cSrcweir         // user authentification
63*cdf0e10cSrcweir         FixedLine           m_aFL2;
64*cdf0e10cSrcweir         FixedText           m_aUserNameLabel;
65*cdf0e10cSrcweir         Edit                m_aUserName;
66*cdf0e10cSrcweir         CheckBox            m_aPasswordRequired;
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir         // jdbc driver
69*cdf0e10cSrcweir         FixedLine           m_aFL3;
70*cdf0e10cSrcweir         FixedText           m_aJavaDriverLabel;
71*cdf0e10cSrcweir         Edit                m_aJavaDriver;
72*cdf0e10cSrcweir         PushButton          m_aTestJavaDriver;
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir         // connection test
75*cdf0e10cSrcweir         PushButton          m_aTestConnection;
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir         // called when the test connection button was clicked
79*cdf0e10cSrcweir         DECL_LINK(OnTestJavaClickHdl,PushButton*);
80*cdf0e10cSrcweir         DECL_LINK(OnEditModified,Edit*);
81*cdf0e10cSrcweir 
82*cdf0e10cSrcweir     public:
83*cdf0e10cSrcweir         static  SfxTabPage* Create( Window* pParent, const SfxItemSet& _rAttrSet );
84*cdf0e10cSrcweir         virtual sal_Bool        FillItemSet (SfxItemSet& _rCoreAttrs);
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir         virtual void        implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir         inline void enableConnectionURL() { m_aConnectionURL.SetReadOnly(sal_False); }
89*cdf0e10cSrcweir         inline void disableConnectionURL() { m_aConnectionURL.SetReadOnly(); }
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir         /** changes the connection URL.
92*cdf0e10cSrcweir             <p>The new URL must be of the type which is currently selected, only the parts which do not
93*cdf0e10cSrcweir             affect the type may be changed (compared to the previous URL).</p>
94*cdf0e10cSrcweir         */
95*cdf0e10cSrcweir     private:
96*cdf0e10cSrcweir         OConnectionTabPage(Window* pParent, const SfxItemSet& _rCoreAttrs);
97*cdf0e10cSrcweir             // nControlFlags ist eine Kombination der CBTP_xxx-Konstanten
98*cdf0e10cSrcweir         virtual ~OConnectionTabPage();
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir         // <method>OGenericAdministrationPage::fillControls</method>
101*cdf0e10cSrcweir         virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
102*cdf0e10cSrcweir         // <method>OGenericAdministrationPage::fillWindows</method>
103*cdf0e10cSrcweir         virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir     private:
106*cdf0e10cSrcweir         /** enables the test connection button, if allowed
107*cdf0e10cSrcweir         */
108*cdf0e10cSrcweir         virtual bool checkTestConnection();
109*cdf0e10cSrcweir     };
110*cdf0e10cSrcweir //.........................................................................
111*cdf0e10cSrcweir }   // namespace dbaui
112*cdf0e10cSrcweir //.........................................................................
113*cdf0e10cSrcweir 
114*cdf0e10cSrcweir #endif // _DBAUI_DETAILPAGES_HXX_
115