GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/gui/popups/speechbubble.h Lines: 1 1 100.0 %
Date: 2021-03-17 Branches: 0 0 0.0 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2008  The Legend of Mazzeroth Development Team
4
 *  Copyright (C) 2008-2009  The Mana World Development Team
5
 *  Copyright (C) 2009-2010  The Mana Developers
6
 *  Copyright (C) 2011-2019  The ManaPlus Developers
7
 *  Copyright (C) 2019-2021  Andrei Karas
8
 *
9
 *  This file is part of The ManaPlus Client.
10
 *
11
 *  This program is free software; you can redistribute it and/or modify
12
 *  it under the terms of the GNU General Public License as published by
13
 *  the Free Software Foundation; either version 2 of the License, or
14
 *  any later version.
15
 *
16
 *  This program is distributed in the hope that it will be useful,
17
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 *  GNU General Public License for more details.
20
 *
21
 *  You should have received a copy of the GNU General Public License
22
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
 */
24
25
#ifndef GUI_POPUPS_SPEECHBUBBLE_H
26
#define GUI_POPUPS_SPEECHBUBBLE_H
27
28
#include "gui/widgets/popup.h"
29
30
class Label;
31
class StaticBrowserBox;
32
33
3
class SpeechBubble final : public Popup
34
{
35
    public:
36
        /**
37
         * Constructor. Initializes the speech bubble.
38
         */
39
        SpeechBubble();
40
41
        A_DELETE_COPY(SpeechBubble)
42
43
        void postInit() override final;
44
45
        /**
46
         * Sets the name displayed for the speech bubble, and in what color.
47
         */
48
        void setCaption(const std::string &name,
49
                        const Color *const color1,
50
                        const Color *const color2);
51
52
        /**
53
         * Sets the text to be displayed.
54
         */
55
        void setText(const std::string &text,
56
                     const bool showName);
57
58
        void requestMoveToBackground();
59
60
    private:
61
        std::string mText;
62
        int mSpacing;
63
        Label *mCaption A_NONNULLPOINTER;
64
        StaticBrowserBox *mSpeechBox A_NONNULLPOINTER;
65
};
66
67
#endif  // GUI_POPUPS_SPEECHBUBBLE_H