1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_SVTOOLS_EXTCOLORCFG_HXX
20 #define INCLUDED_SVTOOLS_EXTCOLORCFG_HXX
22 #include <svtools/svtdllapi.h>
23 #include <rtl/ustring.hxx>
24 #include <tools/color.hxx>
25 #include <com/sun/star/uno/Sequence.h>
26 #include <svl/brdcst.hxx>
27 #include <svl/lstner.hxx>
29 //-----------------------------------------------------------------------------
32 class ExtendedColorConfig_Impl
;
33 class ExtendedColorConfigValue
36 OUString m_sDisplayName
;
38 sal_Int32 m_nDefaultColor
;
40 ExtendedColorConfigValue() : m_nColor(0),m_nDefaultColor(0){}
41 ExtendedColorConfigValue(const OUString
& _sName
42 ,const OUString
& _sDisplayName
44 ,sal_Int32 _nDefaultColor
)
46 ,m_sDisplayName(_sDisplayName
)
48 ,m_nDefaultColor(_nDefaultColor
)
51 inline OUString
getName() const { return m_sName
; }
52 inline OUString
getDisplayName() const { return m_sDisplayName
; }
53 inline sal_Int32
getColor() const { return m_nColor
; }
54 inline sal_Int32
getDefaultColor() const { return m_nDefaultColor
; }
56 inline void setColor(sal_Int32 _nColor
) { m_nColor
= _nColor
; }
58 sal_Bool
operator !=(const ExtendedColorConfigValue
& rCmp
) const
59 { return m_nColor
!= rCmp
.m_nColor
;}
62 class SVT_DLLPUBLIC ExtendedColorConfig
: public SfxBroadcaster
, public SfxListener
64 friend class ExtendedColorConfig_Impl
;
66 static ExtendedColorConfig_Impl
* m_pImpl
;
68 ExtendedColorConfig();
69 ~ExtendedColorConfig();
71 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
73 // get the configured value
74 ExtendedColorConfigValue
GetColorValue(const OUString
& _sComponentName
,const OUString
& _sName
)const;
75 sal_Int32
GetComponentCount() const;
76 OUString
GetComponentName(sal_uInt32 _nPos
) const;
77 OUString
GetComponentDisplayName(const OUString
& _sComponentName
) const;
78 sal_Int32
GetComponentColorCount(const OUString
& _sName
) const;
79 ExtendedColorConfigValue
GetComponentColorConfigValue(const OUString
& _sComponentName
,sal_uInt32 _nPos
) const;
82 class SVT_DLLPUBLIC EditableExtendedColorConfig
84 ExtendedColorConfig_Impl
* m_pImpl
;
87 EditableExtendedColorConfig();
88 ~EditableExtendedColorConfig();
90 void DeleteScheme(const OUString
& rScheme
);
91 void AddScheme(const OUString
& rScheme
);
92 sal_Bool
LoadScheme(const OUString
& rScheme
);
93 void SetCurrentSchemeName(const OUString
& rScheme
);
95 sal_Int32
GetComponentCount() const;
96 OUString
GetComponentName(sal_uInt32 _nPos
) const;
97 sal_Int32
GetComponentColorCount(const OUString
& _sName
) const;
98 ExtendedColorConfigValue
GetComponentColorConfigValue(const OUString
& _sName
,sal_uInt32 _nPos
) const;
99 void SetColorValue(const OUString
& _sComponentName
, const ExtendedColorConfigValue
& rValue
);
101 void ClearModified(){m_bModified
= sal_False
;}
102 sal_Bool
IsModified()const{return m_bModified
;}
105 void DisableBroadcast();
106 void EnableBroadcast();
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */