1*f8e07b45SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*f8e07b45SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*f8e07b45SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*f8e07b45SAndrew Rist  * distributed with this work for additional information
6*f8e07b45SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*f8e07b45SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*f8e07b45SAndrew Rist  * "License"); you may not use this file except in compliance
9*f8e07b45SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*f8e07b45SAndrew Rist  *
11*f8e07b45SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*f8e07b45SAndrew Rist  *
13*f8e07b45SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*f8e07b45SAndrew Rist  * software distributed under the License is distributed on an
15*f8e07b45SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*f8e07b45SAndrew Rist  * KIND, either express or implied.  See the License for the
17*f8e07b45SAndrew Rist  * specific language governing permissions and limitations
18*f8e07b45SAndrew Rist  * under the License.
19*f8e07b45SAndrew Rist  *
20*f8e07b45SAndrew Rist  *************************************************************/
21*f8e07b45SAndrew Rist 
22*f8e07b45SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef __FRAMEWORK_CLASSES_ROOTACTIONTRIGGERCONTAINER_HXX_
25cdf0e10cSrcweir #define __FRAMEWORK_CLASSES_ROOTACTIONTRIGGERCONTAINER_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <helper/propertysetcontainer.hxx>
28cdf0e10cSrcweir #include <vcl/menu.hxx>
29cdf0e10cSrcweir #include <com/sun/star/container/XNamed.hpp>
30cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
31cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
32cdf0e10cSrcweir #include <com/sun/star/lang/XUnoTunnel.hpp>
33cdf0e10cSrcweir #include <com/sun/star/lang/XTypeProvider.hpp>
34cdf0e10cSrcweir #include <framework/fwedllapi.h>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir #define IMPLEMENTATIONNAME_ROOTACTIONTRIGGERCONTAINER   "com.sun.star.comp.ui.RootActionTriggerContainer"
37cdf0e10cSrcweir 
38cdf0e10cSrcweir 
39cdf0e10cSrcweir namespace framework
40cdf0e10cSrcweir {
41cdf0e10cSrcweir 
42cdf0e10cSrcweir class FWE_DLLPUBLIC RootActionTriggerContainer :  public PropertySetContainer,
43cdf0e10cSrcweir                                     public com::sun::star::lang::XMultiServiceFactory,
44cdf0e10cSrcweir                                     public com::sun::star::lang::XServiceInfo,
45cdf0e10cSrcweir                                     public com::sun::star::lang::XUnoTunnel,
46cdf0e10cSrcweir                                     public com::sun::star::lang::XTypeProvider,
47cdf0e10cSrcweir                                     public com::sun::star::container::XNamed
48cdf0e10cSrcweir {
49cdf0e10cSrcweir     public:
50cdf0e10cSrcweir         RootActionTriggerContainer( const Menu* pMenu, const ::rtl::OUString* pMenuIdentifier, const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
51cdf0e10cSrcweir         virtual ~RootActionTriggerContainer();
52cdf0e10cSrcweir 
53cdf0e10cSrcweir         const Menu* GetMenu();
54cdf0e10cSrcweir 
55cdf0e10cSrcweir         ::com::sun::star::uno::Sequence< sal_Int8 > GetUnoTunnelId() const;
56cdf0e10cSrcweir 
57cdf0e10cSrcweir         // XInterface
58cdf0e10cSrcweir         virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType )
59cdf0e10cSrcweir             throw (::com::sun::star::uno::RuntimeException);
60cdf0e10cSrcweir         virtual void SAL_CALL acquire() throw ();
61cdf0e10cSrcweir         virtual void SAL_CALL release() throw ();
62cdf0e10cSrcweir 
63cdf0e10cSrcweir         // XMultiServiceFactory
64cdf0e10cSrcweir         virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier )
65cdf0e10cSrcweir             throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
66cdf0e10cSrcweir         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 )
67cdf0e10cSrcweir             throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
68cdf0e10cSrcweir         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames()
69cdf0e10cSrcweir             throw (::com::sun::star::uno::RuntimeException);
70cdf0e10cSrcweir 
71cdf0e10cSrcweir         // XIndexContainer
72cdf0e10cSrcweir         virtual void SAL_CALL insertByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element )
73cdf0e10cSrcweir             throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
74cdf0e10cSrcweir 
75cdf0e10cSrcweir         virtual void SAL_CALL removeByIndex( sal_Int32 Index )
76cdf0e10cSrcweir             throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
77cdf0e10cSrcweir 
78cdf0e10cSrcweir         // XIndexReplace
79cdf0e10cSrcweir         virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element )
80cdf0e10cSrcweir             throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
81cdf0e10cSrcweir 
82cdf0e10cSrcweir         // XIndexAccess
83cdf0e10cSrcweir         virtual sal_Int32 SAL_CALL getCount()
84cdf0e10cSrcweir             throw (::com::sun::star::uno::RuntimeException);
85cdf0e10cSrcweir 
86cdf0e10cSrcweir         virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
87cdf0e10cSrcweir             throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
88cdf0e10cSrcweir 
89cdf0e10cSrcweir         // XElementAccess
90cdf0e10cSrcweir         virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
91cdf0e10cSrcweir             throw (::com::sun::star::uno::RuntimeException);
92cdf0e10cSrcweir 
93cdf0e10cSrcweir         virtual sal_Bool SAL_CALL hasElements()
94cdf0e10cSrcweir             throw (::com::sun::star::uno::RuntimeException);
95cdf0e10cSrcweir 
96cdf0e10cSrcweir         // XServiceInfo
97cdf0e10cSrcweir         virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw (::com::sun::star::uno::RuntimeException);
98cdf0e10cSrcweir         virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
99cdf0e10cSrcweir         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException);
100cdf0e10cSrcweir 
101cdf0e10cSrcweir         // XUnoTunnel
102cdf0e10cSrcweir         virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (::com::sun::star::uno::RuntimeException);
103cdf0e10cSrcweir 
104cdf0e10cSrcweir         // XTypeProvider
105cdf0e10cSrcweir         virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw (::com::sun::star::uno::RuntimeException);
106cdf0e10cSrcweir         virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw (::com::sun::star::uno::RuntimeException);
107cdf0e10cSrcweir 
108cdf0e10cSrcweir         // XNamed
109cdf0e10cSrcweir         virtual ::rtl::OUString SAL_CALL getName(  ) throw (::com::sun::star::uno::RuntimeException);
110cdf0e10cSrcweir         virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
111cdf0e10cSrcweir 
112cdf0e10cSrcweir     private:
113cdf0e10cSrcweir         void FillContainer();
114cdf0e10cSrcweir 
115cdf0e10cSrcweir         sal_Bool    m_bContainerCreated;
116cdf0e10cSrcweir         sal_Bool    m_bContainerChanged;
117cdf0e10cSrcweir         sal_Bool    m_bInContainerCreation;
118cdf0e10cSrcweir         const Menu* m_pMenu;
119cdf0e10cSrcweir         const ::rtl::OUString* m_pMenuIdentifier;
120cdf0e10cSrcweir };
121cdf0e10cSrcweir 
122cdf0e10cSrcweir }
123cdf0e10cSrcweir 
124cdf0e10cSrcweir #endif // __FRAMEWORK_CLASSES_ROOTACTIONTRIGGERCONTAINER_HXX_
125