X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fhistorymap.h;fp=src%2Fhistorymap.h;h=9d16d667da0cfcdd22893e56ffecdae3b3f29b63;hb=9eda00ff73353c55ecef6f82131166d5d4a85e29;hp=0000000000000000000000000000000000000000;hpb=3d34d4aa85a929f912464f71158396a388274f27;p=lordsawar diff --git a/src/historymap.h b/src/historymap.h new file mode 100644 index 0000000..9d16d66 --- /dev/null +++ b/src/historymap.h @@ -0,0 +1,92 @@ +// Copyright (C) 2007, 2008, 2009 Ben Asselstine +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 3 of the License, or +// (at your option) any later version. +// +// This program 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 General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +// 02110-1301, USA. + +#ifndef HISTORYMAP_H +#define HISTORYMAP_H + +#include +#include +#include + +#include "overviewmap.h" +#include "LocationList.h" + +class City; +class Ruin; +//! Draw the given cities and ruins on the map. +/** + * Draw a set of cities and ruins onto the miniature map graphic. + * + * @note This is called HistoryMap because it is used for the HistoryDialog. + * + */ +class HistoryMap: public OverviewMap +{ + public: + //! Default constructor. Make a new HistoryMap. + /** + * @param clist The list of the City objects to draw on the miniature map. + */ + HistoryMap(LocationList *clist, LocationList *rlist); + + //! Emitted when the cities are finished being drawn on the map surface. + /** + * Classes that use HistoryMap must catch this signal to display the map. + */ + sigc::signal > map_changed; + + //! Change which cities are shown on the miniature map graphic. + /** + * This method erases the cities that were previously drawn and shows + * a new set of City objects. + * + * @param clist The new list of City objects to draw onto the miniature + * map graphic. + * @param rlist The new list of Ruin objects to draw onto the miniature + * map graphic. + */ + void updateCities (LocationList *clist, LocationList *rlist); + + private: + + //! The set of city objects to show on the miniature map graphic. + LocationList *d_clist; + + //! The set of ruin objects to show on the miniature map graphic. + LocationList *d_rlist; + + //! Draw the City objects onto the miniature map graphic. + /** + * This method is automatically called by the HistoryMap::draw method. + */ + virtual void after_draw(); + + //! Draw the cities. + /** + * This method iterates over the members of HistoryMap::d_clist and draws + * each city onto the minature map graphic. + * + * We can't use the OverviewMap::draw_cities method because it draws the + * City objects of Citylist, and not the set of cities defined here. + */ + void drawCities (); + + //! Draw the ruins. + void drawRuins(); +}; + +#endif