Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef __FRAMEWORK_UIELEMENT_ROOTITEMCONTAINER_HXX_
30 : : #define __FRAMEWORK_UIELEMENT_ROOTITEMCONTAINER_HXX_
31 : :
32 : : #include <threadhelp/threadhelpbase.hxx>
33 : : #include <macros/generic.hxx>
34 : : #include <macros/xinterface.hxx>
35 : : #include <macros/xtypeprovider.hxx>
36 : : #include <helper/shareablemutex.hxx>
37 : :
38 : : #include <com/sun/star/container/XIndexContainer.hpp>
39 : : #include <com/sun/star/container/XIndexAccess.hpp>
40 : : #include <com/sun/star/lang/XSingleComponentFactory.hpp>
41 : : #include <com/sun/star/beans/PropertyValue.hpp>
42 : : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
43 : : #include <com/sun/star/lang/XUnoTunnel.hpp>
44 : :
45 : : #include <rtl/ustring.hxx>
46 : : #include <cppuhelper/weak.hxx>
47 : : #include <cppuhelper/propshlp.hxx>
48 : : #include <cppuhelper/interfacecontainer.hxx>
49 : :
50 : : #include <vector>
51 : : #include <fwidllapi.h>
52 : :
53 : : namespace framework
54 : : {
55 : : class ConstItemContainer;
56 : : class RootItemContainer : public ::com::sun::star::lang::XTypeProvider ,
57 : : public ::com::sun::star::container::XIndexContainer ,
58 : : public ::com::sun::star::lang::XSingleComponentFactory ,
59 : : public ::com::sun::star::lang::XUnoTunnel ,
60 : : protected ThreadHelpBase ,
61 : : public ::cppu::OBroadcastHelper ,
62 : : public ::cppu::OPropertySetHelper ,
63 : : public ::cppu::OWeakObject
64 : : {
65 : : friend class ConstItemContainer;
66 : :
67 : : public:
68 : : FWI_DLLPUBLIC RootItemContainer();
69 : : FWI_DLLPUBLIC RootItemContainer( const com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess >& rItemAccessContainer );
70 : : virtual FWI_DLLPUBLIC ~RootItemContainer();
71 : :
72 : : //---------------------------------------------------------------------------------------------------------
73 : : // XInterface, XTypeProvider
74 : : //---------------------------------------------------------------------------------------------------------
75 : : FWK_DECLARE_XINTERFACE
76 : : FWK_DECLARE_XTYPEPROVIDER
77 : :
78 : : // XUnoTunnel
79 : : static FWI_DLLPUBLIC const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw();
80 : : static FWI_DLLPUBLIC RootItemContainer* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw();
81 : : sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException);
82 : :
83 : : // XIndexContainer
84 : : virtual void SAL_CALL insertByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element )
85 : : throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
86 : :
87 : : virtual void SAL_CALL removeByIndex( sal_Int32 Index )
88 : : throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
89 : :
90 : : // XIndexReplace
91 : : virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element )
92 : : throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
93 : :
94 : : // XIndexAccess
95 : : virtual sal_Int32 SAL_CALL getCount()
96 : : throw (::com::sun::star::uno::RuntimeException);
97 : :
98 : : virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
99 : : throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
100 : :
101 : : // XElementAccess
102 : 0 : virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
103 : : throw (::com::sun::star::uno::RuntimeException)
104 : : {
105 : 0 : return ::getCppuType((com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >*)0);
106 : : }
107 : :
108 : : virtual sal_Bool SAL_CALL hasElements()
109 : : throw (::com::sun::star::uno::RuntimeException);
110 : :
111 : : // XSingleComponentFactory
112 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithContext( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& Context ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
113 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArgumentsAndContext( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& Context ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
114 : :
115 : : protected:
116 : : // OPropertySetHelper
117 : : virtual sal_Bool SAL_CALL convertFastPropertyValue ( com::sun::star::uno::Any& aConvertedValue ,
118 : : com::sun::star::uno::Any& aOldValue ,
119 : : sal_Int32 nHandle ,
120 : : const com::sun::star::uno::Any& aValue ) throw( com::sun::star::lang::IllegalArgumentException );
121 : : virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle ,
122 : : const com::sun::star::uno::Any& aValue ) throw( com::sun::star::uno::Exception );
123 : : using cppu::OPropertySetHelper::getFastPropertyValue;
124 : : virtual void SAL_CALL getFastPropertyValue( com::sun::star::uno::Any& aValue ,
125 : : sal_Int32 nHandle ) const;
126 : : virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
127 : : virtual ::com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw (::com::sun::star::uno::RuntimeException);
128 : :
129 : : static const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > impl_getStaticPropertyDescriptor();
130 : :
131 : : private:
132 : : RootItemContainer& operator=( const RootItemContainer& );
133 : : RootItemContainer( const RootItemContainer& );
134 : :
135 : : com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > deepCopyContainer( const com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess >& rSubContainer );
136 : :
137 : : mutable ShareableMutex m_aShareMutex;
138 : : std::vector< com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > > m_aItemVector;
139 : : rtl::OUString m_aUIName;
140 : : };
141 : :
142 : : }
143 : :
144 : : #endif // #ifndef __FRAMEWORK_UIELEMENT_ROOTITEMCONTAINER_HXX_
145 : :
146 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|