LibreOffice Module sw (master) 1
condedit.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#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_CONDEDIT_HXX
20#define INCLUDED_SW_SOURCE_UIBASE_INC_CONDEDIT_HXX
21
22#include <vcl/transfer.hxx>
23#include <vcl/weld.hxx>
24#include <swdllapi.h>
25
26class ConditionEdit;
27
28class SW_DLLPUBLIC ConditionEditDropTarget final : public DropTargetHelper
29{
30private:
32
33 SAL_DLLPRIVATE virtual sal_Int8 AcceptDrop(const AcceptDropEvent& rEvt) override;
34 SAL_DLLPRIVATE virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent& rEvt) override;
35
36public:
38};
39
41{
42 std::unique_ptr<weld::Entry> m_xControl;
44 bool m_bBrackets, m_bEnableDrop;
45
46public:
47 ConditionEdit(std::unique_ptr<weld::Entry> xControl);
48
49 OUString get_text() const { return m_xControl->get_text(); }
50 void set_text(const OUString& rText) { m_xControl->set_text(rText); }
51 void set_visible(bool bVisible) { m_xControl->set_visible(bVisible); }
52 void set_accessible_name(const OUString& rName) { m_xControl->set_accessible_name(rName); }
53 void save_value() { m_xControl->save_value(); }
54 bool get_value_changed_from_saved() const { return m_xControl->get_value_changed_from_saved(); }
55 void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); }
57 {
58 m_xControl->connect_changed(rLink);
59 }
60 void replace_selection(const OUString& rText) { m_xControl->replace_selection(rText); }
61 void hide() { m_xControl->hide(); }
63
64 OString get_buildable_name() const { return m_xControl->get_buildable_name(); }
65 void set_buildable_name(const OString& rId) { m_xControl->set_buildable_name(rId); }
66
67 void ShowBrackets(bool bShow) { m_bBrackets = bShow; }
68 bool GetBrackets() const { return m_bBrackets; }
69 void SetDropEnable(bool bFlag) { m_bEnableDrop = bFlag; }
70 bool GetDropEnable() const { return m_bEnableDrop; }
71};
72
73#endif
74
75/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ConditionEdit & m_rEdit
Definition: condedit.hxx:31
void save_value()
Definition: condedit.hxx:53
OUString get_text() const
Definition: condedit.hxx:49
OString get_buildable_name() const
Definition: condedit.hxx:64
void replace_selection(const OUString &rText)
Definition: condedit.hxx:60
void ShowBrackets(bool bShow)
Definition: condedit.hxx:67
void hide()
Definition: condedit.hxx:61
weld::Entry & get_widget()
Definition: condedit.hxx:62
void SetDropEnable(bool bFlag)
Definition: condedit.hxx:69
void connect_changed(const Link< weld::Entry &, void > &rLink)
Definition: condedit.hxx:56
ConditionEditDropTarget m_aDropTargetHelper
Definition: condedit.hxx:43
void set_buildable_name(const OString &rId)
Definition: condedit.hxx:65
bool GetBrackets() const
Definition: condedit.hxx:68
bool m_bBrackets
Definition: condedit.hxx:44
void set_text(const OUString &rText)
Definition: condedit.hxx:50
void set_sensitive(bool bSensitive)
Definition: condedit.hxx:55
std::unique_ptr< weld::Entry > m_xControl
Definition: condedit.hxx:42
bool GetDropEnable() const
Definition: condedit.hxx:70
bool get_value_changed_from_saved() const
Definition: condedit.hxx:54
void set_visible(bool bVisible)
Definition: condedit.hxx:51
void set_accessible_name(const OUString &rName)
Definition: condedit.hxx:52
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
bool bVisible
signed char sal_Int8
Reference< XControl > m_xControl