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 #ifndef INCLUDED_CUI_SOURCE_INC_DLGNAME_HXX
20 #define INCLUDED_CUI_SOURCE_INC_DLGNAME_HXX
21 
22 #include <vcl/weld.hxx>
23 
26 {
27 private:
28  std::unique_ptr<weld::Entry> m_xEdtName;
29  std::unique_ptr<weld::Label> m_xFtDescription;
30  std::unique_ptr<weld::Button> m_xBtnOK;
31 
34 
35  DECL_LINK(ModifyHdl, weld::Entry&, void);
36 
37 public:
38  SvxNameDialog(weld::Window* pWindow, const OUString& rName, const OUString& rDesc);
39 
40  OUString GetName() const { return m_xEdtName->get_text(); }
41 
57  void SetCheckNameHdl(const Link<SvxNameDialog&,bool>& rLink, bool bCheckImmediately)
58  {
59  m_aCheckNameHdl = rLink;
60  if (bCheckImmediately)
61  m_xBtnOK->set_sensitive(rLink.Call(*this));
62  }
63 
65  {
66  m_aCheckNameTooltipHdl = rLink;
67  m_xBtnOK->set_tooltip_text(rLink.Call(*this));
68  }
69 
70  void SetEditHelpId(const OString& aHelpId) { m_xEdtName->set_help_id(aHelpId);}
71 };
72 
77 {
78 private:
79  // name
80  std::unique_ptr<weld::Entry> m_xEdtName;
81 
82  // buttons
83  std::unique_ptr<weld::Button> m_xBtnOK;
84 
85  // callback link for name uniqueness
87 
88  DECL_LINK(ModifyHdl, weld::Entry&, void);
89 
90 public:
91  // constructor
92  SvxObjectNameDialog(weld::Window* pWindow, const OUString& rName);
93 
94  // data access
95  OUString GetName() const { return m_xEdtName->get_text(); }
96 
97  // set handler
99  {
100  aCheckNameHdl = rLink;
101  }
102 };
103 
107 {
108 private:
109  // title
110  std::unique_ptr<weld::Entry> m_xEdtTitle;
111 
112  // description
113  std::unique_ptr<weld::TextView> m_xEdtDescription;
114 
115 public:
116  // constructor
117  SvxObjectTitleDescDialog(weld::Window* pWindow, const OUString& rTitle, const OUString& rDesc);
118  // data access
119  OUString GetTitle() const { return m_xEdtTitle->get_text(); }
120  OUString GetDescription() const { return m_xEdtDescription->get_text(); }
121 };
122 
123 #endif // INCLUDED_CUI_SOURCE_INC_DLGNAME_HXX
124 
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::TextView > m_xEdtDescription
Definition: dlgname.hxx:113
DECL_LINK(ModifyHdl, weld::Entry &, void)
void SetCheckNameHdl(const Link< SvxObjectNameDialog &, bool > &rLink)
Definition: dlgname.hxx:98
OUString GetName() const
Definition: dlgname.hxx:40
Dialog for editing a name.
Definition: dlgname.hxx:25
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:57
std::unique_ptr< weld::Label > m_xFtDescription
Definition: dlgname.hxx:29
std::unique_ptr< weld::Entry > m_xEdtName
Definition: dlgname.hxx:28
void SetCheckNameTooltipHdl(const Link< SvxNameDialog &, OUString > &rLink)
Definition: dlgname.hxx:64
Link< SvxNameDialog &, OUString > m_aCheckNameTooltipHdl
Definition: dlgname.hxx:33
#i68101# Dialog for editing Object name plus uniqueness-callback-linkHandler
Definition: dlgname.hxx:76
SvxObjectNameDialog(weld::Window *pWindow, const OUString &rName)
Definition: dlgname.cxx:63
#i68101# Dialog for editing Object Title and Description
Definition: dlgname.hxx:106
std::unique_ptr< weld::Entry > m_xEdtTitle
Definition: dlgname.hxx:110
OUString GetTitle() const
Definition: dlgname.hxx:119
Link< SvxNameDialog &, bool > m_aCheckNameHdl
Definition: dlgname.hxx:32
OUString GetName() const
Definition: dlgname.hxx:95
SvxNameDialog(weld::Window *pWindow, const OUString &rName, const OUString &rDesc)
Definition: dlgname.cxx:28
std::unique_ptr< weld::Button > m_xBtnOK
Definition: dlgname.hxx:30
void SetEditHelpId(const OString &aHelpId)
Definition: dlgname.hxx:70
DECL_LINK(ModifyHdl, weld::Entry &, void)
std::unique_ptr< weld::Entry > m_xEdtName
Definition: dlgname.hxx:80
SvxObjectTitleDescDialog(weld::Window *pWindow, const OUString &rTitle, const OUString &rDesc)
Definition: dlgname.cxx:88
Link< SvxObjectNameDialog &, bool > aCheckNameHdl
Definition: dlgname.hxx:86
std::unique_ptr< weld::Button > m_xBtnOK
Definition: dlgname.hxx:83
OUString GetDescription() const
Definition: dlgname.hxx:120