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