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