-
Notifications
You must be signed in to change notification settings - Fork 3
/
bcmgr.h
106 lines (82 loc) · 3.8 KB
/
bcmgr.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#ifndef BCMGR_H
#define BCMGR_H
#include <QObject>
#include "pathmanage.h"
#include "myglobal.h"
#include "myconfig.h"
#include "userdatadb.h"
#include "./AnsleDictCode/CreatWordListDB.h"
#include "QTreeWidget"
#include "QMessageBox"
#include "QString"
#include "QPoint"
#include "QMap"
class BCMgr : public QObject
{
Q_OBJECT
public:
explicit BCMgr(QObject *parent = 0,const QString &userName = NULL);
~BCMgr();
signals:
public slots:
QSqlDatabase *getUserBookdb();
QString getUserName();
QStringList getBookClasses();
QString getBookClasse(const QString &bookpath);
QStringList getBookNames();
QStringList getBookNames(const QString &bookclass);
QString getBookName(const QString &bookpath);
QStringList getBookPaths();
QString getBookPaths(const QString &bookclass, const QString &bookname);
int getTotalNumb(const QString &bookclass, const QString &bookname);
int getCount();
int getHaveLearnedNum(const QString &bookclass, const QString &bookname);
int getHaveLearnedNum(const QString &bookpath);
int getLearnState(const QString &bookclass, const QString &bookname);
int getLearnState(const QString &bookpath);
bool addNewBook(const QString &bookclass,const QString &bookname,
const QString &bookpath,int totalnum = 0);
void deleteBook(const QString &bookclass,const QString &bookname);
void addRootItem(QTreeWidget *parent, const QString &strings);
void addChildItem(QTreeWidget *parent, const QString &strings);
void addChildItem(QTreeWidget *parent,const QString &string,const QString &strings);
void removeRootItem(QTreeWidget *parent,const QString &strings,int column = 0);
void removeRootItem(QTreeWidget *parent);
void removeChildItem(QTreeWidget *parent);
void removeChildItemByRow(QTreeWidget *parent,int row = 0);
void editItem(QTreeWidget *parent,const QString &strings);
bool updateBookName(QTreeWidget *parent,const QString &bookclass,
const QString &bookname,const QString &newbookname);
bool updateBookClass(QTreeWidget *parent,const QString &bookclass,
const QString &newbookclass);
bool updateTotalNumb(const QString &bookclass,const QString &bookname,
int totalNumb = 0);
bool updateTotalNumb(const QString &bookpath,const int totalnumb = 0);
bool updateHaveLearnedNum(const QString &bookclass,const QString &bookname,const int havelearned = 0);
bool updateHaveLearnedNum(const QString &bookpath,const int havelearned = 0);
bool updateLearnState(const QString &bookclass,const QString &bookname,
bool learnstate = true);
bool updateLearnState(const QString &bookpath,bool learnstate = true);
///////////////////////////////////////////////////////////////////////////////////
//
bool existsDayRecord(const QString &bookpath,const QString &daytime);
bool addNewBookStudyRecord(const QString &bookpath, const QString &daytime,
const int &learncount, const int &reviewcount);
int getDayLearnRecord(const QString &bookpath,const QString &daytime);
int getDayReviewRecord(const QString &bookpath,const QString &daytime);
bool updateLearnRecord(const QString &bookpath, const QString &daytime,
const int &learncount);
bool updateReviewRecord(const QString &bookpath, const QString &daytime,
const int &reviewcount);
///////////////////////////////////////////////////////////////////////////////////
//
void showBookList(QTreeWidget *parent);
QSqlTableModel *userDataDBModel(QWidget *parent);
public:
MyConfig *userConf;//Óû§µÄÅäÖÃÐÅÏ¢
CreatWordListDB *myBook;
protected:
UserDataDB *userdatadb;
};
extern BCMgr *bcMgr;
#endif // BCMGR_H