00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ 00002 00003 /* AbiSource 00004 * 00005 * Copyright (C) 2007 Philippe Milot <PhilMilot@gmail.com> 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License 00009 * as published by the Free Software Foundation; either version 2 00010 * of the License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00020 * 02110-1301 USA. 00021 */ 00022 00023 #ifndef _OXML_THEME_H_ 00024 #define _OXML_THEME_H_ 00025 00026 // Internal includes 00027 #include <OXML_Types.h> 00028 00029 // External includes 00030 #include <string> 00031 #include <map> 00032 #include <memory> 00033 00034 /* \class OXML_Theme 00035 * \brief This class holds all the information contained in a document's Theme part. 00036 * OXML_Theme keeps mappings of the theme's color names and their hex values, as well 00037 * as mappings between a script name and its associated font face. OXML_FontManager uses 00038 * the latter information to determine which font face is to be used for a particular 00039 * run of text. 00040 */ 00041 class OXML_Theme 00042 { 00043 public: 00044 OXML_Theme(); 00045 00046 inline std::string getColor(OXML_ColorName name) { return m_colorScheme[name]; } 00047 inline void setColor (OXML_ColorName name, std::string val) { m_colorScheme[name] = val; } 00048 00049 std::string getMajorFont(std::string script); 00050 std::string getMinorFont(std::string script); 00051 inline void setMajorFont(std::string script, std::string val) { m_majorFontScheme[script] = val; } 00052 inline void setMinorFont(std::string script, std::string val) { m_minorFontScheme[script] = val; } 00053 00054 private: 00055 std::string m_colorScheme[12]; 00056 typedef std::map<std::string, std::string> OXML_FontScheme; 00057 OXML_FontScheme m_majorFontScheme; 00058 OXML_FontScheme m_minorFontScheme; 00059 }; 00060 00061 typedef std::shared_ptr<OXML_Theme> OXML_SharedTheme; 00062 00063 #endif //_OXML_THEME_H_ 00064