WPSFont.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwps
3  * Version: MPL 2.0 / LGPLv2.1+
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * Major Contributor(s):
10  * Copyright (C) 2009, 2011 Alonso Laurent (alonso@loria.fr)
11  * Copyright (C) 2006, 2007 Andrew Ziem
12  * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
13  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
14  * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
15  *
16  * For minor contributions see the git repository.
17  *
18  * Alternatively, the contents of this file may be used under the terms
19  * of the GNU Lesser General Public License Version 2.1 or later
20  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
21  * applicable instead of those above.
22  *
23  * For further information visit http://libwps.sourceforge.net
24  */
25 
26 #ifndef WPS_FONT
27 # define WPS_FONT
28 
29 #include <assert.h>
30 #include <iostream>
31 
32 #include <string>
33 
34 #include "libwps_internal.h"
35 
37 class WPSFont
38 {
39 public:
41  WPSFont() : m_name(""), m_size(0), m_attributes(0), m_color(0), m_languageId(-1), m_extra("") {}
44  {
45  WPSFont res;
46  res.m_name = "Courier";
47  res.m_size = 12;
48  return res;
49  }
51  virtual ~WPSFont() {}
53  friend std::ostream &operator<<(std::ostream &o, WPSFont const &ft);
54 
56  void addTo(librevenge::RVNGPropertyList &propList) const;
57 
59  bool isSet() const
60  {
61  return !m_name.empty();
62  }
63 
65  bool operator==(WPSFont const &ft) const;
67  bool operator!=(WPSFont const &ft) const
68  {
69  return !operator==(ft);
70  }
71 
73  std::string m_name;
75  double m_size;
77  uint32_t m_attributes;
79  uint32_t m_color;
82 
84  std::string m_extra;
85 };
86 
87 #endif
88 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
virtual ~WPSFont()
destructor
Definition: WPSFont.h:51
bool operator==(WPSFont const &ft) const
operator==
Definition: WPSFont.cpp:64
std::string m_extra
public field use to add a message when the font is printed
Definition: WPSFont.h:84
friend std::ostream & operator<<(std::ostream &o, WPSFont const &ft)
operator&lt;&lt;
Definition: WPSFont.cpp:33
define the font properties
Definition: WPSFont.h:37
uint32_t m_color
the font color
Definition: WPSFont.h:79
bool isSet() const
accessor
Definition: WPSFont.h:59
uint32_t m_attributes
the font attributes defined as a set of bits
Definition: WPSFont.h:77
int m_languageId
the language (simplified locale name id) if known
Definition: WPSFont.h:81
WPSFont()
constructor
Definition: WPSFont.h:41
static WPSFont getDefault()
returns the default font ( Courier 12pt)
Definition: WPSFont.h:43
std::string m_name
font name
Definition: WPSFont.h:73
void addTo(librevenge::RVNGPropertyList &propList) const
add to the propList
Definition: WPSFont.cpp:75
double m_size
font size
Definition: WPSFont.h:75
bool operator!=(WPSFont const &ft) const
operator!=
Definition: WPSFont.h:67

Generated on Mon Nov 23 2015 07:09:19 for libwps by doxygen 1.8.5