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