-
Notifications
You must be signed in to change notification settings - Fork 1
/
DBManager.h
40 lines (36 loc) · 996 Bytes
/
DBManager.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
#ifndef USESDATABASE_H
#define USESDATABASE_H
#include <QObject>
#include "QtSql/QtSql"
#include <QTableView>
class DBManager: public QObject
{
Q_OBJECT
private:
QSqlDatabase DataBase;
QString DataBaseName;
QString TableClientsName;
QString TableChannelsName;
QTableView *tableView;
public:
explicit DBManager(QObject *parent = 0);
explicit DBManager(QString name);
~DBManager();
void connectToBase();
void disconnectBase();
void createClientsTable();
void createChannelsTable();
bool addNewClient(QString, QString, QString inf);
bool addNewChannel(QString, QString topic);
bool isClient(QString nick);
void editInf(QString, QString inf);
void editPass(QString, QString password);
void editTopic(QString channelname, QString);
bool authorization(QString nick, QString);
//
signals:
void logMessage(QString&);
public slots:
void lookTable(QTableView *, QString tablename);
};
#endif // USESDATABASE_H