LibreOffice Module comphelper (master)  1
propertybag.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_PROPERTYBAG_HXX
21 #define INCLUDED_COMPHELPER_PROPERTYBAG_HXX
22 
25 
26 #include <memory>
27 
28 
29 namespace comphelper
30 {
31 
32 
33  struct PropertyBag_Impl;
34 
35  //= PropertyBag
36 
43  {
44  private:
45  ::std::unique_ptr< PropertyBag_Impl > m_pImpl;
46 
47  public:
48  PropertyBag();
49  virtual ~PropertyBag();
50 
56  void setAllowEmptyPropertyName(bool i_isAllowed);
57 
80  void addProperty(
81  const OUString& _rName,
82  sal_Int32 _nHandle,
83  sal_Int32 _nAttributes,
84  const css::uno::Any& _rInitialValue
85  );
86 
108  void addVoidProperty(
109  const OUString& _rName,
110  const css::uno::Type& _rType,
111  sal_Int32 _nHandle,
112  sal_Int32 _nAttributes
113  );
114 
125  void removeProperty(
126  const OUString& _rName
127  );
128 
134  css::uno::Sequence< css::beans::Property >& _out_rProps
135  ) const
136  {
138  }
139 
148  void getFastPropertyValue(
149  sal_Int32 _nHandle,
150  css::uno::Any& _out_rValue
151  ) const;
152 
170  bool convertFastPropertyValue(
171  sal_Int32 _nHandle,
172  const css::uno::Any& _rNewValue,
173  css::uno::Any& _out_rConvertedValue,
174  css::uno::Any& _out_rCurrentValue
175  ) const;
176 
181  void setFastPropertyValue(
182  sal_Int32 _nHandle,
183  const css::uno::Any& _rValue
184  );
185 
198  void getPropertyDefaultByHandle(
199  sal_Int32 _nHandle,
200  css::uno::Any& _out_rValue
201  ) const;
202 
205  bool hasPropertyByName( const OUString& _rName ) const
206  {
207  return isRegisteredProperty( _rName );
208  }
209 
212  bool hasPropertyByHandle( sal_Int32 _nHandle ) const
213  {
214  return isRegisteredProperty( _nHandle );
215  }
216  protected:
219  };
220 
221 
222 } // namespace comphelper
223 
224 
225 #endif // INCLUDED_COMPHELPER_PROPERTYBAG_HXX
226 
227 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void describeProperties(css::uno::Sequence< css::beans::Property > &_rProps) const
appends the descriptions of all properties which were registered 'til that moment to the given sequen...
provides a bag of properties associated with their values
Definition: propertybag.hxx:42
void describeProperties(css::uno::Sequence< css::beans::Property > &_out_rProps) const
describes all properties in the bag
bool hasPropertyByHandle(sal_Int32 _nHandle) const
determines whether a property with a given handle is part of the bag
helper class for managing property values, and implementing most of the X*Property* interfaces ...
::std::unique_ptr< PropertyBag_Impl > m_pImpl
Definition: propertybag.hxx:45
void getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const
bool hasPropertyByName(const OUString &_rName) const
determines whether a property with a given name is part of the bag
#define COMPHELPER_DLLPUBLIC
bool convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue)