xref: /trunk/main/dbaccess/source/ext/adabas/AdabasNewDb.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1*2e2212a7SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2e2212a7SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2e2212a7SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2e2212a7SAndrew Rist  * distributed with this work for additional information
6*2e2212a7SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2e2212a7SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2e2212a7SAndrew Rist  * "License"); you may not use this file except in compliance
9*2e2212a7SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*2e2212a7SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*2e2212a7SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2e2212a7SAndrew Rist  * software distributed under the License is distributed on an
15*2e2212a7SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2e2212a7SAndrew Rist  * KIND, either express or implied.  See the License for the
17*2e2212a7SAndrew Rist  * specific language governing permissions and limitations
18*2e2212a7SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*2e2212a7SAndrew Rist  *************************************************************/
21*2e2212a7SAndrew Rist 
22*2e2212a7SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef ADABASUI_ADABAS_CREATEDB_HXX
25cdf0e10cSrcweir #define ADABASUI_ADABAS_CREATEDB_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #ifndef _SV_DIALOG_HXX
29cdf0e10cSrcweir #include <vcl/dialog.hxx>
30cdf0e10cSrcweir #endif
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #ifndef _SV_FIXED_HXX
33cdf0e10cSrcweir #include <vcl/fixed.hxx>
34cdf0e10cSrcweir #endif
35cdf0e10cSrcweir #ifndef _SV_BUTTON_HXX
36cdf0e10cSrcweir #include <vcl/button.hxx>
37cdf0e10cSrcweir #endif
38cdf0e10cSrcweir #ifndef _SV_FIELD_HXX
39cdf0e10cSrcweir #include <vcl/field.hxx>
40cdf0e10cSrcweir #endif
41cdf0e10cSrcweir #ifndef _SV_EDIT_HXX
42cdf0e10cSrcweir #include <vcl/edit.hxx>
43cdf0e10cSrcweir #endif
44cdf0e10cSrcweir #ifndef _COM_SUN_STAR_SDBCX_XCREATECATALOG_HPP_
45cdf0e10cSrcweir #include <com/sun/star/sdbcx/XCreateCatalog.hpp>
46cdf0e10cSrcweir #endif
47cdf0e10cSrcweir #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
48cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
49cdf0e10cSrcweir #endif
50cdf0e10cSrcweir #ifndef _FILEDLGHELPER_HXX
51cdf0e10cSrcweir #include <sfx2/filedlghelper.hxx>
52cdf0e10cSrcweir #endif
53cdf0e10cSrcweir #include <memory>
54cdf0e10cSrcweir #include "ASQLNameEdit.hxx"
55cdf0e10cSrcweir 
56cdf0e10cSrcweir class WaitObject;
57cdf0e10cSrcweir 
58cdf0e10cSrcweir namespace adabasui
59cdf0e10cSrcweir {
60cdf0e10cSrcweir     class ODatabaseCreator;
61cdf0e10cSrcweir     //========================================================================
62cdf0e10cSrcweir     // ADABAS for new db; is called from typepage
63cdf0e10cSrcweir     //========================================================================
64cdf0e10cSrcweir     class OAdabasNewDbDlg : public ModalDialog
65cdf0e10cSrcweir     {
66cdf0e10cSrcweir     private:
67cdf0e10cSrcweir         FixedText           m_FT_DATABASENAME;
68cdf0e10cSrcweir         OSQLNameEdit        m_ET_DATABASENAME;
69cdf0e10cSrcweir 
70cdf0e10cSrcweir         FixedLine           m_FL_USER;
71cdf0e10cSrcweir         FixedText           m_FT_SYSUSR;
72cdf0e10cSrcweir         FixedText           m_FT_CONUSR;
73cdf0e10cSrcweir         FixedText           m_FT_DOMAIN_USR;
74cdf0e10cSrcweir 
75cdf0e10cSrcweir         OSQLNameEdit        m_ET_SYSUSR;
76cdf0e10cSrcweir         PushButton          m_PB_SYSPWD;
77cdf0e10cSrcweir         OSQLNameEdit        m_ET_CONUSR;
78cdf0e10cSrcweir         PushButton          m_PB_CONPWD;
79cdf0e10cSrcweir         OSQLNameEdit        m_ET_DOMAIN_USR;
80cdf0e10cSrcweir         PushButton          m_PB_DOMAINPWD;
81cdf0e10cSrcweir 
82cdf0e10cSrcweir         FixedImage          m_BMP_CON;
83cdf0e10cSrcweir         FixedImage          m_BMP_SYS;
84cdf0e10cSrcweir         FixedImage          m_BMP_DOMAIN;
85cdf0e10cSrcweir 
86cdf0e10cSrcweir         FixedText           m_FT_RESTORE;
87cdf0e10cSrcweir         Edit                m_ET_RESTORE;
88cdf0e10cSrcweir         PushButton          m_PB_RESTORE;
89cdf0e10cSrcweir 
90cdf0e10cSrcweir         FixedLine           m_FL_DBSETTINGS;
91cdf0e10cSrcweir         FixedText           m_FT_SYSDEVSPACE;
92cdf0e10cSrcweir         FixedText           m_FT_TRANSACTIONLOG;
93cdf0e10cSrcweir         FixedText           m_FT_DATADEVSPACE;
94cdf0e10cSrcweir         Edit                m_ET_SYSDEVSPACE;
95cdf0e10cSrcweir         PushButton          m_PB_SYSDEVSPACE;
96cdf0e10cSrcweir         Edit                m_ET_TRANSACTIONLOG;
97cdf0e10cSrcweir         PushButton          m_PB_TRANSACTIONLOG;
98cdf0e10cSrcweir         Edit                m_ET_DATADEVSPACE;
99cdf0e10cSrcweir         PushButton          m_PB_DATADEVSPACE;
100cdf0e10cSrcweir 
101cdf0e10cSrcweir         FixedText           m_FT_TRANSACTIONLOG_SIZE;
102cdf0e10cSrcweir         NumericField        m_NF_TRANSACTIONLOG_SIZE;
103cdf0e10cSrcweir         FixedText           m_FT_DATADEVSPACE_SIZE;
104cdf0e10cSrcweir         NumericField        m_NF_DATADEVSPACE_SIZE;
105cdf0e10cSrcweir         FixedText           m_FT_CACHE_SIZE;
106cdf0e10cSrcweir         NumericField        m_NF_CACHE_SIZE;
107cdf0e10cSrcweir 
108cdf0e10cSrcweir         FixedLine           m_FL_END;
109cdf0e10cSrcweir 
110cdf0e10cSrcweir         OKButton            m_PB_OK;
111cdf0e10cSrcweir         CancelButton        m_PB_CANCEL;
112cdf0e10cSrcweir 
113cdf0e10cSrcweir         String              m_SYSDEV_File;
114cdf0e10cSrcweir         String              m_TRANSDEV_File;
115cdf0e10cSrcweir         String              m_DATADEV_File;
116cdf0e10cSrcweir         String              m_Backup_File;
117cdf0e10cSrcweir         String              m_ConPwd;
118cdf0e10cSrcweir         String              m_SysPwd;
119cdf0e10cSrcweir         String              m_DomainPwd;
120cdf0e10cSrcweir         String              m_DBName;
121cdf0e10cSrcweir         String              m_sDbWork;
122cdf0e10cSrcweir         String              m_sDbConfig;
123cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XCreateCatalog>      m_xCreateCatalog;
124cdf0e10cSrcweir         com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >    m_xORB;
125cdf0e10cSrcweir         sal_Bool                m_bRestore;
126cdf0e10cSrcweir         sal_Int8                m_nSetBitmap;
127cdf0e10cSrcweir 
128cdf0e10cSrcweir         ::std::auto_ptr<WaitObject>         m_aCreatorWait;
129cdf0e10cSrcweir         ::std::auto_ptr<ODatabaseCreator>   m_aCreatorThread;
130cdf0e10cSrcweir 
131cdf0e10cSrcweir         DECL_LINK( LoadButtonClickHdl,  Button      * );
132cdf0e10cSrcweir         DECL_LINK( ButtonClickHdl,      Button      * );
133cdf0e10cSrcweir         DECL_LINK( PwdClickHdl,         Button      * );
134cdf0e10cSrcweir         DECL_LINK( ImplOKHdl,           OKButton    * );
135cdf0e10cSrcweir         DECL_LINK( LoseFocusHdl,        Edit        * );
136cdf0e10cSrcweir         DECL_LINK( TerminateHdl,        void        * );
137cdf0e10cSrcweir 
138cdf0e10cSrcweir         void CheckBitmaps();
139cdf0e10cSrcweir 
140cdf0e10cSrcweir         DECL_LINK(OnError, void*);
141cdf0e10cSrcweir         DECL_LINK(OnNoDefaultPath, void*);
142cdf0e10cSrcweir         DECL_LINK(OnNoAccessRights, void*);
143cdf0e10cSrcweir 
144cdf0e10cSrcweir         sal_Bool fillEnvironmentVariable(const ::rtl::OUString& _sVariableName,String& _rsValue);
145cdf0e10cSrcweir     public:
146cdf0e10cSrcweir         OAdabasNewDbDlg(Window* pParent,
147cdf0e10cSrcweir                         const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XCreateCatalog>& _rxCreateCatalog,
148cdf0e10cSrcweir                         const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& _rxORB,
149cdf0e10cSrcweir                         sal_Bool _bRestore=sal_False);
150cdf0e10cSrcweir         virtual ~OAdabasNewDbDlg();
151cdf0e10cSrcweir 
GetDatabaseName() const152cdf0e10cSrcweir         ::rtl::OUString GetDatabaseName()       const { return m_ET_DATABASENAME.GetText(); }
GetControlUser() const153cdf0e10cSrcweir         ::rtl::OUString GetControlUser()        const { return m_ET_CONUSR.GetText();       }
GetControlPassword() const154cdf0e10cSrcweir         ::rtl::OUString GetControlPassword()    const { return m_ConPwd;                    }
GetUser() const155cdf0e10cSrcweir         ::rtl::OUString GetUser()               const { return m_ET_SYSUSR.GetText();       }
GetUserPassword() const156cdf0e10cSrcweir         ::rtl::OUString GetUserPassword()       const { return m_SysPwd;                    }
GetCacheSize() const157cdf0e10cSrcweir         sal_Int32       GetCacheSize()          const { return static_cast<sal_Int32>(m_NF_CACHE_SIZE.GetValue());  }
158cdf0e10cSrcweir     };
159cdf0e10cSrcweir }
160cdf0e10cSrcweir #endif // adabasui_ADABAS_CREATEDB_HXX
161