/* $Id: aboutdialog.hg,v 1.10 2006/07/18 19:49:30 murrayc Exp $ */

/* aboutdialog.h
 *
 * Copyright (C) 2004 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gtkmm/dialog.h>
//#include <glibmm/listhandle.h>

_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/dialog_p.h)

namespace Gtk
{

/** The AboutDialog offers a simple way to display information about a program like its logo, name, copyright, 
 * website and license. It is also possible to give credits to the authors, documenters, translators and artists 
 * who have worked on the program. An about dialog is typically opened when the user selects the About option 
 * from the Help menu. All parts of the dialog are optional.
 *
 * About dialogs often contain links and email addresses. Gtk::AboutDialog supports this by offering global 
 * hooks, which are called when the user clicks on a link or email address, see set_email_hook() and 
 * set_url_hook(). Email addresses in the authors, documenters and artists properties are recognized by looking 
 * for <user@host>, URLs are recognized by looking for http://url, with the URL extending to the next space, 
 * tab or line break.
 *
 * @ingroup Dialogs
 */
class AboutDialog : public Dialog
{
  _CLASS_GTKOBJECT(AboutDialog, GtkAboutDialog, GTK_ABOUT_DIALOG, Gtk::Dialog, GtkDialog)
  _UNMANAGEABLE
public:
  _CTOR_DEFAULT()

  _WRAP_METHOD(Glib::ustring get_name() const, gtk_about_dialog_get_name, deprecated)
  _WRAP_METHOD(void set_name(const Glib::ustring& name), gtk_about_dialog_set_name, deprecated)
  _WRAP_METHOD(Glib::ustring get_program_name() const, gtk_about_dialog_get_program_name)
  _WRAP_METHOD(void set_program_name(const Glib::ustring& name), gtk_about_dialog_set_program_name)

  _WRAP_METHOD(Glib::ustring get_version() const, gtk_about_dialog_get_version)
  _WRAP_METHOD(void set_version(const Glib::ustring& version), gtk_about_dialog_set_version)
  _WRAP_METHOD(Glib::ustring get_copyright() const, gtk_about_dialog_get_copyright)
  _WRAP_METHOD(void set_copyright(const Glib::ustring& copyright), gtk_about_dialog_set_copyright)
  _WRAP_METHOD(Glib::ustring get_comments() const, gtk_about_dialog_get_comments)
  _WRAP_METHOD(void set_comments(const Glib::ustring& comments), gtk_about_dialog_set_comments)
  _WRAP_METHOD(Glib::ustring get_license() const, gtk_about_dialog_get_license)
  _WRAP_METHOD(void set_license(const Glib::ustring& license), gtk_about_dialog_set_license)
  _WRAP_METHOD(Glib::ustring get_website() const, gtk_about_dialog_get_website)
  _WRAP_METHOD(void set_website(const Glib::ustring& website), gtk_about_dialog_set_website)
  _WRAP_METHOD(Glib::ustring get_website_label() const, gtk_about_dialog_get_website_label)
  _WRAP_METHOD(void set_website_label(const Glib::ustring& website_label), gtk_about_dialog_set_website_label)

  #m4 _CONVERSION(`gchar const * const *',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3)')

  _WRAP_METHOD(Glib::StringArrayHandle get_authors() const, gtk_about_dialog_get_authors)

  _WRAP_METHOD(void set_authors(const Glib::StringArrayHandle& authors) const, gtk_about_dialog_set_authors)

  _WRAP_METHOD(Glib::StringArrayHandle get_documenters() const, gtk_about_dialog_get_documenters)

  #m4 _CONVERSION(`const Glib::StringArrayHandle&',`const gchar**',`const_cast<const gchar**>(($3).data())')

  _WRAP_METHOD(void set_documenters(const Glib::StringArrayHandle& documenters), gtk_about_dialog_set_documenters)
  _WRAP_METHOD(Glib::StringArrayHandle get_artists() const, gtk_about_dialog_get_artists)
  _WRAP_METHOD(void set_artists(const Glib::StringArrayHandle& artists), gtk_about_dialog_set_artists)
  _WRAP_METHOD(Glib::ustring get_translator_credits() const, gtk_about_dialog_get_translator_credits)
  _WRAP_METHOD(void set_translator_credits(const Glib::ustring& translator_credits), gtk_about_dialog_set_translator_credits)

  _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_logo(), gtk_about_dialog_get_logo)
  _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> get_logo() const, gtk_about_dialog_get_logo, constversion)

  _WRAP_METHOD(void set_logo(const Glib::RefPtr<Gdk::Pixbuf>& logo), gtk_about_dialog_set_logo)

  _WRAP_METHOD(Glib::ustring get_logo_icon_name() const, gtk_about_dialog_get_logo_icon_name)
  _WRAP_METHOD(void set_logo_icon_name(const Glib::ustring& icon_name), gtk_about_dialog_set_logo_icon_name)

  _WRAP_METHOD(bool get_wrap_license() const, gtk_about_dialog_get_wrap_license)
  _WRAP_METHOD(void set_wrap_license(bool wrap_license), gtk_about_dialog_set_wrap_license)

  /** For instance,
   * void on_activate_link_url(AboutDialog& about_dialog, const Glib::ustring& link);
   */
  typedef sigc::slot<void, AboutDialog& /* about_dialog */, const Glib::ustring& /* link */> SlotActivateLink;

  /** Installs a global callback to be called whenever the user activates an email link in an about dialog.
   * @param slot A function or method to call when an email link is activated.
   */
  static void set_email_hook(const SlotActivateLink& slot);
  _IGNORE(gtk_about_dialog_set_email_hook)

  /** Installs a global callback to be called whenever the user activates a URL link in an about dialog.
   * @param slot A function or method to call when a URL link is activated.
   */
  static void set_url_hook(const SlotActivateLink& slot);
  _IGNORE(gtk_about_dialog_set_url_hook)

//TODO: Deprecate this, because it conflicts with the property in GtkWidget, and has been removed in GTK+ 2.12.
//If this could not have been used without an error, then remove it:
  _WRAP_PROPERTY("name", Glib::ustring)

  _WRAP_PROPERTY("program-name", Glib::ustring)

  _WRAP_PROPERTY("version", Glib::ustring)
  _WRAP_PROPERTY("copyright", Glib::ustring)
  _WRAP_PROPERTY("comments", Glib::ustring)
  _WRAP_PROPERTY("website", Glib::ustring)
  _WRAP_PROPERTY("website_label", Glib::ustring)
  _WRAP_PROPERTY("license", Glib::ustring)
  _WRAP_PROPERTY("authors", Glib::StringArrayHandle)
  _WRAP_PROPERTY("documenters", Glib::StringArrayHandle)
  _WRAP_PROPERTY("translator_credits", Glib::StringArrayHandle)
  _WRAP_PROPERTY("artists", Glib::StringArrayHandle)
  _WRAP_PROPERTY("logo", Glib::RefPtr<Gdk::Pixbuf>)
  _WRAP_PROPERTY("logo_icon_name", Glib::ustring)  
  _WRAP_PROPERTY("wrap_license", bool)  
};

} // namespace Gtk

