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 SVX_DLLPUBLIC ColorSet 25 { 26 OUString maColorSetName; 27 std::vector<Color> maColors; 28 public: 29 ColorSet(OUString const & aName); 30 add(sal_uInt32 nIndex,sal_uInt32 aColorData)31 void add(sal_uInt32 nIndex, sal_uInt32 aColorData) 32 { 33 maColors[nIndex] = Color(aColorData); 34 } 35 getName() const36 const OUString& getName() const 37 { 38 return maColorSetName; 39 } getColor(sal_uInt32 nIndex) const40 const Color& getColor(sal_uInt32 nIndex) const 41 { 42 return maColors[nIndex]; 43 } 44 }; 45 46 class SVX_DLLPUBLIC ColorSets 47 { 48 std::vector<ColorSet> maColorSets; 49 public: 50 ColorSets(); 51 ~ColorSets(); 52 53 void init(); getColorSets() const54 const std::vector<ColorSet>& getColorSets() const 55 { 56 return maColorSets; 57 } 58 getColorSet(sal_uInt32 nIndex)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: */ 72