Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

scribusdoc.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 /***************************************************************************
00008                           scribusdoc.h  -  description
00009                              -------------------
00010     begin                : Fre Apr  6 21:47:55 CEST 2001
00011     copyright            : (C) 2001 by Franz Schmid
00012     email                : Franz.Schmid@altmuehlnet.de
00013  ***************************************************************************/
00014 
00015 /***************************************************************************
00016  *                                                                         *
00017  *   This program is free software; you can redistribute it and/or modify  *
00018  *   it under the terms of the GNU General Public License as published by  *
00019  *   the Free Software Foundation; either version 2 of the License, or     *
00020  *   (at your option) any later version.                                   *
00021  *                                                                         *
00022  ***************************************************************************/
00023 #ifndef SCRIBUSDOC_H
00024 #define SCRIBUSDOC_H
00025 #ifdef HAVE_CONFIG_H
00026 #include "scconfig.h"
00027 #endif
00028 // include files for QT
00029 #include <QColor>
00030 #include <QFont>
00031 #include <QList>
00032 #include <QMap>
00033 #include <QObject>
00034 #include <QPixmap>
00035 #include <QRectF>
00036 #include <QStringList>
00037 #include <QTimer>
00038 
00039 
00040 #include "gtgettext.h" //CB For the ImportSetup struct and itemadduserframe
00041 #include "scribusapi.h"
00042 #include "observable.h"
00043 #include "prefsstructs.h"
00044 #include "documentinformation.h"
00045 #include "undoobject.h"
00046 #include "page.h"
00047 #include "pageitem.h"
00048 #include "pagestructs.h"
00049 #include "usertaskstructs.h"
00050 #include "styles/styleset.h"
00051 #include "scguardedptr.h"
00052 #include "updatemanager.h"
00053 #include "sclayer.h"
00054 
00055 #include CMS_INC
00056 
00057 #include <ft2build.h>
00058 #include FT_FREETYPE_H
00059 
00060 class DocUpdater;
00061 class UndoManager;
00062 class UndoState;
00063 class PDFOptions;
00064 class Hyphenator;
00065 class Selection;
00066 class ScribusView;
00067 class ScribusMainWindow;
00068 class ResourceCollection;
00069 class PageSize;
00070 class ScPattern;
00071 class UndoTransaction;
00072 
00073 class QProgressBar;
00074 
00075 struct SCRIBUS_API NodeEditContext : public MassObservable<QPointF>
00076 {
00077     enum SubMode { MOVE_POINT = 0, ADD_POINT = 1, DEL_POINT = 2, SPLIT_PATH = 3 };
00078     int submode;
00079     bool isContourLine;
00080     FPointArray *oldClip;
00081     UndoTransaction* nodeTransaction;
00082     double oldItemX;
00083     double oldItemY;
00084         
00085     int ClRe;
00086     int ClRe2;
00087     int SegP1;
00088     int SegP2;
00089     bool EdPoints;
00090     bool MoveSym;
00091     QList<int> SelNode; 
00092     
00093     NodeEditContext();
00094     
00095     bool hasNodeSelected();
00096     void deselect();
00097     
00098     void reset();
00099     
00100     void reset1Control(PageItem* currItem);
00101     void resetControl(PageItem* currItem);
00102     FPointArray beginTransaction(PageItem* currItem);
00103     void finishTransaction(PageItem* currItem);
00104     ItemState<QPair<FPointArray, FPointArray> >* finishTransaction1(PageItem* currItem);
00105     void finishTransaction2(PageItem* currItem, ItemState<QPair<FPointArray, FPointArray> >* state);
00106     void moveClipPoint(PageItem *currItem, FPoint ip);
00107 };
00108 
00109 
00112 class SCRIBUS_API ScribusDoc : public QObject, public UndoObject, public Observable<ScribusDoc>
00113 {
00114     Q_OBJECT
00115 
00116 public:
00117     ScribusDoc();
00118     ScribusDoc(const QString& docName, int unitIndex, const PageSize& pagesize, const MarginStruct& margins, const DocPagesSetup& pagesSetup);
00119     ~ScribusDoc();
00120     void init();
00121     void setup(const int, const int, const int, const int, const int, const QString&, const QString&);
00122     void setLoading(const bool);
00123     bool isLoading() const;
00124     void setModified(const bool);
00125     bool isModified() const;
00127     void setPage(double b, double h, double t, double l, double r, double bo, double sp, double ab, bool atf, int fp);
00128     void resetPage(double t, double l, double r, double bo, int fp);
00129 
00133     ScribusView* view() const;
00134     ScribusMainWindow* scMW() const {return m_ScMW;}
00135     void setGUI(bool hasgui, ScribusMainWindow* mw, ScribusView* view);
00136 
00140     const ScGuardedPtr<ScribusDoc>& guardedPtr() const;
00141     
00142     UpdateManager* updateManager() { return &m_updateManager; }
00143     MassObservable<PageItem*> * itemsChanged() { return &m_itemsChanged; }
00144     MassObservable<Page*>     * pagesChanged() { return &m_pagesChanged; }
00145     MassObservable<QRectF>    * regionsChanged() { return &m_regionsChanged; }
00146     void invalidateRegion(QRectF region);
00147     
00148     // Add, delete and move pages
00149     
00150     Page* addPage(const int pageNumber, const QString& masterPageName=QString::null, const bool addAutoFrame=false);
00151     void deletePage(const int);
00153     Page* addMasterPage(const int, const QString&);
00154     void deleteMasterPage(const int);
00156     void rebuildMasterNames(void);
00158     void replaceMasterPage(const QString& oldMasterPage);
00160     bool renameMasterPage(const QString& oldPageName, const QString& newPageName);
00162     void createDefaultMasterPages();
00164     void createNewDocPages(int pageCount);
00170     int addAutomaticTextFrame(const int pageNumber);
00175     void setLocationBasedPageLRMargins(uint pageIndex);
00183     void movePage(const int from, const int to, const int ziel, const int art);
00184     
00192     void copyPage(int pageNumberToCopy, int existingPage, int whereToInsert, int copyCount);
00193     
00194     // Add, delete and move layers
00201     int addLayer(const QString& layerName=QString::null, const bool activate=false);
00208     void copyLayer(int layerNumberToCopy, int whereToInsert);
00215     bool deleteLayer(const int layerNumber, const bool deleteItems);
00220     int activeLayer();
00221 
00226     const QString& activeLayerName();
00232     bool setActiveLayer(const int layerToActivate);
00238     bool setActiveLayer(const QString & layerNameToActivate);
00245     bool setLayerPrintable(const int layerNumber, const bool isPrintable);
00251     bool layerPrintable(const int layerNumber);
00258     bool setLayerVisible(const int layerNumber, const bool isViewable);
00264     bool layerVisible(const int layerNumber);
00271     bool setLayerLocked(const int layerNumber, const bool isLocked);
00277     bool layerLocked(const int layerNumber);
00284     bool setLayerFlow(const int layerNumber, const bool flow);
00290     bool layerFlow(const int layerNumber);
00297     bool setLayerTransparency(const int layerNumber, double trans);
00303     double layerTransparency(const int layerNumber);
00310     bool setLayerBlendMode(const int layerNumber, int blend);
00316     int layerBlendMode(const int layerNumber);
00322     int layerLevelFromNumber(const int layerNumber);
00329     bool setLayerMarker(const int layerNumber, QColor color);
00335     QColor layerMarker(const int layerNumber);
00342     bool setLayerOutline(const int layerNumber, const bool outline);
00348     bool layerOutline(const int layerNumber);
00354     int layerNumberFromLevel(const int layerLevel);
00359     int layerCount() const;
00365     bool lowerLayer(const int layerNumber);
00371     bool lowerLayerByLevel(const int layerLevel);
00377     bool raiseLayer(const int layerNumber);
00383     bool raiseLayerByLevel(const int layerLevel);
00389     QString layerName(const int layerNumber) const;
00396     bool changeLayerName(const int layerNumber, const QString& newName);
00402     bool layerContainsItems(const int layerNumber);
00409     bool renumberLayer(const int layerNumber, const int newLayerNumber);
00414     void orderedLayerList(QStringList* list);
00415     //Items
00416     bool deleteTaggedItems();
00417 
00421     void getUsedProfiles(ProfilesL& usedProfiles);
00422     bool OpenCMSProfiles(ProfilesL InPo, ProfilesL InPoCMYK, ProfilesL MoPo, ProfilesL PrPo);
00423     void CloseCMSProfiles();
00424     void SetDefaultCMSParams();
00429     void enableCMS(bool enable);
00430     
00431     const ParagraphStyle& paragraphStyle(QString name) { return docParagraphStyles.get(name); }
00432     const StyleSet<ParagraphStyle>& paragraphStyles()   { return docParagraphStyles; }
00433     bool isDefaultStyle( const ParagraphStyle& p ) const { return docParagraphStyles.isDefault(p); }
00434     bool isDefaultStyle( const CharStyle& c ) const { return docCharStyles.isDefault(c); }
00435 //  bool isDefaultStyle( LineStyle& l ) const { return MLineStyles......; }
00436 
00437     void getNamedResources(ResourceCollection& lists) const;
00438     void replaceNamedResources(ResourceCollection& newNames);   
00439     
00440     void redefineStyles(const StyleSet<ParagraphStyle>& newStyles, bool removeUnused=false);
00446     void replaceStyles(const QMap<QString,QString>& newNameForOld);
00447     void loadStylesFromFile(QString fileName, StyleSet<ParagraphStyle> *tempStyles = NULL,
00448                                               StyleSet<CharStyle> *tempCharStyles = NULL,
00449                                               QMap<QString, multiLine> *tempLineStyles = NULL);
00450 
00451     const CharStyle& charStyle(QString name) { return docCharStyles.get(name); }
00452     const StyleSet<CharStyle>& charStyles()  { return docCharStyles; }
00453     void redefineCharStyles(const StyleSet<CharStyle>& newStyles, bool removeUnused=false);
00459     void replaceCharStyles(const QMap<QString,QString>& newNameForOld);
00460 
00467     void lockGuides(bool isLocked);
00474     void restore(UndoState* state, bool isUndo);
00480     void setName(const QString& name);
00484     QStringList getItemAttributeNames();
00485 
00486     bool AddFont(QString name, int fsize = 10);
00490     void getUsedFonts(QMap<QString,QMap<uint, FPointArray> > &Really);
00491     void checkItemForFonts(PageItem *it, QMap<QString, QMap<uint, FPointArray> > & Really, uint lc);
00492 
00496     void replaceLineStyleColors(const QMap<QString, QString>& colorMap);
00500     void getUsedColors(ColorList &colorsToUse, bool spot = false);
00504     bool lineStylesUseColor(const QString& colorName);
00508     bool addPattern(QString &name, ScPattern& pattern);
00509     void setPatterns(QMap<QString, ScPattern> &patterns);
00513     QStringList getUsedPatterns();
00514     QStringList getUsedPatternsSelection();
00515     QStringList getUsedPatternsHelper(QString pattern, QStringList &results);
00519     void reorganiseFonts();
00523     void setUnitIndex(const int);
00524     int unitIndex() const;
00525     double unitRatio() const;
00529     bool applyMasterPage(const QString& pageName, const int pageNumber);
00533     void restoreMasterPageApplying(SimpleState *state, bool isUndo);
00534     void restorePageCopy(SimpleState *state, bool isUndo);
00538     bool save(const QString& fileName, QString* savedFile = NULL);
00542     bool changePageMargins(const double initialTop, const double initialBottom, const double initialLeft, const double initialRight, const double initialHeight, const double initialWidth, const double Height, const double width, const int orientation, const QString& pageSize, const int pageNumber=-1, const int pageType = 0);
00546      void recalculateColors();
00550     void setScTextDefaultsFromDoc(ScText *);
00554     bool copyPageToMasterPage(const int, const int, const int, const QString&, bool);
00562     //TODO: void PasteItem(struct CopyPasteBuffer *Buffer, bool loading, bool drag = false);
00563     
00581     int itemAdd(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, const double x, const double y, const double b, const double h, const double w, const QString& fill, const QString& outline, const bool itemFinalised);
00582 
00584     int itemAddArea(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, const double x, const double y, const double w, const QString& fill, const QString& outline, const bool itemFinalised);
00585     
00602     int itemAddUserFrame(InsertAFrameData &iafData);
00603 
00609     bool itemAddCommit(const int itemNumber);
00610     
00615     void itemAddDetails(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, const int itemNumber);
00616 
00617     uint getItemNrfromUniqueID(uint unique);
00618     //itemDelete
00619     //itemBlah...
00620     
00624     void updateFrameItems();
00632     void renumberItemsInListOrder();
00639     void rebuildItemLists();
00643     bool usesAutomaticTextFrames() const;
00644     void setUsesAutomaticTextFrames(const bool);
00645     
00650     bool LoadPict(QString fn, int ItNr, bool reload = false, bool showMsg = false);
00658     bool loadPict(QString fn, PageItem *pageItem, bool reload = false, bool showMsg = false);
00665     void RecalcPictures(ProfilesL *Pr, ProfilesL *PrCMYK, QProgressBar *dia = 0);
00669     void canvasMinMax(FPoint&, FPoint&);
00670     
00671     int OnPage(double x2, double  y2);
00672     int OnPage(PageItem *currItem);
00673     void GroupOnPage(PageItem *currItem);
00674     //void reformPages(double& maxX, double& maxY, bool moveObjects = true);
00675     void reformPages(bool moveObjects = true);
00676     
00682     double getXOffsetForPage(const int);
00683     double getYOffsetForPage(const int);
00684     void getBleeds(int pageNumber, double *bleedTop, double *bleedBottom, double *bleedLeft, double *bleedRight);
00685     void getBleeds(Page* page, double *bleedTop, double *bleedBottom, double *bleedLeft, double *bleedRight);
00686     
00690     PageItem* convertItemTo(PageItem *currItem, PageItem::ItemType newType, PageItem* secondaryItem=NULL);
00691     
00695     int currentPageNumber();
00696     
00703     bool itemNameExists(const QString itemName);
00704     
00709     void setMasterPageMode(bool);
00710 
00711     /*** Is the document in master page mode? */
00712     bool masterPageMode() const { return m_masterPageMode; }
00713     
00718     void addSection(const int number=0, const QString& name=QString::null, const uint fromindex=0, const uint toindex=0, const  DocumentSectionType type=Type_1_2_3, const uint sectionstartindex=0, const bool reversed=false, const bool active=true);
00722     bool deleteSection(const uint);
00727     const QString getSectionPageNumberForPageIndex(const uint) const;
00732     int getSectionKeyForPageIndex(const uint pageIndex) const;
00737     void updateSectionPageNumbersToPages();
00744     void addPageToSection(const uint otherPageIndex, const uint location, const uint count=1);
00749     void removePageFromSection(const uint pageIndex);
00753     void setFirstSectionFromFirstPageNumber();
00757     void updateAllItemQColors();
00759     typedef enum {alignFirst, alignLast, alignPage, alignMargins, alignGuide, alignSelection } AlignTo;
00760     void buildAlignItemList(Selection* customSelection=0);
00761     bool startAlign();
00762     void endAlign();
00771     void insertColor(QString nam, double c, double m, double y, double k);
00772     
00773     QMap<QString, double>& constants() { return m_constants; }
00780     PageLocation locationOfPage(int pageIndex) const;
00781     
00782     bool sendItemSelectionToBack();
00783     bool bringItemSelectionToFront();
00784 
00785     void itemSelection_GroupObjects  (bool changeLock, bool lock, Selection* customSelection=0);
00786     void itemSelection_UnGroupObjects(Selection* customSelection=0);
00787     void itemSelection_convertItemsTo(const PageItem::ItemType newType, Selection* customSelection=0);
00788 
00789     void itemSelection_ApplyParagraphStyle(const ParagraphStyle & newstyle, Selection* customSelection=0);
00790     void itemSelection_SetParagraphStyle(const ParagraphStyle & newstyle, Selection* customSelection=0);
00791     void itemSelection_ApplyCharStyle(const CharStyle & newstyle, Selection* customSelection=0);
00792     void itemSelection_SetCharStyle(const CharStyle & newstyle, Selection* customSelection=0);
00793     void itemSelection_EraseParagraphStyle(Selection* customSelection=0);
00794     void itemSelection_EraseCharStyle(Selection* customSelection=0);
00795 
00796     void itemSelection_SetNamedParagraphStyle(const QString & name, Selection* customSelection=0);
00797     void itemSelection_SetNamedCharStyle(const QString & name, Selection* customSelection=0);
00798     void itemSelection_SetNamedLineStyle(const QString & name, Selection* customSelection=0);
00799 
00800     void ChLineWidth(double w);
00801     void ChLineArt(Qt::PenStyle w);
00802     void ChLineJoin(Qt::PenJoinStyle w);
00803     void ChLineEnd(Qt::PenCapStyle w);
00804     void itemSelection_SetAlignment(int w, Selection* customSelection=0);
00805     void itemSelection_SetLineSpacing(double w, Selection* customSelection=0);
00806     void itemSelection_SetLineSpacingMode(int w, Selection* customSelection=0);
00807     //void ChLocalXY(double x, double y);
00808     //void ChLocalSc(double x, double y);
00809     void itemSelection_SetFont(QString fon, Selection* customSelection=0);
00810     void itemSelection_SetFillColor(QString farbe, Selection* customSelection=0);
00811     void itemSelection_SetFillShade(int sha, Selection* customSelection=0);
00812     void itemSelection_SetStrokeColor(QString farbe, Selection* customSelection=0);
00813     void itemSelection_SetStrokeShade(int sha, Selection* customSelection=0);
00814     void itemSelection_SetScaleV(int, Selection* customSelection=0);
00815     void itemSelection_SetScaleH(int, Selection* customSelection=0);
00816     void itemSelection_SetBaselineOffset(int, Selection* customSelection=0);
00817     void itemSelection_SetOutlineWidth(int, Selection* customSelection=0);
00818     void itemSelection_SetShadowOffsets(int shx, int shy, Selection* customSelection=0);
00819     void itemSelection_SetUnderline(int pos, int wid, Selection* customSelection=0);
00820     void itemSelection_SetStrikethru(int pos, int wid, Selection* customSelection=0);
00821     void itemSelection_SetEffects(int s, Selection* customSelection=0);
00822     void itemSelection_SetOpticalMargins(int i, Selection* customSelection=0);
00823     
00824 //  void chAbStyle(PageItem *currItem, int s);
00825 
00826     void itemSelection_SetTracking(int us, Selection* customSelection=0);
00827     void itemSelection_SetFontSize(int size, Selection* customSelection=0);
00828     //void FlipImageH();
00829     //void FlipImageV();
00830     void MirrorPolyH(PageItem *currItem);
00831     void MirrorPolyV(PageItem *currItem);
00832     
00833     void setRedrawBounding(PageItem *currItem);
00834     void adjustCanvas(FPoint minPos, FPoint maxPos, bool absolute = false);
00835     void recalcPicturesRes(bool applyNewRes = false);
00836     void connectDocSignals();
00837     void removeLayer(int l, bool dl = false); //FIXME: Make protected once scripter function no longer uses this directly
00842     void changed();
00845     Page* currentPage();
00848     void setCurrentPage(Page *newPage);
00849     bool hasGUI() const {return m_hasGUI;}
00851     QPoint ApplyGrid(const QPoint& in);
00853     FPoint ApplyGridF(const FPoint& in);
00855     bool hasTOCSetup() { return !docToCSetups.empty(); }
00857     void getClosestGuides(double xin, double yin, double *xout, double *yout, int *GxM, int *GyM);
00859     void SnapToGuides(PageItem *currItem);
00860     bool ApplyGuides(double *x, double *y);
00861     bool MoveItem(double newX, double newY, PageItem* ite, bool fromMP = false);
00862     void RotateItem(double win, int ite);
00863     void RotateItem(double win, PageItem *currItem);
00864     void MoveRotated(PageItem *currItem, FPoint npv, bool fromMP = false);
00865     bool SizeItem(double newX, double newY, int ite, bool fromMP = false, bool DoUpdateClip = true, bool redraw = true);
00866     bool SizeItem(double newX, double newY, PageItem *pi, bool fromMP = false, bool DoUpdateClip = true, bool redraw = true);
00867     bool MoveSizeItem(FPoint newX, FPoint newY, int ite, bool fromMP = false, bool constrainRotation=false);
00868     void AdjustItemSize(PageItem *currItem);
00869     void moveGroup(double x, double y, bool fromMP = false, Selection* customSelection = 0);
00870     void rotateGroup(double angle, FPoint RCenter);
00871     void scaleGroup(double scx, double scy, bool scaleText=true, Selection* customSelection = 0);
00872     
00873 protected:
00874     void addSymbols();
00875     bool m_hasGUI;
00876     ApplicationPrefs& prefsData;
00877     UndoManager * const undoManager;
00878     bool loading;
00879     bool modified;
00880     int ActiveLayer;
00881     int docUnitIndex;
00882     double docUnitRatio;
00883     bool automaticTextFrames; // Flag for automatic Textframes
00884     bool m_masterPageMode;
00885     QMap<QString, double> m_constants;
00886     ScribusMainWindow* m_ScMW;
00887     ScribusView* m_View;
00888     ScGuardedObject<ScribusDoc> m_guardedObject;
00889     
00890 public: // Public attributes
00891     bool is12doc; //public for now, it will be removed later
00892     int NrItems;
00893     int First;
00894     int Last;
00895     int viewCount;
00896     int viewID;
00897     bool SnapGuides;
00898     bool GuideLock;
00900     MarginStruct scratch;
00901     double GapHorizontal;
00902     double GapVertical;
00903 //  double ScratchLeft;
00904 //  double ScratchRight;
00905 //  double ScratchTop;
00906 //  double ScratchBottom;
00908     FPoint minCanvasCoordinate;
00909     FPoint maxCanvasCoordinate;
00910     double rulerXoffset;
00911     double rulerYoffset;
00913     QList<Page*>* Pages;
00915     QList<Page*> MasterPages;
00917     QList<Page*> DocPages;
00919     QMap<QString,int> MasterNames;
00921     QList<PageItem*>* Items;
00922     QList<PageItem*> MasterItems;
00923     QList<PageItem*> DocItems;
00924     QList<PageItem*> FrameItems;
00925     Selection* const m_Selection;
00927     double pageWidth;
00929     double pageHeight;
00930     /* Number of Pages */
00931     // int pageCount; Disabled CR no longer required
00933     MarginStruct pageMargins;
00934     QList<PageSet> pageSets;
00935     MarginStruct bleeds;
00936 //  double BleedTop;
00937 //  double BleedLeft;
00938 //  double BleedRight;
00939 //  double BleedBottom;
00941     double PageSp;
00943     double PageSpa;
00945     int currentPageLayout;
00947     int PageOri;
00948     QString m_pageSize;
00950     int FirstPnum;
00952     bool useRaster;
00954     ColorList PageColors;
00956     DocumentInformation documentInfo;
00957     int appMode;
00958     int SubMode;
00959     double *ShapeValues;
00960     int ValCount;
00961     QString DocName;
00962     QMap<QString,int> UsedFonts;
00963     SCFonts * const AllFonts;
00964     QList<AlignObjs> AObjects;
00965     QColor papColor;
00966     int CurrentSel;
00967     ParagraphStyle currentStyle;
00968 
00969     NodeEditContext nodeEdit;
00970 
00971     typoPrefs typographicSettings;
00972     guidesPrefs guidesSettings;
00973     toolPrefs toolSettings;
00974     QMap<QString, checkerPrefs> checkerProfiles;
00975     QString curCheckProfile;
00977     PageItem *LastAuto;
00979     PageItem *FirstAuto;
00980     bool DragP;
00981     bool leaveDrag;
00982     PageItem *DraggedElem;
00983     PageItem *ElemToLink;
00984     QList<uint> DragElements;
00985 private:
00986     StyleSet<ParagraphStyle> docParagraphStyles;
00987     StyleSet<CharStyle> docCharStyles;
00988 public:
00989     ScLayers Layers;
00990     bool marginColored;
00991     int GroupCounter;
00992     CMSData CMSSettings;
00993     cmsHPROFILE DocInputImageRGBProf;
00994     cmsHPROFILE DocInputImageCMYKProf;
00995     cmsHPROFILE DocInputRGBProf;
00996     cmsHPROFILE DocInputCMYKProf;
00997     cmsHPROFILE DocOutputProf;
00998     cmsHPROFILE DocPrinterProf;
00999     cmsHTRANSFORM stdTransRGBMon;
01000     cmsHTRANSFORM stdTransCMYKMon;
01001     cmsHTRANSFORM stdProof;
01002     cmsHTRANSFORM stdTransImg;
01003     cmsHTRANSFORM stdProofImg;
01004     cmsHTRANSFORM stdProofImgCMYK;
01005     cmsHTRANSFORM stdTransCMYK;
01006     cmsHTRANSFORM stdProofCMYK;
01007     cmsHTRANSFORM stdTransRGB;
01008     cmsHTRANSFORM stdProofGC;
01009     cmsHTRANSFORM stdProofCMYKGC;
01010     bool BlackPoint;
01011     bool SoftProofing;
01012     bool Gamut;
01013     int  IntentColors;
01014     int  IntentImages;
01015     bool HasCMS;
01016     QMap<QString,QString> JavaScripts;
01017     int TotalItems;
01018     int MinWordLen;
01019     int HyCount;
01020     QString Language;
01021     bool Automatic;
01022     bool AutoCheck;
01023     
01024     PDFOptions PDF_Options;
01025     PrintOptions Print_Options;
01026     bool RePos;
01027     struct BookMa {
01028                     QString Title;
01029                     QString Text;
01030                     QString Aktion;
01031                     PageItem *PageObject;
01032                     int Parent;
01033                     int ItemNr;
01034                     int First;
01035                     int Last;
01036                     int Prev;
01037                     int Next;
01038                     };
01039     QList<BookMa> BookMarks;
01040     bool OldBM;
01041     bool hasName;
01042     int RotMode;
01043     bool AutoSave;
01044     int AutoSaveTime;
01045     QTimer * const autoSaveTimer;
01046     QMap<QString,multiLine> MLineStyles;
01047     QList<ArrowDesc> arrowStyles;
01048     QMap<QString, ScPattern> docPatterns;
01049     QWidget* WinHan;
01050     bool DoDrawing;
01051     struct OpenNodesList
01052     {
01053         int type;
01054         Page *page;
01055         PageItem *item;
01056     };
01057     QList<OpenNodesList> OpenNodes;
01058     QTimer *CurTimer;
01059     QMap<int, errorCodes> docLayerErrors;
01060     QMap<int, errorCodes> docItemErrors;
01061     QMap<int, errorCodes> masterItemErrors;
01062     //Attributes to be applied to frames
01063     ObjAttrVector docItemAttributes;
01064     ToCSetupVector docToCSetups;
01065     DocumentSectionMap sections;
01066     FPointArray symReturn;
01067     FPointArray symNewLine;
01068     FPointArray symTab;
01069     FPointArray symNonBreak;
01070     FPointArray symNewCol;
01071     FPointArray symNewFrame;
01072     
01073     Hyphenator * docHyphenator;
01074 private:
01075     UndoTransaction* m_itemCreationTransaction;
01076     UndoTransaction* m_alignTransaction;
01077 
01078     Page* _currentPage;
01079     UpdateManager m_updateManager;
01080     MassObservable<PageItem*> m_itemsChanged;
01081     MassObservable<Page*> m_pagesChanged;
01082     MassObservable<QRectF> m_regionsChanged;
01083     DocUpdater* m_docUpdater;
01084     
01085 signals:
01086     //Lets make our doc talk to our GUI rather than confusing all our normal stuff
01090     void docChanged();
01091     void updateContents();
01092     void updateContents(const QRect &r);
01093     void refreshItem(PageItem *);
01094     void canvasAdjusted(double width, double height, double dX, double dY);
01095     void firstSelectedItemType(int);
01096     void setApplicationMode(int);
01106     void signalRebuildOutLinePalette();
01108     void widthAndHeight(double, double);
01109     
01110 public slots:
01111     void itemSelection_ToggleLock();
01112     void itemSelection_ToggleSizeLock();
01113     void itemSelection_ToggleImageShown();
01114     void itemSelection_TogglePrintEnabled();
01115     void itemSelection_ChangePreviewResolution(int id);
01116     void itemSelection_ClearItem(Selection* customSelection=0);
01118     void itemSelection_DeleteItem(Selection* customSelection=0, bool forceDeletion=false);
01119     void itemSelection_SetItemFillTransparency(double t);
01120     void itemSelection_SetItemLineTransparency(double t);
01121     void itemSelection_SetItemFillBlend(int t);
01122     void itemSelection_SetItemLineBlend(int t);
01123     void itemSelection_SetLineGradient(VGradient& newGradient, Selection* customSelection=0);
01124     void itemSelection_SetFillGradient(VGradient& newGradient, Selection* customSelection=0);
01125     void itemSelection_SetOverprint(bool overprint, Selection* customSelection=0);
01126     void itemSelection_ApplyImageEffects(ScImageEffectList& newEffectList, Selection* customSelection=0);
01127     void itemSelection_FlipH();
01128     void itemSelection_FlipV();
01129     void itemSelection_DoHyphenate();
01130     void itemSelection_DoDeHyphenate();
01131     void itemSelection_SendToLayer(int layerNumber);
01132     void itemSelection_SetImageOffset(double x, double y, Selection* customSelection=0);
01133     void itemSelection_SetImageScale(double x, double y, Selection* customSelection=0);
01134     void itemSelection_SetImageScaleAndOffset(double ox, double oy, double sx, double sy, Selection* customSelection=0);
01135     void itemSelection_AlignLeftOut(AlignTo currAlignTo, double guidePosition);
01136     void itemSelection_AlignRightOut(AlignTo currAlignTo, double guidePosition);
01137     void itemSelection_AlignBottomIn(AlignTo currAlignTo, double guidePosition);
01138     void itemSelection_AlignRightIn(AlignTo currAlignTo, double guidePosition);
01139     void itemSelection_AlignBottomOut(AlignTo currAlignTo, double guidePosition);
01140     void itemSelection_AlignCenterHor(AlignTo currAlignTo, double guidePosition);
01141     void itemSelection_AlignLeftIn(AlignTo currAlignTo, double guidePosition);
01142     void itemSelection_AlignCenterVer(AlignTo currAlignTo, double guidePosition);
01143     void itemSelection_AlignTopOut(AlignTo currAlignTo, double guidePosition);
01144     void itemSelection_AlignTopIn(AlignTo currAlignTo, double guidePosition);
01145     void itemSelection_DistributeDistH(bool usingDistance=false, double distance=0.0);
01146     void itemSelection_DistributeAcrossPage(bool useMargins=false);
01147     void itemSelection_DistributeRight();
01148     void itemSelection_DistributeBottom();
01149     void itemSelection_DistributeCenterH();
01150     void itemSelection_DistributeDistV(bool usingDistance=false, double distance=0.0);
01151     void itemSelection_DistributeDownPage(bool useMargins=false);
01152     void itemSelection_DistributeLeft();
01153     void itemSelection_DistributeCenterV();
01154     void itemSelection_DistributeTop();
01155     void itemSelection_MultipleDuplicate(ItemMultipleDuplicateData&);
01156     void itemSelection_UniteItems(Selection* customSelection=0);
01157     void itemSelection_SplitItems(Selection* customSelection=0);
01161     void itemSelection_adjustFrametoImageSize(Selection* customSelection=0);
01163     void itemSelection_ApplyArrowHead(int startArrowID=-1, int endArrowID=-1, Selection* customSelection=0);
01164 
01165     void ItemPen(QString farbe);
01166     void ItemPenShade(int sha);
01167     void ItemBrush(QString farbe);
01168     void ItemBrushShade(int sha);
01169     void ItemGradFill(int typ);
01170     void ItemPatternFill(QString pattern);
01171     void ItemPatternProps(double scaleX, double scaleY, double offsetX, double offsetY, double rotation);
01172 
01173     void updatePic();
01174     void updatePict(QString name);
01175     void removePict(QString name);
01176 };
01177 
01178 #endif
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.