LibreOffice Module cui (master) 1
dlgname.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#pragma once
20
21#include "cuidllapi.h"
22
23#include <vcl/weld.hxx>
24
27{
28private:
29 std::unique_ptr<weld::Entry> m_xEdtName;
30 std::unique_ptr<weld::Label> m_xFtDescription;
31 std::unique_ptr<weld::Button> m_xBtnOK;
32
35
36 DECL_LINK(ModifyHdl, weld::Entry&, void);
37
38public:
39 SvxNameDialog(weld::Window* pWindow, const OUString& rName, const OUString& rDesc);
40
41 OUString GetName() const { return m_xEdtName->get_text(); }
42
58 void SetCheckNameHdl(const Link<SvxNameDialog&, bool>& rLink, bool bCheckImmediately)
59 {
60 m_aCheckNameHdl = rLink;
61 if (bCheckImmediately)
62 m_xBtnOK->set_sensitive(rLink.Call(*this));
63 }
64
66 {
67 m_aCheckNameTooltipHdl = rLink;
68 m_xBtnOK->set_tooltip_text(rLink.Call(*this));
69 }
70
71 void SetEditHelpId(const OUString& aHelpId) { m_xEdtName->set_help_id(aHelpId); }
72};
73
78{
79private:
80 // name
81 std::unique_ptr<weld::Entry> m_xEdtName;
82
83 // buttons
84 std::unique_ptr<weld::Button> m_xBtnOK;
85
86 // callback link for name uniqueness
88
89 DECL_LINK(ModifyHdl, weld::Entry&, void);
90
91public:
92 // constructor
93 SvxObjectNameDialog(weld::Window* pWindow, const OUString& rName);
94
95 // data access
96 OUString GetName() const { return m_xEdtName->get_text(); }
97
98 // set handler
100};
101
105{
106private:
107 // title
108 std::unique_ptr<weld::Label> m_xTitleFT;
109 std::unique_ptr<weld::Entry> m_xEdtTitle;
110
111 // description
112 std::unique_ptr<weld::Label> m_xDescriptionFT;
113 std::unique_ptr<weld::TextView> m_xEdtDescription;
114
115 std::unique_ptr<weld::CheckButton> m_xDecorativeCB;
116
117 DECL_LINK(DecorativeHdl, weld::Toggleable&, void);
118
119public:
120 // constructor
121 SvxObjectTitleDescDialog(weld::Window* pWindow, const OUString& rTitle, const OUString& rDesc,
122 bool isDecorative);
123 // data access
124 OUString GetTitle() const { return m_xEdtTitle->get_text(); }
125 OUString GetDescription() const { return m_xEdtDescription->get_text(); }
126 bool IsDecorative() const { return m_xDecorativeCB->get_active(); }
127};
128
129/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Dialog for editing a name.
Definition: dlgname.hxx:27
std::unique_ptr< weld::Entry > m_xEdtName
Definition: dlgname.hxx:29
std::unique_ptr< weld::Button > m_xBtnOK
Definition: dlgname.hxx:31
DECL_LINK(ModifyHdl, weld::Entry &, void)
void SetCheckNameTooltipHdl(const Link< SvxNameDialog &, OUString > &rLink)
Definition: dlgname.hxx:65
Link< SvxNameDialog &, OUString > m_aCheckNameTooltipHdl
Definition: dlgname.hxx:34
std::unique_ptr< weld::Label > m_xFtDescription
Definition: dlgname.hxx:30
void SetEditHelpId(const OUString &aHelpId)
Definition: dlgname.hxx:71
void SetCheckNameHdl(const Link< SvxNameDialog &, bool > &rLink, bool bCheckImmediately)
add a callback Link that is called whenever the content of the edit field is changed.
Definition: dlgname.hxx:58
OUString GetName() const
Definition: dlgname.hxx:41
Link< SvxNameDialog &, bool > m_aCheckNameHdl
Definition: dlgname.hxx:33
#i68101# Dialog for editing Object name plus uniqueness-callback-linkHandler
Definition: dlgname.hxx:78
SvxObjectNameDialog(weld::Window *pWindow, const OUString &rName)
Definition: dlgname.cxx:64
void SetCheckNameHdl(const Link< SvxObjectNameDialog &, bool > &rLink)
Definition: dlgname.hxx:99
std::unique_ptr< weld::Button > m_xBtnOK
Definition: dlgname.hxx:84
OUString GetName() const
Definition: dlgname.hxx:96
DECL_LINK(ModifyHdl, weld::Entry &, void)
Link< SvxObjectNameDialog &, bool > aCheckNameHdl
Definition: dlgname.hxx:87
std::unique_ptr< weld::Entry > m_xEdtName
Definition: dlgname.hxx:81
#i68101# Dialog for editing Object Title and Description
Definition: dlgname.hxx:105
OUString GetTitle() const
Definition: dlgname.hxx:124
std::unique_ptr< weld::CheckButton > m_xDecorativeCB
Definition: dlgname.hxx:115
std::unique_ptr< weld::Entry > m_xEdtTitle
Definition: dlgname.hxx:109
std::unique_ptr< weld::Label > m_xTitleFT
Definition: dlgname.hxx:108
DECL_LINK(DecorativeHdl, weld::Toggleable &, void)
SvxObjectTitleDescDialog(weld::Window *pWindow, const OUString &rTitle, const OUString &rDesc, bool isDecorative)
Definition: dlgname.cxx:89
std::unique_ptr< weld::Label > m_xDescriptionFT
Definition: dlgname.hxx:112
bool IsDecorative() const
Definition: dlgname.hxx:126
OUString GetDescription() const
Definition: dlgname.hxx:125
std::unique_ptr< weld::TextView > m_xEdtDescription
Definition: dlgname.hxx:113
#define CUI_DLLPUBLIC
Definition: cuidllapi.h:18