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