Back to index

scribus-ng  1.3.4.dfsg+svn20071115
util.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 #ifndef _UTIL_H
00008 #define _UTIL_H
00009 
00010 #include <vector>
00011 
00012 #include <qcolor.h>
00013 #include <qstring.h>
00014 #include <qpixmap.h>
00015 #include <qstringlist.h>
00016 #include <qpointarray.h>
00017 #include <qvaluelist.h>
00018 #include <qpoint.h>
00019 
00020 #include "fpoint.h"
00021 #include "fpointarray.h"
00022 #include "pagestructs.h"
00023 #include "style.h"
00024 #include "styles/charstyle.h"
00025 #include "styles/paragraphstyle.h"
00026 #include "scribusapi.h"
00027 
00028 class ScribusDoc;
00029 class ParagraphStyle;
00030 class QDomElement;
00031 class QWidget;
00032 class ScribusView;
00033 struct CopyPasteBuffer;
00034 class PageItem;
00035 struct Layer;
00036 // class Foi;
00037 
00041 bool SCRIBUS_API compareDouble(double a, double b);
00042 
00043 void SCRIBUS_API GetItemProps(bool newVersion, QDomElement *obj, struct CopyPasteBuffer *OB);
00050 QStringList SCRIBUS_API sortQStringList(QStringList aList);
00051 void SCRIBUS_API ReOrderText(ScribusDoc *currentDoc, ScribusView *view);
00052 void SCRIBUS_API WordAndPara(PageItem *currItem, int *w, int *p, int *c, int *wN, int *pN, int *cN);
00053 bool SCRIBUS_API overwrite(QWidget *parent, QString filename);
00054 FPoint SCRIBUS_API getMaxClipF(FPointArray* Clip);
00055 FPoint SCRIBUS_API getMinClipF(FPointArray* Clip);
00056 QString SCRIBUS_API Path2Relative(QString Path);
00057 QByteArray SCRIBUS_API ComputeMD5Sum(QByteArray *in);
00058 char SCRIBUS_API *toHex( uchar u );
00059 QString SCRIBUS_API String2Hex(QString *in, bool lang = true);
00060 QString SCRIBUS_API CompressStr(QString *in);
00061 QByteArray SCRIBUS_API CompressArray(QByteArray *in);
00062 void SCRIBUS_API Level2Layer(ScribusDoc *currentDoc, struct Layer *ll, int Level);
00063 //int Layer2Level(ScribusDoc *currentDoc, int LayerNr);
00064 void SCRIBUS_API BezierPoints(QPointArray *ar, QPoint n1, QPoint n2, QPoint n3, QPoint n4);
00065 double SCRIBUS_API xy2Deg(double x, double y);
00066 QPointArray SCRIBUS_API FlattenPath(FPointArray ina, QValueList<uint> &Segs);
00067 QPointArray SCRIBUS_API RegularPolygon(double w, double h, uint c, bool star, double factor, double rota);
00068 FPointArray SCRIBUS_API RegularPolygonF(double w, double h, uint c, bool star, double factor, double rota);
00069 QPixmap SCRIBUS_API loadIcon(QString nam);
00070 uint SCRIBUS_API getDouble(QString in, bool raw);
00072 bool SCRIBUS_API loadText(QString nam, QString *Buffer);
00078 bool SCRIBUS_API loadRawText(const QString & filename, QCString & buf);
00079 bool SCRIBUS_API loadRawBytes(const QString & filename, QByteArray & buf);
00080 QString SCRIBUS_API GetAttr(QDomElement *el, QString at, QString def="0");
00102 int SCRIBUS_API System(const QStringList & args, const QString fileStdErr = "", const QString fileStdOut = "");
00103 int SCRIBUS_API copyFile(QString source, QString target);
00104 int SCRIBUS_API moveFile(QString source, QString target);
00112 QString SCRIBUS_API checkFileExtension(const QString &, const QString &);
00114 QString SCRIBUS_API getShortPathName(QString longPath);
00122 QString SCRIBUS_API getFileNameByPage(ScribusDoc* currDoc, uint pageNo, QString extension);
00123 void SCRIBUS_API sDebug(QString message);
00124 inline double SCRIBUS_API square(double);
00125 inline double SCRIBUS_API distance(double, double);
00132 double SCRIBUS_API constrainAngle(double angle, double constrain);
00139 double SCRIBUS_API getRotationFromMatrix(QWMatrix& matrix, double def);
00140 const QString SCRIBUS_API getStringFromSequence(DocumentSectionType type, uint position);
00141 const QString SCRIBUS_API arabicToRoman(uint i);
00142 const QString SCRIBUS_API numberToLetterSequence(uint i);
00143 void SCRIBUS_API parsePagesString(QString pages, std::vector<int>* pageNs, int sourcePageCount);
00144 
00145 #ifndef NLS_CONFORMANCE
00146 int SCRIBUS_API findParagraphStyle(ScribusDoc* doc, const ParagraphStyle& parStyle);
00147 int SCRIBUS_API findParagraphStyle(ScribusDoc* doc, const QString &name);
00148 #endif
00149 
00157 QPixmap SCRIBUS_API getQCheckBoxPixmap(const bool checked, const QColor background);
00158 
00163 void tDebug(QString message);
00164 
00165 QString SCRIBUS_API setupImageFormats();
00166 QString SCRIBUS_API getImageType(QString filename);
00167 
00168 #endif