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