Planeshift

pawspetitiongmwindow.h

Go to the documentation of this file.
00001 /*
00002  * pawspetitiongmwindow.h - Author: Alexander Wiseman
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_PETITION_WINDOW_GM_HEADER
00021 #define PAWS_PETITION_WINDOW_GM_HEADER
00022 
00023 #include "paws/pawswidget.h"
00024 #include "paws/pawslistbox.h"
00025 #include "paws/pawsbutton.h"
00026 #include "paws/pawsstringpromptwindow.h"
00027 
00029 enum {
00030     PGMCOL_LVL = 0,
00031     PGMCOL_GM= 1,
00032     PGMCOL_PLAYER = 2,
00033     PGMCOL_ONLINE = 3,
00034     PGMCOL_STATUS = 4,
00035     PGMCOL_CREATED = 5,
00036     PGMCOL_PETITION = 6
00037 };
00038 
00042 #define        MAX_GMPETITION_LENGTH   (65)
00043 
00055 class pawsPetitionGMWindow : public pawsWidget, public psCmdBase, public iOnStringEnteredAction
00056 {
00057 public:
00059     pawsPetitionGMWindow();
00060 
00062     virtual ~pawsPetitionGMWindow();
00063 
00065     void Show();
00066 
00068     void HandleMessage( MsgEntry* message );
00069 
00071     const char* HandleCommand(const char* cmd);
00072 
00074     bool PostSetup();
00075 
00077     bool OnButtonReleased(int mouseButton, int keyModifier, pawsWidget* reporter);
00078 
00079     void OnListAction( pawsListBox* selected, int status );
00080 
00082     void OnStringEntered(const char *name,int param,const char *value);
00083 
00084 protected:
00085 
00087     void QueryServer();
00088 
00090     void SetText(size_t rowNum, int colNum, const char* fmt, ...);
00091 
00093     void AddPetitions(csArray<psPetitionInfo> &petitions);
00094 
00096     void CloseCurrPetition(const char * desc);
00097 
00098 
00100     pawsListBox* petitionList;
00101 
00103     int currentRow;
00104 
00106     psPetitionMessage petitionMessage;
00107 
00109     int petCount;
00110 
00113     bool hasPetInterest;
00114 
00116     psPetitionInfo selectedPet;
00117 
00119     pawsMessageTextBox * petText;
00120 };
00121 
00124 CREATE_PAWS_FACTORY( pawsPetitionGMWindow );
00125 
00126 #endif