gui/dialogs/transient_message.hpp

Go to the documentation of this file.
00001 /* $Id: transient_message.hpp 52533 2012-01-07 02:35:17Z shadowmaster $ */
00002 /*
00003    Copyright (C) 2009 - 2012 by Mark de Wever <koraq@xs4all.nl>
00004    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY.
00012 
00013    See the COPYING file for more details.
00014 */
00015 
00016 #ifndef GUI_DIALOGS_TRANSIENT_MESSAGE_HPP_INCLUDED
00017 #define GUI_DIALOGS_TRANSIENT_MESSAGE_HPP_INCLUDED
00018 
00019 #include "gui/dialogs/dialog.hpp"
00020 
00021 namespace gui2 {
00022 
00023 /** Shows a transient message. */
00024 class ttransient_message
00025     : public tdialog
00026 {
00027 public:
00028 
00029     ttransient_message(const std::string& title
00030             , const bool title_use_markup
00031             , const std::string& message
00032             , const bool message_use_markup
00033             , const std::string& image);
00034 
00035 private:
00036 
00037     /** Inherited from tdialog, implemented by REGISTER_DIALOG. */
00038     virtual const std::string& window_id() const;
00039 };
00040 
00041 /**
00042  * Shows a transient message to the user.
00043  *
00044  * This shows a dialog with a short message which can be dismissed with a
00045  * single click.
00046  *
00047  * @note The message _should_ be small enough to fit on the window, the text
00048  * can contain newlines and will wrap when needed.
00049  *
00050  * @param video               The video which contains the surface to draw
00051  *                            upon.
00052  * @param title               The title of the dialog.
00053  * @param message             The message to show in the dialog.
00054  * @param image               An image to show in the dialog.
00055  * @param message_use_markup  Use markup for the message?
00056  * @param title_use_markup    Use markup for the title?
00057  */
00058 void show_transient_message(CVideo& video
00059         , const std::string& title
00060         , const std::string& message
00061         , const std::string& image = std::string()
00062         , const bool message_use_markup = false
00063         , const bool title_use_markup = false);
00064 
00065 /**
00066  * Shows a transient error message to the user.
00067  *
00068  * This shows a dialog with a short message which can be dismissed with a
00069  * single click.
00070  *
00071  * @param video               The video which contains the surface to draw
00072  *                            upon.
00073  * @param message             The message to show in the dialog.
00074  * @param image               An image to show in the dialog.
00075  * @param message_use_markup  Use markup for the message?
00076  */
00077 void show_transient_error_message(CVideo& video
00078         , const std::string& message
00079         , const std::string& image = std::string()
00080         , const bool message_use_markup = false);
00081 
00082 } // namespace gui2
00083 
00084 #endif
00085 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:02:59 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs