LibreOffice Module comphelper (master) 1
propertystatecontainer.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_COMPHELPER_PROPERTYSTATECONTAINER_HXX
21#define INCLUDED_COMPHELPER_PROPERTYSTATECONTAINER_HXX
22
24#include <com/sun/star/beans/XPropertyState.hpp>
26#include <comphelper/uno3.hxx>
28
29
30namespace comphelper
31{
32
33
34 //= OPropertyStateContainer
35
36 typedef ::cppu::ImplHelper1 < css::beans::XPropertyState
38
46 :public OPropertyContainer
48 {
49 protected:
55
56
57 // XPropertyState
58 virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
59 virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override;
60 virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
61 virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
62
63
64 // own overridables
65 // these are the impl-methods for the XPropertyState members - they are implemented already by this class,
66 // but you may want to override them for whatever reasons (for instance, if your derived class
67 // supports the AMBIGUOUS state for properties)
68
74 css::beans::PropertyState getPropertyStateByHandle( sal_Int32 _nHandle ) const;
75
81 void setPropertyToDefaultByHandle( sal_Int32 _nHandle );
82
88 virtual void getPropertyDefaultByHandle( sal_Int32 _nHandle, css::uno::Any& _rDefault ) const = 0;
89
90 protected:
91 // XInterface
92 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& _rType ) override;
93 // XTypeProvider
95
96 protected:
101 sal_Int32 getHandleForName( const OUString& _rPropertyName );
102 };
103
104
105} // namespace comphelper
106
107
108#endif // INCLUDED_COMPHELPER_PROPERTYSTATECONTAINER_HXX
109
110/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
an OPropertySetHelper implementation which is just a simple container for properties represented by c...
helper implementation for components which have properties with a default
virtual void getPropertyDefaultByHandle(sal_Int32 _nHandle, css::uno::Any &_rDefault) const =0
get the default value for the property denoted by the given handle
#define COMPHELPER_DLLPUBLIC
::cppu::ImplHelper1< css::beans::XPropertyState > OPropertyStateContainer_TBase
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
#define DECLARE_XTYPEPROVIDER()
Definition: uno3.hxx:126