/usr/include/gtkmm-3.0/gtkmm/dialog.h is in libgtkmm-3.0-dev 3.10.1-0ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 | // -*- c++ -*-
// Generated by gmmproc 2.38.0 -- DO NOT MODIFY!
#ifndef _GTKMM_DIALOG_H
#define _GTKMM_DIALOG_H
#include <glibmm/ustring.h>
#include <sigc++/sigc++.h>
/*
* Copyright (C) 1998-2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <vector>
#include <gtkmm/window.h>
#include <gtkmm/box.h>
#include <gtkmm/button.h>
#include <gtkmm/buttonbox.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GtkDialog GtkDialog;
typedef struct _GtkDialogClass GtkDialogClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gtk
{ class Dialog_Class; } // namespace Gtk
namespace Gtk
{
/** @defgroup Dialogs Dialogs
*/
/** @addtogroup gtkmmEnums gtkmm Enums and Flags */
/**
* @var ResponseType RESPONSE_NONE
* Returned if an action widget has no response id,or if the dialog gets programmatically hidden or destroyed.
*
* @var ResponseType RESPONSE_REJECT
* Generic response id, not used by GTK+ dialogs.
*
* @var ResponseType RESPONSE_ACCEPT
* Generic response id, not used by GTK+ dialogs.
*
* @var ResponseType RESPONSE_DELETE_EVENT
* Returned if the dialog is deleted.
*
* @var ResponseType RESPONSE_OK
* Returned by OK buttons in GTK+ dialogs.
*
* @var ResponseType RESPONSE_CANCEL
* Returned by Cancel buttons in GTK+ dialogs.
*
* @var ResponseType RESPONSE_CLOSE
* Returned by Close buttons in GTK+ dialogs.
*
* @var ResponseType RESPONSE_YES
* Returned by Yes buttons in GTK+ dialogs.
*
* @var ResponseType RESPONSE_NO
* Returned by No buttons in GTK+ dialogs.
*
* @var ResponseType RESPONSE_APPLY
* Returned by Apply buttons in GTK+ dialogs.
*
* @var ResponseType RESPONSE_HELP
* Returned by Help buttons in GTK+ dialogs.
*
* @enum ResponseType
*
* Predefined values for use as response ids in Gtk::Dialog::add_button().
* All predefined values are negative, GTK+ leaves positive values for
* application-defined response ids.
* @ingroup gtkmmEnums
*/
enum ResponseType
{
RESPONSE_NONE = -1,
RESPONSE_REJECT = -2,
RESPONSE_ACCEPT = -3,
RESPONSE_DELETE_EVENT = -4,
RESPONSE_OK = -5,
RESPONSE_CANCEL = -6,
RESPONSE_CLOSE = -7,
RESPONSE_YES = -8,
RESPONSE_NO = -9,
RESPONSE_APPLY = -10,
RESPONSE_HELP = -11
};
} // namespace Gtk
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{
template <>
class Value<Gtk::ResponseType> : public Glib::Value_Enum<Gtk::ResponseType>
{
public:
static GType value_type() G_GNUC_CONST;
};
} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gtk
{
/** Create popup windows.
*
* Dialog boxes are a convenient way to prompt the user for a small amount
* of input, eg. to display a message, ask a question, or anything else that
* does not require extensive effort on the user's part.
*
* gtkmm treats a dialog as a window split vertically. The top section is a
* vertical Gtk::Box, and is where widgets such as a Gtk::Label or a Gtk::Entry should be
* packed. The bottom area is known as the action_area. This is generally
* used for packing buttons into the dialog which may perform functions such
* as cancel, ok, or apply.
*
* The dialog can be 'modal' (that is, one which freezes the rest of the
* application from user input) - this can be specified in the Gtk::Dialog
* constructor.
*
* When adding buttons using add_button(), clicking the button will emit
* signal_response() with a "response id" you specified. You are encouraged
* to use the Gtk::ResponseType enum. If a dialog receives a delete event,
* the "response" signal will be emitted with a response id of
* Gtk::RESPONSE_NONE.
*
* If you want to block waiting for a dialog to return before returning control
* flow to your code, you can call run(). This function enters a
* recursive main loop and waits for the user to respond to the dialog, returning
* the response ID corresponding to the button the user clicked.
*
* @ingroup Dialogs
*/
class Dialog : public Window
{
public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef Dialog CppObjectType;
typedef Dialog_Class CppClassType;
typedef GtkDialog BaseObjectType;
typedef GtkDialogClass BaseClassType;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
virtual ~Dialog();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
private:
friend class Dialog_Class;
static CppClassType dialog_class_;
// noncopyable
Dialog(const Dialog&);
Dialog& operator=(const Dialog&);
protected:
explicit Dialog(const Glib::ConstructParams& construct_params);
explicit Dialog(GtkDialog* castitem);
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
public:
/** Get the GType for this class, for use with the underlying GObject type system.
*/
static GType get_type() G_GNUC_CONST;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
static GType get_base_type() G_GNUC_CONST;
#endif
///Provides access to the underlying C GtkObject.
GtkDialog* gobj() { return reinterpret_cast<GtkDialog*>(gobject_); }
///Provides access to the underlying C GtkObject.
const GtkDialog* gobj() const { return reinterpret_cast<GtkDialog*>(gobject_); }
public:
//C++ methods used to invoke GTK+ virtual functions:
protected:
//GTK+ Virtual Functions (override these to change behaviour):
//Default Signal Handlers::
/// This is a default handler for the signal signal_response().
virtual void on_response(int response_id);
private:
public:
Dialog();
explicit Dialog(const Glib::ustring& title, bool modal = false);
Dialog(const Glib::ustring& title, Gtk::Window& parent, bool modal = false);
/** Adds an activatable widget to the action area of a Gtk::Dialog,
* connecting a signal handler that will emit the Gtk::Dialog::signal_response()
* signal on the dialog when the widget is activated. The widget is
* appended to the end of the dialog's action area. If you want to add a
* non-activatable widget, simply pack it into the @a action_area field
* of the Gtk::Dialog struct.
* @param child An activatable widget.
* @param response_id Response ID for @a child.
*/
void add_action_widget(Widget& child, int response_id);
/** Adds a button with the given text and sets things up so that
* clicking the button will emit the Gtk::Dialog::signal_response() signal with
* the given @a response_id. The button is appended to the end of the
* dialog's action area. The button widget is returned, but usually
* you don't need it.
* @param button_text Text of button.
* @param response_id Response ID for the button.
* @return The Gtk::Button widget that was added.
*/
Button* add_button(const Glib::ustring& button_text, int response_id);
#ifndef GTKMM_DISABLE_DEPRECATED
/** Adds a button with the given text and sets things up so that
* clicking the button will emit the Gtk::Dialog::signal_response() signal with
* the given @a response_id. The button is appended to the end of the
* dialog's action area. The button widget is returned, but usually
* you don't need it.
* @deprecated Use the add_button() that takes a Glib::ustring instead.
* @param button_text Text of button.
* @param response_id Response ID for the button.
* @return The Gtk::Button widget that was added.
*/
Button* add_button(const Gtk::StockID& stock_id, int response_id);
#endif // GTKMM_DISABLE_DEPRECATED
/** Calls <tt>gtk_widget_set_sensitive (widget, @a setting)</tt>
* for each widget in the dialog's action area with the given @a response_id.
* A convenient way to sensitize/desensitize dialog buttons.
* @param response_id A response ID.
* @param setting <tt>true</tt> for sensitive.
*/
void set_response_sensitive(int response_id, bool setting = true);
/** Sets the last widget in the dialog's action area with the given @a response_id
* as the default widget for the dialog. Pressing "Enter" normally activates
* the default widget.
* @param response_id A response ID.
*/
void set_default_response(int response_id);
/** Gets the widget button that uses the given response ID in the action area
* of a dialog.
*
* @newin{2,20}
* @param response_id The response ID used by the @a dialog widget.
* @return The @a widget button that uses the given
* @a response_id, or <tt>0</tt>.
*/
Widget* get_widget_for_response(int response_id);
/** Gets the widget button that uses the given response ID in the action area
* of a dialog.
*
* @newin{2,20}
* @param response_id The response ID used by the @a dialog widget.
* @return The @a widget button that uses the given
* @a response_id, or <tt>0</tt>.
*/
const Widget* get_widget_for_response(int response_id) const;
/** Gets the response id of a widget in the action area
* of a dialog.
*
* @newin{2,8}
* @param widget A widget in the action area of @a dialog.
* @return The response id of @a widget, or Gtk::RESPONSE_NONE
* if @a widget doesn't have a response id set.
*/
int get_response_for_widget(const Gtk::Widget& widget) const;
/** Returns <tt>true</tt> if dialogs are expected to use an alternative
* button order on the screen @a screen. See
* Gtk::Dialog::set_alternative_button_order() for more details
* about alternative button order.
*
* If you need to use this function, you should probably connect
* to the ::notify:gtk-alternative-button-order signal on the
* Gtk::Settings object associated to @a screen, in order to be
* notified if the button order setting changes.
*
* @newin{2,6}
* @param screen A Gdk::Screen, or <tt>0</tt> to use the default screen.
* @return Whether the alternative button order should be used.
*/
static bool alternative_button_order(const Glib::RefPtr<const Gdk::Screen>& screen);
/** Sets an alternative button order. If the gtk-alternative-button-order
* setting is set to true, the dialog buttons are reordered according to
* the order of the response ids in @a new_order.
*
* By default, GTK+ dialogs use the button order advocated by the Gnome
* <a href="http://developer.gnome.org/hig-book/stable/">Human
* Interface Guidelines</a> with the affirmative button at the far
* right, and the cancel button left of it. But the builtin GTK+ dialogs
* and MessageDialog<!-- -->s do provide an alternative button order,
* which is more suitable on some platforms, e.g. Windows.
*
* Use this function after adding all the buttons to your dialog.
*
* @param new_order an array of response ids of the dialog's buttons.
*
* @newin{2,6}
*/
void set_alternative_button_order_from_array(const std::vector<int>& new_order);
/** Emits the Gtk::Dialog::signal_response() signal with the given response ID.
* Used to indicate that the user has responded to the dialog in some way;
* typically either you or run() will be monitoring the
* signal_response() signal and take appropriate action.
* @param response_id Response ID.
*/
void response(int response_id);
/** Blocks in a recursive main loop until the @a dialog emits the
* response signal. It returns the response ID from the "response" signal emission.
* Before entering the recursive main loop, run() calls
* Gtk::Widget::show() on the dialog for you. Note that you still
* need to show any children of the dialog yourself.
*
* If the dialog receives "delete_event", Gtk::Dialog::run() will return
* Gtk::RESPONSE_DELETE_EVENT. Also, during Gtk::Dialog::run() the dialog will be
* modal. You can force Gtk::Dialog::run() to return at any time by
* calling Gtk::Dialog::response() to emit the "response"
* signal.
*
* After Gtk::Dialog::run() returns, you are responsible for hiding or
* destroying the dialog if you wish to do so.
*
* Typical usage of this function might be:
* <informalexample><programlisting>
* int result = dialog.run();
* switch (result)
* {
* case Gtk::RESPONSE_ACCEPT:
* do_application_specific_something();
* break;
* default:
* do_nothing_since_dialog_was_cancelled();
* break;
* }
* </programlisting></informalexample>
* @return Response ID.
*/
int run();
// This previously returned an HButtonBox*, which broke on Maemo Fremantle.
// Changed post-2.18.2
/** Returns the action area of @a dialog.
*
* @newin{2,14}
* @return The action area.
*/
ButtonBox* get_action_area();
/** Returns the action area of @a dialog.
*
* @newin{2,14}
* @return The action area.
*/
const ButtonBox* get_action_area() const;
#ifndef GTKMM_DISABLE_DEPRECATED
/** Returns the content area of @a dialog.
*
* @newin{2,14}
* @deprecated Use get_content_area() instead.
* @return The content area Gtk::Box.
*/
Box* get_vbox();
#endif // GTKMM_DISABLE_DEPRECATED
#ifndef GTKMM_DISABLE_DEPRECATED
/** Returns the content area of @a dialog.
*
* @newin{2,14}
* @deprecated Use get_content_area() instead.
* @return The content area Gtk::Box.
*/
const Box* get_vbox() const;
#endif // GTKMM_DISABLE_DEPRECATED
/** Returns the content area of @a dialog.
*
* @newin{2,14}
* @return The content area Gtk::Box.
*/
Box* get_content_area();
/** Returns the content area of @a dialog.
*
* @newin{2,14}
* @return The content area Gtk::Box.
*/
const Box* get_content_area() const;
/**
* @par Slot Prototype:
* <tt>void on_my_%response(int response_id)</tt>
*
* Emitted when an action widget is clicked, the dialog receives a
* delete event, or the application programmer calls Gtk::Dialog::response().
* On a delete event, the response ID is Gtk::RESPONSE_DELETE_EVENT.
* Otherwise, it depends on which action widget was clicked.
* @param response_id The response ID.
*/
Glib::SignalProxy1< void,int > signal_response();
//_WRAP_PROPERTY("has-separator", bool) //deprecated.
};
} //namespace Gtk
namespace Glib
{
/** A Glib::wrap() method for this object.
*
* @param object The C instance.
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
* @result A C++ instance that wraps this C instance.
*
* @relates Gtk::Dialog
*/
Gtk::Dialog* wrap(GtkDialog* object, bool take_copy = false);
} //namespace Glib
#endif /* _GTKMM_DIALOG_H */
|