xref: /trunk/main/framework/inc/classes/rootactiontriggercontainer.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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         virtual void SAL_CALL acquire() throw ();
60         virtual void SAL_CALL release() throw ();
61 
62         // XMultiServiceFactory
63         virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier );
64         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 );
65         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames();
66 
67         // XIndexContainer
68         virtual void SAL_CALL insertByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element );
69 
70         virtual void SAL_CALL removeByIndex( sal_Int32 Index );
71 
72         // XIndexReplace
73         virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element );
74 
75         // XIndexAccess
76         virtual sal_Int32 SAL_CALL getCount();
77 
78         virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index );
79 
80         // XElementAccess
81         virtual ::com::sun::star::uno::Type SAL_CALL getElementType();
82 
83         virtual sal_Bool SAL_CALL hasElements();
84 
85         // XServiceInfo
86         virtual ::rtl::OUString SAL_CALL getImplementationName(  );
87         virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName );
88         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  );
89 
90         // XUnoTunnel
91         virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier );
92 
93         // XTypeProvider
94         virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  );
95         virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  );
96 
97         // XNamed
98         virtual ::rtl::OUString SAL_CALL getName(  );
99         virtual void SAL_CALL setName( const ::rtl::OUString& aName );
100 
101     private:
102         void FillContainer();
103 
104         sal_Bool    m_bContainerCreated;
105         sal_Bool    m_bContainerChanged;
106         sal_Bool    m_bInContainerCreation;
107         const Menu* m_pMenu;
108         const ::rtl::OUString* m_pMenuIdentifier;
109 };
110 
111 }
112 
113 #endif // __FRAMEWORK_CLASSES_ROOTACTIONTRIGGERCONTAINER_HXX_
114