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 PAGESTRUCTS_H
8 #define PAGESTRUCTS_H
9 
10 #include <QMap>
11 #include <QList>
12 #include <QString>
13 #include "numeration.h"
14 
15 struct ObjectAttribute
16 {
17 	QString name;
18 	QString type;
19 	QString value;
20 	QString parameter;
21 	QString relationship;
22 	QString relationshipto;
23 	QString autoaddto;
24 };
25 
26 typedef QList<ObjectAttribute> ObjAttrVector;
27 
28 typedef enum {Beginning, End, NotShown} TOCPageLocation;
29 
30 struct ToCSetup
31 {
32 	QString name; //Name of ToC
33 	QString itemAttrName; //Attribute to Scan for
34 	QString frameName; //Destination frame
35 	TOCPageLocation pageLocation; //Place the page number for the TOC at the beginning, end or not at all
36 	bool listNonPrintingFrames; //List non printing frames in the TOC
37 	QString textStyle; //Paragraph style for text
38 	//QString leaderParaStyle; //Paragraph style for leaders
39 	//QString pageNumberParaStyle; //Paragraph style for page numbers
40 };
41 
42 typedef QList<ToCSetup> ToCSetupVector;
43 
44 struct DocumentSection
45 {
46 	uint number; //Just an index in the section list
47 	QString name; //User defined name for the section
48 	uint fromindex; //First page _index_ of the section in the document (old page number)
49 	uint toindex; //Last page _index_ of the section in the document (old page number)
50 	NumFormat type; //Type of section numbering, ie i,ii,iii or a,b,c or 1,2,3, etc
51 	uint sectionstartindex; // Start of section, an index in the range of type, eg for type i,ii,iii, this would be 2 for "ii".
52 	bool reversed; // Counting 10-1 ?
53 	bool active; // Is the section active, ie, if the fromindex is 10, and theres 5 pages, this should be inactive.
54 	QChar pageNumberFillChar; //Prefix to be placed before page number
55 	int pageNumberWidth; //Minimum width of page number string
56 
57 	bool operator==(const DocumentSection &other) const
58 	{
59 		if (number != other.number)
60 			return false;
61 		if (name != other.name)
62 			return false;
63 		if (fromindex != other.fromindex)
64 			return false;
65 		if (toindex != other.toindex)
66 			return false;
67 		if (type != other.type)
68 			return false;
69 		if (sectionstartindex != other.sectionstartindex)
70 			return false;
71 		if (reversed != other.reversed)
72 			return false;
73 		if (active != other.active)
74 			return false;
75 		if (pageNumberFillChar != other.pageNumberFillChar)
76 			return false;
77 		if (pageNumberWidth != other.pageNumberWidth)
78 			return false;
79 		return true;
80 	}
81 
82 	inline bool operator!=(const DocumentSection &other) const
83 	{
84 		return (this->operator==(other) == false);
85 	}
86 };
87 
88 typedef QMap<uint, DocumentSection> DocumentSectionMap;
89 
90 typedef enum
91 {
92 	singlePage,
93 	doublePage,
94 	triplePage,
95 	quadroPage
96 } PageLayout;
97 
98 typedef enum
99 {
100 	LeftPage,
101 	MiddlePage,
102 	RightPage
103 } PageLocation;
104 
105 
106 #endif
107