1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tphfedit.hxx,v $
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>
41 #include <vcl/timer.hxx>
42 #include <vcl/virdev.hxx>
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
;
56 class ScAccessibleEditObject
;
59 SC_DLLPUBLIC ScEditWindow
* GetScEditWindow (); //CHINA001
61 enum ScEditWindowLocation
68 class SC_DLLPUBLIC ScEditWindow
: public Control
71 ScEditWindow( Window
* pParent
, const ResId
& rResId
, ScEditWindowLocation eLoc
);
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
;}
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();
99 ScHeaderEditEngine
* pEdEngine
;
101 ScEditWindowLocation eLocation
;
104 com::sun::star::uno::WeakReference
< ::com::sun::star::accessibility::XAccessible
> xAcc
;
105 ScAccessibleEditObject
* pAcc
;
108 //===================================================================
109 class SC_DLLPUBLIC ScExtIButton
: public ImageButton
114 ScPopupMenu
* pPopupMenu
;
118 SC_DLLPRIVATE
DECL_LINK( TimerHdl
, Timer
*);
124 virtual void MouseButtonDown( const MouseEvent
& rMEvt
);
125 virtual void MouseButtonUp( const MouseEvent
& rMEvt
);
126 virtual void Click();
128 virtual void StartPopup();
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 //===================================================================
147 //CHINA001 class ScHFEditPage : public SfxTabPage
150 //CHINA001 virtual BOOL FillItemSet ( SfxItemSet& rCoreSet );
151 //CHINA001 virtual void Reset ( const SfxItemSet& rCoreSet );
153 //CHINA001 void SetNumType(SvxNumType eNumType);
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();
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;
180 //CHINA001 USHORT nWhich;
181 //CHINA001 String aCmdArr[6];
184 //CHINA001 #ifdef _TPHFEDIT_CXX
185 //CHINA001 void FillCmdArr();
186 //CHINA001 DECL_LINK( ClickHdl, ImageButton* );
187 //CHINA001 DECL_LINK( MenuHdl, ScExtIButton* );
191 //CHINA001 //===================================================================
193 //CHINA001 class ScRightHeaderEditPage : public ScHFEditPage
196 //CHINA001 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rCoreSet );
197 //CHINA001 static USHORT* GetRanges();
200 //CHINA001 ScRightHeaderEditPage( Window* pParent, const SfxItemSet& rSet );
203 //CHINA001 //===================================================================
205 //CHINA001 class ScLeftHeaderEditPage : public ScHFEditPage
208 //CHINA001 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rCoreSet );
209 //CHINA001 static USHORT* GetRanges();
212 //CHINA001 ScLeftHeaderEditPage( Window* pParent, const SfxItemSet& rSet );
215 //CHINA001 //===================================================================
217 //CHINA001 class ScRightFooterEditPage : public ScHFEditPage
220 //CHINA001 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rCoreSet );
221 //CHINA001 static USHORT* GetRanges();
224 //CHINA001 ScRightFooterEditPage( Window* pParent, const SfxItemSet& rSet );
227 //CHINA001 //===================================================================
229 //CHINA001 class ScLeftFooterEditPage : public ScHFEditPage
232 //CHINA001 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rCoreSet );
233 //CHINA001 static USHORT* GetRanges();
236 //CHINA001 ScLeftFooterEditPage( Window* pParent, const SfxItemSet& rSet );
241 #endif // SC_TPHFEDIT_HXX