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 __FRAMEWORK_CLASSES_ACTIONTRIGGERSEPARATORPROPERTYSET_HXX_
25 #define __FRAMEWORK_CLASSES_ACTIONTRIGGERSEPARATORPROPERTYSET_HXX_
26 
27 #include <threadhelp/threadhelpbase.hxx>
28 #include <cppuhelper/propshlp.hxx>
29 #include <cppuhelper/weak.hxx>
30 #include <osl/mutex.hxx>
31 #include <rtl/ustring.hxx>
32 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
33 #include <com/sun/star/lang/XServiceInfo.hpp>
34 #include <com/sun/star/lang/XTypeProvider.hpp>
35 #include <com/sun/star/lang/IllegalArgumentException.hpp>
36 #include <framework/fwedllapi.h>
37 
38 #define SERVICENAME_ACTIONTRIGGERSEPARATOR			"com.sun.star.ui.ActionTriggerSeparator"
39 #define IMPLEMENTATIONNAME_ACTIONTRIGGERSEPARATOR	"com.sun.star.comp.ui.ActionTriggerSeparator"
40 
41 
42 namespace framework
43 {
44 
45 class ActionTriggerSeparatorPropertySet :	public ThreadHelpBase						,	// Struct for right initialization of mutex member! Must be first of baseclasses.
46 											public ::com::sun::star::lang::XServiceInfo	,
47 											public ::com::sun::star::lang::XTypeProvider,
48 											public ::cppu::OBroadcastHelper				,
49 											public ::cppu::OPropertySetHelper			,	// -> XPropertySet, XFastPropertySet, XMultiPropertySet
50 											public ::cppu::OWeakObject
51 {
52 	public:
53 		ActionTriggerSeparatorPropertySet( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
54 		virtual ~ActionTriggerSeparatorPropertySet();
55 
56 		// XInterface
57 		virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType )
58 			throw (::com::sun::star::uno::RuntimeException);
59 		virtual void SAL_CALL acquire() throw ();
60 		virtual void SAL_CALL release() throw ();
61 
62 		// XServiceInfo
63 		virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw (::com::sun::star::uno::RuntimeException);
64 		virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
65 		virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException);
66 
67 		// XTypeProvider
68 		virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw (::com::sun::star::uno::RuntimeException);
69 		virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw (::com::sun::star::uno::RuntimeException);
70 
71 	private:
72 		//---------------------------------------------------------------------------------------------------------
73 		//	OPropertySetHelper
74 		//---------------------------------------------------------------------------------------------------------
75 		virtual sal_Bool SAL_CALL convertFastPropertyValue(	com::sun::star::uno::Any&		aConvertedValue,
76 															com::sun::star::uno::Any&		aOldValue,
77 															sal_Int32						nHandle,
78 															const com::sun::star::uno::Any&	aValue			)
79 			throw( com::sun::star::lang::IllegalArgumentException );
80 
81 
82 		virtual void SAL_CALL setFastPropertyValue_NoBroadcast(	sal_Int32 nHandle, const com::sun::star::uno::Any& aValue )
83 			throw( com::sun::star::uno::Exception );
84 
85         using cppu::OPropertySetHelper::getFastPropertyValue;
86 		virtual void SAL_CALL getFastPropertyValue(	com::sun::star::uno::Any& aValue, sal_Int32	nHandle	) const;
87 
88 		virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
89 
90 		virtual com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo()
91 			throw (::com::sun::star::uno::RuntimeException);
92 
93 		static const com::sun::star::uno::Sequence< com::sun::star::beans::Property > impl_getStaticPropertyDescriptor();
94 
95 		//---------------------------------------------------------------------------------------------------------
96 		//	helper
97 		//---------------------------------------------------------------------------------------------------------
98 
99 		sal_Bool impl_tryToChangeProperty(	sal_Int16							aCurrentValue	,
100 											const	com::sun::star::uno::Any&	aNewValue		,
101 											com::sun::star::uno::Any&			aOldValue		,
102 											com::sun::star::uno::Any&			aConvertedValue	) throw( com::sun::star::lang::IllegalArgumentException );
103 
104 		//---------------------------------------------------------------------------------------------------------
105 		//	members
106 		//---------------------------------------------------------------------------------------------------------
107 
108 		sal_Int16	m_nSeparatorType;
109 };
110 
111 }
112 
113 #endif // __FRAMEWORK_CLASSES_ACTIONTRIGGERSEPARATORPROPERTYSET_HXX_
114