ManaPlus
characterdisplay.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2004-2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2019 The ManaPlus Developers
6  * Copyright (C) 2019-2021 Andrei Karas
7  *
8  * This file is part of The ManaPlus Client.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef GUI_WIDGETS_CHARACTERDISPLAY_H
25 #define GUI_WIDGETS_CHARACTERDISPLAY_H
26 
27 #include "gui/widgets/container.h"
28 #include "gui/widgets/playerbox.h"
29 
31 
32 #include "localconsts.h"
33 
34 class CharSelectDialog;
35 class Label;
36 
37 namespace Net
38 {
39  struct Character;
40 } // namespace Net
41 
43  public MouseListener,
44  public WidgetListener
45 {
46  public:
47  CharacterDisplay(const Widget2 *const widget,
48  CharSelectDialog *const charSelectDialog);
49 
51 
52  ~CharacterDisplay() override final;
53 
54  void setCharacter(Net::Character *const character);
55 
57  { return mCharacter; }
58 
60 
61  void setActive(const bool active);
62 
63  bool isSelectFocused() const
64  { return false; }
65 
66  bool isDeleteFocused() const
67  { return false; }
68 
69  void focusSelect()
70  { }
71 
72  void focusDelete()
73  { }
74 
75  void setSelect(bool b)
76  { mPlayerBox->setSelected(b); }
77 
78  void widgetHidden(const Event &event) override final;
79 
80  void mouseExited(MouseEvent &event) override final;
81 
82  void mouseMoved(MouseEvent &event) override final;
83 
84  void mousePressed(MouseEvent &event) override final;
85 
86  void update();
87 
88  private:
92 };
93 
94 #endif // GUI_WIDGETS_CHARACTERDISPLAY_H
CharacterDisplay(const Widget2 *const widget, CharSelectDialog *const charSelectDialog)
PlayerBox * mPlayerBox
void mouseMoved(MouseEvent &event)
Net::Character * getCharacter() const
void setSelect(bool b)
void widgetHidden(const Event &event)
void setActive(const bool active)
void setCharacter(Net::Character *const character)
void mousePressed(MouseEvent &event)
void mouseExited(MouseEvent &event)
Net::Character * mCharacter
bool isDeleteFocused() const
bool isSelectFocused() const
Definition: event.h:79
Definition: label.h:91
void setSelected(bool b)
Definition: playerbox.h:95
#define override
Definition: localconsts.h:47
#define A_NONNULLPOINTER
Definition: localconsts.h:266
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53