Debian Codegraph @

gtk/gtkmm/targetentry.h

raw symbols SCIP
1 #ifndef _GTKMM_TARGETENTRY_H
2 #define _GTKMM_TARGETENTRY_H
3 /* targetentry.h
4 *
5 * Copyright (C) 2002 The gtkmm Development Team
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
19 */
20
21 #include <glibmm/utility.h>
22 #include <glibmm/ustring.h>
23 #include <gtkmm/enums.h>
24 #include <gtk/gtk.h> //For GtkTargetEntry.
25
26 #ifndef DOXYGEN_SHOULD_SKIP_THIS
27 extern "C"
28 {
29 typedef struct _GtkTargetEntry GtkTargetEntry;
30 }
31 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
32
33 namespace Gtk
34 {
35
36 class GTKMM_API TargetEntry
37 {
38 public:
39 TargetEntry();
40 explicit TargetEntry(const Glib::ustring& target, Gtk::TargetFlags flags = Gtk::TargetFlags(0), guint info = 0);
41 explicit TargetEntry(const GtkTargetEntry& gobject);
42 TargetEntry(const TargetEntry& src);
43 virtual ~TargetEntry() noexcept;
44
45 TargetEntry& operator=(const TargetEntry& src);
46
47 Glib::ustring get_target() const;
48 void set_target(const Glib::ustring& target);
49
50 Gtk::TargetFlags get_flags() const;
51 void set_flags(Gtk::TargetFlags flags);
52
53 guint get_info() const;
54 void set_info(guint info);
55
56 //Use this when you have to use an array of GdkTargetEntrys
57 //This TargetEntry will still own the string memory.
58 GtkTargetEntry* gobj();
59 const GtkTargetEntry* gobj() const;
60
61 protected:
62 GtkTargetEntry gobject_;
63 };
64
65 #ifndef DOXYGEN_SHOULD_SKIP_THIS
66 struct TargetEntryTraits
67 {
68 typedef TargetEntry CppType;
69 typedef GtkTargetEntry CType;
70 typedef GtkTargetEntry CTypeNonConst;
71
72 static const CType& to_c_type(const CppType& item)
73 { return *item.gobj(); }
74
75 static const CType& to_c_type(const CType& item)
76 { return item; }
77
78 static CppType to_cpp_type(const CType& item)
79 { return TargetEntry(item); /* copies string */}
80
81 static void release_c_type(const CType&) {}
82 };
83 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
84
85 } /* namespace Gtk */
86
87 #endif /* _GTKMM_TARGETENTRY_H */