1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef ADABASUI_ADABAS_CREATEDB_HXX 29 #define ADABASUI_ADABAS_CREATEDB_HXX 30 31 32 #ifndef _SV_DIALOG_HXX 33 #include <vcl/dialog.hxx> 34 #endif 35 36 #ifndef _SV_FIXED_HXX 37 #include <vcl/fixed.hxx> 38 #endif 39 #ifndef _SV_BUTTON_HXX 40 #include <vcl/button.hxx> 41 #endif 42 #ifndef _SV_FIELD_HXX 43 #include <vcl/field.hxx> 44 #endif 45 #ifndef _SV_EDIT_HXX 46 #include <vcl/edit.hxx> 47 #endif 48 #ifndef _COM_SUN_STAR_SDBCX_XCREATECATALOG_HPP_ 49 #include <com/sun/star/sdbcx/XCreateCatalog.hpp> 50 #endif 51 #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ 52 #include <com/sun/star/lang/XMultiServiceFactory.hpp> 53 #endif 54 #ifndef _FILEDLGHELPER_HXX 55 #include <sfx2/filedlghelper.hxx> 56 #endif 57 #include <memory> 58 #include "ASQLNameEdit.hxx" 59 60 class WaitObject; 61 62 namespace adabasui 63 { 64 class ODatabaseCreator; 65 //======================================================================== 66 // ADABAS for new db; is called from typepage 67 //======================================================================== 68 class OAdabasNewDbDlg : public ModalDialog 69 { 70 private: 71 FixedText m_FT_DATABASENAME; 72 OSQLNameEdit m_ET_DATABASENAME; 73 74 FixedLine m_FL_USER; 75 FixedText m_FT_SYSUSR; 76 FixedText m_FT_CONUSR; 77 FixedText m_FT_DOMAIN_USR; 78 79 OSQLNameEdit m_ET_SYSUSR; 80 PushButton m_PB_SYSPWD; 81 OSQLNameEdit m_ET_CONUSR; 82 PushButton m_PB_CONPWD; 83 OSQLNameEdit m_ET_DOMAIN_USR; 84 PushButton m_PB_DOMAINPWD; 85 86 FixedImage m_BMP_CON; 87 FixedImage m_BMP_SYS; 88 FixedImage m_BMP_DOMAIN; 89 90 FixedText m_FT_RESTORE; 91 Edit m_ET_RESTORE; 92 PushButton m_PB_RESTORE; 93 94 FixedLine m_FL_DBSETTINGS; 95 FixedText m_FT_SYSDEVSPACE; 96 FixedText m_FT_TRANSACTIONLOG; 97 FixedText m_FT_DATADEVSPACE; 98 Edit m_ET_SYSDEVSPACE; 99 PushButton m_PB_SYSDEVSPACE; 100 Edit m_ET_TRANSACTIONLOG; 101 PushButton m_PB_TRANSACTIONLOG; 102 Edit m_ET_DATADEVSPACE; 103 PushButton m_PB_DATADEVSPACE; 104 105 FixedText m_FT_TRANSACTIONLOG_SIZE; 106 NumericField m_NF_TRANSACTIONLOG_SIZE; 107 FixedText m_FT_DATADEVSPACE_SIZE; 108 NumericField m_NF_DATADEVSPACE_SIZE; 109 FixedText m_FT_CACHE_SIZE; 110 NumericField m_NF_CACHE_SIZE; 111 112 FixedLine m_FL_END; 113 114 OKButton m_PB_OK; 115 CancelButton m_PB_CANCEL; 116 117 String m_SYSDEV_File; 118 String m_TRANSDEV_File; 119 String m_DATADEV_File; 120 String m_Backup_File; 121 String m_ConPwd; 122 String m_SysPwd; 123 String m_DomainPwd; 124 String m_DBName; 125 String m_sDbWork; 126 String m_sDbConfig; 127 ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XCreateCatalog> m_xCreateCatalog; 128 com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xORB; 129 sal_Bool m_bRestore; 130 sal_Int8 m_nSetBitmap; 131 132 ::std::auto_ptr<WaitObject> m_aCreatorWait; 133 ::std::auto_ptr<ODatabaseCreator> m_aCreatorThread; 134 135 DECL_LINK( LoadButtonClickHdl, Button * ); 136 DECL_LINK( ButtonClickHdl, Button * ); 137 DECL_LINK( PwdClickHdl, Button * ); 138 DECL_LINK( ImplOKHdl, OKButton * ); 139 DECL_LINK( LoseFocusHdl, Edit * ); 140 DECL_LINK( TerminateHdl, void * ); 141 142 void CheckBitmaps(); 143 144 DECL_LINK(OnError, void*); 145 DECL_LINK(OnNoDefaultPath, void*); 146 DECL_LINK(OnNoAccessRights, void*); 147 148 sal_Bool fillEnvironmentVariable(const ::rtl::OUString& _sVariableName,String& _rsValue); 149 public: 150 OAdabasNewDbDlg(Window* pParent, 151 const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XCreateCatalog>& _rxCreateCatalog, 152 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& _rxORB, 153 sal_Bool _bRestore=sal_False); 154 virtual ~OAdabasNewDbDlg(); 155 156 ::rtl::OUString GetDatabaseName() const { return m_ET_DATABASENAME.GetText(); } 157 ::rtl::OUString GetControlUser() const { return m_ET_CONUSR.GetText(); } 158 ::rtl::OUString GetControlPassword() const { return m_ConPwd; } 159 ::rtl::OUString GetUser() const { return m_ET_SYSUSR.GetText(); } 160 ::rtl::OUString GetUserPassword() const { return m_SysPwd; } 161 sal_Int32 GetCacheSize() const { return static_cast<sal_Int32>(m_NF_CACHE_SIZE.GetValue()); } 162 }; 163 } 164 #endif // adabasui_ADABAS_CREATEDB_HXX 165 166