initial commit, lordsawar source, slightly modified
[lordsawar] / src / gui / quest-report-dialog.h
1 //  Copyright (C) 2007, 2008, 2009 Ben Asselstine
2 //
3 //  This program is free software; you can redistribute it and/or modify
4 //  it under the terms of the GNU General Public License as published by
5 //  the Free Software Foundation; either version 3 of the License, or
6 //  (at your option) any later version.
7 //
8 //  This program is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 //  GNU Library General Public License for more details.
12 //
13 //  You should have received a copy of the GNU General Public License
14 //  along with this program; if not, write to the Free Software
15 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
16 //  02110-1301, USA.
17
18 #ifndef QUEST_REPORT_DIALOG_H
19 #define QUEST_REPORT_DIALOG_H
20
21 #include <memory>
22 #include <vector>
23 #include <sigc++/trackable.h>
24 #include <gtkmm.h>
25
26 #include "questmap.h"
27 #include "Quest.h"
28 #include "reward.h"
29
30
31 #include "decorated.h"
32
33 // dialog for depicting a quest
34 class QuestReportDialog: public Decorated
35 {
36  public:
37     QuestReportDialog(std::vector<Quest *>quests, Hero *preferred_hero);
38     ~QuestReportDialog();
39
40     void set_parent_window(Gtk::Window &parent);
41
42     void run();
43
44     void hide();
45     
46  private:
47     Gtk::Dialog* dialog;
48     QuestMap* questmap;
49
50     Gtk::Image *map_image;
51     Gtk::Label *label;
52     Gtk::Label *hero_label;
53     
54     std::vector<Quest*> quests;
55     Quest *quest;
56
57     void on_map_changed(Glib::RefPtr<Gdk::Pixmap> map);
58     Gtk::TreeView *heroes_treeview;
59
60     class HeroesColumns: public Gtk::TreeModelColumnRecord {
61     public:
62         HeroesColumns() 
63         { add(hero_name); add(quest);}
64         
65         Gtk::TreeModelColumn<Glib::ustring> hero_name;
66         Gtk::TreeModelColumn<Quest*> quest;
67     };
68     const HeroesColumns heroes_columns;
69     Glib::RefPtr<Gtk::ListStore> heroes_list;
70
71     void fill_quest_info(Quest *q);
72
73     void add_questing_hero(Quest *quest, Hero *h);
74
75     void on_hero_changed();
76 };
77
78 #endif