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