xref: /trunk/main/dbaccess/source/ui/dlg/dsselect.hxx (revision 2e2212a7)
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_DSSELECT_HXX_
25 #define _DBAUI_DSSELECT_HXX_
26 
27 #include "dsntypes.hxx"
28 #include "odbcconfig.hxx"
29 #include "commontypes.hxx"
30 
31 #include <vcl/dialog.hxx>
32 #include <vcl/lstbox.hxx>
33 #include <vcl/button.hxx>
34 #include <vcl/group.hxx>
35 #include <vcl/fixed.hxx>
36 #include <rtl/ustring.hxx>
37 
38 #include <memory>
39 
40 class SfxItemSet;
41 //.........................................................................
42 namespace dbaui
43 {
44 //.........................................................................
45 
46 //=========================================================================
47 //= ODatasourceSelector
48 //=========================================================================
49 class ODatasourceSelectDialog : public ModalDialog
50 {
51 protected:
52 	FixedText		m_aDescription;
53 	ListBox			m_aDatasource;
54 	OKButton		m_aOk;
55 	CancelButton	m_aCancel;
56 	HelpButton		m_aHelp;
57 #ifdef HAVE_ODBC_ADMINISTRATION
58 	PushButton		m_aManageDatasources;
59 #endif
60 	PushButton		m_aCreateAdabasDB;
61 	SfxItemSet*		m_pOutputSet;
62 #ifdef HAVE_ODBC_ADMINISTRATION
63     ::std::auto_ptr< OOdbcManagement >
64                     m_pODBCManagement;
65 #endif
66 
67 public:
68 	ODatasourceSelectDialog( Window* _pParent, const StringBag& _rDatasources, bool _bAdabas,SfxItemSet* _pOutputSet = NULL );
69     ~ODatasourceSelectDialog();
70 
GetSelected() const71 	inline String	GetSelected() const { return m_aDatasource.GetSelectEntry();}
Select(const String & _rEntry)72 	void			Select( const String& _rEntry ) { m_aDatasource.SelectEntry(_rEntry); }
73 
74 	virtual sal_Bool	Close();
75 
76 protected:
77 	DECL_LINK( ListDblClickHdl, ListBox * );
78 #ifdef HAVE_ODBC_ADMINISTRATION
79 	DECL_LINK( ManageClickHdl, PushButton * );
80 	DECL_LINK( ManageProcessFinished, void* );
81 #endif
82 	DECL_LINK( CreateDBClickHdl, PushButton * );
83 	void fillListBox(const StringBag& _rDatasources);
84 };
85 
86 //.........................................................................
87 }	// namespace dbaui
88 //.........................................................................
89 
90 #endif // _DBAUI_DSSELECT_HXX_
91 
92