Poppler CPP 24.12.0
poppler-global.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2009-2010, Pino Toscano <pino@kde.org>
3 * Copyright (C) 2010, Patrick Spendrin <ps_ml@gmx.de>
4 * Copyright (C) 2014, Hans-Peter Deifel <hpdeifel@gmx.de>
5 * Copyright (C) 2018, Adam Reichold <adam.reichold@t-online.de>
6 * Copyright (C) 2021, 2022, Albert Astals Cid <aacid@kde.org>
7 * Copyright (C) 2022, Tobias C. Berner <tcberner@gmail.com>
8 * Copyright (C) 2022, Oliver Sander <oliver.sander@tu-dresden.de>
9 * Copyright (C) 2024, hugegameartgd@gmail.com
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2, or (at your option)
14 * any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
24 */
25
26#ifndef POPPLER_GLOBAL_H
27#define POPPLER_GLOBAL_H
28
29#include "poppler_cpp_export.h"
30
31#include <ctime>
32#include <iosfwd>
33#include <string>
34#include <vector>
35
36namespace poppler {
37
39namespace detail {
40
41class POPPLER_CPP_EXPORT noncopyable
42{
43public:
44 noncopyable(const noncopyable &) = delete;
45 const noncopyable &operator=(const noncopyable &) = delete;
46
47protected:
48 noncopyable();
49 ~noncopyable() = default;
50 noncopyable &operator=(noncopyable &&other) noexcept;
51};
52
53}
54
55typedef detail::noncopyable noncopyable;
57
65
74
86
88{
89 case_sensitive,
90 case_insensitive
91};
92
93typedef std::vector<char> byte_array;
94
95typedef unsigned int /* time_t */ time_type;
96
97// to disable warning only for this occurrence
98#ifdef _MSC_VER
99# pragma warning(push)
100# pragma warning(disable : 4251) /* class 'A' needs to have dll interface for to be used by clients of class 'B'. */
101#endif
102class POPPLER_CPP_EXPORT ustring : public std::basic_string<char16_t>
103{
104public:
105 ustring();
106 ustring(size_type len, value_type ch);
107 ~ustring();
108
109 byte_array to_utf8() const;
110 std::string to_latin1() const;
111
112 static ustring from_utf8(const char *str, int len = -1);
113 static ustring from_latin1(const std::string &str);
114
115private:
116 // forbid implicit std::string conversions
117 explicit ustring(const std::string &);
118 explicit operator std::string() const;
119 ustring &operator=(const std::string &);
120};
121#ifdef _MSC_VER
122# pragma warning(pop)
123#endif
124
125[[deprecated]] POPPLER_CPP_EXPORT time_type convert_date(const std::string &date);
126
127POPPLER_CPP_EXPORT time_t convert_date_t(const std::string &date);
128
129POPPLER_CPP_EXPORT std::ostream &operator<<(std::ostream &stream, const byte_array &array);
130
131POPPLER_CPP_EXPORT bool set_data_dir(const std::string &new_data_dir);
132
133typedef void (*debug_func)(const std::string &, void *);
134
135POPPLER_CPP_EXPORT void set_debug_error_function(debug_func debug_function, void *closure);
136
137}
138
139#endif
Definition poppler-global.h:103
Single namespace containing all the classes and functions of poppler-cpp.
Definition poppler-destination.h:27
void set_debug_error_function(debug_func debug_function, void *closure)
Set a new debug/error output function.
Definition poppler-global.cpp:400
bool set_data_dir(const std::string &new_data_dir)
Sets a custom data directory for initialization of global parameters.
Definition poppler-global.cpp:373
time_type convert_date(const std::string &date)
Converts a string representing a PDF date to a value compatible with time_type.
Definition poppler-global.cpp:326
page_box_enum
A possible box of a page in a PDF document.
Definition poppler-global.h:67
@ trim_box
The "trim" box.
Definition poppler-global.h:71
@ media_box
The "media" box.
Definition poppler-global.h:68
@ crop_box
The "crop" box.
Definition poppler-global.h:69
@ art_box
The "art" box.
Definition poppler-global.h:72
@ bleed_box
The "bleed" box.
Definition poppler-global.h:70
time_t convert_date_t(const std::string &date)
Converts a string representing a PDF date to a value compatible with time_t.
Definition poppler-global.cpp:335
void(* debug_func)(const std::string &, void *)
Debug/error function.
Definition poppler-global.h:133
permission_enum
A possible permission in a PDF document.
Definition poppler-global.h:76
@ perm_assemble
The permission to allow to "assemble" a document.
Definition poppler-global.h:83
@ perm_add_notes
The permission to allow the addition or editing of annotations, and the filling of interactive form f...
Definition poppler-global.h:80
@ perm_print_high_resolution
The permission to allow the high resolution print of a document.
Definition poppler-global.h:84
@ perm_copy
The permission to allow the copy or extraction of the text in a document.
Definition poppler-global.h:79
@ perm_fill_forms
The permission to allow the filling of interactive form fields (including signature fields).
Definition poppler-global.h:81
@ perm_accessibility
The permission to allow the extracting of content (for example, text) for accessibility usage (e....
Definition poppler-global.h:82
@ perm_print
The permission to allow the print of a document.
Definition poppler-global.h:77
@ perm_change
The permission to change a document.
Definition poppler-global.h:78
case_sensitivity_enum
The case sensitivity.
Definition poppler-global.h:88
rotation_enum
The case sensitivity.
Definition poppler-global.h:59
@ rotate_90
A rotation of 90 degrees clockwise.
Definition poppler-global.h:61
@ rotate_0
A rotation of 0 degrees clockwise.
Definition poppler-global.h:60
@ rotate_180
A rotation of 180 degrees clockwise.
Definition poppler-global.h:62
@ rotate_270
A rotation of 270 degrees clockwise.
Definition poppler-global.h:63