-
Notifications
You must be signed in to change notification settings - Fork 0
/
wipechan.h
executable file
·64 lines (53 loc) · 2.32 KB
/
wipechan.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef WIPECHAN_H
#define WIPECHAN_H
#include <QObject>
#include <QWidget>
#include <QPlainTextEdit>
#include <QDir>
#include <iostream>
#include <fstream>
#include <map>
class Wipechan : public QFrame {
public:
enum Request { MEET = 0, HELLO, START, FINISH, ERROR, CRASH, TIP };
private:
struct {
std::vector<std::string> meet;
std::vector<std::string> hello[5];
std::vector<std::string> start[5];
std::vector<std::string> finish[5];
std::vector<std::string> error[5];
std::vector<std::string> crash[5];
std::map<std::string, std::string> tips;
} quoteBank;
QPlainTextEdit * blockquote;
std::string * quote;
std::string dir;
std::string defaultQuote;
bool called;
unsigned int rnd;
void set_height(const unsigned short &num=0);
void set_quote(const std::string "e, std::vector<std::string> * bank);
void set_tips(const std::string &tips, std::map<std::string, std::string> * bank);
void set_quote_bank();
void add_quote_part(const std::vector<std::string> &bank, const std::vector<std::string> ¶ms, const std::string &username="");
void add_quote_part(const std::string &str, const std::vector<std::string> ¶ms, const std::string &username="");
void set_emotion(const Request &request, const long &relation=5000);
void meet(const std::string &username);
void hello(const std::string &username, const long &relation);
void start(const std::string &username, const long &relation);
void finish(const std::vector<std::string> &results, const std::string &username, const long &relation);
void error(const std::vector<std::string> &errors, const std::string &username, const long &relation);
void crash(const std::string &reason, const std::string &username, const long &relation);
void tip(const std::vector<std::string> ¶ms, const std::string &username);
public:
Wipechan();
Wipechan(QWidget * centralWidget);
Wipechan(QWidget * centralWidget, QPlainTextEdit * blockquote);
void set_blockquote(QPlainTextEdit * blockquote);
void set_chan(const std::string &dir);
void call(const Request &request, const std::vector<std::string> ¶ms={}, const std::string &username="Аноним", const long &relation=5000);
void uncall();
bool is_called();
};
#endif // WIPECHAN_H