-
Notifications
You must be signed in to change notification settings - Fork 0
/
book.h
48 lines (41 loc) · 1.14 KB
/
book.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
#ifndef BOOK_H
#define BOOK_H
#include <QWidget>
#include <QVBoxLayout>
#include "tabdata.h"
#include "sheet.h"
class Window;
class Book : public QWidget
{
Q_OBJECT
public:
Book(Window *window);
Window* window() const;
void addSheet(const QString &label = QString());
void removeSheet(int index, bool doDelete = true);
void setSheetLabel(int index, const QString &label);
QString sheetLabel(int index) const;
int count() const;
bool isEmpty() const;
SheetList sheets() const;
void setCurrentIndex(int value);
int currentIndex() const;
Sheet* currentSheet() const;
void nextSheet();
void previousSheet();
int indexOf(const QUuid &tabUid) const;
bool contains(const QUuid &tabUid) const;
Sheet* sheet(int index) const;
Sheet* sheet(const QUuid &tabUid) const;
TabData tabData() const;
bool moveSheet(Book *fromBook, const QUuid &tabUid, int toIndex);
signals:
void changed();
private:
Window* m_window;
SheetList m_sheets;
QVBoxLayout *m_layout;
void innerSetCurrentIndex(int index, bool &wasChanged);
QString newTabLabel() const;
};
#endif // BOOK_H