Planeshift

pawsquestwindow.h

Go to the documentation of this file.
00001 /*
00002  * pawsquestwindow.h - Author: Keith Fulton
00003  *
00004  * Copyright (C) 2003 Atomic Blue ([email protected], http://www.atomicblue.org)
00005  *
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation (version 2 of the License)
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017  *
00018  */
00019 
00020 #ifndef PAWS_QUEST_WINDOW_HEADER
00021 #define PAWS_QUEST_WINDOW_HEADER
00022 
00023 #include "paws/pawswidget.h"
00024 #include "paws/pawslistbox.h"
00025 #include "paws/pawsbutton.h"
00026 #include "paws/pawstabwindow.h"
00027 #include "gui/pawscontrolwindow.h"
00028 #include "paws/pawsnumberpromptwindow.h"
00029 #include "paws/pawsstringpromptwindow.h"
00030 
00032 enum
00033 {
00034     QCOL_NAME = 0,
00035     QCOL_ID   = 1,
00036     QCOL_STATUS = 2 // A for Active, C for completed
00037 };
00038 
00039 struct QuestNote
00040 {
00041     int id;
00042     size_t topLine;
00043     csString notes;
00044 };
00045 
00047 enum
00048 {
00049     EVCOL_NAME = 0,
00050     EVCOL_ROLE = 1,
00051     EVCOL_ID   = 2
00052 };
00053 
00065 class pawsQuestListWindow : public pawsControlledWindow, public psCmdBase, public iOnStringEnteredAction, public iOnNumberEnteredAction
00066 {
00067 public:
00069     pawsQuestListWindow();
00070 
00072     virtual ~pawsQuestListWindow();
00073 
00075     void Show(void);
00076 
00078     void HandleMessage( MsgEntry* message );
00079 
00081     const char* HandleCommand(const char* cmd);
00082 
00084     bool PostSetup();
00085 
00087     bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget* reporter);
00088 
00090     bool OnButtonReleased(int mouseButton, int keyModifier, pawsWidget* reporter);
00091 
00092     void OnListAction( pawsListBox* selected, int status );
00093 
00095     void SaveNotes(const char * fileName);
00096 
00098     void LoadNotes(const char * fileName);
00099 
00101     void ShowNotes();
00102     
00104     void OnStringEntered(const char *name, int param, const char *value);
00105     
00107     void OnNumberEntered(const char *name, int param, int value);
00108 
00109 protected:
00110 
00112     void RequestQuestData(int id);
00113 
00115     void RequestGMEventData(int id);
00116 
00118     void DiscardQuest(int id);
00119 
00121     void DiscardGMEvent(int id);
00122     
00129     void EvaluateGMEvent(int id, uint8_t vote, csString comment);
00130 
00132     void PopulateQuestTab(void);
00133 
00135     void PopulateGMEventTab(void);
00136 
00138     pawsTabWindow* questTab;
00139 
00141     pawsListBox* questList;
00142 
00144     pawsListBox* completedQuestList;
00145 
00147     pawsListBox* uncompletedQuestList;
00148 
00150     csString completedQuests;
00151     csString uncompletedQuests;
00152 
00154     bool populateQuestLists;
00155 
00157     pawsTabWindow* eventTab;
00158 
00160     pawsListBox* eventList;
00161 
00163     pawsListBox* completedEventList;
00164 
00166     pawsListBox* uncompletedEventList;
00167 
00169     csString completedEvents;
00170     csString uncompletedEvents;
00171 
00173     bool populateGMEventLists;
00174 
00176     pawsTabWindow* currentTab;
00177 
00178     pawsMessageTextBox* description;
00179 
00180     pawsMultilineEditTextBox* notes;
00181 
00182     pawsTextBox* total;
00183     
00185     pawsButton* EvaluateBtn;
00186 
00187     int questID;        
00188     int questIDBuffer;  
00189     
00190     int VoteBuffer;     
00191 
00192     csArray<QuestNote*> quest_notes;
00193 
00194     csRef<iVFS> vfs;
00195     csRef<iDocumentSystem> xml;
00196     csString filename;
00197     csString TotalNumberStr;
00198     pawsButton* QuestListsBtn;
00199 };
00200 
00203 CREATE_PAWS_FACTORY( pawsQuestListWindow );
00204 
00205 #endif