xref: /AOO41X/main/dbaccess/source/ui/dlg/ConnectionPageSetup.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 
25 #ifndef DBAUI_CONNECTIONPAGESETUP_HXX
26 #define DBAUI_CONNECTIONPAGESETUP_HXX
27 #ifndef DBAUI_CONNECTIONHELPER_HXX
28 #include "ConnectionHelper.hxx"
29 #endif
30 
31 #ifndef _DBAUI_ADMINPAGES_HXX_
32 #include "adminpages.hxx"
33 #endif
34 #ifndef _UCBHELPER_CONTENT_HXX
35 #include <ucbhelper/content.hxx>
36 #endif
37 #ifndef _DBAUI_CURLEDIT_HXX_
38 #include "curledit.hxx"
39 #endif
40 
41 #ifndef _SV_FIELD_HXX
42 #include <vcl/field.hxx>
43 #endif
44 
45 
46 //.........................................................................
47 namespace dbaui
48 {
49 //.........................................................................
50 /*  // #106016# --------------
51     enum IS_PATH_EXIST
52     {
53         PATH_NOT_EXIST = 0,
54         PATH_EXIST,
55         PATH_NOT_KNOWN
56     };
57     */
58 
59     class IDatabaseSettingsDialog;
60     //=========================================================================
61     //= OConnectionTabPageSetup
62     //=========================================================================
63 
64     /** implements the connection page of the data source properties dialog.
65     */
66     class OConnectionTabPageSetup : public OConnectionHelper
67     {
68         sal_Bool            m_bUserGrabFocus : 1;
69     protected:
70 
71         FixedText           m_aFT_HelpText;
72 
73         // called when the test connection button was clicked
74         DECL_LINK(OnEditModified,Edit*);
75 
76     public:
77         static  OGenericAdministrationPage* CreateDbaseTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
78         static  OGenericAdministrationPage* CreateMSAccessTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
79         static  OGenericAdministrationPage* CreateAdabasTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
80         static  OGenericAdministrationPage* CreateADOTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
81         static  OGenericAdministrationPage* CreateODBCTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
82         static  OGenericAdministrationPage* CreateUserDefinedTabPage( Window* pParent, const SfxItemSet& _rAttrSet );
83 
84 
85         virtual sal_Bool        FillItemSet (SfxItemSet& _rCoreAttrs);
86 
87         virtual void        implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
88         virtual sal_Bool    commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
89 
90 
enableConnectionURL()91         inline void enableConnectionURL() { m_aConnectionURL.SetReadOnly(sal_False); }
disableConnectionURL()92         inline void disableConnectionURL() { m_aConnectionURL.SetReadOnly(); }
93 
94         /** changes the connection URL.
95             <p>The new URL must be of the type which is currently selected, only the parts which do not
96             affect the type may be changed (compared to the previous URL).</p>
97         */
98         void    changeConnectionURL( const String& _rNewDSN );
99         String  getConnectionURL( ) const;
100 
101 
102     protected:
103         OConnectionTabPageSetup(Window* pParent, sal_uInt16 _rId, const SfxItemSet& _rCoreAttrs, sal_uInt16 _nHelpTextResId, sal_uInt16 _nHeaderResId, sal_uInt16 _nUrlResId);
104         virtual bool checkTestConnection();
105             // nControlFlags ist eine Kombination der CBTP_xxx-Konstanten
106         virtual ~OConnectionTabPageSetup();
107     };
108 
109 //.........................................................................
110 }   // namespace dbaui
111 //.........................................................................
112 
113 #endif
114