1 // Generated by gmmproc 2.60.0 -- DO NOT MODIFY!
2 #ifndef _GDKMM_PIXBUFFORMAT_H
3 #define _GDKMM_PIXBUFFORMAT_H
4
5
6 #include <glibmm/ustring.h>
7 #include <sigc++/sigc++.h>
8
9 /* Copyright (C) 2002 The gtkmm Development Team
10 *
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
15 *
16 * This library 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 GNU
19 * Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 */
25
26
27 #include <gdkmmconfig.h>
28 #include <glibmm/value.h>
29 #include <vector>
30
31 #ifndef DOXYGEN_SHOULD_SKIP_THIS
32 extern "C" { typedef struct _GdkPixbufFormat GdkPixbufFormat; }
33 #endif
34
35 namespace Gdk
36 {
37
38 class PixbufFormat
39 {
40 public:
41 #ifndef DOXYGEN_SHOULD_SKIP_THIS
42 using CppObjectType = PixbufFormat;
43 using BaseObjectType = GdkPixbufFormat;
44 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
45
46 /** Get the GType for this class, for use with the underlying GObject type system.
47 */
48 static GType get_type() G_GNUC_CONST;
49
50
51 explicit PixbufFormat(GdkPixbufFormat* gobject, bool make_a_copy = true);
52
53 PixbufFormat(const PixbufFormat& other);
54 PixbufFormat& operator=(const PixbufFormat& other);
55
56 PixbufFormat(PixbufFormat&& other) noexcept;
57 PixbufFormat& operator=(PixbufFormat&& other) noexcept;
58
59 ~PixbufFormat() noexcept;
60
61 void swap(PixbufFormat& other) noexcept;
62
63 ///Provides access to the underlying C instance.
gobj()64 GdkPixbufFormat* gobj() { return gobject_; }
65
66 ///Provides access to the underlying C instance.
gobj()67 const GdkPixbufFormat* gobj() const { return gobject_; }
68
69 ///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
70 GdkPixbufFormat* gobj_copy() const;
71
72 protected:
73 GdkPixbufFormat* gobject_;
74
75 private:
76
77
78 public:
79
80 PixbufFormat();
81
82
83 /** Returns the name of the format.
84 *
85 * @newin{2,2}
86 *
87 * @return The name of the format.
88 */
89 Glib::ustring get_name() const;
90
91 /** Returns a description of the format.
92 *
93 * @newin{2,2}
94 *
95 * @return A description of the format.
96 */
97 Glib::ustring get_description() const;
98
99
100 /** Returns the mime types supported by the format.
101 *
102 * @newin{2,2}
103 *
104 * @return A <tt>nullptr</tt>-terminated array of mime types which must be freed with
105 * Glib::strfreev() when it is no longer needed.
106 */
107 std::vector<Glib::ustring> get_mime_types() const;
108
109 /** Returns the filename extensions typically used for files in the
110 * given format.
111 *
112 * @newin{2,2}
113 *
114 * @return A <tt>nullptr</tt>-terminated array of filename extensions which must be
115 * freed with Glib::strfreev() when it is no longer needed.
116 */
117 std::vector<Glib::ustring> get_extensions() const;
118
119 /** Returns <tt>true</tt> if the save option specified by @a option_key is supported when
120 * saving a pixbuf using the module implementing @a format.
121 * See save() for more information about option keys.
122 *
123 * @newin{2,36}
124 *
125 * @param option_key The name of an option.
126 * @return <tt>true</tt> if the specified option is supported.
127 */
128 bool is_save_option_supported(const Glib::ustring& option_key) const;
129
130 /** Returns whether pixbufs can be saved in the given format.
131 *
132 * @newin{2,2}
133 *
134 * @return Whether pixbufs can be saved in the given format.
135 */
136 bool is_writable() const;
137
138
139 /** Returns whether this image format is scalable. If a file is in a
140 * scalable format, it is preferable to load it at the desired size,
141 * rather than loading it at the default size and scaling the
142 * resulting pixbuf to the desired size.
143 *
144 * @newin{2,6}
145 *
146 * @return Whether this image format is scalable.
147 */
148 bool is_scalable() const;
149
150 /** Returns whether this image format is disabled. See
151 * set_disabled().
152 *
153 * @newin{2,6}
154 *
155 * @return Whether this image format is disabled.
156 */
157 bool is_disabled() const;
158
159 /** Disables or enables an image format. If a format is disabled,
160 * gdk-pixbuf won't use the image loader for this format to load
161 * images. Applications can use this to avoid using image loaders
162 * with an inappropriate license, see get_license().
163 *
164 * @newin{2,6}
165 *
166 * @param disabled <tt>true</tt> to disable the format @a format.
167 */
168 void set_disabled(bool disabled = true);
169
170 /** Returns information about the license of the image loader for the format. The
171 * returned string should be a shorthand for a wellknown license, e.g. "LGPL",
172 * "GPL", "QPL", "GPL/QPL", or "other" to indicate some other license.
173 *
174 * @newin{2,6}
175 *
176 * @return A string describing the license of @a format.
177 */
178 Glib::ustring get_license() const;
179
180
181 };
182
183 #ifndef DOXYGEN_SHOULD_SKIP_THIS
184 struct PixbufFormatTraits
185 {
186 typedef PixbufFormat CppType;
187 typedef const GdkPixbufFormat* CType;
188 typedef GdkPixbufFormat* CTypeNonConst;
189
to_c_typePixbufFormatTraits190 static CType to_c_type (const CppType& obj) { return obj.gobj(); }
to_c_typePixbufFormatTraits191 static CType to_c_type (CType ptr) { return ptr; }
to_cpp_typePixbufFormatTraits192 static CppType to_cpp_type (CType ptr) { return PixbufFormat(const_cast<GdkPixbufFormat*>(ptr), true); }
release_c_typePixbufFormatTraits193 static void release_c_type (CType /* ptr */) { /* Doesn't happen */ }
194 };
195 #endif //DOXYGEN_SHOULD_SKIP_THIS
196
197 } // namespace Gdk
198
199
200 namespace Gdk
201 {
202
203 /** @relates Gdk::PixbufFormat
204 * @param lhs The left-hand side
205 * @param rhs The right-hand side
206 */
swap(PixbufFormat & lhs,PixbufFormat & rhs)207 inline void swap(PixbufFormat& lhs, PixbufFormat& rhs) noexcept
208 { lhs.swap(rhs); }
209
210 } // namespace Gdk
211
212 namespace Glib
213 {
214
215 /** A Glib::wrap() method for this object.
216 *
217 * @param object The C instance.
218 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
219 * @result A C++ instance that wraps this C instance.
220 *
221 * @relates Gdk::PixbufFormat
222 */
223 Gdk::PixbufFormat wrap(GdkPixbufFormat* object, bool take_copy = false);
224
225 #ifndef DOXYGEN_SHOULD_SKIP_THIS
226 template <>
227 class Value<Gdk::PixbufFormat> : public Glib::Value_Boxed<Gdk::PixbufFormat>
228 {};
229 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
230
231 } // namespace Glib
232
233
234 #endif /* _GDKMM_PIXBUFFORMAT_H */
235
236