bump product version to 4.1.6.2
[LibreOffice.git] / dbaccess / source / ui / inc / curledit.hxx
blob981d790b8dc49aa30c58fd20bd343f92459bc030
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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"
26 #include <memory>
28 //.........................................................................
29 namespace dbaui
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*
43 m_pTypeCollection;
44 FixedText* m_pForcedPrefix;
45 String m_sSaveValueNoPrefix;
46 sal_Bool m_bShowPrefix; // when <TRUE> the prefix will be visible, otherwise not
48 public:
49 OConnectionURLEdit(Window* pParent, const ResId& rResId,sal_Bool _bShowPrefix = sal_False);
50 ~OConnectionURLEdit();
52 public:
53 // Edit overridables
54 virtual void SetText(const OUString& _rStr);
55 virtual void SetText(const OUString& _rStr, const Selection& _rNewSelection);
56 virtual OUString GetText() const;
59 /** Showsthe Prefix
60 @param _bShowPrefix
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 //.........................................................................
75 } // namespace dbaui
76 //.........................................................................
78 #endif // _DBAUI_CURLEDIT_HXX_
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */