Planeshift
pawsguildwindow.h
Go to the documentation of this file.
1 /*
2  * pawsguildwindow.h
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_GUILD_WINDOW_HEADER
21 #define PAWS_GUILD_WINDOW_HEADER
22 
23 #include "paws/pawswidget.h"
27 #include "gui/pawscontrolwindow.h"
28 #include "gui/chatwindow.h"
29 
30 class pawsButton;
31 class pawsListBox;
32 class pawsCheckBox;
33 class pawsComboBox;
34 class pawsEditTextBox;
35 
36 typedef struct
37 {
38  int char_id;
39  csString name, public_notes, private_notes;
40  int points, level;
42 
47 {
48 public:
49 
51  virtual ~pawsGuildWindow();
52 
53  virtual bool PostSetup();
55  virtual bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget* widget);
56  virtual bool OnButtonReleased( int mouseButton, int keyModifier, pawsWidget* widget );
57  virtual void Show();
58  virtual void Hide();
59 
60  void HandleMessage( MsgEntry* me );
61 
62  bool IsCreatingGuild() { return creatingGuild;}
63  void SetCreatingGuild(bool v) { creatingGuild = v;}
64 
65  size_t GetLevel( const char* levelName );
66 
68  void OnStringEntered(const char *name,int param,const char *value);
69  void OnNumberEntered(const char *name,int param,int value);
70  void OnItemChosen(const char *name,int param,int itemNum, const csString & itemText);
71 
72 private:
73 
75  bool creatingGuild;
76 
80  void SetupLevelNameButtons();
81 
83  void Deactivate();
84 
85  void HandleGuildData( csString& openString );
86  void HandleLevelData( csString& openString );
87  void HandleMemberData( csString& openString );
88  void HandleAllianceData( csString& openString );
89 
90  guildMemberInfo * FindSelectedMemberInfo();
91  guildMemberInfo * FindMemberInfo(const csString & name);
92  guildMemberInfo * FindMemberInfo(int char_id);
93  int FindMemberInListBox(const csString & name);
94 
96 // void SetMemberTextCell(int char_id, int colNum, const csString & text);
97 
98  void ExtractLevelInfo(csRef<iDocumentNode> levelNode);
99  void HideLeaderCheckboxes();
100 
102  void OpenGuildLeaveConfirm();
103 
109  void SetAllianceWidgetVisibility(int mode);
110 
111  // Tab controls
112  pawsWidget *permissionsPanel,*membersPanel,*alliancesPanel,*settingsPanel,*currentPanel;
113  pawsButton *permissionsTab,*membersTab,*alliancesTab,*settingsTab,*currentTab;
114 
115  pawsTextBox *guildName;
116  pawsTextBox *allianceName;
117  pawsCheckBox *guildSecret;
118  pawsTextBox *guildWebPage;
119  pawsListBox *levelList;
120  pawsListBox *memberList;
121  pawsCheckBox *onlineOnly;
122  pawsCheckBox *guildNotifications;
123  pawsCheckBox *allianceNotifications;
124  pawsTextBox *memberCount;
125  pawsMultilineEditTextBox *motdEdit;
126  pawsListBox *allianceMemberList;
127 
128  csRef<iDocumentSystem> xml;
129 
130  csArray<guildMemberInfo> members;
131 
132  int char_id;
133  int playerLevel;
134 
135  int max_guild_points;
136 
140  csArray<csString> levels;
141 
142  pawsChatWindow* chatWindow;
143 };
144 
145 //--------------------------------------------------------------------------
147 
148 #endif
This is a window that is controlled by a button on the control bar.
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
A combination widget that has a check box and a text label.
Definition: pawscheckbox.h:48
CREATE_PAWS_FACTORY(pawsGuildWindow)
csString name
The name of this widget.
Definition: pawswidget.h:217
Main Chat window for PlaneShift.
Definition: chatwindow.h:133
The structure of 1 queue entry (pointer to a message)
Definition: message.h:143
virtual void Hide()
When the window is closed let the controller window know about it.
csString public_notes
An edit box widget/.
Definition: pawstextbox.h:409
void HandleMessage(MsgEntry *me)
size_t GetLevel(const char *levelName)
void OnStringEntered(const char *name, int param, const char *value)
Handle popup question window callback.
A simple list box widget.
Definition: pawslistbox.h:202
virtual ~pawsGuildWindow()
Window with all information about your guild, also allows to create a new guild.
void OnItemChosen(const char *name, int param, int itemNum, const csString &itemText)
virtual bool OnButtonReleased(int mouseButton, int keyModifier, pawsWidget *widget)
Called whenever a button is released.
A simple button widget.
Definition: pawsbutton.h:43
A basic combo box widget.
Definition: pawscombo.h:53
This interface defines the callback used by pawsStringPromptWindow to notify another window of a supp...
void SetCreatingGuild(bool v)
virtual void Show()
When the window is opened let the controller window know about it.
void OnNumberEntered(const char *name, int param, int value)
virtual bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget *widget)
Handles when a button is pressed.
virtual bool PostSetup()
This is called after the widget and all of it&#39;s children have been created.
A basic text box widget.
Definition: pawstextbox.h:42