1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 #ifndef FONTEMBEDDINGMODEL_H
8 #define FONTEMBEDDINGMODEL_H
9 
10 #include <QAbstractItemModel>
11 #include <QVector>
12 
13 #include "scribusapi.h"
14 
15 class ScribusDoc;
16 
17 class SCRIBUS_API FontEmbeddingModel : public QAbstractItemModel
18 {
19 	Q_OBJECT
20 
21 public:
22 	//! Constructor
23 	FontEmbeddingModel(QObject* parent = nullptr);
24 
25 	//! Remove all colors from list;
26 	void clear();
27 
28 	//! Reimplement QAbstractItemModel columnCount()
29 	int columnCount(const QModelIndex &parent = QModelIndex()) const;
30 
31 	//! Reimplement QAbstractItemModel data()
32 	QVariant data(const QModelIndex &index, int role) const;
33 
34 	//! Reimplement QAbstractItemModel flags()
35 	Qt::ItemFlags flags(const QModelIndex &index) const;
36 
37 	//! Reimplement QAbstractItemModel index()
38 	QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
39 
40 	//! Reimplement QAbstractItemModel parent()
41 	QModelIndex parent(const QModelIndex &child) const;
42 
43 	//! Reimplement QAbstractItemModel removeRow()
44 	bool removeRow(int row, const QModelIndex& parent = QModelIndex());
45 
46 	//! Reimplement QAbstractItemModel removeRowz()
47 	bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex());
48 
49 	//! Reimplement QAbstractItemModel rowCount()
50 	int rowCount(const QModelIndex &parent = QModelIndex()) const;
51 
52 	//! Allow or disallow no font embedding mode
53 	void setNoFontEmbeddingEnabled(bool enabled);
54 
55 protected:
56 	//! The color list
57 	QVector<bool> m_enabledVec;
58 };
59 
60 #endif // FONTEMBEDDINGMODEL_H
61