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_ROOTACTIONTRIGGERCONTAINER_HXX_
25 #define __FRAMEWORK_CLASSES_ROOTACTIONTRIGGERCONTAINER_HXX_
26 
27 #include <helper/propertysetcontainer.hxx>
28 #include <vcl/menu.hxx>
29 #include <com/sun/star/container/XNamed.hpp>
30 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
31 #include <com/sun/star/lang/XServiceInfo.hpp>
32 #include <com/sun/star/lang/XUnoTunnel.hpp>
33 #include <com/sun/star/lang/XTypeProvider.hpp>
34 #include <framework/fwedllapi.h>
35 
36 #define IMPLEMENTATIONNAME_ROOTACTIONTRIGGERCONTAINER   "com.sun.star.comp.ui.RootActionTriggerContainer"
37 
38 
39 namespace framework
40 {
41 
42 class FWE_DLLPUBLIC RootActionTriggerContainer :  public PropertySetContainer,
43                                     public com::sun::star::lang::XMultiServiceFactory,
44                                     public com::sun::star::lang::XServiceInfo,
45                                     public com::sun::star::lang::XUnoTunnel,
46                                     public com::sun::star::lang::XTypeProvider,
47                                     public com::sun::star::container::XNamed
48 {
49     public:
50         RootActionTriggerContainer( const Menu* pMenu, const ::rtl::OUString* pMenuIdentifier, const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
51         virtual ~RootActionTriggerContainer();
52 
53         const Menu* GetMenu();
54 
55         ::com::sun::star::uno::Sequence< sal_Int8 > GetUnoTunnelId() const;
56 
57         // XInterface
58         virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType )
59             throw (::com::sun::star::uno::RuntimeException);
60         virtual void SAL_CALL acquire() throw ();
61         virtual void SAL_CALL release() throw ();
62 
63         // XMultiServiceFactory
64         virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier )
65             throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
66         virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments )
67             throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
68         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames()
69             throw (::com::sun::star::uno::RuntimeException);
70 
71         // XIndexContainer
72         virtual void SAL_CALL insertByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element )
73             throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
74 
75         virtual void SAL_CALL removeByIndex( sal_Int32 Index )
76             throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
77 
78         // XIndexReplace
79         virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element )
80             throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
81 
82         // XIndexAccess
83         virtual sal_Int32 SAL_CALL getCount()
84             throw (::com::sun::star::uno::RuntimeException);
85 
86         virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
87             throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
88 
89         // XElementAccess
90         virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
91             throw (::com::sun::star::uno::RuntimeException);
92 
93         virtual sal_Bool SAL_CALL hasElements()
94             throw (::com::sun::star::uno::RuntimeException);
95 
96         // XServiceInfo
97         virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw (::com::sun::star::uno::RuntimeException);
98         virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
99         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException);
100 
101         // XUnoTunnel
102         virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (::com::sun::star::uno::RuntimeException);
103 
104         // XTypeProvider
105         virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw (::com::sun::star::uno::RuntimeException);
106         virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw (::com::sun::star::uno::RuntimeException);
107 
108         // XNamed
109         virtual ::rtl::OUString SAL_CALL getName(  ) throw (::com::sun::star::uno::RuntimeException);
110         virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
111 
112     private:
113         void FillContainer();
114 
115         sal_Bool    m_bContainerCreated;
116         sal_Bool    m_bContainerChanged;
117         sal_Bool    m_bInContainerCreation;
118         const Menu* m_pMenu;
119         const ::rtl::OUString* m_pMenuIdentifier;
120 };
121 
122 }
123 
124 #endif // __FRAMEWORK_CLASSES_ROOTACTIONTRIGGERCONTAINER_HXX_
125