LibreOffice Module dbaccess (master) 1
curledit.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <vcl/weld.hxx>
23#include <dsntypes.hxx>
24
25namespace dbaui
26{
27
29{
30 OUString m_sSavedValue;
31
34 bool m_bShowPrefix; // when <TRUE> the prefix will be visible, otherwise not
35
36 std::unique_ptr<weld::Entry> m_xEntry;
37 std::unique_ptr<weld::Label> m_xForcedPrefix;
38
39public:
40 OConnectionURLEdit(std::unique_ptr<weld::Entry> xEntry, std::unique_ptr<weld::Label> xForcedPrefix);
42
43public:
44 bool get_visible() const { return m_xEntry->get_visible(); }
45 void connect_changed(const Link<weld::Entry&, void>& rLink) { m_xEntry->connect_changed(rLink); }
46 void set_help_id(const OUString& rName) { m_xEntry->set_help_id(rName); }
47 void hide()
48 {
49 m_xEntry->hide();
50 if (m_bShowPrefix)
51 m_xForcedPrefix->hide();
52 }
53 void show()
54 {
55 m_xEntry->show();
56 if (m_bShowPrefix)
57 m_xForcedPrefix->show();
58 }
62 {
63 m_xEntry->grab_focus();
64 }
65 void set_sensitive(bool bSensitive)
66 {
67 m_xEntry->set_sensitive(bSensitive);
68 if (m_bShowPrefix)
69 m_xForcedPrefix->set_sensitive(bSensitive);
70 }
72 {
73 m_xEntry->connect_focus_in(rLink);
74 }
76 {
77 m_xEntry->connect_focus_out(rLink);
78 }
79
80 // Edit overridables
81 void SetText(const OUString& _rStr);
82 void SetText(const OUString& _rStr, const Selection& _rNewSelection);
83 OUString GetText() const;
84
89 void ShowPrefix(bool _bShowPrefix);
91 OUString GetTextNoPrefix() const;
93 void SetTextNoPrefix(const OUString& _rText);
94
96 const OUString& GetSavedValueNoPrefix() const { return m_sSaveValueNoPrefix; }
97 void SetTypeCollection(::dbaccess::ODsnTypeCollection* _pTypeCollection) { m_pTypeCollection = _pTypeCollection; }
98};
99
100} // namespace dbaui
101
102/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void connect_focus_in(const Link< weld::Widget &, void > &rLink)
Definition: curledit.hxx:71
void connect_focus_out(const Link< weld::Widget &, void > &rLink)
Definition: curledit.hxx:75
bool get_value_changed_from_saved() const
Definition: curledit.hxx:60
OUString GetText() const
Definition: curledit.cxx:76
OUString GetTextNoPrefix() const
get the currently set text, excluding the prefix indicating the type
Definition: curledit.cxx:42
std::unique_ptr< weld::Label > m_xForcedPrefix
Definition: curledit.hxx:37
void ShowPrefix(bool _bShowPrefix)
Shows the Prefix.
Definition: curledit.cxx:81
const OUString & GetSavedValueNoPrefix() const
Definition: curledit.hxx:96
void set_sensitive(bool bSensitive)
Definition: curledit.hxx:65
OConnectionURLEdit(std::unique_ptr< weld::Entry > xEntry, std::unique_ptr< weld::Label > xForcedPrefix)
Definition: curledit.cxx:25
void set_help_id(const OUString &rName)
Definition: curledit.hxx:46
void SetText(const OUString &_rStr)
Definition: curledit.cxx:47
std::unique_ptr< weld::Entry > m_xEntry
Definition: curledit.hxx:36
::dbaccess::ODsnTypeCollection * m_pTypeCollection
Definition: curledit.hxx:32
void SetTextNoPrefix(const OUString &_rText)
set a new text, leave the current prefix unchanged
Definition: curledit.cxx:37
void connect_changed(const Link< weld::Entry &, void > &rLink)
Definition: curledit.hxx:45
bool get_visible() const
Definition: curledit.hxx:44
void SetTypeCollection(::dbaccess::ODsnTypeCollection *_pTypeCollection)
Definition: curledit.hxx:97