xref: /AOO41X/main/dbaccess/source/ui/inc/curledit.hxx (revision 2e2212a7c22e96cf6f6fab0dd042c34a45a64bd6)
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 _DBAUI_CURLEDIT_HXX_
25cdf0e10cSrcweir #define _DBAUI_CURLEDIT_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef _SV_EDIT_HXX
28cdf0e10cSrcweir #include <vcl/edit.hxx>
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #ifndef _SV_FIXED_HXX
31cdf0e10cSrcweir #include <vcl/fixed.hxx>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #ifndef _DBAUI_DSNTYPES_HXX_
34cdf0e10cSrcweir #include "dsntypes.hxx"
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir #include <memory>
37cdf0e10cSrcweir 
38cdf0e10cSrcweir //.........................................................................
39cdf0e10cSrcweir namespace dbaui
40cdf0e10cSrcweir {
41cdf0e10cSrcweir //.........................................................................
42cdf0e10cSrcweir 
43cdf0e10cSrcweir //=========================================================================
44cdf0e10cSrcweir //= OConnectionURLEdit
45cdf0e10cSrcweir //=========================================================================
46cdf0e10cSrcweir /** an edit control which may be used to edit connection URLs like
47cdf0e10cSrcweir 	"sdbc:odbc:" or "jdbc:". It prevents the user from editing this prefix,
48cdf0e10cSrcweir 	though it is normally shown.
49cdf0e10cSrcweir */
50cdf0e10cSrcweir class OConnectionURLEdit : public Edit
51cdf0e10cSrcweir {
52cdf0e10cSrcweir     ::dbaccess::ODsnTypeCollection*
53cdf0e10cSrcweir                         m_pTypeCollection;
54cdf0e10cSrcweir 	FixedText*			m_pForcedPrefix;
55cdf0e10cSrcweir 	String				m_sSaveValueNoPrefix;
56cdf0e10cSrcweir 	sal_Bool				m_bShowPrefix; // when <TRUE> the prefix will be visible, otherwise not
57cdf0e10cSrcweir 
58cdf0e10cSrcweir public:
59cdf0e10cSrcweir 	OConnectionURLEdit(Window* pParent, const ResId& rResId,sal_Bool _bShowPrefix = sal_False);
60cdf0e10cSrcweir 	~OConnectionURLEdit();
61cdf0e10cSrcweir 
62cdf0e10cSrcweir public:
63cdf0e10cSrcweir 	// Edit overridables
64cdf0e10cSrcweir 	virtual void	SetText(const String& _rStr);
65cdf0e10cSrcweir 	virtual void	SetText(const String& _rStr, const Selection& _rNewSelection);
66cdf0e10cSrcweir 	virtual String	GetText() const;
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 	/** Showsthe Prefix
70cdf0e10cSrcweir 		@param	_bShowPrefix
71cdf0e10cSrcweir 			If <TRUE/> than the prefix will be visible, otherwise not.
72cdf0e10cSrcweir 	*/
73cdf0e10cSrcweir 	void ShowPrefix(sal_Bool _bShowPrefix);
74cdf0e10cSrcweir 	/// get the currently set text, excluding the prefix indicating the type
75cdf0e10cSrcweir 	virtual String	GetTextNoPrefix() const;
76cdf0e10cSrcweir 	/// set a new text, leave the current prefix unchanged
77cdf0e10cSrcweir 	virtual void	SetTextNoPrefix(const String& _rText);
78cdf0e10cSrcweir 
SaveValueNoPrefix()79cdf0e10cSrcweir 	inline void		SaveValueNoPrefix()				{ m_sSaveValueNoPrefix = GetTextNoPrefix(); }
GetSavedValueNoPrefix() const80cdf0e10cSrcweir 	inline String	GetSavedValueNoPrefix() const	{ return m_sSaveValueNoPrefix; }
SetTypeCollection(::dbaccess::ODsnTypeCollection * _pTypeCollection)81cdf0e10cSrcweir     inline void     SetTypeCollection(::dbaccess::ODsnTypeCollection* _pTypeCollection) { m_pTypeCollection = _pTypeCollection; }
82cdf0e10cSrcweir };
83cdf0e10cSrcweir 
84cdf0e10cSrcweir //.........................................................................
85cdf0e10cSrcweir }	// namespace dbaui
86cdf0e10cSrcweir //.........................................................................
87cdf0e10cSrcweir 
88cdf0e10cSrcweir #endif // _DBAUI_CURLEDIT_HXX_
89cdf0e10cSrcweir 
90