nss: upgrade to release 3.73
[LibreOffice.git] / include / editeng / colritem.hxx
blob8e081fc6aab1bec4c86c1076f5e200b9363b4787
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 .
19 #ifndef INCLUDED_EDITENG_COLRITEM_HXX
20 #define INCLUDED_EDITENG_COLRITEM_HXX
22 #include <svl/poolitem.hxx>
23 #include <tools/color.hxx>
24 #include <editeng/editengdllapi.h>
26 #define VERSION_USEAUTOCOLOR 1
28 /** SvxColorItem item describes a color.
30 class EDITENG_DLLPUBLIC SvxColorItem : public SfxPoolItem
32 private:
33 Color mColor;
35 public:
36 static SfxPoolItem* CreateDefault();
38 explicit SvxColorItem(const sal_uInt16 nId);
39 SvxColorItem(const Color& aColor, const sal_uInt16 nId);
40 virtual ~SvxColorItem() override;
42 // "pure virtual Methods" from SfxPoolItem
43 virtual bool operator==(const SfxPoolItem& rPoolItem) const override;
44 virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override;
45 virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) override;
47 virtual bool GetPresentation(SfxItemPresentation ePres,
48 MapUnit eCoreMetric, MapUnit ePresMetric,
49 OUString &rText, const IntlWrapper& rIntlWrapper) const override;
51 virtual SvxColorItem* Clone(SfxItemPool* pPool = nullptr) const override;
52 SvxColorItem(SvxColorItem const &) = default; // SfxPoolItem copy function dichotomy
54 const Color& GetValue() const
56 return mColor;
58 void SetValue(const Color& rNewColor);
60 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
63 // XXX: to be moved in a separate header.
64 class EDITENG_DLLPUBLIC SvxBackgroundColorItem final : public SfxPoolItem
66 private:
67 Color mColor;
69 public:
70 static SfxPoolItem* CreateDefault();
72 SvxBackgroundColorItem(const sal_uInt16 nId);
73 SvxBackgroundColorItem(const Color& rCol, const sal_uInt16 nId);
74 virtual ~SvxBackgroundColorItem() override;
76 virtual bool operator==(const SfxPoolItem& rPoolItem) const override;
77 virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override;
78 virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) override;
80 virtual bool GetPresentation(SfxItemPresentation ePres,
81 MapUnit eCoreMetric, MapUnit ePresMetric,
82 OUString &rText, const IntlWrapper& rIntlWrapper) const override;
84 virtual SvxBackgroundColorItem* Clone(SfxItemPool* pPool = nullptr) const override;
85 SvxBackgroundColorItem(SvxBackgroundColorItem const &) = default; // SfxPoolItem copy function dichotomy
87 const Color& GetValue() const
89 return mColor;
92 void SetValue(const Color& rNewColor);
94 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
97 #endif
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */