bump product version to 4.2.0.1
[LibreOffice.git] / include / svtools / extcolorcfg.hxx
blobafafa1dc416d23aac7106e96fde4022012e6a306
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_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 //-----------------------------------------------------------------------------
30 namespace svtools{
32 class ExtendedColorConfig_Impl;
33 class ExtendedColorConfigValue
35 OUString m_sName;
36 OUString m_sDisplayName;
37 sal_Int32 m_nColor;
38 sal_Int32 m_nDefaultColor;
39 public:
40 ExtendedColorConfigValue() : m_nColor(0),m_nDefaultColor(0){}
41 ExtendedColorConfigValue(const OUString& _sName
42 ,const OUString& _sDisplayName
43 ,sal_Int32 _nColor
44 ,sal_Int32 _nDefaultColor)
45 : m_sName(_sName)
46 ,m_sDisplayName(_sDisplayName)
47 ,m_nColor(_nColor)
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;
65 private:
66 static ExtendedColorConfig_Impl* m_pImpl;
67 public:
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;
85 sal_Bool m_bModified;
86 public:
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);
100 void SetModified();
101 void ClearModified(){m_bModified = sal_False;}
102 sal_Bool IsModified()const{return m_bModified;}
103 void Commit();
105 void DisableBroadcast();
106 void EnableBroadcast();
108 }//namespace svtools
109 #endif
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */