xref: /AOO41X/main/dbaccess/source/ui/dlg/ConnectionPage.hxx (revision 2e2212a7c22e96cf6f6fab0dd042c34a45a64bd6)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef DBAUI_CONNECTIONPAGE_HXX
25 #define DBAUI_CONNECTIONPAGE_HXX
26 
27 #ifndef DBAUI_CONNECTIONHELPER_HXX
28 #include "ConnectionHelper.hxx"
29 #endif
30 #ifndef _DBAUI_ADMINPAGES_HXX_
31 #include "adminpages.hxx"
32 #endif
33 #ifndef _UCBHELPER_CONTENT_HXX
34 #include <ucbhelper/content.hxx>
35 #endif
36 #ifndef _DBAUI_CURLEDIT_HXX_
37 #include "curledit.hxx"
38 #endif
39 
40 //.........................................................................
41 namespace dbaui
42 {
43 //.........................................................................
44 
45     class IDatabaseSettingsDialog;
46     //=========================================================================
47     //= OConnectionTabPage
48     //=========================================================================
49 
50     /** implements the connection page of teh data source properties dialog.
51     */
52     class OConnectionTabPage : public OConnectionHelper
53     {
54         sal_Bool            m_bUserGrabFocus : 1;
55     protected:
56         // connection
57         FixedLine           m_aFL1;
58         // user authentification
59         FixedLine           m_aFL2;
60         FixedText           m_aUserNameLabel;
61         Edit                m_aUserName;
62         CheckBox            m_aPasswordRequired;
63 
64         // jdbc driver
65         FixedLine           m_aFL3;
66         FixedText           m_aJavaDriverLabel;
67         Edit                m_aJavaDriver;
68         PushButton          m_aTestJavaDriver;
69 
70         // connection test
71         PushButton          m_aTestConnection;
72 
73 
74         // called when the test connection button was clicked
75         DECL_LINK(OnTestJavaClickHdl,PushButton*);
76         DECL_LINK(OnEditModified,Edit*);
77 
78     public:
79         static  SfxTabPage* Create( Window* pParent, const SfxItemSet& _rAttrSet );
80         virtual sal_Bool        FillItemSet (SfxItemSet& _rCoreAttrs);
81 
82         virtual void        implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
83 
enableConnectionURL()84         inline void enableConnectionURL() { m_aConnectionURL.SetReadOnly(sal_False); }
disableConnectionURL()85         inline void disableConnectionURL() { m_aConnectionURL.SetReadOnly(); }
86 
87         /** changes the connection URL.
88             <p>The new URL must be of the type which is currently selected, only the parts which do not
89             affect the type may be changed (compared to the previous URL).</p>
90         */
91     private:
92         OConnectionTabPage(Window* pParent, const SfxItemSet& _rCoreAttrs);
93             // nControlFlags ist eine Kombination der CBTP_xxx-Konstanten
94         virtual ~OConnectionTabPage();
95 
96         // <method>OGenericAdministrationPage::fillControls</method>
97         virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
98         // <method>OGenericAdministrationPage::fillWindows</method>
99         virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
100 
101     private:
102         /** enables the test connection button, if allowed
103         */
104         virtual bool checkTestConnection();
105     };
106 //.........................................................................
107 }   // namespace dbaui
108 //.........................................................................
109 
110 #endif // _DBAUI_DETAILPAGES_HXX_
111