Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / cui / source / inc / postdlg.hxx
blob4918714a35457ca4a89aa4736e2248cc0c1d1eb4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef _SVX_POSTDLG_HXX
20 #define _SVX_POSTDLG_HXX
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>
29 // class SvxPostItDialog -------------------------------------------------
31 {k:\svx\prototyp\dialog\memo.bmp}
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.
38 [Items]
39 <SvxPostitAuthorItem><SID_ATTR_POSTIT_AUTHOR>
40 <SvxPostitDateItem><SID_ATTR_POSTIT_DATE>
41 <SvxPostitTextItem><SID_ATTR_POSTIT_TEXT>
44 class SvxPostItDialog : public SfxModalDialog
46 public:
47 SvxPostItDialog( Window* pParent, const SfxItemSet& rCoreSet,
48 sal_Bool bPrevNext = sal_False, sal_Bool bRedline = sal_False );
49 ~SvxPostItDialog();
51 static sal_uInt16* GetRanges();
52 const SfxItemSet* GetOutputItemSet() const { return pOutSet; }
54 Link GetPrevHdl() const { return aPrevHdlLink; }
55 void SetPrevHdl( const Link& rLink )
56 { aPrevHdlLink = rLink; }
57 Link GetNextHdl() const { return aNextHdlLink; }
58 void SetNextHdl( const Link& rLink )
59 { aNextHdlLink = rLink; }
61 void EnableTravel(sal_Bool bNext, sal_Bool bPrev);
62 inline String GetNote() { return aEditED.GetText(); }
63 inline void SetNote(const String& rTxt) { aEditED.SetText(rTxt); }
65 void ShowLastAuthor(const String& rAuthor, const String& rDate);
66 inline void DontChangeAuthor() { aAuthorBtn.Enable(sal_False); }
67 inline void HideAuthor() { aAuthorFT.Hide(); aAuthorBtn.Hide(); }
68 inline void SetReadonlyPostIt(sal_Bool bDisable)
70 aOKBtn.Enable( !bDisable );
71 aEditED.SetReadOnly( bDisable );
72 aAuthorBtn.Enable( !bDisable );
74 inline sal_Bool IsOkEnabled() const { return aOKBtn.IsEnabled(); }
76 private:
77 FixedLine aPostItFL;
78 FixedText aLastEditLabelFT;
79 FixedInfo aLastEditFT;
81 FixedText aEditFT;
82 MultiLineEdit aEditED;
84 FixedText aAuthorFT;
85 PushButton aAuthorBtn;
87 OKButton aOKBtn;
88 CancelButton aCancelBtn;
89 HelpButton aHelpBtn;
91 ImageButton aPrevBtn;
92 ImageButton aNextBtn;
94 const SfxItemSet& rSet;
95 SfxItemSet* pOutSet;
97 Link aPrevHdlLink;
98 Link aNextHdlLink;
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
109 #endif
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */