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