xref: /trunk/main/cui/source/inc/postdlg.hxx (revision c4eee24d)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SVX_POSTDLG_HXX
24 #define _SVX_POSTDLG_HXX
25 
26 // include ---------------------------------------------------------------
27 
28 #ifndef _GROUP_HXX //autogen
29 #include <vcl/group.hxx>
30 #endif
31 #ifndef _IMAGEBTN_HXX //autogen
32 #include <vcl/button.hxx>
33 #endif
34 #ifndef _EDIT_HXX //autogen
35 #include <vcl/edit.hxx>
36 #endif
37 #include <svtools/stdctrl.hxx>
38 #include <sfx2/basedlgs.hxx>
39 #include <svtools/svmedit.hxx>
40 
41 // class SvxPostItDialog -------------------------------------------------
42 /*
43 	{k:\svx\prototyp\dialog\memo.bmp}
44 
45 	[Beschreibung]
46 	In diesem Dialog kann eine Notiz erstellt oder bearbeitet werden. Wenn die
47 	Applikation eine Liste von Notizen haelt, kann mit Hilfe von Links, ueber
48 	diese Liste iteriert werden.
49 
50 	[Items]
51 	<SvxPostitAuthorItem><SID_ATTR_POSTIT_AUTHOR>
52 	<SvxPostitDateItem><SID_ATTR_POSTIT_DATE>
53 	<SvxPostitTextItem><SID_ATTR_POSTIT_TEXT>
54 */
55 
56 class SvxPostItDialog : public SfxModalDialog
57 {
58 public:
59 	SvxPostItDialog( Window* pParent, const SfxItemSet& rCoreSet,
60 					 sal_Bool bPrevNext = sal_False, sal_Bool bRedline = sal_False );
61 	~SvxPostItDialog();
62 
63 	static sal_uInt16*      GetRanges();
GetOutputItemSet() const64 	const SfxItemSet*   GetOutputItemSet() const { return pOutSet; }
65 
GetPrevHdl() const66 	Link                GetPrevHdl() const { return aPrevHdlLink; }
SetPrevHdl(const Link & rLink)67 	void                SetPrevHdl( const Link& rLink )
68 							{ aPrevHdlLink = rLink; }
GetNextHdl() const69 	Link                GetNextHdl() const { return aNextHdlLink; }
SetNextHdl(const Link & rLink)70 	void                SetNextHdl( const Link& rLink )
71 							{ aNextHdlLink = rLink; }
72 
73 	void				EnableTravel(sal_Bool bNext, sal_Bool bPrev);
GetNote()74 	inline String		GetNote() { return aEditED.GetText(); }
SetNote(const String & rTxt)75 	inline void			SetNote(const String& rTxt) { aEditED.SetText(rTxt); }
76 
77 	void				ShowLastAuthor(const String& rAuthor, const String& rDate);
DontChangeAuthor()78 	inline void			DontChangeAuthor()	{ aAuthorBtn.Enable(sal_False); }
HideAuthor()79 	inline void			HideAuthor()		{ aAuthorBtn.Hide(); }
SetReadonlyPostIt(sal_Bool bDisable)80 	inline void			SetReadonlyPostIt(sal_Bool bDisable)
81 							{
82 								aOKBtn.Enable( !bDisable );
83 								aEditED.SetReadOnly( bDisable );
84 								aAuthorBtn.Enable( !bDisable );
85 							}
IsOkEnabled() const86 	inline sal_Bool 		IsOkEnabled() const { return aOKBtn.IsEnabled(); }
87 
88 private:
89     FixedLine           aPostItFL;
90     FixedText           aLastEditLabelFT;
91 	FixedInfo           aLastEditFT;
92 
93 	FixedText           aEditFT;
94 	MultiLineEdit       aEditED;
95 
96     FixedText           aAuthorFT;
97     PushButton          aAuthorBtn;
98 
99     OKButton            aOKBtn;
100 	CancelButton        aCancelBtn;
101 	HelpButton          aHelpBtn;
102 
103     ImageButton         aPrevBtn;
104 	ImageButton         aNextBtn;
105 
106 	const SfxItemSet&   rSet;
107 	SfxItemSet*         pOutSet;
108 
109 	Link                aPrevHdlLink;
110 	Link                aNextHdlLink;
111 
112 #ifdef _SVX_POSTDLG_CXX
113 	DECL_LINK( Stamp, Button* );
114 	DECL_LINK( OKHdl, Button* );
115 	DECL_LINK( PrevHdl, Button* );
116 	DECL_LINK( NextHdl, Button* );
117 #endif
118 };
119 
120 
121 #endif
122 
123