00001 /* 00002 * The Mana World 00003 * Copyright (C) 2008 The Mana World Development Team 00004 * 00005 * This file is part of The Mana World. 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 */ 00021 00022 #ifndef GUI_GUILDWINDOW_H 00023 #define GUI_GUILDWINDOW_H 00024 00025 #include "gui/widgets/window.h" 00026 00027 #include "guichanfwd.h" 00028 00029 #include <guichan/actionlistener.hpp> 00030 #include <guichan/widgets/listbox.hpp> 00031 00032 #include <iosfwd> 00033 #include <map> 00034 #include <vector> 00035 00036 class LocalPlayer; 00037 class TextDialog; 00038 class ConfirmDialog; 00039 class GuildListBox; 00040 class ScrollArea; 00041 class TabbedArea; 00042 00043 class GuildWindow : public Window, public gcn::ActionListener 00044 { 00045 public: 00046 GuildWindow(); 00047 ~GuildWindow(); 00048 00052 void action(const gcn::ActionEvent &event); 00053 00057 void draw(gcn::Graphics *graphics); 00058 00062 void update(); 00063 00067 void newGuildTab(const std::string &guildName); 00068 00072 void setTab(const std::string &guildName); 00073 00077 void updateTab(); 00078 00082 bool isWindowFocused(); 00083 00087 void openAcceptDialog(const std::string &inviterName, const std::string &guildName); 00088 00092 void requestMemberList(short guildId); 00093 00097 void removeTab(int guildId); 00098 00102 void setOnline(const std::string &guildName, const std::string &member, 00103 bool online); 00104 00105 protected: 00110 short getSelectedGuild(); 00111 00112 private: 00113 gcn::Button *mGuildButton[3]; 00114 TextDialog *guildDialog; 00115 TextDialog *inviteDialog; 00116 ConfirmDialog *acceptDialog; 00117 TabbedArea *mGuildTabs; 00118 ScrollArea *mScrollArea; 00119 bool mFocus; 00120 std::string invitedGuild; 00121 typedef std::map<std::string, GuildListBox*> GuildListMap; 00122 GuildListMap mGuildLists; 00123 }; 00124 00125 extern GuildWindow *guildWindow; 00126 00127 #endif