LibreOffice Module svx (master)  1
ColorSets.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  */
10 
11 #ifndef INCLUDED_SVX_COLORSETS_HXX
12 #define INCLUDED_SVX_COLORSETS_HXX
13 
14 #include <vector>
15 
16 #include <rtl/ustring.hxx>
17 #include <sal/types.h>
18 #include <svx/svxdllapi.h>
19 #include <tools/color.hxx>
20 
21 namespace svx
22 {
23 
24 class ColorSet
25 {
26  OUString maColorSetName;
27  std::vector<Color> maColors;
28 public:
29  ColorSet(OUString const & aName);
30 
31  void add(sal_uInt32 nIndex, sal_uInt32 aColorData)
32  {
33  maColors[nIndex] = Color(aColorData);
34  }
35 
36  const OUString& getName() const
37  {
38  return maColorSetName;
39  }
40  const Color& getColor(sal_uInt32 nIndex) const
41  {
42  return maColors[nIndex];
43  }
44 };
45 
47 {
48  std::vector<ColorSet> maColorSets;
49 public:
50  ColorSets();
51  ~ColorSets();
52 
53  void init();
54  const std::vector<ColorSet>& getColorSets() const
55  {
56  return maColorSets;
57  }
58 
59  const ColorSet& getColorSet(sal_uInt32 nIndex)
60  {
61  return maColorSets[nIndex];
62  }
63 
64  const ColorSet& getColorSet(const OUString& rName);
65 };
66 
67 } // end of namespace svx
68 
69 #endif // INCLUDED_SVX_COLORSETS_HXX
70 
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void add(sal_uInt32 nIndex, sal_uInt32 aColorData)
Definition: ColorSets.hxx:31
OUString maColorSetName
Definition: ColorSets.hxx:26
const ColorSet & getColorSet(sal_uInt32 nIndex)
Definition: ColorSets.hxx:59
std::vector< ColorSet > maColorSets
Definition: ColorSets.hxx:48
const OUString & getName() const
Definition: ColorSets.hxx:36
ColorSet(OUString const &aName)
Definition: ColorSets.cxx:16
const std::vector< ColorSet > & getColorSets() const
Definition: ColorSets.hxx:54
std::vector< Color > maColors
Definition: ColorSets.hxx:27
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35
const Color & getColor(sal_uInt32 nIndex) const
Definition: ColorSets.hxx:40
FILE * init(int, char **)