diff options
author | Krisztian Pinter <pin.terminator@gmail.com> | 2014-07-25 16:45:13 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2014-09-17 10:19:41 +0200 |
commit | cfdefe488fedbd12f7a3daf578c889ef82e962fc (patch) | |
tree | 49b10153c14dac54448d89e39f585e10e2596585 /include | |
parent | d1d5c9185f9d5231bdaa332d965b31b946411ac3 (diff) |
Add loading .soc palettes
Change-Id: Ie0d084a70d9b135658840bb7529f2099a702d280
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/Palette.hxx | 44 | ||||
-rw-r--r-- | include/svx/PaletteManager.hxx | 4 | ||||
-rw-r--r-- | include/svx/SvxColorValueSet.hxx | 2 |
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); }; |