VSDXTheme.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* libvisio
00003  * Version: MPL 1.1 / GPLv2+ / LGPLv2+
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License or as specified alternatively below. You may obtain a copy of
00008  * the License at http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * Major Contributor(s):
00016  * Copyright (C) 2013 Fridrich Strba <fridrich.strba@bluewin.ch>
00017  *
00018  *
00019  * All Rights Reserved.
00020  *
00021  * For minor contributions see the git repository.
00022  *
00023  * Alternatively, the contents of this file may be used under the terms of
00024  * either the GNU General Public License Version 2 or later (the "GPLv2+"), or
00025  * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
00026  * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable
00027  * instead of those above.
00028  */
00029 
00030 #ifndef __VSDXTHEME_H__
00031 #define __VSDXTHEME_H__
00032 
00033 #include <vector>
00034 #include <boost/optional.hpp>
00035 #include <libwpd-stream/libwpd-stream.h>
00036 #include "VSDXMLHelper.h"
00037 
00038 namespace libvisio
00039 {
00040 
00041 class VSDCollector;
00042 
00043 struct VSDXVariationClrScheme
00044 {
00045   Colour m_varColor1;
00046   Colour m_varColor2;
00047   Colour m_varColor3;
00048   Colour m_varColor4;
00049   Colour m_varColor5;
00050   Colour m_varColor6;
00051   Colour m_varColor7;
00052 };
00053 
00054 struct VSDXClrScheme
00055 {
00056   Colour m_dk1;
00057   Colour m_lt1;
00058   Colour m_dk2;
00059   Colour m_lt2;
00060   Colour m_accent1;
00061   Colour m_accent2;
00062   Colour m_accent3;
00063   Colour m_accent4;
00064   Colour m_accent5;
00065   Colour m_accent6;
00066   Colour m_hlink;
00067   Colour m_folHlink;
00068   std::vector<VSDXVariationClrScheme> m_variationClrSchemeLst;
00069 };
00070 
00071 class VSDXTheme
00072 {
00073 public:
00074   VSDXTheme();
00075   ~VSDXTheme();
00076   bool parse(WPXInputStream *input);
00077 
00078 private:
00079   VSDXTheme(const VSDXTheme &);
00080   VSDXTheme &operator=(const VSDXTheme &);
00081 
00082   boost::optional<Colour> readSrgbClr(xmlTextReaderPtr reader);
00083   boost::optional<Colour> readSysClr(xmlTextReaderPtr reader);
00084 
00085   void readClrScheme(xmlTextReaderPtr reader);
00086   void readThemeColour(xmlTextReaderPtr reader, int idToken, Colour &clr);
00087   void readVariationClrSchemeLst(xmlTextReaderPtr reader);
00088   void readVariationClrScheme(xmlTextReaderPtr reader, VSDXVariationClrScheme &varClrSch);
00089 
00090   int getElementToken(xmlTextReaderPtr reader);
00091 
00092   VSDXClrScheme m_clrScheme;
00093 };
00094 
00095 } // namespace libvisio
00096 
00097 #endif // __VSDXTHEME_H__
00098 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */