forked from lpxxn/docx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackage.h
57 lines (44 loc) · 1.17 KB
/
package.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
#ifndef PACKAGE_H
#define PACKAGE_H
#include "./opc/opcpackage.h"
#include "./opc/rel.h"
#include "./opc/part.h"
#include <QList>
#include <QImage>
namespace Docx {
class ImagePart;
class ImageParts;
class Image;
class Package : public OpcPackage
{
public:
Package();
void loadRel(const QString &reltype, const QString &targetRef, Part *target, const QString rId, bool isternal = false);
static Package* open(const QString &pkgFile);
static Package* open(QIODevice *device);
void save(const QString &filePath);
void afterUnmarshal();
ImageParts *imageparts() const;
virtual ~Package();
private:
void gatherImageParts(const QMap<QString, Relationship *> &rels);
private:
ImageParts *m_imageParts;
};
class ImageParts
{
public:
ImageParts();
~ImageParts();
ImagePart *getOrAddImagePart(const PackURI &imageDescriptor);
ImagePart *getOrAddImagePart(const QImage &img);
ImagePart *getOrAddImagePart(Image *img);
void append(ImagePart * item);
private:
ImagePart *getByHash(const QByteArray &hash);
PackURI nextImagePartName(const QString &ext);
private:
QList<ImagePart *> m_imageparts;
};
}
#endif // PACKAGE_H