xref: /aoo41x/main/sc/source/ui/inc/tphfedit.hxx (revision 0deba7fb)
138d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
338d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
438d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
538d50f7bSAndrew Rist  * distributed with this work for additional information
638d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
738d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
838d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
938d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
1038d50f7bSAndrew Rist  *
1138d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
1238d50f7bSAndrew Rist  *
1338d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
1438d50f7bSAndrew Rist  * software distributed under the License is distributed on an
1538d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1638d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
1738d50f7bSAndrew Rist  * specific language governing permissions and limitations
1838d50f7bSAndrew Rist  * under the License.
1938d50f7bSAndrew Rist  *
2038d50f7bSAndrew Rist  *************************************************************/
2138d50f7bSAndrew Rist 
2238d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_TPHFEDIT_HXX
25cdf0e10cSrcweir #define SC_TPHFEDIT_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <sfx2/tabdlg.hxx>
28cdf0e10cSrcweir #include <svx/pageitem.hxx>
29cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
30cdf0e10cSrcweir #include <vcl/group.hxx>
31cdf0e10cSrcweir #ifndef _LSTBOX_HXX //autogen
32cdf0e10cSrcweir #include <vcl/lstbox.hxx>
33cdf0e10cSrcweir #endif
34cdf0e10cSrcweir #include <vcl/timer.hxx>
35cdf0e10cSrcweir #include <vcl/virdev.hxx>
36cdf0e10cSrcweir #include "scdllapi.h"
37cdf0e10cSrcweir #include "scitems.hxx"          // wegen enum SvxNumType
38cdf0e10cSrcweir #include "popmenu.hxx"
39cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessible.hpp>
40cdf0e10cSrcweir #include <cppuhelper/weakref.hxx>
41cdf0e10cSrcweir 
42cdf0e10cSrcweir //===================================================================
43cdf0e10cSrcweir 
44cdf0e10cSrcweir class ScHeaderEditEngine;
45cdf0e10cSrcweir class ScPatternAttr;
46cdf0e10cSrcweir class EditView;
47cdf0e10cSrcweir class EditTextObject;
48cdf0e10cSrcweir class SvxFieldItem;
49cdf0e10cSrcweir class ScAccessibleEditObject;
50cdf0e10cSrcweir class ScEditWindow;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir SC_DLLPUBLIC ScEditWindow* GetScEditWindow (); //CHINA001
53cdf0e10cSrcweir 
54cdf0e10cSrcweir enum ScEditWindowLocation
55cdf0e10cSrcweir {
56cdf0e10cSrcweir     Left,
57cdf0e10cSrcweir     Center,
58cdf0e10cSrcweir     Right
59cdf0e10cSrcweir };
60cdf0e10cSrcweir 
61cdf0e10cSrcweir class SC_DLLPUBLIC ScEditWindow : public Control
62cdf0e10cSrcweir {
63cdf0e10cSrcweir public:
64cdf0e10cSrcweir 			ScEditWindow( Window* pParent, const ResId& rResId, ScEditWindowLocation eLoc );
65cdf0e10cSrcweir 			~ScEditWindow();
66cdf0e10cSrcweir 
67cdf0e10cSrcweir     using Control::SetFont;
68cdf0e10cSrcweir 	void 			SetFont( const ScPatternAttr& rPattern );
69cdf0e10cSrcweir     using Control::SetText;
70cdf0e10cSrcweir 	void 			SetText( const EditTextObject& rTextObject );
71cdf0e10cSrcweir 	EditTextObject*	CreateTextObject();
72cdf0e10cSrcweir 	void			SetCharAttriutes();
73cdf0e10cSrcweir 
74cdf0e10cSrcweir 	void			InsertField( const SvxFieldItem& rFld );
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 	void			SetNumType(SvxNumType eNumType);
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
79cdf0e10cSrcweir 
80cdf0e10cSrcweir 	inline ScHeaderEditEngine*  GetEditEngine() const {return pEdEngine;}
81*0deba7fbSSteve Yin 	//IAccessibility2 Implementation 2009-----
82*0deba7fbSSteve Yin 	void 			SetObjectSelectHdl( const Link& aLink){ aObjectSelectLink = aLink; };
83*0deba7fbSSteve Yin 	//-----IAccessibility2 Implementation 2009
84cdf0e10cSrcweir protected:
85cdf0e10cSrcweir 	virtual void	Paint( const Rectangle& rRec );
86cdf0e10cSrcweir 	virtual void	MouseMove( const MouseEvent& rMEvt );
87cdf0e10cSrcweir 	virtual void	MouseButtonDown( const MouseEvent& rMEvt );
88cdf0e10cSrcweir 	virtual void	MouseButtonUp( const MouseEvent& rMEvt );
89cdf0e10cSrcweir 	virtual void	KeyInput( const KeyEvent& rKEvt );
90cdf0e10cSrcweir 	virtual void	Command( const CommandEvent& rCEvt );
91cdf0e10cSrcweir 	virtual void	GetFocus();
92cdf0e10cSrcweir     virtual void    LoseFocus();
93cdf0e10cSrcweir 
94cdf0e10cSrcweir private:
95cdf0e10cSrcweir 	ScHeaderEditEngine*	pEdEngine;
96cdf0e10cSrcweir 	EditView*			pEdView;
97cdf0e10cSrcweir     ScEditWindowLocation eLocation;
98cdf0e10cSrcweir     bool mbRTL;
99cdf0e10cSrcweir 
100cdf0e10cSrcweir     com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible > xAcc;
101cdf0e10cSrcweir     ScAccessibleEditObject* pAcc;
102*0deba7fbSSteve Yin 
103*0deba7fbSSteve Yin 	//IAccessibility2 Implementation 2009-----
104*0deba7fbSSteve Yin     Link				aObjectSelectLink;
105*0deba7fbSSteve Yin 	//-----IAccessibility2 Implementation 2009
106*0deba7fbSSteve Yin 
107cdf0e10cSrcweir };
108cdf0e10cSrcweir 
109cdf0e10cSrcweir //===================================================================
110cdf0e10cSrcweir class SC_DLLPUBLIC ScExtIButton : public ImageButton
111cdf0e10cSrcweir {
112cdf0e10cSrcweir private:
113cdf0e10cSrcweir 
114cdf0e10cSrcweir 	Timer			aTimer;
115cdf0e10cSrcweir 	ScPopupMenu*	pPopupMenu;
116cdf0e10cSrcweir 	Link			aMLink;
117cdf0e10cSrcweir 	sal_uInt16			nSelected;
118cdf0e10cSrcweir 
119cdf0e10cSrcweir 	SC_DLLPRIVATE  DECL_LINK( TimerHdl, Timer*);
120cdf0e10cSrcweir 
121cdf0e10cSrcweir //	void			DrawArrow();
122cdf0e10cSrcweir 
123cdf0e10cSrcweir protected:
124cdf0e10cSrcweir 
125cdf0e10cSrcweir 	virtual void	MouseButtonDown( const MouseEvent& rMEvt );
126cdf0e10cSrcweir 	virtual void	MouseButtonUp( const MouseEvent& rMEvt);
127cdf0e10cSrcweir 	virtual void	Click();
128cdf0e10cSrcweir 
129cdf0e10cSrcweir 	virtual void	StartPopup();
130cdf0e10cSrcweir 
131cdf0e10cSrcweir public:
132cdf0e10cSrcweir 
133cdf0e10cSrcweir 	ScExtIButton(Window* pParent, const ResId& rResId );
134cdf0e10cSrcweir 
135cdf0e10cSrcweir 	void			SetPopupMenu(ScPopupMenu* pPopUp);
136cdf0e10cSrcweir 
137cdf0e10cSrcweir 	sal_uInt16			GetSelected();
138cdf0e10cSrcweir 
139cdf0e10cSrcweir 	void            SetMenuHdl( const Link& rLink ) { aMLink = rLink; }
140cdf0e10cSrcweir 	const Link&     GetMenuHdl() const { return aMLink; }
141cdf0e10cSrcweir 
142cdf0e10cSrcweir 	virtual long	PreNotify( NotifyEvent& rNEvt );
143cdf0e10cSrcweir };
144cdf0e10cSrcweir 
145cdf0e10cSrcweir 
146cdf0e10cSrcweir //===================================================================
147cdf0e10cSrcweir //CHINA001
148cdf0e10cSrcweir //CHINA001 class ScHFEditPage : public SfxTabPage
149cdf0e10cSrcweir //CHINA001 {
150cdf0e10cSrcweir //CHINA001 public:
151cdf0e10cSrcweir //CHINA001 virtual	sal_Bool	FillItemSet	( SfxItemSet& rCoreSet );
152cdf0e10cSrcweir //CHINA001 virtual	void	Reset		( const SfxItemSet& rCoreSet );
153cdf0e10cSrcweir //CHINA001
154cdf0e10cSrcweir //CHINA001 void			SetNumType(SvxNumType eNumType);
155cdf0e10cSrcweir //CHINA001
156cdf0e10cSrcweir //CHINA001 protected:
157cdf0e10cSrcweir //CHINA001 ScHFEditPage( Window*			pParent,
158cdf0e10cSrcweir //CHINA001 sal_uInt16			nResId,
159cdf0e10cSrcweir //CHINA001 const SfxItemSet&	rCoreSet,
160cdf0e10cSrcweir //CHINA001 sal_uInt16			nWhich );
161cdf0e10cSrcweir //CHINA001 virtual		~ScHFEditPage();
162cdf0e10cSrcweir //CHINA001
163cdf0e10cSrcweir //CHINA001 private:
164cdf0e10cSrcweir //CHINA001 FixedText		aFtLeft;
165cdf0e10cSrcweir //CHINA001 ScEditWindow	aWndLeft;
166cdf0e10cSrcweir //CHINA001 FixedText		aFtCenter;
167cdf0e10cSrcweir //CHINA001 ScEditWindow	aWndCenter;
168cdf0e10cSrcweir //CHINA001 FixedText		aFtRight;
169cdf0e10cSrcweir //CHINA001 ScEditWindow	aWndRight;
170cdf0e10cSrcweir //CHINA001 ImageButton		aBtnText;
171cdf0e10cSrcweir //CHINA001 ScExtIButton	aBtnFile;
172cdf0e10cSrcweir //CHINA001 ImageButton		aBtnTable;
173cdf0e10cSrcweir //CHINA001 ImageButton		aBtnPage;
174cdf0e10cSrcweir //CHINA001 ImageButton		aBtnLastPage;
175cdf0e10cSrcweir //CHINA001 ImageButton		aBtnDate;
176cdf0e10cSrcweir //CHINA001 ImageButton		aBtnTime;
177cdf0e10cSrcweir //CHINA001 FixedLine		aFlInfo;
178cdf0e10cSrcweir //CHINA001 FixedInfo		aFtInfo;
179cdf0e10cSrcweir //CHINA001 ScPopupMenu		aPopUpFile;
180cdf0e10cSrcweir //CHINA001
181cdf0e10cSrcweir //CHINA001 sal_uInt16			nWhich;
182cdf0e10cSrcweir //CHINA001 String			aCmdArr[6];
183cdf0e10cSrcweir //CHINA001
184cdf0e10cSrcweir //CHINA001 private:
185cdf0e10cSrcweir //CHINA001 #ifdef _TPHFEDIT_CXX
186cdf0e10cSrcweir //CHINA001 void FillCmdArr();
187cdf0e10cSrcweir //CHINA001 DECL_LINK( ClickHdl, ImageButton* );
188cdf0e10cSrcweir //CHINA001 DECL_LINK( MenuHdl, ScExtIButton* );
189cdf0e10cSrcweir //CHINA001 #endif
190cdf0e10cSrcweir //CHINA001 };
191cdf0e10cSrcweir //CHINA001
192cdf0e10cSrcweir //CHINA001 //===================================================================
193cdf0e10cSrcweir //CHINA001
194cdf0e10cSrcweir //CHINA001 class ScRightHeaderEditPage : public ScHFEditPage
195cdf0e10cSrcweir //CHINA001 {
196cdf0e10cSrcweir //CHINA001 public:
197cdf0e10cSrcweir //CHINA001 static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
198cdf0e10cSrcweir //CHINA001 static sal_uInt16*		GetRanges();
199cdf0e10cSrcweir //CHINA001
200cdf0e10cSrcweir //CHINA001 private:
201cdf0e10cSrcweir //CHINA001 ScRightHeaderEditPage( Window* pParent, const SfxItemSet& rSet );
202cdf0e10cSrcweir //CHINA001 };
203cdf0e10cSrcweir //CHINA001
204cdf0e10cSrcweir //CHINA001 //===================================================================
205cdf0e10cSrcweir //CHINA001
206cdf0e10cSrcweir //CHINA001 class ScLeftHeaderEditPage : public ScHFEditPage
207cdf0e10cSrcweir //CHINA001 {
208cdf0e10cSrcweir //CHINA001 public:
209cdf0e10cSrcweir //CHINA001 static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
210cdf0e10cSrcweir //CHINA001 static sal_uInt16*		GetRanges();
211cdf0e10cSrcweir //CHINA001
212cdf0e10cSrcweir //CHINA001 private:
213cdf0e10cSrcweir //CHINA001 ScLeftHeaderEditPage( Window* pParent, const SfxItemSet& rSet );
214cdf0e10cSrcweir //CHINA001 };
215cdf0e10cSrcweir //CHINA001
216cdf0e10cSrcweir //CHINA001 //===================================================================
217cdf0e10cSrcweir //CHINA001
218cdf0e10cSrcweir //CHINA001 class ScRightFooterEditPage : public ScHFEditPage
219cdf0e10cSrcweir //CHINA001 {
220cdf0e10cSrcweir //CHINA001 public:
221cdf0e10cSrcweir //CHINA001 static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
222cdf0e10cSrcweir //CHINA001 static sal_uInt16*		GetRanges();
223cdf0e10cSrcweir //CHINA001
224cdf0e10cSrcweir //CHINA001 private:
225cdf0e10cSrcweir //CHINA001 ScRightFooterEditPage( Window* pParent, const SfxItemSet& rSet );
226cdf0e10cSrcweir //CHINA001 };
227cdf0e10cSrcweir //CHINA001
228cdf0e10cSrcweir //CHINA001 //===================================================================
229cdf0e10cSrcweir //CHINA001
230cdf0e10cSrcweir //CHINA001 class ScLeftFooterEditPage : public ScHFEditPage
231cdf0e10cSrcweir //CHINA001 {
232cdf0e10cSrcweir //CHINA001 public:
233cdf0e10cSrcweir //CHINA001 static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
234cdf0e10cSrcweir //CHINA001 static sal_uInt16*		GetRanges();
235cdf0e10cSrcweir //CHINA001
236cdf0e10cSrcweir //CHINA001 private:
237cdf0e10cSrcweir //CHINA001 ScLeftFooterEditPage( Window* pParent, const SfxItemSet& rSet );
238cdf0e10cSrcweir //CHINA001 };
239cdf0e10cSrcweir 
240cdf0e10cSrcweir 
241cdf0e10cSrcweir 
242cdf0e10cSrcweir #endif // SC_TPHFEDIT_HXX
243cdf0e10cSrcweir 
244