GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/events/inputevent.h Lines: 0 5 0.0 %
Date: 2017-11-29 Branches: 0 0 0.0 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2012-2017  The ManaPlus Developers
4
 *
5
 *  This file is part of The ManaPlus Client.
6
 *
7
 *  This program is free software; you can redistribute it and/or modify
8
 *  it under the terms of the GNU General Public License as published by
9
 *  the Free Software Foundation; either version 2 of the License, or
10
 *  any later version.
11
 *
12
 *  This program is distributed in the hope that it will be useful,
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 *  GNU General Public License for more details.
16
 *
17
 *  You should have received a copy of the GNU General Public License
18
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 */
20
21
#ifndef EVENTS_INPUTEVENT_H
22
#define EVENTS_INPUTEVENT_H
23
24
#include "enums/input/inputaction.h"
25
26
#include "utils/vector.h"
27
28
#include <map>
29
#include <string>
30
31
#include "localconsts.h"
32
33
class ChatTab;
34
35
typedef STD_VECTOR<InputActionT> KeysVector;
36
typedef KeysVector::iterator KeysVectorIter;
37
typedef KeysVector::const_iterator KeysVectorCIter;
38
39
typedef std::map<int, KeysVector> KeyToActionMap;
40
typedef KeyToActionMap::iterator KeyToActionMapIter;
41
42
typedef std::map<int, InputActionT> KeyToIdMap;
43
typedef KeyToIdMap::iterator KeyToIdMapIter;
44
45
typedef std::map<int, int> KeyTimeMap;
46
typedef KeyTimeMap::iterator KeyTimeMapIter;
47
48
struct InputEvent final
49
{
50
    InputEvent(const InputActionT action0,
51
               const int mask0) :
52
        args(),
53
        tab(nullptr),
54
        action(action0),
55
        mask(mask0)
56
    { }
57
58
    InputEvent(const std::string &args0,
59
               ChatTab *const tab0,
60
               const int mask0) :
61
        args(args0),
62
        tab(tab0),
63
        action(InputAction::NO_VALUE),
64
        mask(mask0)
65
    { }
66
67
    A_DELETE_COPY(InputEvent)
68
69
    const std::string args;
70
    ChatTab *const tab;
71
    const InputActionT action;
72
    const int mask;
73
};
74
75
#endif  // EVENTS_INPUTEVENT_H