update dev300-m58
[ooovba.git] / sc / source / ui / inc / tphfedit.hxx
blobe3e3e386488ae6a162eb665b7c624a81823970ba
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tphfedit.hxx,v $
10 * $Revision: 1.14 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_TPHFEDIT_HXX
32 #define SC_TPHFEDIT_HXX
34 #include <sfx2/tabdlg.hxx>
35 #include <svx/pageitem.hxx>
36 #include <svtools/stdctrl.hxx>
37 #include <vcl/group.hxx>
38 #ifndef _LSTBOX_HXX //autogen
39 #include <vcl/lstbox.hxx>
40 #endif
41 #include <vcl/timer.hxx>
42 #include <vcl/virdev.hxx>
43 #include "scdllapi.h"
44 #include "scitems.hxx" // wegen enum SvxNumType
45 #include "popmenu.hxx"
46 #include <com/sun/star/accessibility/XAccessible.hpp>
47 #include <cppuhelper/weakref.hxx>
49 //===================================================================
51 class ScHeaderEditEngine;
52 class ScPatternAttr;
53 class EditView;
54 class EditTextObject;
55 class SvxFieldItem;
56 class ScAccessibleEditObject;
57 class ScEditWindow;
59 SC_DLLPUBLIC ScEditWindow* GetScEditWindow (); //CHINA001
61 enum ScEditWindowLocation
63 Left,
64 Center,
65 Right
68 class SC_DLLPUBLIC ScEditWindow : public Control
70 public:
71 ScEditWindow( Window* pParent, const ResId& rResId, ScEditWindowLocation eLoc );
72 ~ScEditWindow();
74 using Control::SetFont;
75 void SetFont( const ScPatternAttr& rPattern );
76 using Control::SetText;
77 void SetText( const EditTextObject& rTextObject );
78 EditTextObject* CreateTextObject();
79 void SetCharAttriutes();
81 void InsertField( const SvxFieldItem& rFld );
83 void SetNumType(SvxNumType eNumType);
85 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
87 inline ScHeaderEditEngine* GetEditEngine() const {return pEdEngine;}
88 protected:
89 virtual void Paint( const Rectangle& rRec );
90 virtual void MouseMove( const MouseEvent& rMEvt );
91 virtual void MouseButtonDown( const MouseEvent& rMEvt );
92 virtual void MouseButtonUp( const MouseEvent& rMEvt );
93 virtual void KeyInput( const KeyEvent& rKEvt );
94 virtual void Command( const CommandEvent& rCEvt );
95 virtual void GetFocus();
96 virtual void LoseFocus();
98 private:
99 ScHeaderEditEngine* pEdEngine;
100 EditView* pEdView;
101 ScEditWindowLocation eLocation;
102 bool mbRTL;
104 com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible > xAcc;
105 ScAccessibleEditObject* pAcc;
108 //===================================================================
109 class SC_DLLPUBLIC ScExtIButton : public ImageButton
111 private:
113 Timer aTimer;
114 ScPopupMenu* pPopupMenu;
115 Link aMLink;
116 USHORT nSelected;
118 SC_DLLPRIVATE DECL_LINK( TimerHdl, Timer*);
120 // void DrawArrow();
122 protected:
124 virtual void MouseButtonDown( const MouseEvent& rMEvt );
125 virtual void MouseButtonUp( const MouseEvent& rMEvt);
126 virtual void Click();
128 virtual void StartPopup();
130 public:
132 ScExtIButton(Window* pParent, const ResId& rResId );
134 void SetPopupMenu(ScPopupMenu* pPopUp);
136 USHORT GetSelected();
138 void SetMenuHdl( const Link& rLink ) { aMLink = rLink; }
139 const Link& GetMenuHdl() const { return aMLink; }
141 virtual long PreNotify( NotifyEvent& rNEvt );
145 //===================================================================
146 //CHINA001
147 //CHINA001 class ScHFEditPage : public SfxTabPage
148 //CHINA001 {
149 //CHINA001 public:
150 //CHINA001 virtual BOOL FillItemSet ( SfxItemSet& rCoreSet );
151 //CHINA001 virtual void Reset ( const SfxItemSet& rCoreSet );
152 //CHINA001
153 //CHINA001 void SetNumType(SvxNumType eNumType);
154 //CHINA001
155 //CHINA001 protected:
156 //CHINA001 ScHFEditPage( Window* pParent,
157 //CHINA001 USHORT nResId,
158 //CHINA001 const SfxItemSet& rCoreSet,
159 //CHINA001 USHORT nWhich );
160 //CHINA001 virtual ~ScHFEditPage();
161 //CHINA001
162 //CHINA001 private:
163 //CHINA001 FixedText aFtLeft;
164 //CHINA001 ScEditWindow aWndLeft;
165 //CHINA001 FixedText aFtCenter;
166 //CHINA001 ScEditWindow aWndCenter;
167 //CHINA001 FixedText aFtRight;
168 //CHINA001 ScEditWindow aWndRight;
169 //CHINA001 ImageButton aBtnText;
170 //CHINA001 ScExtIButton aBtnFile;
171 //CHINA001 ImageButton aBtnTable;
172 //CHINA001 ImageButton aBtnPage;
173 //CHINA001 ImageButton aBtnLastPage;
174 //CHINA001 ImageButton aBtnDate;
175 //CHINA001 ImageButton aBtnTime;
176 //CHINA001 FixedLine aFlInfo;
177 //CHINA001 FixedInfo aFtInfo;
178 //CHINA001 ScPopupMenu aPopUpFile;
179 //CHINA001
180 //CHINA001 USHORT nWhich;
181 //CHINA001 String aCmdArr[6];
182 //CHINA001
183 //CHINA001 private:
184 //CHINA001 #ifdef _TPHFEDIT_CXX
185 //CHINA001 void FillCmdArr();
186 //CHINA001 DECL_LINK( ClickHdl, ImageButton* );
187 //CHINA001 DECL_LINK( MenuHdl, ScExtIButton* );
188 //CHINA001 #endif
189 //CHINA001 };
190 //CHINA001
191 //CHINA001 //===================================================================
192 //CHINA001
193 //CHINA001 class ScRightHeaderEditPage : public ScHFEditPage
194 //CHINA001 {
195 //CHINA001 public:
196 //CHINA001 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rCoreSet );
197 //CHINA001 static USHORT* GetRanges();
198 //CHINA001
199 //CHINA001 private:
200 //CHINA001 ScRightHeaderEditPage( Window* pParent, const SfxItemSet& rSet );
201 //CHINA001 };
202 //CHINA001
203 //CHINA001 //===================================================================
204 //CHINA001
205 //CHINA001 class ScLeftHeaderEditPage : public ScHFEditPage
206 //CHINA001 {
207 //CHINA001 public:
208 //CHINA001 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rCoreSet );
209 //CHINA001 static USHORT* GetRanges();
210 //CHINA001
211 //CHINA001 private:
212 //CHINA001 ScLeftHeaderEditPage( Window* pParent, const SfxItemSet& rSet );
213 //CHINA001 };
214 //CHINA001
215 //CHINA001 //===================================================================
216 //CHINA001
217 //CHINA001 class ScRightFooterEditPage : public ScHFEditPage
218 //CHINA001 {
219 //CHINA001 public:
220 //CHINA001 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rCoreSet );
221 //CHINA001 static USHORT* GetRanges();
222 //CHINA001
223 //CHINA001 private:
224 //CHINA001 ScRightFooterEditPage( Window* pParent, const SfxItemSet& rSet );
225 //CHINA001 };
226 //CHINA001
227 //CHINA001 //===================================================================
228 //CHINA001
229 //CHINA001 class ScLeftFooterEditPage : public ScHFEditPage
230 //CHINA001 {
231 //CHINA001 public:
232 //CHINA001 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rCoreSet );
233 //CHINA001 static USHORT* GetRanges();
234 //CHINA001
235 //CHINA001 private:
236 //CHINA001 ScLeftFooterEditPage( Window* pParent, const SfxItemSet& rSet );
237 //CHINA001 };
241 #endif // SC_TPHFEDIT_HXX