1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <sal/config.h>
23 #include <string_view>
25 #include <sfx2/basedlgs.hxx>
27 // class SvxPostItDialog -------------------------------------------------
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.
35 <SvxPostItAuthorItem><SID_ATTR_POSTIT_AUTHOR>
36 <SvxPostItDateItem><SID_ATTR_POSTIT_DATE>
37 <SvxPostItTextItem><SID_ATTR_POSTIT_TEXT>
40 class SvxPostItDialog
: public SfxDialogController
43 SvxPostItDialog(weld::Widget
* pParent
, const SfxItemSet
& rCoreSet
,
45 virtual ~SvxPostItDialog() override
;
47 static WhichRangesContainer
GetRanges();
48 const SfxItemSet
* GetOutputItemSet() const { return m_xOutSet
.get(); }
50 void SetPrevHdl( const Link
<SvxPostItDialog
&,void>& rLink
)
51 { m_aPrevHdlLink
= rLink
; }
52 void SetNextHdl( const Link
<SvxPostItDialog
&,void>& rLink
)
53 { m_aNextHdlLink
= rLink
; }
55 void EnableTravel(bool bNext
, bool bPrev
);
56 OUString
GetNote() const
58 return m_xEditED
->get_text();
60 void SetNote(const OUString
& rTxt
)
62 m_xEditED
->set_text(rTxt
);
64 void ShowLastAuthor(std::u16string_view rAuthor
, std::u16string_view rDate
);
65 void DontChangeAuthor()
67 m_xAuthorBtn
->set_sensitive(false);
71 m_xInsertAuthor
->hide();
73 void set_title(const OUString
& rTitle
)
75 m_xDialog
->set_title(rTitle
);
77 std::shared_ptr
<weld::Dialog
> const & GetDialog() const
83 const SfxItemSet
& m_rSet
;
84 std::unique_ptr
<SfxItemSet
> m_xOutSet
;
86 Link
<SvxPostItDialog
&,void> m_aPrevHdlLink
;
87 Link
<SvxPostItDialog
&,void> m_aNextHdlLink
;
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
;
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);
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */