gui/dialogs/addon_list.hpp

Go to the documentation of this file.
00001 /* $Id: addon_list.hpp 54172 2012-05-13 14:47:03Z mordante $ */
00002 /*
00003    Copyright (C) 2008 - 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_ADDON_LIST_HPP_INCLUDED
00017 #define GUI_DIALOGS_ADDON_LIST_HPP_INCLUDED
00018 
00019 #include "gui/dialogs/dialog.hpp"
00020 
00021 #include "gui/widgets/pane.hpp"
00022 
00023 class config;
00024 #include "config.hpp" // needed for config::const_child_itors
00025 
00026 namespace gui2 {
00027 
00028 class pane;
00029 
00030 /** Shows the list of addons on the server. */
00031 class taddon_list
00032     : public tdialog
00033 {
00034 public:
00035     explicit taddon_list(const config& cfg)
00036         : cfg_(cfg)
00037         , cfg_iterators_(cfg_.child_range("campaign"))
00038     {
00039     }
00040 
00041 private:
00042 
00043     /**
00044      * Collapses the description of an addon.
00045      *
00046      * @param grid                The grid of the item whose description to
00047      *                            collapse.
00048      */
00049     void collapse(tgrid& grid);
00050 
00051     /**
00052      * Expands the description of an addon.
00053      *
00054      * @param grid                The grid of the item whose description to
00055      *                            expand.
00056      */
00057     void expand(tgrid& grid);
00058 
00059     /** Inherited from tdialog, implemented by REGISTER_DIALOG. */
00060     virtual const std::string& window_id() const;
00061 
00062     /** Inherited from tdialog. */
00063     void pre_show(CVideo& video, twindow& window);
00064 
00065     /**
00066      * Creates a single campaign.
00067      *
00068      * @param pane                The pane to add the campaigns to.
00069      * @param campaign            A config object containing the campaign info
00070      *                            as send by campaignd.
00071      */
00072     void create_campaign(tpane& pane, const config& campaign);
00073 
00074     /** Config which contains the list with the campaigns. */
00075     const config& cfg_;
00076 
00077     /**
00078      * Debug iterators for testing with --new-widgets
00079      */
00080     config::const_child_itors cfg_iterators_;
00081 
00082     /**
00083      * Debug function to load a single campaign.
00084      *
00085      * @param pane                The pane to add the campaigns to.
00086      */
00087     void load(tpane& pane);
00088 };
00089 
00090 } // namespace gui2
00091 
00092 #endif
00093 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Tue May 22 2012 01:03:50 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs