LibreOffice Module svl (master) 1
grabbagitem.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#ifndef INCLUDED_SVL_GRABBAGITEM_HXX
10#define INCLUDED_SVL_GRABBAGITEM_HXX
11
12#include <map>
13
14#include <svl/svldllapi.h>
15#include <svl/poolitem.hxx>
16#include <com/sun/star/uno/Any.hxx>
17
20{
21private:
22 std::map<OUString, css::uno::Any> m_aMap;
23
24public:
26 SfxGrabBagItem(sal_uInt16 nWhich);
27 ~SfxGrabBagItem() override;
28
29 SfxGrabBagItem(SfxGrabBagItem const&) = default;
31 SfxGrabBagItem& operator=(SfxGrabBagItem const&) = delete; // due to SfxPoolItem
32 SfxGrabBagItem& operator=(SfxGrabBagItem&&) = delete; // due to SfxPoolItem
33
34 const std::map<OUString, css::uno::Any>& GetGrabBag() const { return m_aMap; }
35
36 std::map<OUString, css::uno::Any>& GetGrabBag() { return m_aMap; }
37
38 bool operator==(const SfxPoolItem& rItem) const override;
39 SfxGrabBagItem* Clone(SfxItemPool* pPool = nullptr) const override;
40
41 bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) override;
42 bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override;
43};
44#endif
45
46/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Grab bag item provides a string-any map for keys with untyped values.
Definition: grabbagitem.hxx:20
SfxGrabBagItem & operator=(SfxGrabBagItem const &)=delete
const std::map< OUString, css::uno::Any > & GetGrabBag() const
Definition: grabbagitem.hxx:34
SfxGrabBagItem(SfxGrabBagItem const &)=default
std::map< OUString, css::uno::Any > & GetGrabBag()
Definition: grabbagitem.hxx:36
SfxGrabBagItem(SfxGrabBagItem &&)=default
SfxGrabBagItem & operator=(SfxGrabBagItem &&)=delete
std::map< OUString, css::uno::Any > m_aMap
Definition: grabbagitem.hxx:22
~SfxGrabBagItem() override
Base class for providers of defaults of SfxPoolItems.
Definition: itempool.hxx:51
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
Definition: poolitem.cxx:604
virtual bool operator==(const SfxPoolItem &) const =0
Definition: poolitem.cxx:478
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
Definition: poolitem.cxx:610
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
#define SVL_DLLPUBLIC
Definition: svldllapi.h:28
unsigned char sal_uInt8