Planeshift
pawsquestwindow.h
Go to the documentation of this file.
1 /*
2  * pawsquestwindow.h - Author: Keith Fulton
3  *
4  * Copyright (C) 2003 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 #ifndef PAWS_QUEST_WINDOW_HEADER
21 #define PAWS_QUEST_WINDOW_HEADER
22 
23 #include "paws/pawswidget.h"
24 #include "paws/pawslistbox.h"
25 #include "paws/pawsbutton.h"
26 #include "paws/pawstabwindow.h"
27 #include "gui/pawscontrolwindow.h"
30 
32 enum
33 {
34  QCOL_NAME = 0,
35  QCOL_ID = 1,
36  QCOL_STATUS = 2 // A for Active, C for completed
37 };
38 
39 struct QuestNote
40 {
41  int id;
42  size_t topLine;
43  csString notes;
44 };
45 
47 enum
48 {
52 };
53 
61 {
62 public:
65 
67  virtual ~pawsQuestListWindow();
68 
70  void Show(void);
71 
73  void HandleMessage( MsgEntry* message );
74 
76  const char* HandleCommand(const char* cmd);
77 
79  bool PostSetup();
80 
82  bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget* reporter);
83 
85  bool OnButtonReleased(int mouseButton, int keyModifier, pawsWidget* reporter);
86 
87  void OnListAction( pawsListBox* selected, int status );
88 
90  void SaveNotes(const char * fileName);
91 
93  void LoadNotes(const char * fileName);
94 
96  void ShowNotes();
97 
99  void OnStringEntered(const char *name, int param, const char *value);
100 
102  void OnNumberEntered(const char *name, int param, int value);
103 
104 protected:
105 
107  void RequestQuestData(int id);
108 
110  void RequestGMEventData(int id);
111 
113  void DiscardQuest(int id);
114 
116  void DiscardGMEvent(int id);
117 
124  void EvaluateGMEvent(int id, uint8_t vote, csString comment);
125 
127  void PopulateQuestTab(void);
128 
130  void PopulateGMEventTab(void);
131 
134 
137 
140 
143 
145  csString completedQuests;
147 
150 
153 
156 
159 
162 
164  csString completedEvents;
166 
169 
172 
174 
176 
178 
181 
182  int questID;
184 
186 
187  csArray<QuestNote*> quest_notes;
188 
189  csRef<iVFS> vfs;
190  csRef<iDocumentSystem> xml;
191  csString filename;
192  csString TotalNumberStr;
194 };
195 
199 
200 #endif
This is a window that is controlled by a button on the control bar.
csString completedEvents
XML strings for gm events.
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
pawsButton * QuestListsBtn
The structure of 1 queue entry (pointer to a message)
Definition: message.h:143
pawsListBox * uncompletedQuestList
The list of uncompleted quests (discarded quests are hidden; deleted after expiration) ...
csArray< QuestNote * > quest_notes
pawsListBox * completedEventList
The list of completed events.
csRef< iDocumentSystem > xml
pawsTabWindow * questTab
The selected tab of quests.
pawsTabWindow * eventTab
The selected tab of events.
csString notes
bool populateQuestLists
flag to indicate to populate new quest xml string
pawsMultilineEditTextBox * notes
A simple list box widget.
Definition: pawslistbox.h:202
int questID
ID of selected quest (-1 = no quest selected)
size_t topLine
int questIDBuffer
ID of pending discard (in case selection changes during prompt)
bool populateGMEventLists
flag to indicate to populate new quest xml string
int VoteBuffer
Last vote expressed.
pawsListBox * eventList
The list of events.
This is a special type of text box that is used for messages.
Definition: pawstextbox.h:285
A simple button widget.
Definition: pawsbutton.h:43
pawsListBox * uncompletedEventList
The list of uncompleted events (discarded events are hidden; deleted after expiration) ...
This interface defines the callback used by pawsStringPromptWindow to notify another window of a supp...
pawsListBox * questList
The list of quests.
csString completedQuests
XML strings for quests.
pawsTabWindow * currentTab
current top tab
This window is supposed to be a generic widget for using tabs to show and hide subwindows automatical...
Definition: pawstabwindow.h:33
pawsMessageTextBox * description
pawsButton * EvaluateBtn
The button which brings up the evaluation procedure.
pawsListBox * completedQuestList
The list of completed quests.
A basic text box widget.
Definition: pawstextbox.h:42
CREATE_PAWS_FACTORY(pawsQuestListWindow)
The pawsLootWindow factory.
Window containing a list of completed and in progress quests.