summaryrefslogtreecommitdiff
path: root/poppler-glib/src/fonts_iter.hg
blob: 7ca44e4a84d18cfee192ee4052300dd1d7da5738 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* Copyright (c) 2010  Glenn Rice <glennricster@gmail.com>
 *
 * This file is part of poppler-glibmm.
 *
 * poppler-glibmm is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 2.1 of the License,
 * or (at your option) any later version.
 *
 * poppler-glibmm is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

_DEFS(poppler-glibmm,poppler-glib)
_CC_INCLUDE(poppler.h)

namespace Poppler
{

_WRAP_ENUM(FontType, PopplerFontType)

/** Poppler::FontsIter is used to iterate through the fonts found in a document
 */
class FontsIter
{
  _CLASS_BOXEDTYPE(FontsIter, PopplerFontsIter, NONE, poppler_fonts_iter_copy, poppler_fonts_iter_free)
  _IGNORE(poppler_fonts_iter_copy, poppler_fonts_iter_free)

  public:
    _WRAP_METHOD(Glib::ustring get_name() const, poppler_fonts_iter_get_name)
    _WRAP_METHOD(Glib::ustring get_full_name() const, poppler_fonts_iter_get_full_name)
    _WRAP_METHOD(FontType get_font_type() const, poppler_fonts_iter_get_font_type)
    _WRAP_METHOD(Glib::ustring get_file_name() const, poppler_fonts_iter_get_file_name)
    _WRAP_METHOD(bool is_embedded() const, poppler_fonts_iter_is_embedded)
    _WRAP_METHOD(bool is_subset() const, poppler_fonts_iter_is_subset)
    _WRAP_METHOD(bool next() const, poppler_fonts_iter_next)
    _WRAP_METHOD(Glib::ustring get_substitute_name() const, poppler_fonts_iter_get_substitute_name)
    _WRAP_METHOD(Glib::ustring get_encoding() const, poppler_fonts_iter_get_encoding)

    /** This typedef is just to make it more obvious that
     * our operator const void* should be used like operator bool().
     */
    typedef const void* BoolExpr;

    /** Tests whether the FonstIter is valid.
     * For instance,
     * @code
     * if (fonts_iter) do_something()
     * @endcode
     */
    inline operator BoolExpr() const { return gobj() ? GINT_TO_POINTER(1) : 0; }
};

} // namespace Poppler