1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rootactiontriggercontainer.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __FRAMEWORK_CLASSES_ROOTACTIONTRIGGERCONTAINER_HXX_
32 #define __FRAMEWORK_CLASSES_ROOTACTIONTRIGGERCONTAINER_HXX_
34 #include <helper/propertysetcontainer.hxx>
35 #include <vcl/menu.hxx>
36 #include <com/sun/star/container/XNamed.hpp>
37 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
38 #include <com/sun/star/lang/XServiceInfo.hpp>
39 #include <com/sun/star/lang/XUnoTunnel.hpp>
40 #include <com/sun/star/lang/XTypeProvider.hpp>
42 #define IMPLEMENTATIONNAME_ROOTACTIONTRIGGERCONTAINER "com.sun.star.comp.ui.RootActionTriggerContainer"
48 class RootActionTriggerContainer
: public PropertySetContainer
,
49 public com::sun::star::lang::XMultiServiceFactory
,
50 public com::sun::star::lang::XServiceInfo
,
51 public com::sun::star::lang::XUnoTunnel
,
52 public com::sun::star::lang::XTypeProvider
,
53 public com::sun::star::container::XNamed
56 RootActionTriggerContainer( const Menu
* pMenu
, const ::rtl::OUString
* pMenuIdentifier
, const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& rServiceManager
);
57 virtual ~RootActionTriggerContainer();
59 const Menu
* GetMenu();
61 ::com::sun::star::uno::Sequence
< sal_Int8
> GetUnoTunnelId() const;
64 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& aType
)
65 throw (::com::sun::star::uno::RuntimeException
);
66 virtual void SAL_CALL
acquire() throw ();
67 virtual void SAL_CALL
release() throw ();
69 // XMultiServiceFactory
70 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
createInstance( const ::rtl::OUString
& aServiceSpecifier
)
71 throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
72 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
)
73 throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
74 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getAvailableServiceNames()
75 throw (::com::sun::star::uno::RuntimeException
);
78 virtual void SAL_CALL
insertByIndex( sal_Int32 Index
, const ::com::sun::star::uno::Any
& Element
)
79 throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
81 virtual void SAL_CALL
removeByIndex( sal_Int32 Index
)
82 throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
85 virtual void SAL_CALL
replaceByIndex( sal_Int32 Index
, const ::com::sun::star::uno::Any
& Element
)
86 throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
89 virtual sal_Int32 SAL_CALL
getCount()
90 throw (::com::sun::star::uno::RuntimeException
);
92 virtual ::com::sun::star::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
)
93 throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
96 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType()
97 throw (::com::sun::star::uno::RuntimeException
);
99 virtual sal_Bool SAL_CALL
hasElements()
100 throw (::com::sun::star::uno::RuntimeException
);
103 virtual ::rtl::OUString SAL_CALL
getImplementationName( ) throw (::com::sun::star::uno::RuntimeException
);
104 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
) throw (::com::sun::star::uno::RuntimeException
);
105 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException
);
108 virtual sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& aIdentifier
) throw (::com::sun::star::uno::RuntimeException
);
111 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes( ) throw (::com::sun::star::uno::RuntimeException
);
112 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) throw (::com::sun::star::uno::RuntimeException
);
115 virtual ::rtl::OUString SAL_CALL
getName( ) throw (::com::sun::star::uno::RuntimeException
);
116 virtual void SAL_CALL
setName( const ::rtl::OUString
& aName
) throw (::com::sun::star::uno::RuntimeException
);
119 void FillContainer();
121 sal_Bool m_bContainerCreated
;
122 sal_Bool m_bContainerChanged
;
123 sal_Bool m_bInContainerCreation
;
125 const ::rtl::OUString
* m_pMenuIdentifier
;
130 #endif // __FRAMEWORK_CLASSES_ROOTACTIONTRIGGERCONTAINER_HXX_