1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
19 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
20 * file for a list of people on the GTK+ Team. See the ChangeLog
21 * files for a list of changes. These files are distributed with
22 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25 #ifndef __GTK_DIALOG_H__
26 #define __GTK_DIALOG_H__
29 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
30 #error "Only <gtk/gtk.h> can be included directly."
33 #include <gtk/gtkwindow.h>
40 * @GTK_DIALOG_MODAL: Make the constructed dialog modal,
41 * see gtk_window_set_modal()
42 * @GTK_DIALOG_DESTROY_WITH_PARENT: Destroy the dialog when its
43 * parent is destroyed, see gtk_window_set_destroy_with_parent()
45 * Flags used to influence dialog construction.
49 GTK_DIALOG_MODAL = 1 << 0,
50 GTK_DIALOG_DESTROY_WITH_PARENT = 1 << 1
55 * @GTK_RESPONSE_NONE: Returned if an action widget has no response id,
56 * or if the dialog gets programmatically hidden or destroyed
57 * @GTK_RESPONSE_REJECT: Generic response id, not used by GTK+ dialogs
58 * @GTK_RESPONSE_ACCEPT: Generic response id, not used by GTK+ dialogs
59 * @GTK_RESPONSE_DELETE_EVENT: Returned if the dialog is deleted
60 * @GTK_RESPONSE_OK: Returned by OK buttons in GTK+ dialogs
61 * @GTK_RESPONSE_CANCEL: Returned by Cancel buttons in GTK+ dialogs
62 * @GTK_RESPONSE_CLOSE: Returned by Close buttons in GTK+ dialogs
63 * @GTK_RESPONSE_YES: Returned by Yes buttons in GTK+ dialogs
64 * @GTK_RESPONSE_NO: Returned by No buttons in GTK+ dialogs
65 * @GTK_RESPONSE_APPLY: Returned by Apply buttons in GTK+ dialogs
66 * @GTK_RESPONSE_HELP: Returned by Help buttons in GTK+ dialogs
68 * Predefined values for use as response ids in gtk_dialog_add_button().
69 * All predefined values are negative, GTK+ leaves positive values for
70 * application-defined response ids.
74 GTK_RESPONSE_NONE = -1,
75 GTK_RESPONSE_REJECT = -2,
76 GTK_RESPONSE_ACCEPT = -3,
77 GTK_RESPONSE_DELETE_EVENT = -4,
79 GTK_RESPONSE_CANCEL = -6,
80 GTK_RESPONSE_CLOSE = -7,
81 GTK_RESPONSE_YES = -8,
83 GTK_RESPONSE_APPLY = -10,
84 GTK_RESPONSE_HELP = -11
88 #define GTK_TYPE_DIALOG (gtk_dialog_get_type ())
89 #define GTK_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_DIALOG, GtkDialog))
90 #define GTK_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_DIALOG, GtkDialogClass))
91 #define GTK_IS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DIALOG))
92 #define GTK_IS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DIALOG))
93 #define GTK_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_DIALOG, GtkDialogClass))
96 typedef struct _GtkDialog GtkDialog;
97 typedef struct _GtkDialogPrivate GtkDialogPrivate;
98 typedef struct _GtkDialogClass GtkDialogClass;
103 * The GtkDialog struct contains only private fields
104 * and should not be directly accessed.
111 GtkDialogPrivate *priv;
114 struct _GtkDialogClass
116 GtkWindowClass parent_class;
118 void (* response) (GtkDialog *dialog, gint response_id);
120 /* Keybinding signals */
122 void (* close) (GtkDialog *dialog);
124 /* Padding for future expansion */
125 void (*_gtk_reserved1) (void);
126 void (*_gtk_reserved2) (void);
127 void (*_gtk_reserved3) (void);
128 void (*_gtk_reserved4) (void);
132 GType gtk_dialog_get_type (void) G_GNUC_CONST;
133 GtkWidget* gtk_dialog_new (void);
135 GtkWidget* gtk_dialog_new_with_buttons (const gchar *title,
137 GtkDialogFlags flags,
138 const gchar *first_button_text,
139 ...) G_GNUC_NULL_TERMINATED;
141 void gtk_dialog_add_action_widget (GtkDialog *dialog,
144 GtkWidget* gtk_dialog_add_button (GtkDialog *dialog,
145 const gchar *button_text,
147 void gtk_dialog_add_buttons (GtkDialog *dialog,
148 const gchar *first_button_text,
149 ...) G_GNUC_NULL_TERMINATED;
151 void gtk_dialog_set_response_sensitive (GtkDialog *dialog,
154 void gtk_dialog_set_default_response (GtkDialog *dialog,
156 GtkWidget* gtk_dialog_get_widget_for_response (GtkDialog *dialog,
158 gint gtk_dialog_get_response_for_widget (GtkDialog *dialog,
161 gboolean gtk_alternative_dialog_button_order (GdkScreen *screen);
162 void gtk_dialog_set_alternative_button_order (GtkDialog *dialog,
163 gint first_response_id,
165 void gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog,
169 /* Emit response signal */
170 void gtk_dialog_response (GtkDialog *dialog,
173 /* Returns response_id */
174 gint gtk_dialog_run (GtkDialog *dialog);
176 GtkWidget * gtk_dialog_get_action_area (GtkDialog *dialog);
177 GtkWidget * gtk_dialog_get_content_area (GtkDialog *dialog);
181 #endif /* __GTK_DIALOG_H__ */