xref: /aoo42x/main/sc/source/ui/inc/tphfedit.hxx (revision 4d7c9de0)
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 
GetEditEngine() const80cdf0e10cSrcweir 	inline ScHeaderEditEngine*  GetEditEngine() const {return pEdEngine;}
SetObjectSelectHdl(const Link & aLink)81*0deba7fbSSteve Yin 	void 			SetObjectSelectHdl( const Link& aLink){ aObjectSelectLink = aLink; };
82cdf0e10cSrcweir protected:
83cdf0e10cSrcweir 	virtual void	Paint( const Rectangle& rRec );
84cdf0e10cSrcweir 	virtual void	MouseMove( const MouseEvent& rMEvt );
85cdf0e10cSrcweir 	virtual void	MouseButtonDown( const MouseEvent& rMEvt );
86cdf0e10cSrcweir 	virtual void	MouseButtonUp( const MouseEvent& rMEvt );
87cdf0e10cSrcweir 	virtual void	KeyInput( const KeyEvent& rKEvt );
88cdf0e10cSrcweir 	virtual void	Command( const CommandEvent& rCEvt );
89cdf0e10cSrcweir 	virtual void	GetFocus();
90cdf0e10cSrcweir     virtual void    LoseFocus();
91cdf0e10cSrcweir 
92cdf0e10cSrcweir private:
93cdf0e10cSrcweir 	ScHeaderEditEngine*	pEdEngine;
94cdf0e10cSrcweir 	EditView*			pEdView;
95cdf0e10cSrcweir     ScEditWindowLocation eLocation;
96cdf0e10cSrcweir     bool mbRTL;
97cdf0e10cSrcweir 
98cdf0e10cSrcweir     com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible > xAcc;
99cdf0e10cSrcweir     ScAccessibleEditObject* pAcc;
100*0deba7fbSSteve Yin 
101*0deba7fbSSteve Yin     Link				aObjectSelectLink;
102*0deba7fbSSteve Yin 
103cdf0e10cSrcweir };
104cdf0e10cSrcweir 
105cdf0e10cSrcweir //===================================================================
106cdf0e10cSrcweir class SC_DLLPUBLIC ScExtIButton : public ImageButton
107cdf0e10cSrcweir {
108cdf0e10cSrcweir private:
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 	Timer			aTimer;
111cdf0e10cSrcweir 	ScPopupMenu*	pPopupMenu;
112cdf0e10cSrcweir 	Link			aMLink;
113cdf0e10cSrcweir 	sal_uInt16			nSelected;
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 	SC_DLLPRIVATE  DECL_LINK( TimerHdl, Timer*);
116cdf0e10cSrcweir 
117cdf0e10cSrcweir //	void			DrawArrow();
118cdf0e10cSrcweir 
119cdf0e10cSrcweir protected:
120cdf0e10cSrcweir 
121cdf0e10cSrcweir 	virtual void	MouseButtonDown( const MouseEvent& rMEvt );
122cdf0e10cSrcweir 	virtual void	MouseButtonUp( const MouseEvent& rMEvt);
123cdf0e10cSrcweir 	virtual void	Click();
124cdf0e10cSrcweir 
125cdf0e10cSrcweir 	virtual void	StartPopup();
126cdf0e10cSrcweir 
127cdf0e10cSrcweir public:
128cdf0e10cSrcweir 
129cdf0e10cSrcweir 	ScExtIButton(Window* pParent, const ResId& rResId );
130cdf0e10cSrcweir 
131cdf0e10cSrcweir 	void			SetPopupMenu(ScPopupMenu* pPopUp);
132cdf0e10cSrcweir 
133cdf0e10cSrcweir 	sal_uInt16			GetSelected();
134cdf0e10cSrcweir 
SetMenuHdl(const Link & rLink)135cdf0e10cSrcweir 	void            SetMenuHdl( const Link& rLink ) { aMLink = rLink; }
GetMenuHdl() const136cdf0e10cSrcweir 	const Link&     GetMenuHdl() const { return aMLink; }
137cdf0e10cSrcweir 
138cdf0e10cSrcweir 	virtual long	PreNotify( NotifyEvent& rNEvt );
139cdf0e10cSrcweir };
140cdf0e10cSrcweir 
141cdf0e10cSrcweir 
142cdf0e10cSrcweir //===================================================================
143cdf0e10cSrcweir //CHINA001
144cdf0e10cSrcweir //CHINA001 class ScHFEditPage : public SfxTabPage
145cdf0e10cSrcweir //CHINA001 {
146cdf0e10cSrcweir //CHINA001 public:
147cdf0e10cSrcweir //CHINA001 virtual	sal_Bool	FillItemSet	( SfxItemSet& rCoreSet );
148cdf0e10cSrcweir //CHINA001 virtual	void	Reset		( const SfxItemSet& rCoreSet );
149cdf0e10cSrcweir //CHINA001
150cdf0e10cSrcweir //CHINA001 void			SetNumType(SvxNumType eNumType);
151cdf0e10cSrcweir //CHINA001
152cdf0e10cSrcweir //CHINA001 protected:
153cdf0e10cSrcweir //CHINA001 ScHFEditPage( Window*			pParent,
154cdf0e10cSrcweir //CHINA001 sal_uInt16			nResId,
155cdf0e10cSrcweir //CHINA001 const SfxItemSet&	rCoreSet,
156cdf0e10cSrcweir //CHINA001 sal_uInt16			nWhich );
157cdf0e10cSrcweir //CHINA001 virtual		~ScHFEditPage();
158cdf0e10cSrcweir //CHINA001
159cdf0e10cSrcweir //CHINA001 private:
160cdf0e10cSrcweir //CHINA001 FixedText		aFtLeft;
161cdf0e10cSrcweir //CHINA001 ScEditWindow	aWndLeft;
162cdf0e10cSrcweir //CHINA001 FixedText		aFtCenter;
163cdf0e10cSrcweir //CHINA001 ScEditWindow	aWndCenter;
164cdf0e10cSrcweir //CHINA001 FixedText		aFtRight;
165cdf0e10cSrcweir //CHINA001 ScEditWindow	aWndRight;
166cdf0e10cSrcweir //CHINA001 ImageButton		aBtnText;
167cdf0e10cSrcweir //CHINA001 ScExtIButton	aBtnFile;
168cdf0e10cSrcweir //CHINA001 ImageButton		aBtnTable;
169cdf0e10cSrcweir //CHINA001 ImageButton		aBtnPage;
170cdf0e10cSrcweir //CHINA001 ImageButton		aBtnLastPage;
171cdf0e10cSrcweir //CHINA001 ImageButton		aBtnDate;
172cdf0e10cSrcweir //CHINA001 ImageButton		aBtnTime;
173cdf0e10cSrcweir //CHINA001 FixedLine		aFlInfo;
174cdf0e10cSrcweir //CHINA001 FixedInfo		aFtInfo;
175cdf0e10cSrcweir //CHINA001 ScPopupMenu		aPopUpFile;
176cdf0e10cSrcweir //CHINA001
177cdf0e10cSrcweir //CHINA001 sal_uInt16			nWhich;
178cdf0e10cSrcweir //CHINA001 String			aCmdArr[6];
179cdf0e10cSrcweir //CHINA001
180cdf0e10cSrcweir //CHINA001 private:
181cdf0e10cSrcweir //CHINA001 #ifdef _TPHFEDIT_CXX
182cdf0e10cSrcweir //CHINA001 void FillCmdArr();
183cdf0e10cSrcweir //CHINA001 DECL_LINK( ClickHdl, ImageButton* );
184cdf0e10cSrcweir //CHINA001 DECL_LINK( MenuHdl, ScExtIButton* );
185cdf0e10cSrcweir //CHINA001 #endif
186cdf0e10cSrcweir //CHINA001 };
187cdf0e10cSrcweir //CHINA001
188cdf0e10cSrcweir //CHINA001 //===================================================================
189cdf0e10cSrcweir //CHINA001
190cdf0e10cSrcweir //CHINA001 class ScRightHeaderEditPage : public ScHFEditPage
191cdf0e10cSrcweir //CHINA001 {
192cdf0e10cSrcweir //CHINA001 public:
193cdf0e10cSrcweir //CHINA001 static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
194cdf0e10cSrcweir //CHINA001 static sal_uInt16*		GetRanges();
195cdf0e10cSrcweir //CHINA001
196cdf0e10cSrcweir //CHINA001 private:
197cdf0e10cSrcweir //CHINA001 ScRightHeaderEditPage( Window* pParent, const SfxItemSet& rSet );
198cdf0e10cSrcweir //CHINA001 };
199cdf0e10cSrcweir //CHINA001
200cdf0e10cSrcweir //CHINA001 //===================================================================
201cdf0e10cSrcweir //CHINA001
202cdf0e10cSrcweir //CHINA001 class ScLeftHeaderEditPage : public ScHFEditPage
203cdf0e10cSrcweir //CHINA001 {
204cdf0e10cSrcweir //CHINA001 public:
205cdf0e10cSrcweir //CHINA001 static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
206cdf0e10cSrcweir //CHINA001 static sal_uInt16*		GetRanges();
207cdf0e10cSrcweir //CHINA001
208cdf0e10cSrcweir //CHINA001 private:
209cdf0e10cSrcweir //CHINA001 ScLeftHeaderEditPage( Window* pParent, const SfxItemSet& rSet );
210cdf0e10cSrcweir //CHINA001 };
211cdf0e10cSrcweir //CHINA001
212cdf0e10cSrcweir //CHINA001 //===================================================================
213cdf0e10cSrcweir //CHINA001
214cdf0e10cSrcweir //CHINA001 class ScRightFooterEditPage : public ScHFEditPage
215cdf0e10cSrcweir //CHINA001 {
216cdf0e10cSrcweir //CHINA001 public:
217cdf0e10cSrcweir //CHINA001 static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
218cdf0e10cSrcweir //CHINA001 static sal_uInt16*		GetRanges();
219cdf0e10cSrcweir //CHINA001
220cdf0e10cSrcweir //CHINA001 private:
221cdf0e10cSrcweir //CHINA001 ScRightFooterEditPage( Window* pParent, const SfxItemSet& rSet );
222cdf0e10cSrcweir //CHINA001 };
223cdf0e10cSrcweir //CHINA001
224cdf0e10cSrcweir //CHINA001 //===================================================================
225cdf0e10cSrcweir //CHINA001
226cdf0e10cSrcweir //CHINA001 class ScLeftFooterEditPage : public ScHFEditPage
227cdf0e10cSrcweir //CHINA001 {
228cdf0e10cSrcweir //CHINA001 public:
229cdf0e10cSrcweir //CHINA001 static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
230cdf0e10cSrcweir //CHINA001 static sal_uInt16*		GetRanges();
231cdf0e10cSrcweir //CHINA001
232cdf0e10cSrcweir //CHINA001 private:
233cdf0e10cSrcweir //CHINA001 ScLeftFooterEditPage( Window* pParent, const SfxItemSet& rSet );
234cdf0e10cSrcweir //CHINA001 };
235cdf0e10cSrcweir 
236cdf0e10cSrcweir 
237cdf0e10cSrcweir 
238cdf0e10cSrcweir #endif // SC_TPHFEDIT_HXX
239cdf0e10cSrcweir 
240