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 _COMPHELPER_PROPERTSETINFO_HXX_
21 #define _COMPHELPER_PROPERTSETINFO_HXX_
23 #include <com/sun/star/beans/XPropertySetInfo.hpp>
24 #include <cppuhelper/implbase1.hxx>
25 #include <comphelper/stl_types.hxx>
26 #include "comphelper/comphelperdllapi.h"
28 //=========================================================================
29 //= property helper classes
30 //=========================================================================
32 //... namespace comphelper .......................................................
35 //.........................................................................
37 struct PropertyMapEntry
39 const sal_Char
* mpName
;
42 const com::sun::star::uno::Type
* mpType
;
43 sal_Int16 mnAttributes
;
47 DECLARE_STL_USTRINGACCESS_MAP( PropertyMapEntry
*, PropertyMap
);
49 class PropertyMapImpl
;
51 /** this class implements a XPropertySetInfo that is initialized with arrays of PropertyMapEntry.
52 It is used by the class PropertySetHelper.
54 class COMPHELPER_DLLPUBLIC PropertySetInfo
: public ::cppu::WeakImplHelper1
< ::com::sun::star::beans::XPropertySetInfo
>
57 PropertyMapImpl
* mpMap
;
59 PropertySetInfo() throw();
60 PropertySetInfo( PropertyMapEntry
* pMap
) throw();
61 virtual ~PropertySetInfo() throw();
63 /** returns a stl map with all PropertyMapEntry pointer.<p>
64 The key is the property name.
66 const PropertyMap
* getPropertyMap() const throw();
68 /** adds an array of PropertyMapEntry to this instance.<p>
69 The end is marked with a PropertyMapEntry where mpName equals NULL</p>
71 void add( PropertyMapEntry
* pMap
) throw();
73 /** removes an already added PropertyMapEntry which string in mpName equals to aName */
74 void remove( const OUString
& aName
) throw();
76 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
> SAL_CALL
getProperties() throw(::com::sun::star::uno::RuntimeException
);
77 virtual ::com::sun::star::beans::Property SAL_CALL
getPropertyByName( const OUString
& aName
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::uno::RuntimeException
);
78 virtual sal_Bool SAL_CALL
hasPropertyByName( const OUString
& Name
) throw(::com::sun::star::uno::RuntimeException
);
81 //.........................................................................
83 //... namespace comphelper .......................................................
85 #endif // _UTL_PROPERTSETINFO_HXX_
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */