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, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GTK+ Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
27 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
28 #error "Only <gtk/gtk.h> can be included directly."
31 #ifndef __GTK_DIALOG_H__
32 #define __GTK_DIALOG_H__
35 #include <gtk/gtkwindow.h>
42 * @GTK_DIALOG_MODAL: Make the constructed dialog modal,
43 * see gtk_window_set_modal()
44 * @GTK_DIALOG_DESTROY_WITH_PARENT: Destroy the dialog when its
45 * parent is destroyed, see gtk_window_set_destroy_with_parent()
47 * Flags used to influence dialog construction.
51 GTK_DIALOG_MODAL = 1 << 0,
52 GTK_DIALOG_DESTROY_WITH_PARENT = 1 << 1
57 * @GTK_RESPONSE_NONE: Returned if an action widget has no response id,
58 * or if the dialog gets programmatically hidden or destroyed
59 * @GTK_RESPONSE_REJECT: Generic response id, not used by GTK+ dialogs
60 * @GTK_RESPONSE_ACCEPT: Generic response id, not used by GTK+ dialogs
61 * @GTK_RESPONSE_DELETE_EVENT: Returned if the dialog is deleted
62 * @GTK_RESPONSE_OK: Returned by OK buttons in GTK+ dialogs
63 * @GTK_RESPONSE_CANCEL: Returned by Cancel buttons in GTK+ dialogs
64 * @GTK_RESPONSE_CLOSE: Returned by Close buttons in GTK+ dialogs
65 * @GTK_RESPONSE_YES: Returned by Yes buttons in GTK+ dialogs
66 * @GTK_RESPONSE_NO: Returned by No buttons in GTK+ dialogs
67 * @GTK_RESPONSE_APPLY: Returned by Apply buttons in GTK+ dialogs
68 * @GTK_RESPONSE_HELP: Returned by Help buttons in GTK+ dialogs
70 * Predefined values for use as response ids in gtk_dialog_add_button().
71 * All predefined values are negative, GTK+ leaves positive values for
72 * application-defined response ids.
76 GTK_RESPONSE_NONE = -1,
77 GTK_RESPONSE_REJECT = -2,
78 GTK_RESPONSE_ACCEPT = -3,
79 GTK_RESPONSE_DELETE_EVENT = -4,
81 GTK_RESPONSE_CANCEL = -6,
82 GTK_RESPONSE_CLOSE = -7,
83 GTK_RESPONSE_YES = -8,
85 GTK_RESPONSE_APPLY = -10,
86 GTK_RESPONSE_HELP = -11
90 #define GTK_TYPE_DIALOG (gtk_dialog_get_type ())
91 #define GTK_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_DIALOG, GtkDialog))
92 #define GTK_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_DIALOG, GtkDialogClass))
93 #define GTK_IS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DIALOG))
94 #define GTK_IS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DIALOG))
95 #define GTK_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_DIALOG, GtkDialogClass))
98 typedef struct _GtkDialog GtkDialog;
99 typedef struct _GtkDialogPrivate GtkDialogPrivate;
100 typedef struct _GtkDialogClass GtkDialogClass;
105 * The GtkDialog struct contains only private fields
106 * and should not be directly accessed.
113 GtkDialogPrivate *priv;
116 struct _GtkDialogClass
118 GtkWindowClass parent_class;
120 void (* response) (GtkDialog *dialog, gint response_id);
122 /* Keybinding signals */
124 void (* close) (GtkDialog *dialog);
126 /* Padding for future expansion */
127 void (*_gtk_reserved1) (void);
128 void (*_gtk_reserved2) (void);
129 void (*_gtk_reserved3) (void);
130 void (*_gtk_reserved4) (void);
134 GType gtk_dialog_get_type (void) G_GNUC_CONST;
135 GtkWidget* gtk_dialog_new (void);
137 GtkWidget* gtk_dialog_new_with_buttons (const gchar *title,
139 GtkDialogFlags flags,
140 const gchar *first_button_text,
141 ...) G_GNUC_NULL_TERMINATED;
143 void gtk_dialog_add_action_widget (GtkDialog *dialog,
146 GtkWidget* gtk_dialog_add_button (GtkDialog *dialog,
147 const gchar *button_text,
149 void gtk_dialog_add_buttons (GtkDialog *dialog,
150 const gchar *first_button_text,
151 ...) G_GNUC_NULL_TERMINATED;
153 void gtk_dialog_set_response_sensitive (GtkDialog *dialog,
156 void gtk_dialog_set_default_response (GtkDialog *dialog,
158 GtkWidget* gtk_dialog_get_widget_for_response (GtkDialog *dialog,
160 gint gtk_dialog_get_response_for_widget (GtkDialog *dialog,
163 gboolean gtk_alternative_dialog_button_order (GdkScreen *screen);
164 void gtk_dialog_set_alternative_button_order (GtkDialog *dialog,
165 gint first_response_id,
167 void gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog,
171 /* Emit response signal */
172 void gtk_dialog_response (GtkDialog *dialog,
175 /* Returns response_id */
176 gint gtk_dialog_run (GtkDialog *dialog);
178 GtkWidget * gtk_dialog_get_action_area (GtkDialog *dialog);
179 GtkWidget * gtk_dialog_get_content_area (GtkDialog *dialog);
183 #endif /* __GTK_DIALOG_H__ */