Mana
Loading...
Searching...
No Matches
src
gui
emotepopup.h
Go to the documentation of this file.
1
/*
2
* Extended support for activating emotes
3
* Copyright (C) 2009 Aethyra Development Team
4
* Copyright (C) 2009 The Mana World Development Team
5
* Copyright (C) 2009-2012 The Mana Developers
6
*
7
* This file is part of The Mana Client.
8
*
9
* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 2 of the License, or
12
* any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
18
*
19
* You should have received a copy of the GNU General Public License
20
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21
*/
22
23
#pragma once
24
25
#include "
gui/widgets/popup.h
"
26
27
#include <guichan/mouselistener.hpp>
28
29
#include <list>
30
31
class
Image
;
32
33
namespace
gcn
{
34
class
SelectionListener;
35
}
36
42
class
EmotePopup
:
public
Popup
43
{
44
public
:
48
EmotePopup
();
49
50
~EmotePopup
()
override
;
51
55
void
draw
(gcn::Graphics *
graphics
)
override
;
56
57
void
mouseExited
(gcn::MouseEvent &event)
override
;
58
void
mousePressed
(gcn::MouseEvent &event)
override
;
59
void
mouseMoved
(gcn::MouseEvent &event)
override
;
60
64
int
getSelectedEmoteId
()
const
;
65
70
void
addSelectionListener
(gcn::SelectionListener *listener)
71
{
72
mListeners
.push_back(listener);
73
}
74
79
void
removeSelectionListener
(gcn::SelectionListener *listener)
80
{
81
mListeners
.remove(listener);
82
}
83
84
private
:
88
void
setSelectedEmoteId
(
int
emoteId);
89
94
int
getIndexAt
(
int
x,
int
y)
const
;
95
99
void
recalculateSize
();
100
104
void
distributeValueChangedEvent
();
105
106
int
mSelectedEmoteId
= -1;
107
int
mHoveredEmoteIndex
= -1;
108
109
int
mRowCount
= 1;
110
int
mColumnCount
= 1;
111
112
std::list<gcn::SelectionListener *>
mListeners
;
113
};
EmotePopup
An emote popup.
Definition
emotepopup.h:43
EmotePopup::mSelectedEmoteId
int mSelectedEmoteId
Definition
emotepopup.h:106
EmotePopup::removeSelectionListener
void removeSelectionListener(gcn::SelectionListener *listener)
Removes a listener from the list that's notified each time a change to the selection occurs.
Definition
emotepopup.h:79
EmotePopup::recalculateSize
void recalculateSize()
Determine and set the size of the container.
Definition
emotepopup.cpp:169
EmotePopup::EmotePopup
EmotePopup()
Constructor.
Definition
emotepopup.cpp:38
EmotePopup::mouseExited
void mouseExited(gcn::MouseEvent &event) override
Definition
emotepopup.cpp:94
EmotePopup::getIndexAt
int getIndexAt(int x, int y) const
Returns the index at the specified coordinates.
Definition
emotepopup.cpp:137
EmotePopup::mouseMoved
void mouseMoved(gcn::MouseEvent &event) override
Definition
emotepopup.cpp:116
EmotePopup::setSelectedEmoteId
void setSelectedEmoteId(int emoteId)
Sets the index of the currently selected emote.
Definition
emotepopup.cpp:128
EmotePopup::addSelectionListener
void addSelectionListener(gcn::SelectionListener *listener)
Adds a listener to the list that's notified each time a change to the selection occurs.
Definition
emotepopup.h:70
EmotePopup::~EmotePopup
~EmotePopup() override
EmotePopup::mRowCount
int mRowCount
Definition
emotepopup.h:109
EmotePopup::distributeValueChangedEvent
void distributeValueChangedEvent()
Sends out selection events to the list of selection listeners.
Definition
emotepopup.cpp:188
EmotePopup::draw
void draw(gcn::Graphics *graphics) override
Draws the emotes.
Definition
emotepopup.cpp:47
EmotePopup::mColumnCount
int mColumnCount
Definition
emotepopup.h:110
EmotePopup::mousePressed
void mousePressed(gcn::MouseEvent &event) override
Definition
emotepopup.cpp:101
EmotePopup::mHoveredEmoteIndex
int mHoveredEmoteIndex
Definition
emotepopup.h:107
EmotePopup::getSelectedEmoteId
int getSelectedEmoteId() const
Returns the selected emote.
Definition
emotepopup.cpp:123
EmotePopup::mListeners
std::list< gcn::SelectionListener * > mListeners
Definition
emotepopup.h:112
Image
Defines a class for loading and storing images.
Definition
image.h:45
Popup
A light version of the Window class.
Definition
popup.h:48
graphics
Graphics * graphics
Definition
client.cpp:104
gcn
Definition
emotepopup.h:33
popup.h
Generated by
1.9.8