1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef EXTENSIONS_PROPCTRLR_PUSHBUTTONNAVIGATION_HXX 29 #define EXTENSIONS_PROPCTRLR_PUSHBUTTONNAVIGATION_HXX 30 31 #include <com/sun/star/beans/XPropertySet.hpp> 32 #include <com/sun/star/beans/PropertyState.hpp> 33 34 //............................................................................ 35 namespace pcr 36 { 37 //............................................................................ 38 39 //======================================================================== 40 //= PushButtonNavigation 41 //======================================================================== 42 class PushButtonNavigation 43 { 44 protected: 45 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > 46 m_xControlModel; 47 sal_Bool m_bIsPushButton; 48 49 public: 50 /** ctor 51 @param _rxControlModel 52 the control model which is or will be bound 53 */ 54 PushButtonNavigation( 55 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel 56 ); 57 58 /** returns the current value of the "ButtonType" property, taking into account 59 the "virtual" button types such as "move-to-next-record button". 60 */ 61 ::com::sun::star::uno::Any 62 getCurrentButtonType() const SAL_THROW(()); 63 64 /** sets the current value of the "ButtonType" property, taking into account 65 the "virtual" button types such as "move-to-next-record button". 66 */ 67 void setCurrentButtonType( const ::com::sun::star::uno::Any& _rValue ) const SAL_THROW(()); 68 69 /** retrieves the current state of the "ButtonType" property, taking into account 70 the "virtual" button types such as "move-to-next-record button". 71 */ 72 ::com::sun::star::beans::PropertyState 73 getCurrentButtonTypeState( ) const SAL_THROW(()); 74 75 /** returns the current value of the "TargetURL" property, taking into account 76 that some URLs are special values caused by "virtual" ButtonTypes 77 */ 78 ::com::sun::star::uno::Any 79 getCurrentTargetURL() const SAL_THROW(()); 80 81 /** sets the current value of the "TargetURL" property, taking into account 82 that some URLs are special values caused by "virtual" ButtonTypes 83 */ 84 void setCurrentTargetURL( const ::com::sun::star::uno::Any& _rValue ) const SAL_THROW(()); 85 86 /** retrieves the current state of the "TargetURL" property, taking into account 87 that some URLs are special values caused by "virtual" ButtonTypes 88 */ 89 ::com::sun::star::beans::PropertyState 90 getCurrentTargetURLState( ) const SAL_THROW(()); 91 92 /** determines whether the current button tpye is FormButtonType_URL 93 */ 94 bool currentButtonTypeIsOpenURL() const; 95 96 /** determines whether the TargetURL property does currently denote a non-empty string 97 */ 98 bool hasNonEmptyCurrentTargetURL() const; 99 100 private: 101 sal_Int32 implGetCurrentButtonType() const SAL_THROW(( ::com::sun::star::uno::Exception )); 102 }; 103 104 //............................................................................ 105 } // namespace pcr 106 //............................................................................ 107 108 #endif // EXTENSIONS_PROPCTRLR_PUSHBUTTONNAVIGATION_HXX 109