1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __FRAMEWORK_UIELEMENT_CONSTITEMCONTAINER_HXX_
21 #define __FRAMEWORK_UIELEMENT_CONSTITEMCONTAINER_HXX_
23 #include <threadhelp/threadhelpbase.hxx>
24 #include <macros/generic.hxx>
25 #include <macros/xinterface.hxx>
26 #include <macros/xtypeprovider.hxx>
28 #include <com/sun/star/container/XIndexContainer.hpp>
29 #include <com/sun/star/lang/XSingleComponentFactory.hpp>
30 #include <com/sun/star/beans/PropertyValue.hpp>
31 #include <com/sun/star/beans/XPropertySet.hpp>
32 #include <com/sun/star/beans/XFastPropertySet.hpp>
33 #include <com/sun/star/lang/XTypeProvider.hpp>
34 #include <com/sun/star/lang/XUnoTunnel.hpp>
36 #include <rtl/ustring.hxx>
37 #include <cppuhelper/weak.hxx>
38 #include <cppuhelper/propshlp.hxx>
41 #include <fwidllapi.h>
46 class RootItemContainer
;
48 class FWI_DLLPUBLIC ConstItemContainer
: public ::com::sun::star::lang::XTypeProvider
,
49 public com::sun::star::container::XIndexAccess
,
50 public ::com::sun::star::lang::XUnoTunnel
,
51 public ::com::sun::star::beans::XFastPropertySet
,
52 public ::com::sun::star::beans::XPropertySet
,
53 public ::cppu::OWeakObject
55 friend class RootItemContainer
;
56 friend class ItemContainer
;
60 ConstItemContainer( const ItemContainer
& rtemContainer
);
61 ConstItemContainer( const com::sun::star::uno::Reference
< com::sun::star::container::XIndexAccess
>& rSourceContainer
, sal_Bool bFastCopy
= sal_False
);
62 virtual ~ConstItemContainer();
64 //---------------------------------------------------------------------------------------------------------
65 // XInterface, XTypeProvider
66 //---------------------------------------------------------------------------------------------------------
67 FWK_DECLARE_XINTERFACE
68 FWK_DECLARE_XTYPEPROVIDER
71 static const ::com::sun::star::uno::Sequence
< sal_Int8
>& GetUnoTunnelId() throw();
72 static ConstItemContainer
* GetImplementation( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& rxIFace
) throw();
73 sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& rIdentifier
) throw(::com::sun::star::uno::RuntimeException
);
76 virtual sal_Int32 SAL_CALL
getCount()
77 throw (::com::sun::star::uno::RuntimeException
);
79 virtual ::com::sun::star::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
)
80 throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
83 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType()
84 throw (::com::sun::star::uno::RuntimeException
)
86 return ::getCppuType((com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>*)0);
89 virtual sal_Bool SAL_CALL
hasElements()
90 throw (::com::sun::star::uno::RuntimeException
);
93 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException
);
94 virtual void SAL_CALL
setPropertyValue( const 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
);
95 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
96 virtual void SAL_CALL
addPropertyChangeListener( const 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
);
97 virtual void SAL_CALL
removePropertyChangeListener( const 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
);
98 virtual void SAL_CALL
addVetoableChangeListener( const 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
);
99 virtual void SAL_CALL
removeVetoableChangeListener( const 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
);
102 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
);
103 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
);
106 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper();
107 const com::sun::star::uno::Sequence
< com::sun::star::beans::Property
> impl_getStaticPropertyDescriptor();
108 static ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
createPropertySetInfo( ::cppu::IPropertyArrayHelper
& rProperties
) SAL_THROW(());
110 void copyItemContainer( const std::vector
< com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
> >& rSourceVector
);
111 com::sun::star::uno::Reference
< com::sun::star::container::XIndexAccess
> deepCopyContainer( const com::sun::star::uno::Reference
< com::sun::star::container::XIndexAccess
>& rSubContainer
);
113 std::vector
< com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
> > m_aItemVector
;
119 #endif // #ifndef __FRAMEWORK_UIELEMENT_CONSTITEMCONTAINER_HXX_
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */