update dev300-m58
[ooovba.git] / framework / inc / classes / actiontriggerpropertyset.hxx
blob00641c241d071d4e89f8132cffa8e64868ad363d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: actiontriggerpropertyset.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __FRAMEWORK_CLASSES_ACTIONTRIGGERPROPERTYSET_HXX_
32 #define __FRAMEWORK_CLASSES_ACTIONTRIGGERPROPERTYSET_HXX_
34 #include <threadhelp/threadhelpbase.hxx>
35 #include <cppuhelper/propshlp.hxx>
36 #include <cppuhelper/weak.hxx>
37 #include <osl/mutex.hxx>
38 #include <rtl/ustring.hxx>
40 #ifndef __COM_SUN_STAR_AWT_XBITMAP_HPP_
41 #include <com/sun/star/awt/XBitmap.hpp>
42 #endif
43 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
44 #include <com/sun/star/lang/XServiceInfo.hpp>
45 #include <com/sun/star/lang/XTypeProvider.hpp>
46 #include <com/sun/star/lang/IllegalArgumentException.hpp>
48 #define SERVICENAME_ACTIONTRIGGER "com.sun.star.ui.ActionTrigger"
49 #define IMPLEMENTATIONNAME_ACTIONTRIGGER "com.sun.star.comp.ui.ActionTrigger"
51 namespace framework
54 class ActionTriggerPropertySet : public ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
55 public ::com::sun::star::lang::XServiceInfo ,
56 public ::com::sun::star::lang::XTypeProvider,
57 public ::cppu::OBroadcastHelper ,
58 public ::cppu::OPropertySetHelper , // -> XPropertySet, XFastPropertySet, XMultiPropertySet
59 public ::cppu::OWeakObject
61 public:
62 ActionTriggerPropertySet( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
63 virtual ~ActionTriggerPropertySet();
65 // XInterface
66 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType )
67 throw (::com::sun::star::uno::RuntimeException);
68 virtual void SAL_CALL acquire() throw ();
69 virtual void SAL_CALL release() throw ();
71 // XServiceInfo
72 virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
73 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
74 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
76 // XTypeProvider
77 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException);
78 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException);
80 private:
81 //---------------------------------------------------------------------------------------------------------
82 // OPropertySetHelper
83 //---------------------------------------------------------------------------------------------------------
84 virtual sal_Bool SAL_CALL convertFastPropertyValue( com::sun::star::uno::Any& aConvertedValue,
85 com::sun::star::uno::Any& aOldValue,
86 sal_Int32 nHandle,
87 const com::sun::star::uno::Any& aValue )
88 throw( com::sun::star::lang::IllegalArgumentException );
91 virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const com::sun::star::uno::Any& aValue )
92 throw( com::sun::star::uno::Exception );
94 using cppu::OPropertySetHelper::getFastPropertyValue;
95 virtual void SAL_CALL getFastPropertyValue( com::sun::star::uno::Any& aValue, sal_Int32 nHandle ) const;
97 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
99 virtual com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo()
100 throw (::com::sun::star::uno::RuntimeException);
102 static const com::sun::star::uno::Sequence< com::sun::star::beans::Property > impl_getStaticPropertyDescriptor();
104 //---------------------------------------------------------------------------------------------------------
105 // helper
106 //---------------------------------------------------------------------------------------------------------
108 sal_Bool impl_tryToChangeProperty( const rtl::OUString& aCurrentValue ,
109 const com::sun::star::uno::Any& aNewValue ,
110 com::sun::star::uno::Any& aOldValue ,
111 com::sun::star::uno::Any& aConvertedValue ) throw( com::sun::star::lang::IllegalArgumentException );
113 sal_Bool impl_tryToChangeProperty( const com::sun::star::uno::Reference< com::sun::star::awt::XBitmap > xBitmap,
114 const com::sun::star::uno::Any& aNewValue ,
115 com::sun::star::uno::Any& aOldValue ,
116 com::sun::star::uno::Any& aConvertedValue ) throw( com::sun::star::lang::IllegalArgumentException );
118 sal_Bool impl_tryToChangeProperty( const com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xInterface,
119 const com::sun::star::uno::Any& aNewValue ,
120 com::sun::star::uno::Any& aOldValue ,
121 com::sun::star::uno::Any& aConvertedValue ) throw( com::sun::star::lang::IllegalArgumentException );
123 //---------------------------------------------------------------------------------------------------------
124 // members
125 //---------------------------------------------------------------------------------------------------------
127 rtl::OUString m_aCommandURL;
128 rtl::OUString m_aHelpURL;
129 rtl::OUString m_aText;
130 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap > m_xBitmap;
131 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xActionTriggerContainer;
136 #endif // __FRAMEWORK_CLASSES_ACTIONTRIGGERPROPERTYSET_HXX_