Line data Source code
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 : #ifndef _SVX_COLRITEM_HXX
20 : #define _SVX_COLRITEM_HXX
21 :
22 : #include <svl/poolitem.hxx>
23 : #include <tools/color.hxx>
24 : #include <editeng/editengdllapi.h>
25 :
26 : class SvXMLUnitConverter;
27 : namespace rtl
28 : {
29 : class OUString;
30 : }
31 :
32 : // class SvxColorItem ----------------------------------------------------
33 :
34 : /* [Description]
35 :
36 : This item describes a color.
37 : */
38 :
39 : #define VERSION_USEAUTOCOLOR 1
40 :
41 : class EDITENG_DLLPUBLIC SvxColorItem : public SfxPoolItem
42 : {
43 : private:
44 : Color mColor;
45 :
46 : public:
47 : TYPEINFO();
48 :
49 : explicit SvxColorItem( const sal_uInt16 nId );
50 : SvxColorItem( const Color& aColor, const sal_uInt16 nId );
51 : SvxColorItem( SvStream& rStrm, const sal_uInt16 nId );
52 : SvxColorItem( const SvxColorItem& rCopy );
53 : ~SvxColorItem();
54 :
55 : // "pure virtual Methods" from SfxPoolItem
56 : virtual int operator==( const SfxPoolItem& ) const;
57 : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
58 : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
59 : virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
60 :
61 : virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
62 : SfxMapUnit eCoreMetric,
63 : SfxMapUnit ePresMetric,
64 : String &rText, const IntlWrapper * = 0 ) const;
65 :
66 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
67 : virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
68 : virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
69 :
70 429 : inline SvxColorItem& operator=(const SvxColorItem& rColor)
71 : {
72 429 : SetValue( rColor.GetValue() );
73 429 : return *this;
74 : }
75 :
76 72128 : const Color& GetValue() const
77 : {
78 72128 : return mColor;
79 : }
80 : void SetValue( const Color& rNewCol );
81 :
82 : };
83 :
84 : #endif
85 :
86 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|