1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _DBAUI_CURLEDIT_HXX_
21 #define _DBAUI_CURLEDIT_HXX_
23 #include <vcl/edit.hxx>
24 #include <vcl/fixed.hxx>
25 #include "dsntypes.hxx"
28 //.........................................................................
31 //.........................................................................
33 //=========================================================================
34 //= OConnectionURLEdit
35 //=========================================================================
36 /** an edit control which may be used to edit connection URLs like
37 "sdbc:odbc:" or "jdbc:". It prevents the user from editing this prefix,
38 though it is normally shown.
40 class OConnectionURLEdit
: public Edit
42 ::dbaccess::ODsnTypeCollection
*
44 FixedText
* m_pForcedPrefix
;
45 String m_sSaveValueNoPrefix
;
46 sal_Bool m_bShowPrefix
; // when <TRUE> the prefix will be visible, otherwise not
49 OConnectionURLEdit(Window
* pParent
, const ResId
& rResId
,sal_Bool _bShowPrefix
= sal_False
);
50 ~OConnectionURLEdit();
54 virtual void SetText(const OUString
& _rStr
);
55 virtual void SetText(const OUString
& _rStr
, const Selection
& _rNewSelection
);
56 virtual OUString
GetText() const;
61 If <TRUE/> than the prefix will be visible, otherwise not.
63 void ShowPrefix(sal_Bool _bShowPrefix
);
64 /// get the currently set text, excluding the prefix indicating the type
65 virtual String
GetTextNoPrefix() const;
66 /// set a new text, leave the current prefix unchanged
67 virtual void SetTextNoPrefix(const String
& _rText
);
69 inline void SaveValueNoPrefix() { m_sSaveValueNoPrefix
= GetTextNoPrefix(); }
70 inline String
GetSavedValueNoPrefix() const { return m_sSaveValueNoPrefix
; }
71 inline void SetTypeCollection(::dbaccess::ODsnTypeCollection
* _pTypeCollection
) { m_pTypeCollection
= _pTypeCollection
; }
74 //.........................................................................
76 //.........................................................................
78 #endif // _DBAUI_CURLEDIT_HXX_
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */