tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / include / comphelper / propertystatecontainer.hxx
blobe992e6b64546184d0c97648723d19961248daa0b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
31 namespace comphelper
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
50 protected:
51 /** ctor
52 @param _rBHelper
53 help to be used for broadcasting events
55 OPropertyStateContainer( ::cppu::OBroadcastHelper& _rBHelper );
58 // XPropertyState
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;
65 // own overridables
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
86 @precond
87 <arg>_nHandle</arg> is a valid property handle
89 virtual void getPropertyDefaultByHandle( sal_Int32 _nHandle, css::uno::Any& _rDefault ) const = 0;
91 protected:
92 // XInterface
93 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& _rType ) override;
94 // XTypeProvider
95 DECLARE_XTYPEPROVIDER( )
97 protected:
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: */