YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
ChatWidget.hpp
Go to the documentation of this file.
1
#ifndef YAPOG_CLIENT_CHATWIDGET_HPP
2
# define YAPOG_CLIENT_CHATWIDGET_HPP
3
4
# include "
YAPOG/Macros.hpp
"
5
# include "
YAPOG/Collection/Array.hpp
"
6
# include "
YAPOG/System/String.hpp
"
7
# include "
YAPOG/Game/Chat/ChatHeader.hpp
"
8
# include "
YAPOG/Graphics/Gui/BaseWidget.hpp
"
9
# include "
YAPOG/Graphics/Gui/GuiEvent.hpp
"
10
11
#include "
YAPOG/Graphics/Gui/WidgetBackground.hpp
"
12
#include "
YAPOG/Graphics/Gui/WidgetBorder.hpp
"
13
#include "
YAPOG/Graphics/Gui/HorizontalLayout.hpp
"
14
#include "
YAPOG/Graphics/Gui/VerticalLayout.hpp
"
15
#include "
YAPOG/Graphics/Gui/DialogBoxWidget.hpp
"
16
#include "
YAPOG/Graphics/Gui/TextBoxWidget.hpp
"
17
#include "
YAPOG/Graphics/Gui/MultiLabelWidget.hpp
"
18
19
# include "
YAPOG/Graphics/Vector2.hpp
"
20
21
namespace
yap
22
{
23
class
Chat;
24
class
GameMessage;
25
}
26
27
namespace
ycl
28
{
29
typedef
yap::collection::Array<yap::Label*>
TabTitleType
;
30
class
ChatWidget
:
public
yap::BaseWidget
31
{
32
DISALLOW_COPY
(
ChatWidget
);
33
34
public
:
35
ChatWidget
(
const
yap::String
& userLogin);
36
virtual
~ChatWidget
();
37
38
void
Init
();
39
virtual
bool
IsFocusable
()
const
;
40
41
void
AddMessage
(
const
yap::GameMessage
& message);
42
44
yap::Event<ChatWidget&, yap::GameMessage&>
OnMessageSent
;
45
46
protected
:
47
virtual
yap::Vector2
HandleGetSize
()
const
;
48
virtual
void
HandleMove
(
const
yap::Vector2
& offset);
49
virtual
void
HandleScale
(
const
yap::Vector2
& factor);
50
51
virtual
void
HandleDraw
(
yap::IDrawingContext
& context);
52
virtual
bool
HandleOnEvent
(
const
yap::GuiEvent
& guiEvent);
53
virtual
bool
HandleOnPriorityEvent
(
const
yap::GuiEvent
& guiEvent);
54
55
virtual
void
HandleShow
(
bool
isVisible);
56
virtual
void
HandleChangeColor
(
const
sf::Color& color);
57
58
virtual
void
HandleUpdate
(
const
yap::Time
& dt);
59
60
private
:
61
void
InitTab
();
62
void
InitDial
();
63
void
InitEntry
();
64
void
DisplayResponse
(
yap::ResponseType
response);
65
bool
TestAddChan
(
const
yap::GuiEvent
& guiEvent);
66
bool
TestSwitchTab
(
const
yap::GuiEvent
& guiEvent);
67
bool
TabAndChanHandler
(
bool
chan,
bool
add,
int
i);
68
69
const
yap::String
&
userLogin_
;
70
yap::Chat
*
chat_
;
71
yap::String
line_
;
72
yap::TextBoxWidget
*
lineCatcher_
;
73
TabTitleType
tabTitle_
;
74
yap::HorizontalLayout
*
tabLayout_
;
75
yap::MultiLabelWidget
*
dialog_
;
76
yap::HorizontalLayout
*
dialLayout_
;
77
yap::HorizontalLayout
*
entryLayout_
;
78
yap::VerticalLayout
*
bigLayout_
;
79
};
80
}
// namespace ycl
81
82
#endif // YAPOG_CLIENT_CHATWIDGET_HPP
YAPOG.Client
include
Gui
ChatWidget.hpp
Generated on Mon Sep 17 2012 22:24:21 for YAPOG by
1.8.1.1