LibreOffice Module cui (master)  1
postdlg.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_POSTDLG_HXX
20 #define INCLUDED_CUI_SOURCE_INC_POSTDLG_HXX
21 
22 #include <sfx2/basedlgs.hxx>
23 
24 // class SvxPostItDialog -------------------------------------------------
25 /*
26  [Description]
27  In this dialog a note can be created or edited. If the
28  application holds a list of notes, it can be iterated
29  over this list with links.
30 
31  [Items]
32  <SvxPostItAuthorItem><SID_ATTR_POSTIT_AUTHOR>
33  <SvxPostItDateItem><SID_ATTR_POSTIT_DATE>
34  <SvxPostItTextItem><SID_ATTR_POSTIT_TEXT>
35 */
36 
38 {
39 public:
40  SvxPostItDialog(weld::Widget* pParent, const SfxItemSet& rCoreSet,
41  bool bPrevNext);
42  virtual ~SvxPostItDialog() override;
43 
44  static const sal_uInt16* GetRanges();
45  const SfxItemSet* GetOutputItemSet() const { return m_xOutSet.get(); }
46 
48  { m_aPrevHdlLink = rLink; }
50  { m_aNextHdlLink = rLink; }
51 
52  void EnableTravel(bool bNext, bool bPrev);
53  OUString GetNote() const
54  {
55  return m_xEditED->get_text();
56  }
57  void SetNote(const OUString& rTxt)
58  {
59  m_xEditED->set_text(rTxt);
60  }
61  void ShowLastAuthor(const OUString& rAuthor, const OUString& rDate);
63  {
64  m_xAuthorBtn->set_sensitive(false);
65  }
66  void HideAuthor()
67  {
68  m_xInsertAuthor->hide();
69  }
70  void set_title(const OUString& rTitle)
71  {
72  m_xDialog->set_title(rTitle);
73  }
74  std::shared_ptr<weld::Dialog> const & GetDialog() const
75  {
76  return m_xDialog;
77  }
78 
79 private:
81  std::unique_ptr<SfxItemSet> m_xOutSet;
82 
85 
86  std::unique_ptr<weld::Label> m_xLastEditFT;
87  std::unique_ptr<weld::Label> m_xAltTitle;
88  std::unique_ptr<weld::TextView> m_xEditED;
89  std::unique_ptr<weld::Widget> m_xInsertAuthor;
90  std::unique_ptr<weld::Button> m_xAuthorBtn;
91  std::unique_ptr<weld::Button> m_xOKBtn;
92  std::unique_ptr<weld::Button> m_xPrevBtn;
93  std::unique_ptr<weld::Button> m_xNextBtn;
94 
95  DECL_LINK(Stamp, weld::Button&, void);
96  DECL_LINK(OKHdl, weld::Button&, void);
97  DECL_LINK(PrevHdl, weld::Button&, void);
98  DECL_LINK(NextHdl, weld::Button&, void);
99 };
100 
101 #endif
102 
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Link< SvxPostItDialog &, void > m_aPrevHdlLink
Definition: postdlg.hxx:83
std::unique_ptr< weld::Button > m_xOKBtn
Definition: postdlg.hxx:91
std::shared_ptr< weld::Dialog > const & GetDialog() const
Definition: postdlg.hxx:74
DECL_LINK(Stamp, weld::Button &, void)
std::unique_ptr< weld::Button > m_xPrevBtn
Definition: postdlg.hxx:92
void EnableTravel(bool bNext, bool bPrev)
Definition: postdlg.cxx:130
std::unique_ptr< weld::Label > m_xAltTitle
Definition: postdlg.hxx:87
void SetNote(const OUString &rTxt)
Definition: postdlg.hxx:57
SvxPostItDialog(weld::Widget *pParent, const SfxItemSet &rCoreSet, bool bPrevNext)
Definition: postdlg.cxx:36
OUString GetNote() const
Definition: postdlg.hxx:53
Link< SvxPostItDialog &, void > m_aNextHdlLink
Definition: postdlg.hxx:84
void DontChangeAuthor()
Definition: postdlg.hxx:62
virtual ~SvxPostItDialog() override
Definition: postdlg.cxx:109
std::unique_ptr< weld::Label > m_xLastEditFT
Definition: postdlg.hxx:86
const SfxItemSet * GetOutputItemSet() const
Definition: postdlg.hxx:45
static const sal_uInt16 * GetRanges()
Definition: postdlg.cxx:119
const SfxItemSet & m_rSet
Definition: postdlg.hxx:80
void set_title(const OUString &rTitle)
Definition: postdlg.hxx:70
void SetPrevHdl(const Link< SvxPostItDialog &, void > &rLink)
Definition: postdlg.hxx:47
void SetNextHdl(const Link< SvxPostItDialog &, void > &rLink)
Definition: postdlg.hxx:49
std::unique_ptr< weld::TextView > m_xEditED
Definition: postdlg.hxx:88
std::unique_ptr< weld::Button > m_xNextBtn
Definition: postdlg.hxx:93
std::unique_ptr< weld::Button > m_xAuthorBtn
Definition: postdlg.hxx:90
void HideAuthor()
Definition: postdlg.hxx:66
std::unique_ptr< weld::Widget > m_xInsertAuthor
Definition: postdlg.hxx:89
std::unique_ptr< SfxItemSet > m_xOutSet
Definition: postdlg.hxx:81
void ShowLastAuthor(const OUString &rAuthor, const OUString &rDate)
Definition: postdlg.cxx:113