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 INCLUDED_COMPHELPER_PROPERTYSTATECONTAINER_HXX
21 #define INCLUDED_COMPHELPER_PROPERTYSTATECONTAINER_HXX
23 #include <config_options.h>
24 #include <comphelper/propertycontainer.hxx>
25 #include <com/sun/star/beans/XPropertyState.hpp>
26 #include <cppuhelper/implbase1.hxx>
27 #include <comphelper/uno3.hxx>
28 #include <comphelper/comphelperdllapi.h>
35 //= OPropertyStateContainer
37 typedef ::cppu::ImplHelper1
< css::beans::XPropertyState
38 > OPropertyStateContainer_TBase
;
40 /** helper implementation for components which have properties with a default
42 <p>This class is not intended for direct use, you need to derive from it.</p>
44 @see com.sun.star.beans.XPropertyState
46 class UNLESS_MERGELIBS_MORE(COMPHELPER_DLLPUBLIC
) OPropertyStateContainer
47 :public OPropertyContainer
48 ,public OPropertyStateContainer_TBase
53 help to be used for broadcasting events
55 OPropertyStateContainer( ::cppu::OBroadcastHelper
& _rBHelper
);
59 virtual css::beans::PropertyState SAL_CALL
getPropertyState( const OUString
& PropertyName
) override final
;
60 virtual css::uno::Sequence
< css::beans::PropertyState
> SAL_CALL
getPropertyStates( const css::uno::Sequence
< OUString
>& aPropertyName
) override
;
61 virtual void SAL_CALL
setPropertyToDefault( const OUString
& PropertyName
) override final
;
62 virtual css::uno::Any SAL_CALL
getPropertyDefault( const OUString
& aPropertyName
) override final
;
66 // these are the impl-methods for the XPropertyState members - they are implemented already by this class,
67 // but you may want to override them for whatever reasons (for instance, if your derived class
68 // supports the AMBIGUOUS state for properties)
70 /** get the PropertyState of the property denoted by the given handle
72 <p>Already implemented by this base class, no need to override</p>
73 @precond <arg>_nHandle</arg> is a valid property handle
75 css::beans::PropertyState
getPropertyStateByHandle( sal_Int32 _nHandle
) const;
77 /** set the property denoted by the given handle to its default value
79 <p>Already implemented by this base class, no need to override</p>
80 @precond <arg>_nHandle</arg> is a valid property handle
82 void setPropertyToDefaultByHandle( sal_Int32 _nHandle
);
84 /** get the default value for the property denoted by the given handle
87 <arg>_nHandle</arg> is a valid property handle
89 virtual void getPropertyDefaultByHandle( sal_Int32 _nHandle
, css::uno::Any
& _rDefault
) const = 0;
93 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& _rType
) override
;
95 DECLARE_XTYPEPROVIDER( )
98 /** returns the handle for the given name
100 @throw UnknownPropertyException if the given name is not a registered property
102 sal_Int32
getHandleForName( const OUString
& _rPropertyName
);
106 } // namespace comphelper
109 #endif // INCLUDED_COMPHELPER_PROPERTYSTATECONTAINER_HXX
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */