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

Line Branch Exec Source
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 NET_MAIL2HANDLER_H
23
#define NET_MAIL2HANDLER_H
24
25
#include "enums/net/mailopentype.h"
26
27
#include "enums/resources/mailqueuetype.h"
28
29
#include <string>
30
31
#include "localconsts.h"
32
33
class Item;
34
35
namespace Net
36
{
37
38
class Mail2Handler notfinal
39
{
40
    public:
41
        Mail2Handler()
42
        { }
43
44
        A_DELETE_COPY(Mail2Handler)
45
46
        virtual ~Mail2Handler()
47
        { }
48
49
        virtual void openWriteMail(const std::string &receiver) const = 0;
50
51
        virtual void addItem(const Item *const item,
52
                             const int amount) const = 0;
53
54
        virtual void removeItem(const int index,
55
                                const int amount) const = 0;
56
57
        virtual void sendMail(const std::string &to,
58
                              const std::string &title,
59
                              const std::string &body,
60
                              const int64_t &money) const = 0;
61
62
        virtual void queueCheckName(const MailQueueTypeT type,
63
                                    const std::string &to,
64
                                    const std::string &title,
65
                                    const std::string &body,
66
                                    const int64_t &money) const = 0;
67
68
        virtual void nextPage(const MailOpenTypeT openType,
69
                              const int64_t mailId) const = 0;
70
71
        virtual void readMail(const MailOpenTypeT openType,
72
                              const int64_t mailId) const = 0;
73
74
        virtual void deleteMail(const MailOpenTypeT openType,
75
                                const int64_t mailId) const = 0;
76
77
        virtual void requestMoney(const MailOpenTypeT openType,
78
                                  const int64_t mailId) const = 0;
79
80
        virtual void requestItems(const MailOpenTypeT openType,
81
                                  const int64_t mailId) const = 0;
82
83
        virtual void refreshMailList(const MailOpenTypeT openType,
84
                                     const int64_t mailId) const = 0;
85
86
        virtual void openMailBox(const MailOpenTypeT openType) const = 0;
87
88
        virtual void closeMailBox() const = 0;
89
90
        virtual void cancelWriteMail() const = 0;
91
92
        virtual void requestCheckName(const std::string &name) const = 0;
93
94
        virtual std::string getCheckedName() const = 0;
95
};
96
97
}  // namespace Net
98
99
extern Net::Mail2Handler *mail2Handler;
100
101
#endif  // NET_MAIL2HANDLER_H