summaryrefslogtreecommitdiff
path: root/include/svx
diff options
context:
space:
mode:
Diffstat (limited to 'include/svx')
-rw-r--r--include/svx/Palette.hxx44
-rw-r--r--include/svx/PaletteManager.hxx4
-rw-r--r--include/svx/SvxColorValueSet.hxx2
3 files changed, 40 insertions, 10 deletions
diff --git a/include/svx/Palette.hxx b/include/svx/Palette.hxx
index d31e9580b792..c659e063e696 100644
--- a/include/svx/Palette.hxx
+++ b/include/svx/Palette.hxx
@@ -19,16 +19,30 @@
#ifndef INCLUDED_SVX_PALETTE_HXX
#define INCLUDED_SVX_PALETTE_HXX
+#include <svx/SvxColorValueSet.hxx>
+#include <svx/xtable.hxx>
#include <rtl/ustring.hxx>
#include <tools/color.hxx>
#include <tools/stream.hxx>
+
+typedef std::pair<Color, OString> NamedColor;
+typedef std::vector< NamedColor > ColorList;
+
+
class Palette
{
public:
- typedef std::pair<Color, OString> NamedColor;
- typedef std::vector< NamedColor > ColorList;
-private:
+ virtual ~Palette();
+
+ virtual const OUString& GetName() = 0;
+ virtual void LoadColorSet( SvxColorValueSet& rColorSet ) = 0;
+
+ virtual bool IsValid() = 0;
+};
+
+class PaletteGPL : public Palette
+{
bool mbLoadedPalette;
bool mbValidPalette;
OUString maFName;
@@ -40,12 +54,28 @@ private:
void LoadPaletteHeader();
void LoadPalette();
public:
- Palette( const OUString &rFPath, const OUString &rFName );
+ PaletteGPL( const OUString &rFPath, const OUString &rFName );
+ virtual ~PaletteGPL();
+
+ virtual const OUString& GetName();
+ virtual void LoadColorSet( SvxColorValueSet& rColorSet );
+
+ virtual bool IsValid();
+};
+
+class PaletteSOC : public Palette
+{
+ //TODO add lazy loading
+ OUString maName;
+ XColorListRef mpColorList;
+public:
+ PaletteSOC( const OUString &rFPath, const OUString &rFName );
+ virtual ~PaletteSOC();
- const OUString& GetName();
- const ColorList& GetPaletteColors();
+ virtual const OUString& GetName();
+ virtual void LoadColorSet( SvxColorValueSet& rColorSet );
- bool IsValid();
+ virtual bool IsValid();
};
#endif // INCLUDED_SVX_PALETTE_HXX
diff --git a/include/svx/PaletteManager.hxx b/include/svx/PaletteManager.hxx
index 925f67bf27c9..1bd0bd1fd39d 100644
--- a/include/svx/PaletteManager.hxx
+++ b/include/svx/PaletteManager.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_SVX_PALETTEMANAGER_HXX
#include <svx/SvxColorValueSet.hxx>
+#include <svx/Palette.hxx>
#include <rtl/ustring.hxx>
#include <svx/tbxcolorupdate.hxx>
@@ -32,9 +33,10 @@ class PaletteManager
svx::ToolboxButtonColorUpdater* mpBtnUpdater;
Color mLastColor;
- std::vector<Palette> maPalettes;
+ std::vector<Palette*> maPalettes;
public:
PaletteManager();
+ ~PaletteManager();
void LoadPalettes();
void ReloadColorSet(SvxColorValueSet& rColorSet);
std::vector<OUString> GetPaletteList();
diff --git a/include/svx/SvxColorValueSet.hxx b/include/svx/SvxColorValueSet.hxx
index 7db9f4c38a6e..a3130ed4a731 100644
--- a/include/svx/SvxColorValueSet.hxx
+++ b/include/svx/SvxColorValueSet.hxx
@@ -19,7 +19,6 @@
#ifndef INCLUDED_SVX_SVXCOLORVALUESET_HXX
#define INCLUDED_SVX_SVXCOLORVALUESET_HXX
-#include <svx/Palette.hxx>
#include <svtools/valueset.hxx>
#include <svx/svxdllapi.h>
@@ -41,7 +40,6 @@ public:
void addEntriesForXColorList(const XColorList& rXColorList, sal_uInt32 nStartIndex = 1);
void loadColorVector(const std::vector<Color>& rColorVector, const OUString& rNamePrefix, sal_uInt32 nStartIndex = 1);
- void loadPalette(Palette& rPalette);
Size layoutAllVisible(sal_uInt32 nEntryCount);
Size layoutToGivenHeight(sal_uInt32 nHeight, sal_uInt32 nEntryCount);
};