1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gtk.EmojiChooser;
26 
27 private import glib.ConstructionException;
28 private import glib.Str;
29 private import gobject.ObjectG;
30 private import gobject.Signals;
31 private import gtk.Popover;
32 private import gtk.Widget;
33 private import gtk.c.functions;
34 public  import gtk.c.types;
35 private import std.algorithm;
36 
37 
38 /**
39  * The `GtkEmojiChooser` is used by text widgets such as `GtkEntry` or
40  * `GtkTextView` to let users insert Emoji characters.
41  * 
42  * ![An example GtkEmojiChooser](emojichooser.png)
43  * 
44  * `GtkEmojiChooser` emits the [signal@Gtk.EmojiChooser::emoji-picked]
45  * signal when an Emoji is selected.
46  * 
47  * # CSS nodes
48  * 
49  * ```
50  * popover
51  * ├── box.emoji-searchbar
52  * │   ╰── entry.search
53  * ╰── box.emoji-toolbar
54  * ├── button.image-button.emoji-section
55  * ├── ...
56  * ╰── button.image-button.emoji-section
57  * ```
58  * 
59  * Every `GtkEmojiChooser` consists of a main node called popover.
60  * The contents of the popover are largely implementation defined
61  * and supposed to inherit general styles.
62  * The top searchbar used to search emoji and gets the .emoji-searchbar
63  * style class itself.
64  * The bottom toolbar used to switch between different emoji categories
65  * consists of buttons with the .emoji-section style class and gets the
66  * .emoji-toolbar style class itself.
67  */
68 public class EmojiChooser : Popover
69 {
70 	/** the main Gtk struct */
71 	protected GtkEmojiChooser* gtkEmojiChooser;
72 
73 	/** Get the main Gtk struct */
74 	public GtkEmojiChooser* getEmojiChooserStruct(bool transferOwnership = false)
75 	{
76 		if (transferOwnership)
77 			ownedRef = false;
78 		return gtkEmojiChooser;
79 	}
80 
81 	/** the main Gtk struct as a void* */
82 	protected override void* getStruct()
83 	{
84 		return cast(void*)gtkEmojiChooser;
85 	}
86 
87 	/**
88 	 * Sets our main struct and passes it to the parent class.
89 	 */
90 	public this (GtkEmojiChooser* gtkEmojiChooser, bool ownedRef = false)
91 	{
92 		this.gtkEmojiChooser = gtkEmojiChooser;
93 		super(cast(GtkPopover*)gtkEmojiChooser, ownedRef);
94 	}
95 
96 
97 	/** */
98 	public static GType getType()
99 	{
100 		return gtk_emoji_chooser_get_type();
101 	}
102 
103 	/**
104 	 * Creates a new `GtkEmojiChooser`.
105 	 *
106 	 * Returns: a new `GtkEmojiChooser`
107 	 *
108 	 * Throws: ConstructionException GTK+ fails to create the object.
109 	 */
110 	public this()
111 	{
112 		auto __p = gtk_emoji_chooser_new();
113 
114 		if(__p is null)
115 		{
116 			throw new ConstructionException("null returned by new");
117 		}
118 
119 		this(cast(GtkEmojiChooser*) __p);
120 	}
121 
122 	/**
123 	 * Emitted when the user selects an Emoji.
124 	 *
125 	 * Params:
126 	 *     text = the Unicode sequence for the picked Emoji, in UTF-8
127 	 */
128 	gulong addOnEmojiPicked(void delegate(string, EmojiChooser) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
129 	{
130 		return Signals.connect(this, "emoji-picked", dlg, connectFlags ^ ConnectFlags.SWAPPED);
131 	}
132 }