ManaPlus
pincodemanager.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2018-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 PINCODEMANAGER_H
23 #define PINCODEMANAGER_H
24 
26 
27 #include "enums/gui/pincodestate.h"
28 
29 #include <string>
30 
31 #include "localconsts.h"
32 
33 class PincodeDialog;
34 class Window;
35 
37 {
38  public:
40 
42 
44 
45  void init();
46 
47  void updateState();
48 
49  void pinOk();
50 
51  void wrongPin();
52 
53  void lockedPin();
54 
55  void setSeed(const uint32_t seed)
56  { mSeed = seed; }
57 
58  void setAccountId(const BeingId id)
59  { mAccountId = id; }
60 
61  void setState(const PincodeStateT state)
62  { mState = state; }
63 
64  void setPincodeLockFlag(const bool flag)
65  { mLockFlag = flag; }
66 
67  void changePincode(const std::string &pincode);
68 
69  void clearDialog(const PincodeDialog *const PincodeDialog);
70 
71  void setNewPincode(const std::string &pincode);
72 
73  void sendPincode(const std::string &pincode);
74 
75  void closeDialogs();
76 
77  bool isBlocked();
78 
79  bool processPincodeStatus(const uint16_t state);
80 
81  protected:
82  std::string mOldPincode;
83  std::string mNewPincode;
84  uint32_t mSeed;
88  bool mLockFlag;
89 };
90 
92 
93 #endif // PINCODEMANAGER_H
int BeingId
Definition: beingid.h:30
void sendPincode(const std::string &pincode)
void setState(const PincodeStateT state)
std::string mNewPincode
std::string mOldPincode
void setAccountId(const BeingId id)
Window * mDialog
void clearDialog(const PincodeDialog *const PincodeDialog)
void setPincodeLockFlag(const bool flag)
PincodeStateT mState
bool processPincodeStatus(const uint16_t state)
void setNewPincode(const std::string &pincode)
void changePincode(const std::string &pincode)
BeingId mAccountId
void setSeed(const uint32_t seed)
Definition: window.h:102
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53
PincodeManager pincodeManager
PincodeState ::T PincodeStateT
Definition: pincodestate.h:36