Planeshift
pawsbuddy.h
Go to the documentation of this file.
1 /*
2  * Author: Andrew Craig
3  *
4  * Copyright (C) 2004 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 #ifndef PAWS_BUDDY_HEADER
20 #define PAWS_BUDDY_HEADER
21 
22 #include "paws/pawswidget.h"
23 #include "net/subscriber.h"
24 
26 #include "gui/pawscontrolwindow.h"
27 #include "gui/chatwindow.h"
28 
29 class pawsListBox;
30 
31 
36 #define ALIASES_FILE_PREFIX "/planeshift/userdata/aliases_"
37 
38 
43 {
44 public:
46 
47  bool PostSetup();
48 
52  void HandleMessage( MsgEntry* me );
53 
54  bool OnButtonReleased( int mouseButton, int keyModifier, pawsWidget* widget );
55  void OnListAction( pawsListBox* widget, int status );
56  void OnStringEntered(const char *name,int param,const char *value);
57 
58  virtual void Show();
59 
60  virtual void OnResize();
61 
62 private:
64  pawsListBox* buddyList;
65 
67  csString currentBuddy;
68 
70  pawsChatWindow* chatWindow;
71 
73  csString editBuddy;
74 
76  csStringArray onlineBuddies;
78  csStringArray offlineBuddies;
79 
81  csHash<csString, csString> aliases;
82 
88  csString GetAlias(const csString & name) const;
89 
95  csString GetRealName(const csString & alias) const;
96 
101  void LoadAliases(const csString & charName);
102 
107  void SaveAliases(const csString & charName) const;
108 
115  void ChangeAlias(const csString & name, const csString & oldAlias, const csString & newAlias);
116 
123  void FillBuddyList();
124 
131  bool IsUniqueAlias(const csString & alias) const;
132 
133 };
134 
135 
137 #endif
This is a window that is controlled by a button on the control bar.
The buddy window that shows your current list of in game &#39;friends&#39;.
Definition: pawsbuddy.h:42
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
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 OnResize()
Sets the new position of the close button.
void OnListAction(pawsListBox *widget, int status)
Called whenever an item in a child list box is selected.
bool PostSetup()
This is called after the widget and all of it&#39;s children have been created.
A simple list box widget.
Definition: pawslistbox.h:202
bool OnButtonReleased(int mouseButton, int keyModifier, pawsWidget *widget)
Called whenever a button is released.
CREATE_PAWS_FACTORY(pawsBuddyWindow)
This interface defines the callback used by pawsStringPromptWindow to notify another window of a supp...
void OnStringEntered(const char *name, int param, const char *value)
When the pawsStringPromptWindow is created, a ptr to a class which implements this function is provid...
void HandleMessage(MsgEntry *me)
Handles the messages this widget has subscribed to.
virtual void Show()
When the window is opened let the controller window know about it.