LibreOffice Module svx (master)  1
palettes.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  * 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 INCLUDED_SVX_INC_PALETTE_HXX
20 #define INCLUDED_SVX_INC_PALETTE_HXX
21 
22 #include <svx/Palette.hxx>
23 #include <svx/SvxColorValueSet.hxx>
24 #include <svx/xtable.hxx>
25 
27 
28 typedef std::vector< NamedColor > ColorList;
29 
30 // ASE = Adobe Swatch Exchange
31 
32 class PaletteASE final : public Palette
33 {
35  OUString maFPath;
36  OUString maASEPaletteName;
38 
39  void LoadPalette();
40 public:
41  PaletteASE( const OUString &rFPath, const OUString &rFName );
42  virtual ~PaletteASE() override;
43 
44  virtual const OUString& GetName() override;
45  virtual const OUString& GetPath() override;
46  virtual void LoadColorSet(SvxColorValueSet& rColorSet) override;
47 
48  virtual bool IsValid() override;
49 };
50 
51 // GPL - this is *not* GNU Public License, but is the Gimp PaLette
52 
53 class PaletteGPL final : public Palette
54 {
57  OUString maFName;
58  OUString maFPath;
59  OUString maGPLPaletteName;
61 
62  bool ReadPaletteHeader(SvFileStream& rFileStream);
63  void LoadPaletteHeader();
64  void LoadPalette();
65 public:
66  PaletteGPL( const OUString &rFPath, const OUString &rFName );
67  virtual ~PaletteGPL() override;
68 
69  virtual const OUString& GetName() override;
70  virtual const OUString& GetPath() override;
71  virtual void LoadColorSet(SvxColorValueSet& rColorSet) override;
72 
73  virtual bool IsValid() override;
74 };
75 
76 // SOC - Star Office Color-table
77 
78 class PaletteSOC final : public Palette
79 {
81  OUString maFPath;
82  OUString maSOCPaletteName;
84 public:
85  PaletteSOC( const OUString &rFPath, const OUString &rFName );
86  virtual ~PaletteSOC() override;
87 
88  virtual const OUString& GetName() override;
89  virtual const OUString& GetPath() override;
90  virtual void LoadColorSet(SvxColorValueSet& rColorSet) override;
91 
92  virtual bool IsValid() override;
93 };
94 
95 #endif // INCLUDED_SVX_INC_PALETTE_HXX
96 
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void LoadColorSet(SvxColorValueSet &rColorSet) override
Definition: Palette.cxx:200
void LoadPalette()
Definition: Palette.cxx:80
bool mbLoadedPalette
Definition: palettes.hxx:55
virtual const OUString & GetName() override
Definition: Palette.cxx:336
virtual bool IsValid() override
Definition: Palette.cxx:359
PaletteGPL(const OUString &rFPath, const OUString &rFName)
Definition: Palette.cxx:177
OUString maASEPaletteName
Definition: palettes.hxx:36
OUString maFPath
Definition: palettes.hxx:81
void LoadPaletteHeader()
Definition: Palette.cxx:240
OUString maFPath
Definition: palettes.hxx:35
bool mbValidPalette
Definition: palettes.hxx:56
virtual bool IsValid() override
Definition: Palette.cxx:62
virtual const OUString & GetName() override
Definition: Palette.cxx:190
virtual void LoadColorSet(SvxColorValueSet &rColorSet) override
Definition: Palette.cxx:346
bool ReadPaletteHeader(SvFileStream &rFileStream)
Definition: Palette.cxx:218
virtual const OUString & GetPath() override
Definition: Palette.cxx:341
std::vector< NamedColor > ColorList
Definition: palettes.hxx:26
PaletteASE(const OUString &rFPath, const OUString &rFName)
Definition: Palette.cxx:33
virtual const OUString & GetPath() override
Definition: Palette.cxx:195
virtual const OUString & GetPath() override
Definition: Palette.cxx:57
void LoadPalette()
Definition: Palette.cxx:246
virtual ~PaletteASE() override
Definition: Palette.cxx:29
OUString maSOCPaletteName
Definition: palettes.hxx:82
bool mbValidPalette
Definition: palettes.hxx:34
ColorList maColors
Definition: palettes.hxx:60
bool mbLoadedPalette
Definition: palettes.hxx:80
virtual const OUString & GetName() override
Definition: Palette.cxx:52
virtual ~PaletteSOC() override
Definition: Palette.cxx:332
virtual ~PaletteGPL() override
Definition: Palette.cxx:186
OUString maFName
Definition: palettes.hxx:57
virtual bool IsValid() override
Definition: Palette.cxx:213
OUString maGPLPaletteName
Definition: palettes.hxx:59
virtual void LoadColorSet(SvxColorValueSet &rColorSet) override
Definition: Palette.cxx:41
PaletteSOC(const OUString &rFPath, const OUString &rFName)
Definition: Palette.cxx:325
XColorListRef mpColorList
Definition: palettes.hxx:83
OUString maFPath
Definition: palettes.hxx:58
ColorList maColors
Definition: palettes.hxx:37