ManaPlus
pincode.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2011-2019 The ManaPlus Developers
4  * Copyright (C) 2019-2021 Andrei Karas
5  *
6  * This file is part of The ManaPlus Client.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef GUI_WIDGETS_PINCODE_H
23 #define GUI_WIDGETS_PINCODE_H
24 
25 #include "gui/widgets/container.h"
26 
29 
30 #include "localconsts.h"
31 
32 class Button;
33 class Skin;
34 class TextField;
35 
36 class Pincode final : public Container,
37  public ActionListener,
38  public WidgetListener
39 {
40  public:
41  Pincode(const Widget2 *const widget,
42  TextField *const textField);
43 
45 
46  ~Pincode() override final;
47 
48  void adjustSize();
49 
50  void action(const ActionEvent &event) override final;
51 
52  void shuffle(uint32_t seed) const;
53 
54  static Skin *mSkin;
55 
56  static int mInstances;
57 
58  static void finalCleanup();
59 
60  protected:
61  void addButtons();
62 
63  private:
65  std::string mText;
67  int mPadding;
68  int mSpacing;
71 };
72 
73 #endif // GUI_WIDGETS_PINCODE_H
Definition: button.h:102
int mSpacing
Definition: pincode.h:68
void shuffle(uint32_t seed) const
Definition: pincode.cpp:180
void action(const ActionEvent &event)
Definition: pincode.cpp:155
int mButtonWidth
Definition: pincode.h:69
static void finalCleanup()
Definition: pincode.cpp:150
Pincode(const Widget2 *const widget, TextField *const textField)
Definition: pincode.cpp:38
void addButtons()
Definition: pincode.cpp:93
int mButtonHeight
Definition: pincode.h:70
~Pincode()
Definition: pincode.cpp:77
int mPadding
Definition: pincode.h:67
static Skin * mSkin
Definition: pincode.h:54
std::string mText
Definition: pincode.h:65
void adjustSize()
Definition: pincode.cpp:143
Button * mButtons[11]
Definition: pincode.h:64
static int mInstances
Definition: pincode.h:56
TextField * mTextField
Definition: pincode.h:66
Definition: skin.h:37
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53