xref: /trunk/main/framework/inc/classes/actiontriggerpropertyset.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1f8e07b45SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3f8e07b45SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4f8e07b45SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5f8e07b45SAndrew Rist  * distributed with this work for additional information
6f8e07b45SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7f8e07b45SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8f8e07b45SAndrew Rist  * "License"); you may not use this file except in compliance
9f8e07b45SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11f8e07b45SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13f8e07b45SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14f8e07b45SAndrew Rist  * software distributed under the License is distributed on an
15f8e07b45SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16f8e07b45SAndrew Rist  * KIND, either express or implied.  See the License for the
17f8e07b45SAndrew Rist  * specific language governing permissions and limitations
18f8e07b45SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20f8e07b45SAndrew Rist  *************************************************************/
21f8e07b45SAndrew Rist 
22f8e07b45SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef __FRAMEWORK_CLASSES_ACTIONTRIGGERPROPERTYSET_HXX_
25cdf0e10cSrcweir #define __FRAMEWORK_CLASSES_ACTIONTRIGGERPROPERTYSET_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <threadhelp/threadhelpbase.hxx>
28cdf0e10cSrcweir #include <cppuhelper/propshlp.hxx>
29cdf0e10cSrcweir #include <cppuhelper/weak.hxx>
30cdf0e10cSrcweir #include <osl/mutex.hxx>
31cdf0e10cSrcweir #include <rtl/ustring.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #ifndef __COM_SUN_STAR_AWT_XBITMAP_HPP_
34cdf0e10cSrcweir #include <com/sun/star/awt/XBitmap.hpp>
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
37cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
38cdf0e10cSrcweir #include <com/sun/star/lang/XTypeProvider.hpp>
39cdf0e10cSrcweir #include <com/sun/star/lang/IllegalArgumentException.hpp>
40cdf0e10cSrcweir #include <framework/fwedllapi.h>
41cdf0e10cSrcweir 
42cdf0e10cSrcweir #define SERVICENAME_ACTIONTRIGGER "com.sun.star.ui.ActionTrigger"
43cdf0e10cSrcweir #define IMPLEMENTATIONNAME_ACTIONTRIGGER "com.sun.star.comp.ui.ActionTrigger"
44cdf0e10cSrcweir 
45cdf0e10cSrcweir namespace framework
46cdf0e10cSrcweir {
47cdf0e10cSrcweir 
48*30acf5e8Spfg class ActionTriggerPropertySet :  public ThreadHelpBase                       ,   // Struct for right initialization of mutex member! Must be first of baseclasses.
49cdf0e10cSrcweir                                     public ::com::sun::star::lang::XServiceInfo ,
50cdf0e10cSrcweir                                     public ::com::sun::star::lang::XTypeProvider,
51cdf0e10cSrcweir                                     public ::cppu::OBroadcastHelper             ,
52cdf0e10cSrcweir                                     public ::cppu::OPropertySetHelper           ,   // -> XPropertySet, XFastPropertySet, XMultiPropertySet
53cdf0e10cSrcweir                                     public ::cppu::OWeakObject
54cdf0e10cSrcweir {
55cdf0e10cSrcweir     public:
56cdf0e10cSrcweir         FWE_DLLPUBLIC ActionTriggerPropertySet( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
57cdf0e10cSrcweir         FWE_DLLPUBLIC virtual ~ActionTriggerPropertySet();
58cdf0e10cSrcweir 
59cdf0e10cSrcweir         // XInterface
60cdf0e10cSrcweir         virtual FWE_DLLPUBLIC ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType )
61cdf0e10cSrcweir             throw (::com::sun::star::uno::RuntimeException);
62cdf0e10cSrcweir         virtual FWE_DLLPUBLIC void SAL_CALL acquire() throw ();
63cdf0e10cSrcweir         virtual FWE_DLLPUBLIC void SAL_CALL release() throw ();
64cdf0e10cSrcweir 
65cdf0e10cSrcweir         // XServiceInfo
66cdf0e10cSrcweir         virtual FWE_DLLPUBLIC ::rtl::OUString SAL_CALL getImplementationName(  ) throw (::com::sun::star::uno::RuntimeException);
67cdf0e10cSrcweir         virtual FWE_DLLPUBLIC sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
68cdf0e10cSrcweir         virtual FWE_DLLPUBLIC ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException);
69cdf0e10cSrcweir 
70cdf0e10cSrcweir         // XTypeProvider
71cdf0e10cSrcweir         virtual FWE_DLLPUBLIC ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw (::com::sun::star::uno::RuntimeException);
72cdf0e10cSrcweir         virtual FWE_DLLPUBLIC ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw (::com::sun::star::uno::RuntimeException);
73cdf0e10cSrcweir 
74cdf0e10cSrcweir     private:
75cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
76cdf0e10cSrcweir         //  OPropertySetHelper
77cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
78cdf0e10cSrcweir         virtual sal_Bool SAL_CALL convertFastPropertyValue( com::sun::star::uno::Any&       aConvertedValue,
79cdf0e10cSrcweir                                                             com::sun::star::uno::Any&       aOldValue,
80cdf0e10cSrcweir                                                             sal_Int32                       nHandle,
81cdf0e10cSrcweir                                                             const com::sun::star::uno::Any& aValue          )
82cdf0e10cSrcweir             throw( com::sun::star::lang::IllegalArgumentException );
83cdf0e10cSrcweir 
84cdf0e10cSrcweir 
85cdf0e10cSrcweir         virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const com::sun::star::uno::Any& aValue )
86cdf0e10cSrcweir             throw( com::sun::star::uno::Exception );
87cdf0e10cSrcweir 
88cdf0e10cSrcweir         using cppu::OPropertySetHelper::getFastPropertyValue;
89cdf0e10cSrcweir         virtual void SAL_CALL getFastPropertyValue( com::sun::star::uno::Any& aValue, sal_Int32 nHandle ) const;
90cdf0e10cSrcweir 
91cdf0e10cSrcweir         virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
92cdf0e10cSrcweir 
93cdf0e10cSrcweir         virtual com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo()
94cdf0e10cSrcweir             throw (::com::sun::star::uno::RuntimeException);
95cdf0e10cSrcweir 
96cdf0e10cSrcweir         static const com::sun::star::uno::Sequence< com::sun::star::beans::Property > impl_getStaticPropertyDescriptor();
97cdf0e10cSrcweir 
98cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
99cdf0e10cSrcweir         //  helper
100cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
101cdf0e10cSrcweir 
102cdf0e10cSrcweir         sal_Bool impl_tryToChangeProperty(  const   rtl::OUString&              aCurrentValue   ,
103cdf0e10cSrcweir                                             const   com::sun::star::uno::Any&   aNewValue       ,
104cdf0e10cSrcweir                                             com::sun::star::uno::Any&           aOldValue       ,
105cdf0e10cSrcweir                                             com::sun::star::uno::Any&           aConvertedValue ) throw( com::sun::star::lang::IllegalArgumentException );
106cdf0e10cSrcweir 
107cdf0e10cSrcweir         sal_Bool impl_tryToChangeProperty(  const   com::sun::star::uno::Reference< com::sun::star::awt::XBitmap >  xBitmap,
108cdf0e10cSrcweir                                             const   com::sun::star::uno::Any&   aNewValue       ,
109cdf0e10cSrcweir                                             com::sun::star::uno::Any&           aOldValue       ,
110cdf0e10cSrcweir                                             com::sun::star::uno::Any&           aConvertedValue ) throw( com::sun::star::lang::IllegalArgumentException );
111cdf0e10cSrcweir 
112cdf0e10cSrcweir         sal_Bool impl_tryToChangeProperty(  const   com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xInterface,
113cdf0e10cSrcweir                                             const   com::sun::star::uno::Any&   aNewValue       ,
114cdf0e10cSrcweir                                             com::sun::star::uno::Any&           aOldValue       ,
115cdf0e10cSrcweir                                             com::sun::star::uno::Any&           aConvertedValue ) throw( com::sun::star::lang::IllegalArgumentException );
116cdf0e10cSrcweir 
117cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
118cdf0e10cSrcweir         //  members
119cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
120cdf0e10cSrcweir 
121cdf0e10cSrcweir         rtl::OUString                                                         m_aCommandURL;
122cdf0e10cSrcweir         rtl::OUString                                                         m_aHelpURL;
123cdf0e10cSrcweir         rtl::OUString                                                         m_aText;
124cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap >    m_xBitmap;
125cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xActionTriggerContainer;
126cdf0e10cSrcweir };
127cdf0e10cSrcweir 
128cdf0e10cSrcweir }
129cdf0e10cSrcweir 
130cdf0e10cSrcweir #endif // __FRAMEWORK_CLASSES_ACTIONTRIGGERPROPERTYSET_HXX_
131