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 <iostream>
00030 
00031 #include <string>
00032 
00033 #include "libwps_internal.h"
00034 
00036 class WPSFont
00037 {
00038 public:
00040         WPSFont() : m_name(""), m_size(0), m_attributes(0), m_spacing(0), m_color(WPSColor::black()), m_languageId(-1), m_extra("") {}
00042         static WPSFont getDefault()
00043         {
00044                 WPSFont res;
00045                 res.m_name = "Courier";
00046                 res.m_size = 12;
00047                 return res;
00048         }
00050         virtual ~WPSFont() {}
00052         friend std::ostream &operator<<(std::ostream &o, WPSFont const &ft);
00053 
00055         void addTo(librevenge::RVNGPropertyList &propList) const;
00056 
00058         bool isSet() const
00059         {
00060                 return !m_name.empty();
00061         }
00062 
00064         bool operator==(WPSFont const &ft) const;
00066         bool operator!=(WPSFont const &ft) const
00067         {
00068                 return !operator==(ft);
00069         }
00070 
00072         librevenge::RVNGString m_name;
00074         double m_size;
00076         uint32_t m_attributes;
00078         double m_spacing;
00080         WPSColor m_color;
00082         int m_languageId;
00083 
00085         std::string m_extra;
00086 };
00087 
00088 #endif
00089 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */