Line data Source code
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 _SVX_POSTDLG_HXX
20 : #define _SVX_POSTDLG_HXX
21 :
22 : #include <vcl/group.hxx>
23 : #include <vcl/button.hxx>
24 : #include <vcl/edit.hxx>
25 : #include <svtools/stdctrl.hxx>
26 : #include <sfx2/basedlgs.hxx>
27 : #include <svtools/svmedit.hxx>
28 :
29 : // class SvxPostItDialog -------------------------------------------------
30 : /*
31 : {k:\svx\prototyp\dialog\memo.bmp}
32 :
33 : [Description]
34 : In this dialog a note can be created or edited. If the
35 : application holds a list of notes, it can be iterated
36 : over this list with links.
37 :
38 : [Items]
39 : <SvxPostitAuthorItem><SID_ATTR_POSTIT_AUTHOR>
40 : <SvxPostitDateItem><SID_ATTR_POSTIT_DATE>
41 : <SvxPostitTextItem><SID_ATTR_POSTIT_TEXT>
42 : */
43 :
44 : class SvxPostItDialog : public SfxModalDialog
45 : {
46 : public:
47 : SvxPostItDialog( Window* pParent, const SfxItemSet& rCoreSet,
48 : sal_Bool bPrevNext = sal_False, sal_Bool bRedline = sal_False );
49 : ~SvxPostItDialog();
50 :
51 : static sal_uInt16* GetRanges();
52 0 : const SfxItemSet* GetOutputItemSet() const { return pOutSet; }
53 :
54 : Link GetPrevHdl() const { return aPrevHdlLink; }
55 0 : void SetPrevHdl( const Link& rLink )
56 0 : { aPrevHdlLink = rLink; }
57 : Link GetNextHdl() const { return aNextHdlLink; }
58 0 : void SetNextHdl( const Link& rLink )
59 0 : { aNextHdlLink = rLink; }
60 :
61 : void EnableTravel(sal_Bool bNext, sal_Bool bPrev);
62 0 : inline String GetNote() { return aEditED.GetText(); }
63 0 : inline void SetNote(const String& rTxt) { aEditED.SetText(rTxt); }
64 :
65 : void ShowLastAuthor(const String& rAuthor, const String& rDate);
66 0 : inline void DontChangeAuthor() { aAuthorBtn.Enable(sal_False); }
67 0 : inline void HideAuthor() { aAuthorFT.Hide(); aAuthorBtn.Hide(); }
68 0 : inline void SetReadonlyPostIt(sal_Bool bDisable)
69 : {
70 0 : aOKBtn.Enable( !bDisable );
71 0 : aEditED.SetReadOnly( bDisable );
72 0 : aAuthorBtn.Enable( !bDisable );
73 0 : }
74 0 : inline sal_Bool IsOkEnabled() const { return aOKBtn.IsEnabled(); }
75 :
76 : private:
77 : FixedLine aPostItFL;
78 : FixedText aLastEditLabelFT;
79 : FixedInfo aLastEditFT;
80 :
81 : FixedText aEditFT;
82 : MultiLineEdit aEditED;
83 :
84 : FixedText aAuthorFT;
85 : PushButton aAuthorBtn;
86 :
87 : OKButton aOKBtn;
88 : CancelButton aCancelBtn;
89 : HelpButton aHelpBtn;
90 :
91 : ImageButton aPrevBtn;
92 : ImageButton aNextBtn;
93 :
94 : const SfxItemSet& rSet;
95 : SfxItemSet* pOutSet;
96 :
97 : Link aPrevHdlLink;
98 : Link aNextHdlLink;
99 :
100 : #ifdef _SVX_POSTDLG_CXX
101 : DECL_LINK(Stamp, void *);
102 : DECL_LINK(OKHdl, void *);
103 : DECL_LINK(PrevHdl, void *);
104 : DECL_LINK(NextHdl, void *);
105 : #endif
106 : };
107 :
108 :
109 : #endif
110 :
111 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|