WPSFont.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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 <iostream>
30
31 #include <string>
32
33 #include "libwps_internal.h"
34
36 class WPSFont
37 {
38 public:
40 WPSFont() : m_name(""), m_size(0), m_attributes(0), m_spacing(0), m_color(WPSColor::black()), m_languageId(-1), m_extra("") {}
42 static WPSFont getDefault()
43 {
44 WPSFont res;
45 res.m_name = "Courier";
46 res.m_size = 12;
47 return res;
48 }
50 virtual ~WPSFont() {}
52 friend std::ostream &operator<<(std::ostream &o, WPSFont const &ft);
53
55 void addTo(librevenge::RVNGPropertyList &propList) const;
56
58 bool isSet() const
59 {
60 return !m_name.empty();
61 }
62
64 bool operator==(WPSFont const &ft) const;
66 bool operator!=(WPSFont const &ft) const
67 {
68 return !operator==(ft);
69 }
70
72 librevenge::RVNGString m_name;
74 double m_size;
76 uint32_t m_attributes;
78 double m_spacing;
80 WPSColor m_color;
82 int m_languageId;
83
85 std::string m_extra;
86 };
87
88 #endif
89 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WPSFont::~WPSFont
virtual ~WPSFont()
destructor
Definition: WPSFont.h:50
WPSFont::operator==
bool operator==(WPSFont const &ft) const
operator==
Definition: WPSFont.cpp:69
WPSFont::m_spacing
double m_spacing
font spacing
Definition: WPSFont.h:78
WPSFont::m_extra
std::string m_extra
public field use to add a message when the font is printed
Definition: WPSFont.h:85
WPSFont::operator<<
friend std::ostream & operator<<(std::ostream &o, WPSFont const &ft)
operator<<
Definition: WPSFont.cpp:34
WPSFont
define the font properties
Definition: WPSFont.h:36
WPSFont::isSet
bool isSet() const
accessor
Definition: WPSFont.h:58
libwps_internal.h
WPSFont::m_attributes
uint32_t m_attributes
the font attributes defined as a set of bits
Definition: WPSFont.h:76
WPSFont::m_languageId
int m_languageId
the language (simplified locale name id) if known
Definition: WPSFont.h:82
WPSFont::WPSFont
WPSFont()
constructor
Definition: WPSFont.h:40
WPSFont::getDefault
static WPSFont getDefault()
returns the default font ( Courier 12pt)
Definition: WPSFont.h:42
WPSFont::addTo
void addTo(librevenge::RVNGPropertyList &propList) const
add to the propList
Definition: WPSFont.cpp:81
WPSColor
the class to store a color
Definition: libwps_internal.h:266
WPSFont::m_size
double m_size
font size
Definition: WPSFont.h:74
WPSFont::m_name
librevenge::RVNGString m_name
font name
Definition: WPSFont.h:72
WPSFont::m_color
WPSColor m_color
the font color
Definition: WPSFont.h:80
WPSFont::operator!=
bool operator!=(WPSFont const &ft) const
operator!=
Definition: WPSFont.h:66