xref: /aoo41x/main/sc/source/ui/inc/tphfedit.hxx (revision 38d50f7b)
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 
24 #ifndef SC_TPHFEDIT_HXX
25 #define SC_TPHFEDIT_HXX
26 
27 #include <sfx2/tabdlg.hxx>
28 #include <svx/pageitem.hxx>
29 #include <svtools/stdctrl.hxx>
30 #include <vcl/group.hxx>
31 #ifndef _LSTBOX_HXX //autogen
32 #include <vcl/lstbox.hxx>
33 #endif
34 #include <vcl/timer.hxx>
35 #include <vcl/virdev.hxx>
36 #include "scdllapi.h"
37 #include "scitems.hxx"          // wegen enum SvxNumType
38 #include "popmenu.hxx"
39 #include <com/sun/star/accessibility/XAccessible.hpp>
40 #include <cppuhelper/weakref.hxx>
41 
42 //===================================================================
43 
44 class ScHeaderEditEngine;
45 class ScPatternAttr;
46 class EditView;
47 class EditTextObject;
48 class SvxFieldItem;
49 class ScAccessibleEditObject;
50 class ScEditWindow;
51 
52 SC_DLLPUBLIC ScEditWindow* GetScEditWindow (); //CHINA001
53 
54 enum ScEditWindowLocation
55 {
56     Left,
57     Center,
58     Right
59 };
60 
61 class SC_DLLPUBLIC ScEditWindow : public Control
62 {
63 public:
64 			ScEditWindow( Window* pParent, const ResId& rResId, ScEditWindowLocation eLoc );
65 			~ScEditWindow();
66 
67     using Control::SetFont;
68 	void 			SetFont( const ScPatternAttr& rPattern );
69     using Control::SetText;
70 	void 			SetText( const EditTextObject& rTextObject );
71 	EditTextObject*	CreateTextObject();
72 	void			SetCharAttriutes();
73 
74 	void			InsertField( const SvxFieldItem& rFld );
75 
76 	void			SetNumType(SvxNumType eNumType);
77 
78 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
79 
80 	inline ScHeaderEditEngine*  GetEditEngine() const {return pEdEngine;}
81 protected:
82 	virtual void	Paint( const Rectangle& rRec );
83 	virtual void	MouseMove( const MouseEvent& rMEvt );
84 	virtual void	MouseButtonDown( const MouseEvent& rMEvt );
85 	virtual void	MouseButtonUp( const MouseEvent& rMEvt );
86 	virtual void	KeyInput( const KeyEvent& rKEvt );
87 	virtual void	Command( const CommandEvent& rCEvt );
88 	virtual void	GetFocus();
89     virtual void    LoseFocus();
90 
91 private:
92 	ScHeaderEditEngine*	pEdEngine;
93 	EditView*			pEdView;
94     ScEditWindowLocation eLocation;
95     bool mbRTL;
96 
97     com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible > xAcc;
98     ScAccessibleEditObject* pAcc;
99 };
100 
101 //===================================================================
102 class SC_DLLPUBLIC ScExtIButton : public ImageButton
103 {
104 private:
105 
106 	Timer			aTimer;
107 	ScPopupMenu*	pPopupMenu;
108 	Link			aMLink;
109 	sal_uInt16			nSelected;
110 
111 	SC_DLLPRIVATE  DECL_LINK( TimerHdl, Timer*);
112 
113 //	void			DrawArrow();
114 
115 protected:
116 
117 	virtual void	MouseButtonDown( const MouseEvent& rMEvt );
118 	virtual void	MouseButtonUp( const MouseEvent& rMEvt);
119 	virtual void	Click();
120 
121 	virtual void	StartPopup();
122 
123 public:
124 
125 	ScExtIButton(Window* pParent, const ResId& rResId );
126 
127 	void			SetPopupMenu(ScPopupMenu* pPopUp);
128 
129 	sal_uInt16			GetSelected();
130 
131 	void            SetMenuHdl( const Link& rLink ) { aMLink = rLink; }
132 	const Link&     GetMenuHdl() const { return aMLink; }
133 
134 	virtual long	PreNotify( NotifyEvent& rNEvt );
135 };
136 
137 
138 //===================================================================
139 //CHINA001
140 //CHINA001 class ScHFEditPage : public SfxTabPage
141 //CHINA001 {
142 //CHINA001 public:
143 //CHINA001 virtual	sal_Bool	FillItemSet	( SfxItemSet& rCoreSet );
144 //CHINA001 virtual	void	Reset		( const SfxItemSet& rCoreSet );
145 //CHINA001
146 //CHINA001 void			SetNumType(SvxNumType eNumType);
147 //CHINA001
148 //CHINA001 protected:
149 //CHINA001 ScHFEditPage( Window*			pParent,
150 //CHINA001 sal_uInt16			nResId,
151 //CHINA001 const SfxItemSet&	rCoreSet,
152 //CHINA001 sal_uInt16			nWhich );
153 //CHINA001 virtual		~ScHFEditPage();
154 //CHINA001
155 //CHINA001 private:
156 //CHINA001 FixedText		aFtLeft;
157 //CHINA001 ScEditWindow	aWndLeft;
158 //CHINA001 FixedText		aFtCenter;
159 //CHINA001 ScEditWindow	aWndCenter;
160 //CHINA001 FixedText		aFtRight;
161 //CHINA001 ScEditWindow	aWndRight;
162 //CHINA001 ImageButton		aBtnText;
163 //CHINA001 ScExtIButton	aBtnFile;
164 //CHINA001 ImageButton		aBtnTable;
165 //CHINA001 ImageButton		aBtnPage;
166 //CHINA001 ImageButton		aBtnLastPage;
167 //CHINA001 ImageButton		aBtnDate;
168 //CHINA001 ImageButton		aBtnTime;
169 //CHINA001 FixedLine		aFlInfo;
170 //CHINA001 FixedInfo		aFtInfo;
171 //CHINA001 ScPopupMenu		aPopUpFile;
172 //CHINA001
173 //CHINA001 sal_uInt16			nWhich;
174 //CHINA001 String			aCmdArr[6];
175 //CHINA001
176 //CHINA001 private:
177 //CHINA001 #ifdef _TPHFEDIT_CXX
178 //CHINA001 void FillCmdArr();
179 //CHINA001 DECL_LINK( ClickHdl, ImageButton* );
180 //CHINA001 DECL_LINK( MenuHdl, ScExtIButton* );
181 //CHINA001 #endif
182 //CHINA001 };
183 //CHINA001
184 //CHINA001 //===================================================================
185 //CHINA001
186 //CHINA001 class ScRightHeaderEditPage : public ScHFEditPage
187 //CHINA001 {
188 //CHINA001 public:
189 //CHINA001 static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
190 //CHINA001 static sal_uInt16*		GetRanges();
191 //CHINA001
192 //CHINA001 private:
193 //CHINA001 ScRightHeaderEditPage( Window* pParent, const SfxItemSet& rSet );
194 //CHINA001 };
195 //CHINA001
196 //CHINA001 //===================================================================
197 //CHINA001
198 //CHINA001 class ScLeftHeaderEditPage : public ScHFEditPage
199 //CHINA001 {
200 //CHINA001 public:
201 //CHINA001 static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
202 //CHINA001 static sal_uInt16*		GetRanges();
203 //CHINA001
204 //CHINA001 private:
205 //CHINA001 ScLeftHeaderEditPage( Window* pParent, const SfxItemSet& rSet );
206 //CHINA001 };
207 //CHINA001
208 //CHINA001 //===================================================================
209 //CHINA001
210 //CHINA001 class ScRightFooterEditPage : public ScHFEditPage
211 //CHINA001 {
212 //CHINA001 public:
213 //CHINA001 static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
214 //CHINA001 static sal_uInt16*		GetRanges();
215 //CHINA001
216 //CHINA001 private:
217 //CHINA001 ScRightFooterEditPage( Window* pParent, const SfxItemSet& rSet );
218 //CHINA001 };
219 //CHINA001
220 //CHINA001 //===================================================================
221 //CHINA001
222 //CHINA001 class ScLeftFooterEditPage : public ScHFEditPage
223 //CHINA001 {
224 //CHINA001 public:
225 //CHINA001 static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
226 //CHINA001 static sal_uInt16*		GetRanges();
227 //CHINA001
228 //CHINA001 private:
229 //CHINA001 ScLeftFooterEditPage( Window* pParent, const SfxItemSet& rSet );
230 //CHINA001 };
231 
232 
233 
234 #endif // SC_TPHFEDIT_HXX
235 
236