Mana
Loading...
Searching...
No Matches
socialwindow.h
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2010-2012 The Mana Developers
4 *
5 * This file is part of The Mana Client.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#pragma once
22
23#include "utils/time.h"
24
25#include "gui/widgets/window.h"
26
27#include <guichan/actionevent.hpp>
28#include <guichan/actionlistener.hpp>
29
30#include <string>
31#include <map>
32#include <vector>
33
34class Avatar;
35class Button;
36class ConfirmDialog;
37class CreatePopup;
38class Guild;
39class Party;
40class PlayerListTab;
41class SocialTab;
42class Tab;
43class TabbedArea;
44class TextDialog;
45
51class SocialWindow : public Window, gcn::ActionListener
52{
53public:
55
56 ~SocialWindow() override;
57
58 bool addTab(Guild *guild);
59
60 bool removeTab(Guild *guild);
61
62 bool addTab(Party *party);
63
64 bool removeTab(Party *party);
65
69 void action(const gcn::ActionEvent &event) override;
70
71 void showGuildInvite(const std::string &guildName, int guildId,
72 const std::string &inviterName);
73
74 void showGuildCreate();
75
76 void showPartyInvite(const std::string &inviter,
77 const std::string &partyName = std::string());
78
79 void showPartyCreate();
80
81 void setPlayersOnline(const std::vector<Avatar*> &players);
82
83 void logic() override;
84
85protected:
86 friend class SocialTab;
87
88 void updateButtons();
89
94
95 std::string mPartyInviter;
98
99 std::map<Guild *, SocialTab *> mGuilds;
100 std::map<Party *, SocialTab *> mParties;
101
103
105
110};
111
Button widget.
Definition button.h:38
An option dialog.
Definition guild.h:55
Definition party.h:59
Party window.
void showGuildInvite(const std::string &guildName, int guildId, const std::string &inviterName)
std::map< Guild *, SocialTab * > mGuilds
CreatePopup * mCreatePopup
void showPartyCreate()
void showGuildCreate()
ConfirmDialog * mPartyAcceptDialog
std::string mPartyInviter
TextDialog * mGuildCreateDialog
void logic() override
bool removeTab(Guild *guild)
std::map< Party *, SocialTab * > mParties
TextDialog * mPartyCreateDialog
Button * mCreateButton
TabbedArea * mTabs
Button * mInviteButton
Button * mLeaveButton
ConfirmDialog * mGuildAcceptDialog
bool addTab(Guild *guild)
void action(const gcn::ActionEvent &event) override
Handle events.
Timer mOnlineListUpdateTimer
~SocialWindow() override
PlayerListTab * mPlayerListTab
void showPartyInvite(const std::string &inviter, const std::string &partyName=std::string())
void setPlayersOnline(const std::vector< Avatar * > &players)
A tab, the same as the Guichan tab in 0.8, but extended to allow transparency.
Definition tab.h:33
A tabbed area, the same as the guichan tabbed area in 0.8, but extended.
Definition tabbedarea.h:40
An option dialog.
Definition textdialog.h:36
Simple timer that can be used to check if a certain amount of time has passed.
Definition time.h:62
A window.
Definition window.h:59
SocialWindow * socialWindow
Definition game.cpp:108