forked from lpxxn/docx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocument.h
54 lines (38 loc) · 1.19 KB
/
document.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
#ifndef DOCUMENT_H
#define DOCUMENT_H
#include "docx_global.h"
#include "length.h"
#include <QString>
#include <QImage>
class QIODevice;
namespace Docx {
class Paragraph;
class Table;
class DocumentPart;
class Package;
class InlineShape;
class DOCX_EXPORT Document
{
public:
Document();
explicit Document(const QString& name);
explicit Document(QIODevice* device);
Paragraph *addParagraph(const QString &text = QString(), const QString &style = QString());
Paragraph *addHeading(const QString &text = QString(), int level = 1);
Table *addTable(int rows, int cols, const QString &style = QStringLiteral("TableGrid"));
InlineShape *addPicture(const QString &imgPath, const Length &width = Length(), const Length &height = Length());
InlineShape *addPicture(const QImage &img, const Length &width = Length(), const Length &height = Length());
Paragraph *addPageBreak();
QList<Paragraph*> paragraphs();
QList<Table*> tables();
virtual ~Document();
void save(const QString& path);
private:
void open(const QString& name);
void open(QIODevice* device);
public:
DocumentPart *m_docPart;
Package *m_package;
};
}
#endif // DOCUMENT_H