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_CONNECTIONPAGE_HXX
29 #define DBAUI_CONNECTIONPAGE_HXX
30 
31 #ifndef DBAUI_CONNECTIONHELPER_HXX
32 #include "ConnectionHelper.hxx"
33 #endif
34 #ifndef _DBAUI_ADMINPAGES_HXX_
35 #include "adminpages.hxx"
36 #endif
37 #ifndef _UCBHELPER_CONTENT_HXX
38 #include <ucbhelper/content.hxx>
39 #endif
40 #ifndef _DBAUI_CURLEDIT_HXX_
41 #include "curledit.hxx"
42 #endif
43 
44 //.........................................................................
45 namespace dbaui
46 {
47 //.........................................................................
48 
49 	class IDatabaseSettingsDialog;
50 	//=========================================================================
51 	//= OConnectionTabPage
52 	//=========================================================================
53 
54 	/** implements the connection page of teh data source properties dialog.
55 	*/
56 	class OConnectionTabPage : public OConnectionHelper
57 	{
58 		sal_Bool			m_bUserGrabFocus : 1;
59 	protected:
60 		// connection
61 		FixedLine			m_aFL1;
62 		// user authentification
63 		FixedLine			m_aFL2;
64 		FixedText			m_aUserNameLabel;
65 		Edit				m_aUserName;
66 		CheckBox			m_aPasswordRequired;
67 
68 		// jdbc driver
69 		FixedLine			m_aFL3;
70 		FixedText			m_aJavaDriverLabel;
71 		Edit				m_aJavaDriver;
72 		PushButton			m_aTestJavaDriver;
73 
74 		// connection test
75 		PushButton			m_aTestConnection;
76 
77 
78 		// called when the test connection button was clicked
79 		DECL_LINK(OnTestJavaClickHdl,PushButton*);
80 		DECL_LINK(OnEditModified,Edit*);
81 
82 	public:
83 		static	SfxTabPage*	Create( Window* pParent, const SfxItemSet& _rAttrSet );
84 		virtual	sal_Bool		FillItemSet	(SfxItemSet& _rCoreAttrs);
85 
86 		virtual void		implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
87 
88 		inline void enableConnectionURL() { m_aConnectionURL.SetReadOnly(sal_False); }
89 		inline void disableConnectionURL() { m_aConnectionURL.SetReadOnly(); }
90 
91 		/** changes the connection URL.
92 			<p>The new URL must be of the type which is currently selected, only the parts which do not
93 			affect the type may be changed (compared to the previous URL).</p>
94 		*/
95 	private:
96 		OConnectionTabPage(Window* pParent, const SfxItemSet& _rCoreAttrs);
97 			// nControlFlags ist eine Kombination der CBTP_xxx-Konstanten
98 		virtual ~OConnectionTabPage();
99 
100 		// <method>OGenericAdministrationPage::fillControls</method>
101 		virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
102 		// <method>OGenericAdministrationPage::fillWindows</method>
103 		virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
104 
105 	private:
106 		/** enables the test connection button, if allowed
107 		*/
108 		virtual bool checkTestConnection();
109 	};
110 //.........................................................................
111 }	// namespace dbaui
112 //.........................................................................
113 
114 #endif // _DBAUI_DETAILPAGES_HXX_
115