Scribus
Open source desktop publishing at your fingertips
util.h
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 _UTIL_H
8 #define _UTIL_H
9 
10 #include <vector>
11 
12 #include <QByteArray>
13 #include <QColor>
14 #include <QComboBox>
15 #include <QDataStream>
16 #include <QDir>
17 #include <QList>
18 #include <QPainterPath>
19 #include <QPair>
20 #include <QPixmap>
21 #include <QStack>
22 #include <QString>
23 #include <QStringList>
24 #include <QVector>
25 
26 #include "pagestructs.h"
27 #include "scribusapi.h"
28 
29 class QDomElement;
30 class QWidget;
31 class PageItem;
32 class ParagraphStyle;
33 class ScribusDoc;
34 class ScribusView;
35 
36 // class Foi;
37 
41 bool SCRIBUS_API compareDouble(double a, double b);
42 
49 QStringList SCRIBUS_API sortQStringList(QStringList aList);
50 bool SCRIBUS_API sortingQPairOfStrings( QPair<QString, QString> aP, QPair<QString, QString> bP);
51 void SCRIBUS_API ReOrderText(ScribusDoc *currentDoc, ScribusView *view);
52 void SCRIBUS_API WordAndPara(PageItem *currItem, int *w, int *p, int *c, int *wN, int *pN, int *cN);
53 bool SCRIBUS_API overwrite(QWidget *parent, QString filename);
54 QString SCRIBUS_API Path2Relative(QString Path, const QString& baseDir = QDir::currentPath());
55 QString SCRIBUS_API Relative2Path(QString File, const QString& baseDir = QDir::currentPath());
56 char SCRIBUS_API *toAscii85( quint32 value, bool& allZero );
57 char SCRIBUS_API *toHex( uchar u );
58 QString SCRIBUS_API String2Hex(QString *in, bool lang = true);
59 QString SCRIBUS_API CompressStr(QString *in);
60 QByteArray SCRIBUS_API CompressArray(const QByteArray& in);
62 bool SCRIBUS_API loadText(QString nam, QString *Buffer);
68 bool SCRIBUS_API loadRawText(const QString & filename, QByteArray & buf);
69 bool SCRIBUS_API loadRawBytes(const QString & filename, QByteArray & buf);
93 int SCRIBUS_API System(const QString exename, const QStringList & args,
94  const QString fileStdErr = "", const QString fileStdOut = "",
95  bool* cancel = NULL);
96 
104 QString SCRIBUS_API checkFileExtension(const QString & currName, const QString & extension);
109 QString SCRIBUS_API getShortPathName(const QString & longPath);
114 QString SCRIBUS_API getLongPathName(const QString & shortPath);
123 QString SCRIBUS_API getFileNameByPage(ScribusDoc* currDoc, uint pageNo, QString extension, QString prefix=QString::null);
124 //asterix is QString used in numeration when number is presented as few chars, like *, **, *** etc
125 //default is '*' but can be used any string
126 const QString SCRIBUS_API getStringFromSequence(NumFormat type, uint position, QString asterix="*");
127 const QString SCRIBUS_API arabicToRoman(uint i);
128 const QString SCRIBUS_API arabicToCJK(uint i);
129 QChar SCRIBUS_API cjkDigit(uint i);
130 const QString SCRIBUS_API numberToLetterSequence(uint i);
131 void SCRIBUS_API parsePagesString(QString pages, std::vector<int>* pageNs, int sourcePageCount);
132 
133 QString SCRIBUS_API readLinefromDataStream(QDataStream &s);
134 void SCRIBUS_API setCurrentComboItem(QComboBox *box, QString text);
135 
136 QString SCRIBUS_API readAdobeUniCodeString(QDataStream &s);
137 QString SCRIBUS_API readAdobeUniCodeString16(QDataStream &s);
138 
139 QString SCRIBUS_API getDashString(int dashtype, double linewidth);
140 void SCRIBUS_API getDashArray(int dashtype, double linewidth, QVector<double> &dashArray);
141 void SCRIBUS_API getDashArray(int dashtype, double linewidth, QVector<float> &dashArray);
142 
147 bool SCRIBUS_API convertOldTable(ScribusDoc *m_Doc, PageItem* gItem, QList<PageItem*> &gpL, QStack< QList<PageItem*> > *groupStackT = NULL, QList<PageItem *> *target = NULL);
148 
149 void SCRIBUS_API setWidgetBoldFont(QWidget* w, bool wantBold);
155 void SCRIBUS_API getUniqueName(QString &name, QStringList list, QString separator = "", bool prepend = false);
156 #endif
Definition: paragraphstyle.h:27
the Document Class
Definition: scribusdoc.h:90
Definition: pageitem.h:92
Definition: scribusview.h:87