WPSFont.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /* libwps
00003  * Version: MPL 2.0 / LGPLv2.1+
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * Major Contributor(s):
00010  * Copyright (C) 2009, 2011 Alonso Laurent (alonso@loria.fr)
00011  * Copyright (C) 2006, 2007 Andrew Ziem
00012  * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
00013  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
00014  * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
00015  *
00016  * For minor contributions see the git repository.
00017  *
00018  * Alternatively, the contents of this file may be used under the terms
00019  * of the GNU Lesser General Public License Version 2.1 or later
00020  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
00021  * applicable instead of those above.
00022  *
00023  * For further information visit http://libwps.sourceforge.net
00024  */
00025 
00026 #ifndef WPS_FONT
00027 #  define WPS_FONT
00028 
00029 #include <assert.h>
00030 #include <iostream>
00031 
00032 #include <string>
00033 
00034 #include "libwps_internal.h"
00035 
00037 class WPSFont
00038 {
00039 public:
00041         WPSFont() : m_name(""), m_size(0), m_attributes(0), m_color(0), m_languageId(-1), m_extra("") {}
00043         static WPSFont getDefault()
00044         {
00045                 WPSFont res;
00046                 res.m_name = "Courier";
00047                 res.m_size = 12;
00048                 return res;
00049         }
00051         virtual ~WPSFont() {}
00053         friend std::ostream &operator<<(std::ostream &o, WPSFont const &ft);
00054 
00056         void addTo(librevenge::RVNGPropertyList &propList) const;
00057 
00059         bool isSet() const
00060         {
00061                 return !m_name.empty();
00062         }
00063 
00065         bool operator==(WPSFont const &ft) const;
00067         bool operator!=(WPSFont const &ft) const
00068         {
00069                 return !operator==(ft);
00070         }
00071 
00073         std::string m_name;
00075         double m_size;
00077         uint32_t m_attributes;
00079         uint32_t m_color;
00081         int m_languageId;
00082 
00084         std::string m_extra;
00085 };
00086 
00087 #endif
00088 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */