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: constitemcontainer.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_UIELEMENT_CONSTITEMCONTAINER_HXX_
32 #define __FRAMEWORK_UIELEMENT_CONSTITEMCONTAINER_HXX_
34 //_________________________________________________________________________________________________________________
36 //_________________________________________________________________________________________________________________
38 #include <threadhelp/threadhelpbase.hxx>
39 #include <macros/generic.hxx>
40 #include <macros/xinterface.hxx>
41 #include <macros/xtypeprovider.hxx>
43 //_________________________________________________________________________________________________________________
45 //_________________________________________________________________________________________________________________
46 #include <com/sun/star/container/XIndexContainer.hpp>
47 #include <com/sun/star/lang/XSingleComponentFactory.hpp>
48 #include <com/sun/star/beans/PropertyValue.hpp>
49 #include <com/sun/star/beans/XPropertySet.hpp>
50 #include <com/sun/star/beans/XFastPropertySet.hpp>
51 #include <com/sun/star/lang/XTypeProvider.hpp>
52 #include <com/sun/star/lang/XUnoTunnel.hpp>
54 //_________________________________________________________________________________________________________________
56 //_________________________________________________________________________________________________________________
57 #include <rtl/ustring.hxx>
58 #include <cppuhelper/weak.hxx>
59 #include <cppuhelper/propshlp.hxx>
66 class RootItemContainer
;
68 class ConstItemContainer
: public ::com::sun::star::lang::XTypeProvider
,
69 public com::sun::star::container::XIndexAccess
,
70 public ::com::sun::star::lang::XUnoTunnel
,
71 public ::com::sun::star::beans::XFastPropertySet
,
72 public ::com::sun::star::beans::XPropertySet
,
73 public ::cppu::OWeakObject
75 friend class RootItemContainer
;
76 friend class ItemContainer
;
80 ConstItemContainer( const ItemContainer
& rtemContainer
);
81 ConstItemContainer( const RootItemContainer
& rRootItemContainer
, sal_Bool bFastCopy
= sal_False
);
82 ConstItemContainer( const com::sun::star::uno::Reference
< com::sun::star::container::XIndexAccess
>& rSourceContainer
, sal_Bool bFastCopy
= sal_False
);
83 virtual ~ConstItemContainer();
85 //---------------------------------------------------------------------------------------------------------
86 // XInterface, XTypeProvider
87 //---------------------------------------------------------------------------------------------------------
88 FWK_DECLARE_XINTERFACE
89 FWK_DECLARE_XTYPEPROVIDER
92 static const ::com::sun::star::uno::Sequence
< sal_Int8
>& GetUnoTunnelId() throw();
93 static ConstItemContainer
* GetImplementation( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& rxIFace
) throw();
94 sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& rIdentifier
) throw(::com::sun::star::uno::RuntimeException
);
97 virtual sal_Int32 SAL_CALL
getCount()
98 throw (::com::sun::star::uno::RuntimeException
);
100 virtual ::com::sun::star::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
)
101 throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
104 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType()
105 throw (::com::sun::star::uno::RuntimeException
)
107 return ::getCppuType((com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>*)0);
110 virtual sal_Bool SAL_CALL
hasElements()
111 throw (::com::sun::star::uno::RuntimeException
);
114 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException
);
115 virtual void SAL_CALL
setPropertyValue( const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Any
& aValue
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::beans::PropertyVetoException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
116 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue( const ::rtl::OUString
& PropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
117 virtual void SAL_CALL
addPropertyChangeListener( const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& xListener
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
118 virtual void SAL_CALL
removePropertyChangeListener( const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& aListener
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
119 virtual void SAL_CALL
addVetoableChangeListener( const ::rtl::OUString
& PropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
120 virtual void SAL_CALL
removeVetoableChangeListener( const ::rtl::OUString
& PropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
123 virtual void SAL_CALL
setFastPropertyValue( sal_Int32 nHandle
, const ::com::sun::star::uno::Any
& aValue
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::beans::PropertyVetoException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
124 virtual ::com::sun::star::uno::Any SAL_CALL
getFastPropertyValue( sal_Int32 nHandle
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
127 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper();
128 const com::sun::star::uno::Sequence
< com::sun::star::beans::Property
> impl_getStaticPropertyDescriptor();
129 static ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
createPropertySetInfo( ::cppu::IPropertyArrayHelper
& rProperties
) SAL_THROW( () );
131 void copyItemContainer( const std::vector
< com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
> >& rSourceVector
);
132 com::sun::star::uno::Reference
< com::sun::star::container::XIndexAccess
> deepCopyContainer( const com::sun::star::uno::Reference
< com::sun::star::container::XIndexAccess
>& rSubContainer
);
134 std::vector
< com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
> > m_aItemVector
;
135 rtl::OUString m_aUIName
;
140 #endif // #ifndef __FRAMEWORK_UIELEMENT_CONSTITEMCONTAINER_HXX_