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 _TOOLKIT_HELPER_UNOCONTROLS_HXX_ 25 #define _TOOLKIT_HELPER_UNOCONTROLS_HXX_ 26 27 #include <toolkit/dllapi.h> 28 #include <com/sun/star/awt/XTextComponent.hpp> 29 #include <com/sun/star/awt/XTextListener.hpp> 30 #include <com/sun/star/awt/XLayoutConstrains.hpp> 31 #include <com/sun/star/awt/XTextLayoutConstrains.hpp> 32 #include <com/sun/star/awt/XButton.hpp> 33 #include <com/sun/star/awt/XToggleButton.hpp> 34 #include <com/sun/star/awt/XRadioButton.hpp> 35 #include <com/sun/star/awt/XItemListener.hpp> 36 #include <com/sun/star/awt/XCheckBox.hpp> 37 #include <com/sun/star/awt/XFixedHyperlink.hpp> 38 #include <com/sun/star/awt/XFixedText.hpp> 39 #include <com/sun/star/awt/XListBox.hpp> 40 #include <com/sun/star/awt/XComboBox.hpp> 41 #include <com/sun/star/awt/XDateField.hpp> 42 #include <com/sun/star/awt/XSpinField.hpp> 43 #include <com/sun/star/awt/XTimeField.hpp> 44 #include <com/sun/star/awt/XNumericField.hpp> 45 #include <com/sun/star/awt/XCurrencyField.hpp> 46 #include <com/sun/star/awt/XPatternField.hpp> 47 #include <com/sun/star/awt/XProgressBar.hpp> 48 #include <com/sun/star/awt/XItemList.hpp> 49 #include <com/sun/star/graphic/XGraphicObject.hpp> 50 #include <toolkit/controls/unocontrolmodel.hxx> 51 #include <toolkit/controls/unocontrolbase.hxx> 52 #include <toolkit/helper/macros.hxx> 53 #include <toolkit/helper/servicenames.hxx> 54 #include <vcl/bitmapex.hxx> 55 #include <cppuhelper/implbase5.hxx> 56 #include <cppuhelper/implbase4.hxx> 57 #include <cppuhelper/implbase2.hxx> 58 #include <cppuhelper/implbase1.hxx> 59 #include <comphelper/uno3.hxx> 60 61 #include <list> 62 #include <vector> 63 64 #include <boost/scoped_ptr.hpp> 65 #include <boost/optional.hpp> 66 67 #define UNO_NAME_GRAPHOBJ_URLPREFIX "vnd.sun.star.GraphicObject:" 68 #define UNO_NAME_GRAPHOBJ_URLPKGPREFIX "vnd.sun.star.Package:" 69 70 71 // ---------------------------------------------------- 72 // class UnoControlEditModel 73 // ---------------------------------------------------- 74 class UnoControlEditModel : public UnoControlModel 75 { 76 protected: 77 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 78 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 79 80 public: 81 UnoControlEditModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); UnoControlEditModel(const UnoControlEditModel & rModel)82 UnoControlEditModel( const UnoControlEditModel& rModel ) : UnoControlModel( rModel ) {;} 83 Clone() const84 UnoControlModel* Clone() const { return new UnoControlEditModel( *this ); } 85 86 // ::com::sun::star::io::XPersistObject 87 ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); 88 89 // ::com::sun::star::beans::XMultiPropertySet 90 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 91 92 93 // XServiceInfo 94 DECLIMPL_SERVICEINFO_DERIVED( UnoControlEditModel, UnoControlModel, szServiceName2_UnoControlEditModel ) 95 }; 96 97 // ---------------------------------------------------- 98 // class UnoEditControl 99 // ---------------------------------------------------- 100 typedef ::cppu::ImplHelper4 < ::com::sun::star::awt::XTextComponent 101 , ::com::sun::star::awt::XTextListener 102 , ::com::sun::star::awt::XLayoutConstrains 103 , ::com::sun::star::awt::XTextLayoutConstrains 104 > UnoEditControl_Base; 105 class TOOLKIT_DLLPUBLIC UnoEditControl :public UnoControlBase 106 ,public UnoEditControl_Base 107 { 108 private: 109 TextListenerMultiplexer maTextListeners; 110 111 // Not all fields derived from UnoEditCOntrol have the property "Text" 112 // They only support XTextComponent, so keep the text 113 // here, maybe there is no Peer when calling setText()... 114 ::rtl::OUString maText; 115 sal_uInt16 mnMaxTextLen; 116 117 sal_Bool mbSetTextInPeer; 118 sal_Bool mbSetMaxTextLenInPeer; 119 sal_Bool mbHasTextProperty; 120 121 public: 122 123 UnoEditControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); 124 ::rtl::OUString GetComponentServiceName(); GetTextListeners()125 TextListenerMultiplexer& GetTextListeners() { return maTextListeners; } 126 127 void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); 128 129 void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); disposing(const::com::sun::star::lang::EventObject & Source)130 void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); } 131 void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); 132 133 // disambiguate XInterface 134 DECLARE_XINTERFACE() 135 136 // XAggregation 137 ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); 138 139 // XTypeProvider 140 DECLARE_XTYPEPROVIDER() 141 142 // XTextListener 143 void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); 144 145 // XTextComponent 146 void SAL_CALL addTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener >& l ) throw(::com::sun::star::uno::RuntimeException); 147 void SAL_CALL removeTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener >& l ) throw(::com::sun::star::uno::RuntimeException); 148 void SAL_CALL setText( const ::rtl::OUString& aText ) throw(::com::sun::star::uno::RuntimeException); 149 void SAL_CALL insertText( const ::com::sun::star::awt::Selection& Sel, const ::rtl::OUString& Text ) throw(::com::sun::star::uno::RuntimeException); 150 ::rtl::OUString SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException); 151 ::rtl::OUString SAL_CALL getSelectedText( ) throw(::com::sun::star::uno::RuntimeException); 152 void SAL_CALL setSelection( const ::com::sun::star::awt::Selection& aSelection ) throw(::com::sun::star::uno::RuntimeException); 153 ::com::sun::star::awt::Selection SAL_CALL getSelection( ) throw(::com::sun::star::uno::RuntimeException); 154 sal_Bool SAL_CALL isEditable( ) throw(::com::sun::star::uno::RuntimeException); 155 void SAL_CALL setEditable( sal_Bool bEditable ) throw(::com::sun::star::uno::RuntimeException); 156 void SAL_CALL setMaxTextLen( sal_Int16 nLen ) throw(::com::sun::star::uno::RuntimeException); 157 sal_Int16 SAL_CALL getMaxTextLen( ) throw(::com::sun::star::uno::RuntimeException); 158 159 // XLayoutConstrains 160 ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); 161 ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); 162 ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); 163 164 // XTextLayoutConstrains 165 ::com::sun::star::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException); 166 void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(::com::sun::star::uno::RuntimeException); 167 168 // XServiceInfo 169 DECLIMPL_SERVICEINFO_DERIVED( UnoEditControl, UnoControlBase, szServiceName2_UnoControlEdit ) 170 171 sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw ( ::com::sun::star::uno::RuntimeException ); 172 }; 173 174 // ---------------------------------------------------- 175 // class UnoControlFileControlModel 176 // ---------------------------------------------------- 177 class UnoControlFileControlModel : public UnoControlModel 178 { 179 protected: 180 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 181 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 182 183 public: 184 UnoControlFileControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); UnoControlFileControlModel(const UnoControlFileControlModel & rModel)185 UnoControlFileControlModel( const UnoControlFileControlModel& rModel ) : UnoControlModel( rModel ) {;} 186 Clone() const187 UnoControlModel* Clone() const { return new UnoControlFileControlModel( *this ); } 188 189 // ::com::sun::star::io::XPersistObject 190 ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); 191 192 // ::com::sun::star::beans::XMultiPropertySet 193 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 194 195 // ::com::sun::star::lang::XServiceInfo 196 DECLIMPL_SERVICEINFO_DERIVED( UnoControlFileControlModel, UnoControlModel, szServiceName2_UnoControlFileControlModel ) 197 }; 198 199 // ---------------------------------------------------- 200 // class UnoFileControl 201 // ---------------------------------------------------- 202 class UnoFileControl : public UnoEditControl 203 { 204 public: 205 UnoFileControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); 206 ::rtl::OUString GetComponentServiceName(); 207 208 // ::com::sun::star::lang::XServiceInfo 209 DECLIMPL_SERVICEINFO_DERIVED( UnoFileControl, UnoEditControl, szServiceName2_UnoControlFileControl ) 210 }; 211 212 // ---------------------------------------------------- 213 // class GraphicControlModel 214 // ---------------------------------------------------- 215 class GraphicControlModel : public UnoControlModel 216 { 217 private: 218 bool mbAdjustingImagePosition; 219 bool mbAdjustingGraphic; 220 221 ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > mxGrfObj; 222 ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL ); 223 224 protected: GraphicControlModel(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> & i_factory)225 GraphicControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) 226 :UnoControlModel( i_factory ) 227 ,mbAdjustingImagePosition( false ) 228 ,mbAdjustingGraphic( false ) 229 { 230 } GraphicControlModel(const GraphicControlModel & _rSource)231 GraphicControlModel( const GraphicControlModel& _rSource ) : UnoControlModel( _rSource ), mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { } 232 233 // ::cppu::OPropertySetHelper 234 void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); 235 236 // UnoControlModel 237 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 238 239 private: 240 GraphicControlModel& operator=( const GraphicControlModel& ); // never implemented 241 }; 242 243 // ---------------------------------------------------- 244 // class UnoControlButtonModel 245 // ---------------------------------------------------- 246 class UnoControlButtonModel : public GraphicControlModel 247 { 248 protected: 249 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 250 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 251 252 public: 253 UnoControlButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); UnoControlButtonModel(const UnoControlButtonModel & rModel)254 UnoControlButtonModel( const UnoControlButtonModel& rModel ) : GraphicControlModel( rModel ) {;} 255 Clone() const256 UnoControlModel* Clone() const { return new UnoControlButtonModel( *this ); } 257 258 // ::com::sun::star::beans::XMultiPropertySet 259 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 260 261 // ::com::sun::star::io::XPersistObject 262 ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); 263 264 // ::com::sun::star::lang::XServiceInfo 265 DECLIMPL_SERVICEINFO_DERIVED( UnoControlButtonModel, GraphicControlModel, szServiceName2_UnoControlButtonModel ) 266 }; 267 268 // ---------------------------------------------------- 269 // class UnoButtonControl 270 // ---------------------------------------------------- 271 typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase 272 , ::com::sun::star::awt::XButton 273 , ::com::sun::star::awt::XToggleButton 274 , ::com::sun::star::awt::XLayoutConstrains 275 , ::com::sun::star::awt::XItemListener 276 > UnoButtonControl_Base; 277 class UnoButtonControl : public UnoButtonControl_Base 278 { 279 private: 280 ActionListenerMultiplexer maActionListeners; 281 ItemListenerMultiplexer maItemListeners; 282 ::rtl::OUString maActionCommand; 283 284 public: 285 286 UnoButtonControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); 287 ::rtl::OUString GetComponentServiceName(); 288 289 void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); 290 void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); 291 292 // ::com::sun::star::awt::XButton 293 void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); 294 void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); 295 void SAL_CALL setLabel( const ::rtl::OUString& Label ) throw(::com::sun::star::uno::RuntimeException); 296 void SAL_CALL setActionCommand( const ::rtl::OUString& Command ) throw(::com::sun::star::uno::RuntimeException); 297 298 // ::com::sun::star::awt::XToggleButton 299 // ::com::sun::star::awt::XItemEventBroadcaster 300 void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); 301 void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); 302 303 // ::com::sun::star::lang::XEventListener 304 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); 305 306 // XItemListener 307 virtual void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); 308 309 // ::com::sun::star::awt::XLayoutConstrains 310 ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); 311 ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); 312 ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); 313 314 // ::com::sun::star::lang::XServiceInfo 315 DECLIMPL_SERVICEINFO_DERIVED( UnoButtonControl, UnoControlBase, szServiceName2_UnoControlButton ) 316 }; 317 318 // ---------------------------------------------------- 319 // class UnoControlImageControlModel 320 // ---------------------------------------------------- 321 class UnoControlImageControlModel : public GraphicControlModel 322 { 323 private: 324 bool mbAdjustingImageScaleMode; 325 326 protected: 327 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 328 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 329 330 public: 331 UnoControlImageControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); UnoControlImageControlModel(const UnoControlImageControlModel & rModel)332 UnoControlImageControlModel( const UnoControlImageControlModel& rModel ) : GraphicControlModel( rModel ), mbAdjustingImageScaleMode( false ) { } 333 Clone() const334 UnoControlModel* Clone() const { return new UnoControlImageControlModel( *this ); } 335 336 // ::com::sun::star::beans::XMultiPropertySet 337 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 338 339 // ::com::sun::star::io::XPersistObject 340 ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); 341 342 // ::com::sun::star::lang::XServiceInfo 343 DECLIMPL_SERVICEINFO_DERIVED( UnoControlImageControlModel, GraphicControlModel, szServiceName2_UnoControlImageControlModel ) 344 345 // ::cppu::OPropertySetHelper 346 void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); 347 }; 348 349 // ---------------------------------------------------- 350 // class UnoImageControlControl 351 // ---------------------------------------------------- 352 typedef ::cppu::AggImplInheritanceHelper1 < UnoControlBase 353 , ::com::sun::star::awt::XLayoutConstrains 354 > UnoImageControlControl_Base; 355 class UnoImageControlControl : public UnoImageControlControl_Base 356 { 357 private: 358 ActionListenerMultiplexer maActionListeners; 359 ::rtl::OUString maActionCommand; 360 361 public: 362 363 UnoImageControlControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); 364 ::rtl::OUString GetComponentServiceName(); 365 366 void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); 367 368 // ::com::sun::star::awt::XControl 369 sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); 370 371 // ::com::sun::star::awt::XLayoutConstrains 372 ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); 373 ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); 374 ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); 375 376 // ::com::sun::star::lang::XServiceInfo 377 DECLIMPL_SERVICEINFO_DERIVED( UnoImageControlControl, UnoControlBase, szServiceName2_UnoControlImageControl ) 378 }; 379 380 // ---------------------------------------------------- 381 // class UnoControlRadioButtonModel 382 // ---------------------------------------------------- 383 class UnoControlRadioButtonModel : public GraphicControlModel 384 385 { 386 protected: 387 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 388 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 389 390 public: 391 UnoControlRadioButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); UnoControlRadioButtonModel(const UnoControlRadioButtonModel & rModel)392 UnoControlRadioButtonModel( const UnoControlRadioButtonModel& rModel ) : GraphicControlModel( rModel ) {;} 393 Clone() const394 UnoControlModel* Clone() const { return new UnoControlRadioButtonModel( *this ); } 395 396 // ::com::sun::star::io::XPersistObject 397 ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); 398 399 // ::com::sun::star::beans::XMultiPropertySet 400 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 401 402 // ::com::sun::star::lang::XServiceInfo 403 DECLIMPL_SERVICEINFO_DERIVED( UnoControlRadioButtonModel, GraphicControlModel, szServiceName2_UnoControlRadioButtonModel ) 404 405 }; 406 407 // ---------------------------------------------------- 408 // class UnoRadioButtonControl 409 // ---------------------------------------------------- 410 typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase 411 , ::com::sun::star::awt::XButton 412 , ::com::sun::star::awt::XRadioButton 413 , ::com::sun::star::awt::XItemListener 414 , ::com::sun::star::awt::XLayoutConstrains 415 > UnoRadioButtonControl_Base; 416 class UnoRadioButtonControl : public UnoRadioButtonControl_Base 417 { 418 private: 419 ItemListenerMultiplexer maItemListeners; 420 ActionListenerMultiplexer maActionListeners; 421 ::rtl::OUString maActionCommand; 422 423 public: 424 425 UnoRadioButtonControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); 426 ::rtl::OUString GetComponentServiceName(); 427 428 void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); 429 void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); disposing(const::com::sun::star::lang::EventObject & Source)430 void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); } 431 432 // ::com::sun::star::awt::XControl 433 sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); 434 435 // ::com::sun::star::awt::XButton 436 void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); 437 void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); 438 void SAL_CALL setActionCommand( const ::rtl::OUString& Command ) throw(::com::sun::star::uno::RuntimeException); 439 440 // ::com::sun::star::awt::XRadioButton 441 void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); 442 void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); 443 sal_Bool SAL_CALL getState( ) throw(::com::sun::star::uno::RuntimeException); 444 void SAL_CALL setState( sal_Bool b ) throw(::com::sun::star::uno::RuntimeException); 445 void SAL_CALL setLabel( const ::rtl::OUString& Label ) throw(::com::sun::star::uno::RuntimeException); 446 447 // ::com::sun::star::awt::XItemListener 448 void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); 449 450 // ::com::sun::star::awt::XLayoutConstrains 451 ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); 452 ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); 453 ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); 454 455 // ::com::sun::star::lang::XServiceInfo 456 DECLIMPL_SERVICEINFO_DERIVED( UnoRadioButtonControl, UnoControlBase, szServiceName2_UnoControlRadioButton ) 457 458 }; 459 460 // ---------------------------------------------------- 461 // class UnoControlCheckBoxModel 462 // ---------------------------------------------------- 463 class UnoControlCheckBoxModel : public GraphicControlModel 464 { 465 protected: 466 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 467 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 468 469 public: 470 UnoControlCheckBoxModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); UnoControlCheckBoxModel(const UnoControlCheckBoxModel & rModel)471 UnoControlCheckBoxModel( const UnoControlCheckBoxModel& rModel ) : GraphicControlModel( rModel ) {;} 472 Clone() const473 UnoControlModel* Clone() const { return new UnoControlCheckBoxModel( *this ); } 474 475 // ::com::sun::star::io::XPersistObject 476 ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); 477 478 // ::com::sun::star::beans::XMultiPropertySet 479 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 480 481 // ::com::sun::star::lang::XServiceInfo 482 DECLIMPL_SERVICEINFO_DERIVED( UnoControlCheckBoxModel, GraphicControlModel, szServiceName2_UnoControlCheckBoxModel ) 483 }; 484 485 // ---------------------------------------------------- 486 // class UnoCheckBoxControl 487 // ---------------------------------------------------- 488 typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase 489 , ::com::sun::star::awt::XButton 490 , ::com::sun::star::awt::XCheckBox 491 , ::com::sun::star::awt::XItemListener 492 , ::com::sun::star::awt::XLayoutConstrains 493 > UnoCheckBoxControl_Base; 494 class UnoCheckBoxControl : public UnoCheckBoxControl_Base 495 { 496 private: 497 ItemListenerMultiplexer maItemListeners; 498 ActionListenerMultiplexer maActionListeners; 499 ::rtl::OUString maActionCommand; 500 501 public: 502 503 UnoCheckBoxControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); ~UnoCheckBoxControl()504 ~UnoCheckBoxControl(){;} 505 ::rtl::OUString GetComponentServiceName(); 506 507 void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); 508 void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); disposing(const::com::sun::star::lang::EventObject & Source)509 void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); } 510 511 // ::com::sun::star::awt::XControl 512 sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); 513 514 // ::com::sun::star::awt::XButton 515 void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); 516 void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); 517 void SAL_CALL setActionCommand( const ::rtl::OUString& Command ) throw(::com::sun::star::uno::RuntimeException); 518 519 virtual void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw (::com::sun::star::uno::RuntimeException); 520 virtual void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw (::com::sun::star::uno::RuntimeException); 521 522 523 sal_Int16 SAL_CALL getState( ) throw(::com::sun::star::uno::RuntimeException); 524 void SAL_CALL setState( sal_Int16 n ) throw(::com::sun::star::uno::RuntimeException); 525 void SAL_CALL setLabel( const ::rtl::OUString& Label ) throw(::com::sun::star::uno::RuntimeException); 526 void SAL_CALL enableTriState( sal_Bool b ) throw(::com::sun::star::uno::RuntimeException); 527 528 // ::com::sun::star::awt::XItemListener 529 void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); 530 531 // ::com::sun::star::awt::XLayoutConstrains 532 ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); 533 ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); 534 ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); 535 536 // ::com::sun::star::lang::XServiceInfo 537 DECLIMPL_SERVICEINFO_DERIVED( UnoCheckBoxControl, UnoControlBase, szServiceName2_UnoControlCheckBox ) 538 539 }; 540 541 // ---------------------------------------------------- 542 // class UnoControlFixedTextModel 543 // ---------------------------------------------------- 544 class UnoControlFixedHyperlinkModel : public UnoControlModel 545 { 546 protected: 547 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 548 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 549 550 public: 551 UnoControlFixedHyperlinkModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); UnoControlFixedHyperlinkModel(const UnoControlFixedHyperlinkModel & rModel)552 UnoControlFixedHyperlinkModel( const UnoControlFixedHyperlinkModel& rModel ) : UnoControlModel( rModel ) {;} 553 Clone() const554 UnoControlModel* Clone() const { return new UnoControlFixedHyperlinkModel( *this ); } 555 556 // ::com::sun::star::io::XPersistObject 557 ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); 558 559 // ::com::sun::star::beans::XMultiPropertySet 560 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 561 562 // ::com::sun::star::lang::XServiceInfo 563 DECLIMPL_SERVICEINFO_DERIVED( UnoControlFixedHyperlinkModel, UnoControlModel, szServiceName_UnoControlFixedHyperlinkModel ) 564 }; 565 566 // ---------------------------------------------------- 567 // class UnoFixedHyperlinkControl 568 // ---------------------------------------------------- 569 class UnoFixedHyperlinkControl : public UnoControlBase, 570 public ::com::sun::star::awt::XFixedHyperlink, 571 public ::com::sun::star::awt::XLayoutConstrains 572 { 573 private: 574 ActionListenerMultiplexer maActionListeners; 575 576 public: 577 UnoFixedHyperlinkControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); 578 579 ::rtl::OUString GetComponentServiceName(); 580 queryInterface(const::com::sun::star::uno::Type & rType)581 ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); } 582 ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); acquire()583 void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } release()584 void SAL_CALL release() throw() { OWeakAggObject::release(); } 585 586 void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); 587 void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); 588 589 // ::com::sun::star::lang::XTypeProvider 590 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); 591 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); 592 593 // ::com::sun::star::awt::XControl 594 sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); 595 596 // ::com::sun::star::awt::XFixedHyperlink 597 void SAL_CALL setText( const ::rtl::OUString& Text ) throw(::com::sun::star::uno::RuntimeException); 598 ::rtl::OUString SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException); 599 void SAL_CALL setURL( const ::rtl::OUString& URL ) throw(::com::sun::star::uno::RuntimeException); 600 ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::uno::RuntimeException); 601 void SAL_CALL setAlignment( sal_Int16 nAlign ) throw(::com::sun::star::uno::RuntimeException); 602 sal_Int16 SAL_CALL getAlignment( ) throw(::com::sun::star::uno::RuntimeException); 603 void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); 604 void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); 605 606 // ::com::sun::star::awt::XLayoutConstrains 607 ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); 608 ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); 609 ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); 610 611 // ::com::sun::star::lang::XServiceInfo 612 DECLIMPL_SERVICEINFO_DERIVED( UnoFixedHyperlinkControl, UnoControlBase, szServiceName_UnoControlFixedHyperlink ) 613 }; 614 615 // ---------------------------------------------------- 616 // class UnoControlFixedTextModel 617 // ---------------------------------------------------- 618 class UnoControlFixedTextModel : public UnoControlModel 619 { 620 protected: 621 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 622 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 623 624 public: 625 UnoControlFixedTextModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); UnoControlFixedTextModel(const UnoControlFixedTextModel & rModel)626 UnoControlFixedTextModel( const UnoControlFixedTextModel& rModel ) : UnoControlModel( rModel ) {;} 627 Clone() const628 UnoControlModel* Clone() const { return new UnoControlFixedTextModel( *this ); } 629 630 // ::com::sun::star::io::XPersistObject 631 ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); 632 633 // ::com::sun::star::beans::XMultiPropertySet 634 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 635 636 // ::com::sun::star::lang::XServiceInfo 637 DECLIMPL_SERVICEINFO_DERIVED( UnoControlFixedTextModel, UnoControlModel, szServiceName2_UnoControlFixedTextModel ) 638 639 }; 640 641 // ---------------------------------------------------- 642 // class UnoFixedTextControl 643 // ---------------------------------------------------- 644 class UnoFixedTextControl : public UnoControlBase, 645 public ::com::sun::star::awt::XFixedText, 646 public ::com::sun::star::awt::XLayoutConstrains 647 { 648 public: 649 UnoFixedTextControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); 650 ::rtl::OUString GetComponentServiceName(); 651 queryInterface(const::com::sun::star::uno::Type & rType)652 ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); } 653 ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); acquire()654 void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } release()655 void SAL_CALL release() throw() { OWeakAggObject::release(); } 656 657 // ::com::sun::star::lang::XTypeProvider 658 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); 659 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); 660 661 // ::com::sun::star::awt::XControl 662 sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); 663 664 // ::com::sun::star::awt::XFixedText 665 void SAL_CALL setText( const ::rtl::OUString& Text ) throw(::com::sun::star::uno::RuntimeException); 666 ::rtl::OUString SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException); 667 void SAL_CALL setAlignment( sal_Int16 nAlign ) throw(::com::sun::star::uno::RuntimeException); 668 sal_Int16 SAL_CALL getAlignment( ) throw(::com::sun::star::uno::RuntimeException); 669 670 // ::com::sun::star::awt::XLayoutConstrains 671 ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); 672 ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); 673 ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); 674 675 // ::com::sun::star::lang::XServiceInfo 676 DECLIMPL_SERVICEINFO_DERIVED( UnoFixedTextControl, UnoControlBase, szServiceName2_UnoControlFixedText ) 677 678 }; 679 680 // ---------------------------------------------------- 681 // class UnoControlGroupBoxModel 682 // ---------------------------------------------------- 683 class UnoControlGroupBoxModel : public UnoControlModel 684 { 685 protected: 686 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 687 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 688 689 public: 690 UnoControlGroupBoxModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); UnoControlGroupBoxModel(const UnoControlGroupBoxModel & rModel)691 UnoControlGroupBoxModel( const UnoControlGroupBoxModel& rModel ) : UnoControlModel( rModel ) {;} 692 Clone() const693 UnoControlModel* Clone() const { return new UnoControlGroupBoxModel( *this ); } 694 695 // ::com::sun::star::io::XPersistObject 696 ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); 697 698 // ::com::sun::star::beans::XMultiPropertySet 699 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 700 701 // ::com::sun::star::lang::XServiceInfo 702 DECLIMPL_SERVICEINFO_DERIVED( UnoControlGroupBoxModel, UnoControlModel, szServiceName2_UnoControlGroupBoxModel ) 703 704 }; 705 706 // ---------------------------------------------------- 707 // class UnoGroupBoxControl 708 // ---------------------------------------------------- 709 class UnoGroupBoxControl : public UnoControlBase 710 { 711 public: 712 UnoGroupBoxControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); 713 ::rtl::OUString GetComponentServiceName(); 714 715 sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); 716 717 // ::com::sun::star::lang::XServiceInfo 718 DECLIMPL_SERVICEINFO_DERIVED( UnoGroupBoxControl, UnoControlBase, szServiceName2_UnoControlGroupBox ) 719 720 }; 721 722 // ---------------------------------------------------- 723 // class UnoControlListBoxModel 724 // ---------------------------------------------------- 725 struct UnoControlListBoxModel_Data; 726 typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel 727 , ::com::sun::star::awt::XItemList 728 > UnoControlListBoxModel_Base; 729 class TOOLKIT_DLLPUBLIC UnoControlListBoxModel : public UnoControlListBoxModel_Base 730 { 731 protected: 732 enum ConstructorMode 733 { 734 ConstructDefault, 735 ConstructWithoutProperties 736 }; 737 738 public: 739 UnoControlListBoxModel( 740 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory, 741 ConstructorMode const i_mode = ConstructDefault 742 ); 743 UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource ); 744 ~UnoControlListBoxModel(); 745 Clone() const746 UnoControlModel* Clone() const { return new UnoControlListBoxModel( *this ); } 747 748 virtual void ImplNormalizePropertySequence( 749 const sal_Int32 _nCount, /// the number of entries in the arrays 750 sal_Int32* _pHandles, /// the handles of the properties to set 751 ::com::sun::star::uno::Any* _pValues, /// the values of the properties to set 752 sal_Int32* _pValidHandles /// pointer to the valid handles, allowed to be adjusted 753 ) const SAL_THROW(()); 754 755 // ::com::sun::star::beans::XMultiPropertySet 756 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 757 758 // ::com::sun::star::io::XPersistObject 759 ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); 760 761 // ::com::sun::star::lang::XServiceInfo 762 //DECLIMPL_SERVICEINFO_DERIVED( UnoControlListBoxModel, UnoControlModel, szServiceName2_UnoControlListBoxModel ) 763 ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); 764 ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); 765 766 // ::com::sun::star::awt::XItemList 767 virtual ::sal_Int32 SAL_CALL getItemCount() throw (::com::sun::star::uno::RuntimeException); 768 virtual void SAL_CALL insertItem( ::sal_Int32 Position, const ::rtl::OUString& ItemText, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 769 virtual void SAL_CALL insertItemText( ::sal_Int32 Position, const ::rtl::OUString& ItemText ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 770 virtual void SAL_CALL insertItemImage( ::sal_Int32 Position, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 771 virtual void SAL_CALL removeItem( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 772 virtual void SAL_CALL removeAllItems( ) throw (::com::sun::star::uno::RuntimeException); 773 virtual void SAL_CALL setItemText( ::sal_Int32 Position, const ::rtl::OUString& ItemText ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 774 virtual void SAL_CALL setItemImage( ::sal_Int32 Position, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 775 virtual void SAL_CALL setItemTextAndImage( ::sal_Int32 Position, const ::rtl::OUString& ItemText, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 776 virtual void SAL_CALL setItemData( ::sal_Int32 Position, const ::com::sun::star::uno::Any& DataValue ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 777 virtual ::rtl::OUString SAL_CALL getItemText( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 778 virtual ::rtl::OUString SAL_CALL getItemImage( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 779 virtual ::com::sun::star::beans::Pair< ::rtl::OUString, ::rtl::OUString > SAL_CALL getItemTextAndImage( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 780 virtual ::com::sun::star::uno::Any SAL_CALL getItemData( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 781 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Pair< ::rtl::OUString, ::rtl::OUString > > SAL_CALL getAllItems( ) throw (::com::sun::star::uno::RuntimeException); 782 virtual void SAL_CALL addItemListListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); 783 virtual void SAL_CALL removeItemListListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); 784 785 // OPropertySetHelper 786 void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); 787 788 protected: 789 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 790 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 791 792 private: 793 void impl_notifyItemListEvent_nolck( 794 const sal_Int32 i_nItemPosition, 795 const ::boost::optional< ::rtl::OUString >& i_rItemText, 796 const ::boost::optional< ::rtl::OUString >& i_rItemImageURL, 797 void ( SAL_CALL ::com::sun::star::awt::XItemListListener::*NotificationMethod )( const ::com::sun::star::awt::ItemListEvent& ) 798 ); 799 800 void impl_handleInsert( 801 const sal_Int32 i_nItemPosition, 802 const ::boost::optional< ::rtl::OUString >& i_rItemText, 803 const ::boost::optional< ::rtl::OUString >& i_rItemImageURL, 804 ::osl::ClearableMutexGuard& i_rClearBeforeNotify 805 ); 806 807 void impl_handleRemove( 808 const sal_Int32 i_nItemPosition, 809 ::osl::ClearableMutexGuard& i_rClearBeforeNotify 810 ); 811 812 void impl_handleModify( 813 const sal_Int32 i_nItemPosition, 814 const ::boost::optional< ::rtl::OUString >& i_rItemText, 815 const ::boost::optional< ::rtl::OUString >& i_rItemImageURL, 816 ::osl::ClearableMutexGuard& i_rClearBeforeNotify 817 ); 818 819 void impl_getStringItemList( ::std::vector< ::rtl::OUString >& o_rStringItems ) const; 820 void impl_setStringItemList_nolck( const ::std::vector< ::rtl::OUString >& i_rStringItems ); 821 822 protected: 823 ::boost::scoped_ptr< UnoControlListBoxModel_Data > m_pData; 824 ::cppu::OInterfaceContainerHelper m_aItemListListeners; 825 }; 826 827 // ---------------------------------------------------- 828 // class UnoListBoxControl 829 // ---------------------------------------------------- 830 typedef ::cppu::AggImplInheritanceHelper5 < UnoControlBase 831 , ::com::sun::star::awt::XListBox 832 , ::com::sun::star::awt::XItemListener 833 , ::com::sun::star::awt::XLayoutConstrains 834 , ::com::sun::star::awt::XTextLayoutConstrains 835 , ::com::sun::star::awt::XItemListListener 836 > UnoListBoxControl_Base; 837 class TOOLKIT_DLLPUBLIC UnoListBoxControl : public UnoListBoxControl_Base 838 { 839 public: 840 UnoListBoxControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); 841 ::rtl::OUString GetComponentServiceName(); 842 843 void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); 844 void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); disposing(const::com::sun::star::lang::EventObject & Source)845 void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); } 846 847 // ::com::sun::star::awt::XListBox 848 void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); 849 void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); 850 void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); 851 void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); 852 void SAL_CALL addItem( const ::rtl::OUString& aItem, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); 853 void SAL_CALL addItems( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aItems, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); 854 void SAL_CALL removeItems( sal_Int16 nPos, sal_Int16 nCount ) throw(::com::sun::star::uno::RuntimeException); 855 sal_Int16 SAL_CALL getItemCount( ) throw(::com::sun::star::uno::RuntimeException); 856 ::rtl::OUString SAL_CALL getItem( sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); 857 ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getItems( ) throw(::com::sun::star::uno::RuntimeException); 858 sal_Int16 SAL_CALL getSelectedItemPos( ) throw(::com::sun::star::uno::RuntimeException); 859 ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSelectedItemsPos( ) throw(::com::sun::star::uno::RuntimeException); 860 ::rtl::OUString SAL_CALL getSelectedItem( ) throw(::com::sun::star::uno::RuntimeException); 861 ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSelectedItems( ) throw(::com::sun::star::uno::RuntimeException); 862 void SAL_CALL selectItemPos( sal_Int16 nPos, sal_Bool bSelect ) throw(::com::sun::star::uno::RuntimeException); 863 void SAL_CALL selectItemsPos( const ::com::sun::star::uno::Sequence< sal_Int16 >& aPositions, sal_Bool bSelect ) throw(::com::sun::star::uno::RuntimeException); 864 void SAL_CALL selectItem( const ::rtl::OUString& aItem, sal_Bool bSelect ) throw(::com::sun::star::uno::RuntimeException); 865 sal_Bool SAL_CALL isMutipleMode( ) throw(::com::sun::star::uno::RuntimeException); 866 void SAL_CALL setMultipleMode( sal_Bool bMulti ) throw(::com::sun::star::uno::RuntimeException); 867 sal_Int16 SAL_CALL getDropDownLineCount( ) throw(::com::sun::star::uno::RuntimeException); 868 void SAL_CALL setDropDownLineCount( sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException); 869 void SAL_CALL makeVisible( sal_Int16 nEntry ) throw(::com::sun::star::uno::RuntimeException); 870 871 // ::com::sun::star::awt::XItemListener 872 void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); 873 874 // ::com::sun::star::awt::XLayoutConstrains 875 ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); 876 ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); 877 ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); 878 879 // ::com::sun::star::awt::XTextLayoutConstrains 880 ::com::sun::star::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException); 881 void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(::com::sun::star::uno::RuntimeException); 882 883 // XUnoControl 884 sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw ( ::com::sun::star::uno::RuntimeException ); 885 886 // XItemListListener 887 virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); 888 virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); 889 virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); 890 virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); 891 virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); 892 893 // ::com::sun::star::lang::XServiceInfo 894 // DECLIMPL_SERVICEINFO_DERIVED( UnoListBoxControl, UnoControlBase, szServiceName2_UnoControlListBox ) 895 ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); 896 ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); 897 898 protected: 899 void ImplUpdateSelectedItemsProperty(); 900 virtual void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); 901 virtual void updateFromModel(); 902 903 ActionListenerMultiplexer& getActionListeners(); 904 ItemListenerMultiplexer& getItemListeners(); 905 private: 906 ActionListenerMultiplexer maActionListeners; 907 ItemListenerMultiplexer maItemListeners; 908 }; 909 910 // ---------------------------------------------------- 911 // class UnoControlComboBoxModel 912 // ---------------------------------------------------- 913 class UnoControlComboBoxModel : public UnoControlListBoxModel 914 { 915 protected: 916 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 917 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 918 919 public: 920 UnoControlComboBoxModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); UnoControlComboBoxModel(const UnoControlComboBoxModel & rModel)921 UnoControlComboBoxModel( const UnoControlComboBoxModel& rModel ) : UnoControlListBoxModel( rModel ) {;} 922 Clone() const923 UnoControlModel* Clone() const { return new UnoControlComboBoxModel( *this ); } 924 925 // ::com::sun::star::io::XPersistObject 926 ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); 927 928 // ::com::sun::star::beans::XMultiPropertySet 929 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 930 // OPropertySetHelper 931 void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); 932 933 // ::com::sun::star::lang::XServiceInfo 934 ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); 935 ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); 936 // DECLIMPL_SERVICEINFO_DERIVED( UnoControlComboBoxModel, UnoControlModel, szServiceName2_UnoControlComboBoxModel ) 937 938 }; 939 940 // ---------------------------------------------------- 941 // class UnoComboBoxControl 942 // ---------------------------------------------------- 943 class UnoComboBoxControl : public UnoEditControl 944 , public ::com::sun::star::awt::XComboBox 945 , public ::com::sun::star::awt::XItemListener 946 , public ::com::sun::star::awt::XItemListListener 947 { 948 private: 949 ActionListenerMultiplexer maActionListeners; 950 ItemListenerMultiplexer maItemListeners; 951 952 public: 953 954 UnoComboBoxControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); 955 ::rtl::OUString GetComponentServiceName(); 956 957 void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); disposing(const::com::sun::star::lang::EventObject & Source)958 void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoEditControl::disposing( Source ); } 959 void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); 960 queryInterface(const::com::sun::star::uno::Type & rType)961 ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoEditControl::queryInterface(rType); } 962 ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); acquire()963 void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } release()964 void SAL_CALL release() throw() { OWeakAggObject::release(); } 965 966 967 // ::com::sun::star::lang::XTypeProvider 968 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); 969 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); 970 971 // ::com::sun::star::awt::XComboBox 972 void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); 973 void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); 974 void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); 975 void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); 976 void SAL_CALL addItem( const ::rtl::OUString& aItem, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); 977 void SAL_CALL addItems( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aItems, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); 978 void SAL_CALL removeItems( sal_Int16 nPos, sal_Int16 nCount ) throw(::com::sun::star::uno::RuntimeException); 979 sal_Int16 SAL_CALL getItemCount( ) throw(::com::sun::star::uno::RuntimeException); 980 ::rtl::OUString SAL_CALL getItem( sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); 981 ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getItems( ) throw(::com::sun::star::uno::RuntimeException); 982 sal_Int16 SAL_CALL getDropDownLineCount( ) throw(::com::sun::star::uno::RuntimeException); 983 void SAL_CALL setDropDownLineCount( sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException); 984 985 // XUnoControl 986 virtual sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw ( ::com::sun::star::uno::RuntimeException ); 987 988 // XItemListListener 989 virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); 990 virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); 991 virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); 992 virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); 993 virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); 994 995 // XItemListener 996 virtual void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); 997 998 // ::com::sun::star::lang::XServiceInfo 999 ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); 1000 ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); 1001 //DECLIMPL_SERVICEINFO_DERIVED( UnoComboBoxControl, UnoEditControl, szServiceName2_UnoControlComboBox ) 1002 protected: 1003 virtual void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); 1004 virtual void updateFromModel(); 1005 ActionListenerMultiplexer& getActionListeners(); 1006 ItemListenerMultiplexer& getItemListeners(); 1007 1008 }; 1009 1010 // ---------------------------------------------------- 1011 // class UnoSpinFieldControl 1012 // ---------------------------------------------------- 1013 class UnoSpinFieldControl : public UnoEditControl, 1014 public ::com::sun::star::awt::XSpinField 1015 { 1016 private: 1017 SpinListenerMultiplexer maSpinListeners; 1018 sal_Bool mbRepeat; 1019 1020 public: 1021 UnoSpinFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); 1022 queryInterface(const::com::sun::star::uno::Type & rType)1023 ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoEditControl::queryInterface(rType); } 1024 ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); acquire()1025 void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } release()1026 void SAL_CALL release() throw() { OWeakAggObject::release(); } 1027 1028 // ::com::sun::star::lang::XTypeProvider 1029 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); 1030 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); 1031 1032 void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); 1033 1034 // ::com::sun::star::awt::XSpinField 1035 void SAL_CALL addSpinListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XSpinListener >& l ) throw(::com::sun::star::uno::RuntimeException); 1036 void SAL_CALL removeSpinListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XSpinListener >& l ) throw(::com::sun::star::uno::RuntimeException); 1037 void SAL_CALL up() throw(::com::sun::star::uno::RuntimeException); 1038 void SAL_CALL down() throw(::com::sun::star::uno::RuntimeException); 1039 void SAL_CALL first() throw(::com::sun::star::uno::RuntimeException); 1040 void SAL_CALL last() throw(::com::sun::star::uno::RuntimeException); 1041 void SAL_CALL enableRepeat( sal_Bool bRepeat ) throw(::com::sun::star::uno::RuntimeException); 1042 1043 1044 // ::com::sun::star::lang::XServiceInfo 1045 // No service info, only base class for other fields. 1046 }; 1047 1048 1049 // ---------------------------------------------------- 1050 // class UnoControlDateFieldModel 1051 // ---------------------------------------------------- 1052 class UnoControlDateFieldModel : public UnoControlModel 1053 { 1054 protected: 1055 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 1056 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 1057 1058 public: 1059 UnoControlDateFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); UnoControlDateFieldModel(const UnoControlDateFieldModel & rModel)1060 UnoControlDateFieldModel( const UnoControlDateFieldModel& rModel ) : UnoControlModel( rModel ) {;} 1061 Clone() const1062 UnoControlModel* Clone() const { return new UnoControlDateFieldModel( *this ); } 1063 1064 // ::com::sun::star::io::XPersistObject 1065 ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); 1066 1067 // ::com::sun::star::beans::XMultiPropertySet 1068 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 1069 1070 // ::com::sun::star::lang::XServiceInfo 1071 DECLIMPL_SERVICEINFO_DERIVED( UnoControlDateFieldModel, UnoControlModel, szServiceName2_UnoControlDateFieldModel ) 1072 1073 }; 1074 1075 // ---------------------------------------------------- 1076 // class UnoDateFieldControl 1077 // ---------------------------------------------------- 1078 class UnoDateFieldControl : public UnoSpinFieldControl, 1079 public ::com::sun::star::awt::XDateField 1080 { 1081 private: 1082 sal_Int32 mnFirst; 1083 sal_Int32 mnLast; 1084 sal_Bool mbLongFormat; 1085 public: 1086 UnoDateFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); 1087 ::rtl::OUString GetComponentServiceName(); 1088 queryInterface(const::com::sun::star::uno::Type & rType)1089 ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); } 1090 ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); acquire()1091 void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } release()1092 void SAL_CALL release() throw() { OWeakAggObject::release(); } 1093 1094 // ::com::sun::star::lang::XTypeProvider 1095 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); 1096 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); 1097 1098 void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); 1099 1100 // ::com::sun::star::awt::XTextListener 1101 void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); 1102 1103 //XDateField 1104 void SAL_CALL setDate( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException); 1105 sal_Int32 SAL_CALL getDate( ) throw(::com::sun::star::uno::RuntimeException); 1106 void SAL_CALL setMin( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException); 1107 sal_Int32 SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException); 1108 void SAL_CALL setMax( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException); 1109 sal_Int32 SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException); 1110 void SAL_CALL setFirst( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException); 1111 sal_Int32 SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException); 1112 void SAL_CALL setLast( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException); 1113 sal_Int32 SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException); 1114 void SAL_CALL setLongFormat( sal_Bool bLong ) throw(::com::sun::star::uno::RuntimeException); 1115 sal_Bool SAL_CALL isLongFormat( ) throw(::com::sun::star::uno::RuntimeException); 1116 void SAL_CALL setEmpty( ) throw(::com::sun::star::uno::RuntimeException); 1117 sal_Bool SAL_CALL isEmpty( ) throw(::com::sun::star::uno::RuntimeException); 1118 void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException); 1119 sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException); 1120 1121 // ::com::sun::star::lang::XServiceInfo 1122 DECLIMPL_SERVICEINFO_DERIVED( UnoDateFieldControl, UnoSpinFieldControl, szServiceName2_UnoControlDateField ) 1123 }; 1124 1125 // ---------------------------------------------------- 1126 // class UnoControlTimeFieldModel 1127 // ---------------------------------------------------- 1128 class UnoControlTimeFieldModel : public UnoControlModel 1129 { 1130 protected: 1131 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 1132 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 1133 1134 public: 1135 UnoControlTimeFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); UnoControlTimeFieldModel(const UnoControlTimeFieldModel & rModel)1136 UnoControlTimeFieldModel( const UnoControlTimeFieldModel& rModel ) : UnoControlModel( rModel ) {;} 1137 Clone() const1138 UnoControlModel* Clone() const { return new UnoControlTimeFieldModel( *this ); } 1139 1140 // ::com::sun::star::io::XPersistObject 1141 ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); 1142 1143 // ::com::sun::star::beans::XMultiPropertySet 1144 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 1145 1146 // ::com::sun::star::lang::XServiceInfo 1147 DECLIMPL_SERVICEINFO_DERIVED( UnoControlTimeFieldModel, UnoControlModel, szServiceName2_UnoControlTimeFieldModel ) 1148 1149 }; 1150 1151 // ---------------------------------------------------- 1152 // class UnoTimeFieldControl 1153 // ---------------------------------------------------- 1154 class UnoTimeFieldControl : public UnoSpinFieldControl, 1155 public ::com::sun::star::awt::XTimeField 1156 { 1157 private: 1158 sal_Int32 mnFirst; 1159 sal_Int32 mnLast; 1160 1161 public: 1162 UnoTimeFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); 1163 ::rtl::OUString GetComponentServiceName(); 1164 queryInterface(const::com::sun::star::uno::Type & rType)1165 ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); } 1166 ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); acquire()1167 void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } release()1168 void SAL_CALL release() throw() { OWeakAggObject::release(); } 1169 1170 // ::com::sun::star::lang::XTypeProvider 1171 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); 1172 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); 1173 1174 void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); 1175 1176 // ::com::sun::star::awt::XTextListener 1177 void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); 1178 1179 //XTimeField 1180 void SAL_CALL setTime( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException); 1181 sal_Int32 SAL_CALL getTime( ) throw(::com::sun::star::uno::RuntimeException); 1182 void SAL_CALL setMin( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException); 1183 sal_Int32 SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException); 1184 void SAL_CALL setMax( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException); 1185 sal_Int32 SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException); 1186 void SAL_CALL setFirst( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException); 1187 sal_Int32 SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException); 1188 void SAL_CALL setLast( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException); 1189 sal_Int32 SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException); 1190 void SAL_CALL setEmpty( ) throw(::com::sun::star::uno::RuntimeException); 1191 sal_Bool SAL_CALL isEmpty( ) throw(::com::sun::star::uno::RuntimeException); 1192 void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException); 1193 sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException); 1194 1195 // ::com::sun::star::lang::XServiceInfo 1196 DECLIMPL_SERVICEINFO_DERIVED( UnoTimeFieldControl, UnoSpinFieldControl, szServiceName2_UnoControlTimeField ) 1197 1198 }; 1199 1200 // ---------------------------------------------------- 1201 // class UnoControlNumericFieldModel 1202 // ---------------------------------------------------- 1203 class UnoControlNumericFieldModel : public UnoControlModel 1204 { 1205 protected: 1206 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 1207 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 1208 1209 public: 1210 UnoControlNumericFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); UnoControlNumericFieldModel(const UnoControlNumericFieldModel & rModel)1211 UnoControlNumericFieldModel( const UnoControlNumericFieldModel& rModel ) : UnoControlModel( rModel ) {;} 1212 Clone() const1213 UnoControlModel* Clone() const { return new UnoControlNumericFieldModel( *this ); } 1214 1215 // ::com::sun::star::io::XPersistObject 1216 ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); 1217 1218 // ::com::sun::star::beans::XMultiPropertySet 1219 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 1220 1221 // ::com::sun::star::lang::XServiceInfo 1222 DECLIMPL_SERVICEINFO_DERIVED( UnoControlNumericFieldModel, UnoControlModel, szServiceName2_UnoControlNumericFieldModel ) 1223 1224 }; 1225 1226 // ---------------------------------------------------- 1227 // class UnoNumericFieldControl 1228 // ---------------------------------------------------- 1229 class UnoNumericFieldControl : public UnoSpinFieldControl, 1230 public ::com::sun::star::awt::XNumericField 1231 { 1232 private: 1233 double mnFirst; 1234 double mnLast; 1235 1236 public: 1237 UnoNumericFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); 1238 ::rtl::OUString GetComponentServiceName(); 1239 queryInterface(const::com::sun::star::uno::Type & rType)1240 ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); } 1241 ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); acquire()1242 void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } release()1243 void SAL_CALL release() throw() { OWeakAggObject::release(); } 1244 1245 void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); 1246 1247 // ::com::sun::star::lang::XTypeProvider 1248 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); 1249 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); 1250 1251 // ::com::sun::star::awt::XTextListener 1252 void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); 1253 1254 // ::com::sun::star::awt::XNumericField 1255 void SAL_CALL setValue( double Value ) throw(::com::sun::star::uno::RuntimeException); 1256 double SAL_CALL getValue( ) throw(::com::sun::star::uno::RuntimeException); 1257 void SAL_CALL setMin( double Value ) throw(::com::sun::star::uno::RuntimeException); 1258 double SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException); 1259 void SAL_CALL setMax( double Value ) throw(::com::sun::star::uno::RuntimeException); 1260 double SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException); 1261 void SAL_CALL setFirst( double Value ) throw(::com::sun::star::uno::RuntimeException); 1262 double SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException); 1263 void SAL_CALL setLast( double Value ) throw(::com::sun::star::uno::RuntimeException); 1264 double SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException); 1265 void SAL_CALL setSpinSize( double Value ) throw(::com::sun::star::uno::RuntimeException); 1266 double SAL_CALL getSpinSize( ) throw(::com::sun::star::uno::RuntimeException); 1267 void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) throw(::com::sun::star::uno::RuntimeException); 1268 sal_Int16 SAL_CALL getDecimalDigits( ) throw(::com::sun::star::uno::RuntimeException); 1269 void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException); 1270 sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException); 1271 1272 // ::com::sun::star::lang::XServiceInfo 1273 DECLIMPL_SERVICEINFO_DERIVED( UnoNumericFieldControl, UnoSpinFieldControl, szServiceName2_UnoControlNumericField ) 1274 1275 }; 1276 1277 // ---------------------------------------------------- 1278 // class UnoControlCurrencyFieldModel 1279 // ---------------------------------------------------- 1280 class UnoControlCurrencyFieldModel : public UnoControlModel 1281 { 1282 protected: 1283 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 1284 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 1285 1286 public: 1287 UnoControlCurrencyFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); UnoControlCurrencyFieldModel(const UnoControlCurrencyFieldModel & rModel)1288 UnoControlCurrencyFieldModel( const UnoControlCurrencyFieldModel& rModel ) : UnoControlModel( rModel ) {;} 1289 Clone() const1290 UnoControlModel* Clone() const { return new UnoControlCurrencyFieldModel( *this ); } 1291 1292 // ::com::sun::star::io::XPersistObject 1293 ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); 1294 1295 // ::com::sun::star::beans::XMultiPropertySet 1296 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 1297 1298 // ::com::sun::star::lang::XServiceInfo 1299 DECLIMPL_SERVICEINFO_DERIVED( UnoControlCurrencyFieldModel, UnoControlModel, szServiceName2_UnoControlCurrencyFieldModel ) 1300 1301 }; 1302 1303 // ---------------------------------------------------- 1304 // class UnoCurrencyFieldControl 1305 // ---------------------------------------------------- 1306 class UnoCurrencyFieldControl : public UnoSpinFieldControl, 1307 public ::com::sun::star::awt::XCurrencyField 1308 { 1309 private: 1310 double mnFirst; 1311 double mnLast; 1312 1313 public: 1314 UnoCurrencyFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); 1315 ::rtl::OUString GetComponentServiceName(); 1316 queryInterface(const::com::sun::star::uno::Type & rType)1317 ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); } 1318 ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); acquire()1319 void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } release()1320 void SAL_CALL release() throw() { OWeakAggObject::release(); } 1321 1322 void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); 1323 1324 // ::com::sun::star::lang::XTypeProvider 1325 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); 1326 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); 1327 1328 // ::com::sun::star::awt::XTextListener 1329 void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); 1330 1331 // ::com::sun::star::awt::XCurrencyField 1332 void SAL_CALL setValue( double Value ) throw(::com::sun::star::uno::RuntimeException); 1333 double SAL_CALL getValue( ) throw(::com::sun::star::uno::RuntimeException); 1334 void SAL_CALL setMin( double Value ) throw(::com::sun::star::uno::RuntimeException); 1335 double SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException); 1336 void SAL_CALL setMax( double Value ) throw(::com::sun::star::uno::RuntimeException); 1337 double SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException); 1338 void SAL_CALL setFirst( double Value ) throw(::com::sun::star::uno::RuntimeException); 1339 double SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException); 1340 void SAL_CALL setLast( double Value ) throw(::com::sun::star::uno::RuntimeException); 1341 double SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException); 1342 void SAL_CALL setSpinSize( double Value ) throw(::com::sun::star::uno::RuntimeException); 1343 double SAL_CALL getSpinSize( ) throw(::com::sun::star::uno::RuntimeException); 1344 void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) throw(::com::sun::star::uno::RuntimeException); 1345 sal_Int16 SAL_CALL getDecimalDigits( ) throw(::com::sun::star::uno::RuntimeException); 1346 void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException); 1347 sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException); 1348 1349 // ::com::sun::star::lang::XServiceInfo 1350 DECLIMPL_SERVICEINFO_DERIVED( UnoCurrencyFieldControl, UnoSpinFieldControl, szServiceName2_UnoControlCurrencyField ) 1351 }; 1352 1353 // ---------------------------------------------------- 1354 // class UnoControlPatternFieldModel 1355 // ---------------------------------------------------- 1356 class UnoControlPatternFieldModel : public UnoControlModel 1357 { 1358 protected: 1359 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 1360 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 1361 1362 public: 1363 UnoControlPatternFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); UnoControlPatternFieldModel(const UnoControlPatternFieldModel & rModel)1364 UnoControlPatternFieldModel( const UnoControlPatternFieldModel& rModel ) : UnoControlModel( rModel ) {;} 1365 Clone() const1366 UnoControlModel* Clone() const { return new UnoControlPatternFieldModel( *this ); } 1367 1368 // ::com::sun::star::io::XPersistObject 1369 ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); 1370 1371 // ::com::sun::star::beans::XMultiPropertySet 1372 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 1373 1374 // ::com::sun::star::lang::XServiceInfo 1375 DECLIMPL_SERVICEINFO_DERIVED( UnoControlPatternFieldModel, UnoControlModel, szServiceName2_UnoControlPatternFieldModel ) 1376 1377 }; 1378 1379 // ---------------------------------------------------- 1380 // class UnoPatternFieldControl 1381 // ---------------------------------------------------- 1382 class UnoPatternFieldControl : public UnoSpinFieldControl, 1383 public ::com::sun::star::awt::XPatternField 1384 { 1385 protected: 1386 void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); 1387 1388 public: 1389 UnoPatternFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); 1390 ::rtl::OUString GetComponentServiceName(); 1391 queryInterface(const::com::sun::star::uno::Type & rType)1392 ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); } 1393 ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); acquire()1394 void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } release()1395 void SAL_CALL release() throw() { OWeakAggObject::release(); } 1396 1397 // ::com::sun::star::lang::XTypeProvider 1398 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); 1399 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); 1400 1401 // ::com::sun::star::awt::XPatternField 1402 void SAL_CALL setMasks( const ::rtl::OUString& EditMask, const ::rtl::OUString& LiteralMask ) throw(::com::sun::star::uno::RuntimeException); 1403 void SAL_CALL getMasks( ::rtl::OUString& EditMask, ::rtl::OUString& LiteralMask ) throw(::com::sun::star::uno::RuntimeException); 1404 void SAL_CALL setString( const ::rtl::OUString& Str ) throw(::com::sun::star::uno::RuntimeException); 1405 ::rtl::OUString SAL_CALL getString( ) throw(::com::sun::star::uno::RuntimeException); 1406 void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException); 1407 sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException); 1408 1409 // ::com::sun::star::lang::XServiceInfo 1410 DECLIMPL_SERVICEINFO_DERIVED( UnoPatternFieldControl, UnoSpinFieldControl, szServiceName2_UnoControlPatternField ) 1411 1412 }; 1413 1414 // ---------------------------------------------------- 1415 // class UnoControlProgressBarModel 1416 // ---------------------------------------------------- 1417 class UnoControlProgressBarModel : public UnoControlModel 1418 { 1419 protected: 1420 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 1421 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 1422 1423 public: 1424 UnoControlProgressBarModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); UnoControlProgressBarModel(const UnoControlProgressBarModel & rModel)1425 UnoControlProgressBarModel( const UnoControlProgressBarModel& rModel ) : UnoControlModel( rModel ) {;} 1426 Clone() const1427 UnoControlModel* Clone() const { return new UnoControlProgressBarModel( *this ); } 1428 1429 // ::com::sun::star::beans::XMultiPropertySet 1430 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 1431 1432 // ::com::sun::star::io::XPersistObject 1433 ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); 1434 1435 // XServiceInfo 1436 DECLIMPL_SERVICEINFO_DERIVED( UnoControlProgressBarModel, UnoControlModel, szServiceName2_UnoControlProgressBarModel ) 1437 }; 1438 1439 // ---------------------------------------------------- 1440 // class UnoProgressBarControl 1441 // ---------------------------------------------------- 1442 class UnoProgressBarControl : public UnoControlBase, 1443 public ::com::sun::star::awt::XProgressBar 1444 { 1445 public: 1446 UnoProgressBarControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); 1447 ::rtl::OUString GetComponentServiceName(); 1448 queryInterface(const::com::sun::star::uno::Type & rType)1449 ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); } 1450 ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); acquire()1451 void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } release()1452 void SAL_CALL release() throw() { OWeakAggObject::release(); } 1453 1454 // ::com::sun::star::lang::XTypeProvider 1455 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); 1456 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); 1457 1458 // ::com::sun::star::awt::XProgressBar 1459 void SAL_CALL setForegroundColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException); 1460 void SAL_CALL setBackgroundColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException); 1461 void SAL_CALL setValue( sal_Int32 nValue ) throw(::com::sun::star::uno::RuntimeException); 1462 void SAL_CALL setRange( sal_Int32 nMin, sal_Int32 nMax ) throw(::com::sun::star::uno::RuntimeException ); 1463 sal_Int32 SAL_CALL getValue() throw(::com::sun::star::uno::RuntimeException); 1464 1465 // ::com::sun::star::lang::XServiceInfo 1466 DECLIMPL_SERVICEINFO_DERIVED( UnoProgressBarControl, UnoControlBase, szServiceName2_UnoControlProgressBar ) 1467 }; 1468 1469 1470 // ---------------------------------------------------- 1471 // class UnoControlFixedLineModel 1472 // ---------------------------------------------------- 1473 class UnoControlFixedLineModel : public UnoControlModel 1474 { 1475 protected: 1476 ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; 1477 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 1478 1479 public: 1480 UnoControlFixedLineModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); UnoControlFixedLineModel(const UnoControlFixedLineModel & rModel)1481 UnoControlFixedLineModel( const UnoControlFixedLineModel& rModel ) : UnoControlModel( rModel ) {;} 1482 Clone() const1483 UnoControlModel* Clone() const { return new UnoControlFixedLineModel( *this ); } 1484 1485 // ::com::sun::star::beans::XMultiPropertySet 1486 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 1487 1488 // ::com::sun::star::io::XPersistObject 1489 ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); 1490 1491 // ::com::sun::star::lang::XServiceInfo 1492 DECLIMPL_SERVICEINFO_DERIVED( UnoControlFixedLineModel, UnoControlModel, szServiceName2_UnoControlFixedLineModel ) 1493 1494 }; 1495 1496 // ---------------------------------------------------- 1497 // class UnoFixedLineControl 1498 // ---------------------------------------------------- 1499 class UnoFixedLineControl : public UnoControlBase 1500 { 1501 public: 1502 UnoFixedLineControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ); 1503 ::rtl::OUString GetComponentServiceName(); 1504 1505 sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); 1506 1507 // ::com::sun::star::lang::XServiceInfo 1508 DECLIMPL_SERVICEINFO_DERIVED( UnoFixedLineControl, UnoControlBase, szServiceName2_UnoControlFixedLine ) 1509 1510 }; 1511 1512 1513 1514 #endif // _TOOLKIT_HELPER_UNOCONTROLS_HXX_ 1515 1516