Subversion Repositories Scribus

Rev

Rev 16386 | Rev 16509 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4430 cbradney 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
*/
3 paul 7
/***************************************************************************
8
                          scribusdoc.h  -  description
9
                             -------------------
10
    begin                : Fre Apr  6 21:47:55 CEST 2001
11
    copyright            : (C) 2001 by Franz Schmid
12
    email                : Franz.Schmid@altmuehlnet.de
13
 ***************************************************************************/
14
 
15
/***************************************************************************
16
 *                                                                         *
17
 *   This program is free software; you can redistribute it and/or modify  *
18
 *   it under the terms of the GNU General Public License as published by  *
19
 *   the Free Software Foundation; either version 2 of the License, or     *
20
 *   (at your option) any later version.                                   *
21
 *                                                                         *
22
 ***************************************************************************/
23
#ifndef SCRIBUSDOC_H
24
#define SCRIBUSDOC_H
25
#ifdef HAVE_CONFIG_H
2688 craig 26
#include "scconfig.h"
3 paul 27
#endif
28
// include files for QT
10220 cbradney 29
#include <QColor>
30
#include <QFont>
9767 cbradney 31
#include <QList>
10220 cbradney 32
#include <QMap>
33
#include <QObject>
34
#include <QPixmap>
10701 avox 35
#include <QRectF>
10220 cbradney 36
#include <QStringList>
37
#include <QTimer>
838 cbradney 38
 
6132 cbradney 39
#include "gtgettext.h" //CB For the ImportSetup struct and itemadduserframe
2969 craig 40
#include "scribusapi.h"
14491 jghali 41
#include "colormgmt/sccolormgmtengine.h"
14170 jghali 42
#include "documentinformation.h"
10532 avox 43
#include "observable.h"
3724 cbradney 44
#include "page.h"
3263 cbradney 45
#include "pageitem.h"
3757 cbradney 46
#include "pagestructs.h"
14170 jghali 47
#include "prefsstructs.h"
48
#include "scguardedptr.h"
49
#include "sclayer.h"
5980 avox 50
#include "styles/styleset.h"
14170 jghali 51
#include "undoobject.h"
10532 avox 52
#include "updatemanager.h"
14170 jghali 53
#include "usertaskstructs.h"
3179 cbradney 54
 
68 Franz 55
#include <ft2build.h>
56
#include FT_FREETYPE_H
3020 cbradney 57
 
10532 avox 58
class DocUpdater;
1190 tsoots 59
class UndoManager;
60
class UndoState;
1972 craig 61
class PDFOptions;
3252 craig 62
class Hyphenator;
3903 cbradney 63
class Selection;
4320 cbradney 64
class ScribusView;
5781 cbradney 65
class ScribusMainWindow;
8455 avox 66
class ResourceCollection;
10601 mrdocs 67
class PageSize;
68
class ScPattern;
11576 avox 69
class UndoTransaction;
13659 cbradney 70
class Serializer;
3 paul 71
 
9953 cbradney 72
class QProgressBar;
3 paul 73
 
10532 avox 74
struct SCRIBUS_API NodeEditContext : public MassObservable<QPointF>
75
{
76
        enum SubMode { MOVE_POINT = 0, ADD_POINT = 1, DEL_POINT = 2, SPLIT_PATH = 3 };
77
        int submode;
78
        bool isContourLine;
79
        FPointArray *oldClip;
11576 avox 80
        UndoTransaction* nodeTransaction;
10532 avox 81
        double oldItemX;
82
        double oldItemY;
83
 
84
        int ClRe;
85
        int ClRe2;
86
        int SegP1;
87
        int SegP2;
88
        bool EdPoints;
89
        bool MoveSym;
90
        QList<int> SelNode;    
91
 
11576 avox 92
        NodeEditContext();
10532 avox 93
 
11576 avox 94
        bool hasNodeSelected();
95
        void deselect();
10532 avox 96
 
11576 avox 97
        void reset();
10532 avox 98
 
99
        void reset1Control(PageItem* currItem);
100
        void resetControl(PageItem* currItem);
101
        FPointArray beginTransaction(PageItem* currItem);
102
        void finishTransaction(PageItem* currItem);
103
        ItemState<QPair<FPointArray, FPointArray> >* finishTransaction1(PageItem* currItem);
104
        void finishTransaction2(PageItem* currItem, ItemState<QPair<FPointArray, FPointArray> >* state);
105
        void moveClipPoint(PageItem *currItem, FPoint ip);
106
};
3942 cbradney 107
 
10532 avox 108
 
4650 subik 109
/**! \brief the Document Class
3 paul 110
  */
10532 avox 111
class SCRIBUS_API ScribusDoc : public QObject, public UndoObject, public Observable<ScribusDoc>
3 paul 112
{
3082 fschmid 113
        Q_OBJECT
114
 
3 paul 115
public:
2891 cbradney 116
        ScribusDoc();
5789 cbradney 117
        ScribusDoc(const QString& docName, int unitIndex, const PageSize& pagesize, const MarginStruct& margins, const DocPagesSetup& pagesSetup);
2891 cbradney 118
        ~ScribusDoc();
5789 cbradney 119
        void init();
16105 fschmid 120
        QList<PageItem*> getAllItems(QList<PageItem*> &items);
2901 fschmid 121
        void setup(const int, const int, const int, const int, const int, const QString&, const QString&);
2891 cbradney 122
        void setLoading(const bool);
3985 cbradney 123
        bool isLoading() const;
2891 cbradney 124
        void setModified(const bool);
125
        bool isModified() const;
126
/** Setzt die Seitenattribute */
14994 cbradney 127
        void setPage(double w, double h, double t, double l, double r, double b, double sp, double ab, bool atf, int fp);
128
        void resetPage(int fp, MarginStruct* newMargins=0);
4320 cbradney 129
 
130
        /**
131
         * @brief Return the view associated with the document
132
         */
133
        ScribusView* view() const;
5781 cbradney 134
        ScribusMainWindow* scMW() const {return m_ScMW;}
5824 cbradney 135
        void setGUI(bool hasgui, ScribusMainWindow* mw, ScribusView* view);
7906 jghali 136
 
137
        /**
138
         * @brief Return the guarded object associated with the document
139
         */
140
        const ScGuardedPtr<ScribusDoc>& guardedPtr() const;
3792 cbradney 141
 
10532 avox 142
        UpdateManager* updateManager() { return &m_updateManager; }
143
        MassObservable<PageItem*> * itemsChanged() { return &m_itemsChanged; }
144
        MassObservable<Page*>     * pagesChanged() { return &m_pagesChanged; }
10701 avox 145
        MassObservable<QRectF>    * regionsChanged() { return &m_regionsChanged; }
15235 jghali 146
 
15305 jghali 147
        void invalidateAll();
15235 jghali 148
        void invalidateLayer(int layerID);
11046 avox 149
        void invalidateRegion(QRectF region);
14924 cbradney 150
 
151
 
152
        MarginStruct* scratch() { return &docPrefsData.displayPrefs.scratch; }
14992 cbradney 153
        MarginStruct* bleeds() { return &docPrefsData.docSetupPrefs.bleeds; }
14994 cbradney 154
        MarginStruct& bleedsVal() { return docPrefsData.docSetupPrefs.bleeds; }
155
        MarginStruct* margins() { return &docPrefsData.docSetupPrefs.margins; }
156
        MarginStruct& marginsVal() { return docPrefsData.docSetupPrefs.margins; }
14924 cbradney 157
        double pageGapHorizontal() const { return docPrefsData.displayPrefs.pageGapHorizontal; }
158
        double pageGapVertical() const { return docPrefsData.displayPrefs.pageGapVertical; }
159
        void setPageGapHorizontal(double h) { docPrefsData.displayPrefs.pageGapHorizontal=h; }
160
        void setPageGapVertical(double v) { docPrefsData.displayPrefs.pageGapVertical=v; }
161
        const QList<PageSet>& pageSets() const { return docPrefsData.pageSets; }
162
        void setPageSetFirstPage(int layout, int fp);
163
        void clearPageSets() { docPrefsData.pageSets.clear(); }
164
        void appendToPageSets(const PageSet& ps) { docPrefsData.pageSets.append(ps); }
165
        void setPaperColor(const QColor &c) { docPrefsData.displayPrefs.paperColor=c; }
166
        const QColor& paperColor() const { return docPrefsData.displayPrefs.paperColor; }
167
        int hyphMinimumWordLength() const { return docPrefsData.hyphPrefs.MinWordLen; }
168
        int hyphConsecutiveLines() const { return docPrefsData.hyphPrefs.HyCount; }
169
        const QString& hyphLanguage() const { return docPrefsData.hyphPrefs.Language; }
170
        bool hyphAutomatic() const { return docPrefsData.hyphPrefs.Automatic; }
171
        bool hyphAutoCheck() const { return docPrefsData.hyphPrefs.AutoCheck; }
172
        void setHyphMinimumWordLength(int i) { docPrefsData.hyphPrefs.MinWordLen=i; }
173
        void setHyphConsecutiveLines(int i) { docPrefsData.hyphPrefs.HyCount=i; }
174
        void setHyphLanguage(const QString& s) { docPrefsData.hyphPrefs.Language=s; }
175
        void setHyphAutomatic(bool b) { docPrefsData.hyphPrefs.Automatic=b; }
176
        void setHyphAutoCheck(bool b) { docPrefsData.hyphPrefs.AutoCheck=b; }
14925 cbradney 177
        bool autoSave() const { return docPrefsData.docSetupPrefs.AutoSave; }
178
        int autoSaveTime() const  { return docPrefsData.docSetupPrefs.AutoSaveTime; }
179
        void setAutoSave(bool b) { docPrefsData.docSetupPrefs.AutoSave=b; }
180
        void setAutoSaveTime(int i) { docPrefsData.docSetupPrefs.AutoSaveTime=i; }
14927 cbradney 181
        //FIXME (maybe) :non const, the loaders make a mess here
14925 cbradney 182
        PDFOptions& pdfOptions() { return docPrefsData.pdfPrefs; }
14927 cbradney 183
        ObjAttrVector& itemAttributes() { return docPrefsData.itemAttrPrefs.defaultItemAttributes; }
184
        void setItemAttributes(ObjAttrVector& oav) { docPrefsData.itemAttrPrefs.defaultItemAttributes=oav;}
185
        void clearItemAttributes() { docPrefsData.itemAttrPrefs.defaultItemAttributes.clear(); }
186
        void appendToItemAttributes(const ObjectAttribute& oa) { docPrefsData.itemAttrPrefs.defaultItemAttributes.append(oa); }
187
        ToCSetupVector& tocSetups() { return docPrefsData.tocPrefs.defaultToCSetups; }
188
        void setTocSetups(ToCSetupVector& tsv) { docPrefsData.tocPrefs.defaultToCSetups=tsv; }
189
        void clearTocSetups() { docPrefsData.tocPrefs.defaultToCSetups.clear(); }
190
        void appendToTocSetups(const ToCSetup& ts) { docPrefsData.tocPrefs.defaultToCSetups.append(ts); }
14969 cbradney 191
        void setArrowStyles(QList<ArrowDesc>& as) { docPrefsData.arrowStyles=as; }
192
        QList<ArrowDesc>& arrowStyles() { return docPrefsData.arrowStyles; }
193
        void appendToArrowStyles(const struct ArrowDesc& as) { docPrefsData.arrowStyles.append(as); }
14971 cbradney 194
        const bool marginColored() const { return docPrefsData.displayPrefs.marginColored; }
195
        void setMarginColored(bool b) { docPrefsData.displayPrefs.marginColored=b; }
196
        QMap<QString, CheckerPrefs>& checkerProfiles() { return docPrefsData.verifierPrefs.checkerPrefsList; }
197
        void setCheckerProfiles(const QMap<QString, CheckerPrefs>& cl) { docPrefsData.verifierPrefs.checkerPrefsList=cl; }
198
        void set1CheckerProfile(const QString profileName, const struct CheckerPrefs& cs) { docPrefsData.verifierPrefs.checkerPrefsList[profileName] = cs; }
199
        void clearCheckerProfiles() { docPrefsData.verifierPrefs.checkerPrefsList.clear(); }
200
        const QString& curCheckProfile() const { return docPrefsData.verifierPrefs.curCheckProfile; }
201
        void setCurCheckProfile(const QString& s) { docPrefsData.verifierPrefs.curCheckProfile=s; }
14991 cbradney 202
        int pageOrientation() const { return docPrefsData.docSetupPrefs.pageOrientation; }
203
        void setPageOrientation(int o) { docPrefsData.docSetupPrefs.pageOrientation=o; }
15407 craig 204
        int pagePositioning() const { return docPrefsData.docSetupPrefs.pagePositioning; }
205
        void setPagePositioning(int p) { docPrefsData.docSetupPrefs.pagePositioning=p; }
14991 cbradney 206
        double pageHeight() const { return docPrefsData.docSetupPrefs.pageHeight; }
207
        double pageWidth() const { return docPrefsData.docSetupPrefs.pageWidth; }
208
        const QString& pageSize() const { return docPrefsData.docSetupPrefs.pageSize; }
209
        void setPageHeight(double h) { docPrefsData.docSetupPrefs.pageHeight=h; }
210
        void setPageWidth(double w) { docPrefsData.docSetupPrefs.pageWidth=w; }
211
        void setPageSize(const QString& s) { docPrefsData.docSetupPrefs.pageSize=s; }
14992 cbradney 212
        int marginPreset() const { return docPrefsData.docSetupPrefs.marginPreset; }
213
        void setMarginPreset(int mp) { docPrefsData.docSetupPrefs.marginPreset=mp; }
14925 cbradney 214
 
14932 cbradney 215
        TypoPrefs& typographicPrefs() { return docPrefsData.typoPrefs; }
216
        GuidesPrefs& guidesPrefs() { return docPrefsData.guidesPrefs; }
217
        ItemToolPrefs& itemToolPrefs() { return docPrefsData.itemToolPrefs; }
218
        OperatorToolPrefs& opToolPrefs() { return docPrefsData.opToolPrefs; }
15001 cbradney 219
        ColorPrefs& colorPrefs() { return docPrefsData.colorPrefs; }
220
        CMSData& cmsSettings() { return docPrefsData.colorPrefs.DCMSset; }
15037 cbradney 221
        DocumentInformation& documentInfo() { return docPrefsData.docInfo; }
222
        void setDocumentInfo(DocumentInformation di) { docPrefsData.docInfo=di; }
223
        DocumentSectionMap& sections() { return docPrefsData.docSectionMap; }
224
        void setSections(DocumentSectionMap dsm) { docPrefsData.docSectionMap=dsm; }
15065 cbradney 225
        const QMap<QString, int> & usedFonts() { return UsedFonts; }
14927 cbradney 226
 
14991 cbradney 227
        const ApplicationPrefs& prefsData() { return docPrefsData; }
15096 cbradney 228
        void setNewPrefs(const ApplicationPrefs& prefsData, const ApplicationPrefs& oldPrefsData, bool resizePages, bool resizeMasterPages, bool resizePageMargins, bool resizeMasterPageMargins);
14991 cbradney 229
 
2937 cbradney 230
        // Add, delete and move pages
3852 cbradney 231
 
232
        Page* addPage(const int pageNumber, const QString& masterPageName=QString::null, const bool addAutoFrame=false);
4069 craig 233
        void deletePage(const int);
6715 cbradney 234
        //! @brief Add a master page with this function, do not use addPage
3695 cbradney 235
        Page* addMasterPage(const int, const QString&);
6715 cbradney 236
        void deleteMasterPage(const int);
10155 jghali 237
        //! @brief Rebuild master name list
238
        void rebuildMasterNames(void);
239
        //! @brief Replace a master page by default one
240
        void replaceMasterPage(const QString& oldMasterPage);
5685 cbradney 241
        //! @brief Rename a master page
242
        bool renameMasterPage(const QString& oldPageName, const QString& newPageName);
6715 cbradney 243
        //! @brief Create the default master pages based on the layout selected by the user, ie, Normal, Normal Left, etc.
244
        void createDefaultMasterPages();
245
        //! @brief Create the requested pages in a new document, run after createDefaultMasterPages()
246
        void createNewDocPages(int pageCount);
3852 cbradney 247
        /**
3860 cbradney 248
         * @brief Add the automatic text frame to the page
4645 subik 249
         * @param pageNumber page number
3860 cbradney 250
         * @return number of frame
3852 cbradney 251
         */
4645 subik 252
        int addAutomaticTextFrame(const int pageNumber);
3531 cbradney 253
        /**
3852 cbradney 254
         * Set the left and right margins based on the location of the page
255
         * @param pageIndex
256
         */
257
        void setLocationBasedPageLRMargins(uint pageIndex);
258
        /**
3531 cbradney 259
         * @brief Move page(s) within the document
4650 subik 260
         * @param from page index
261
         * @param to page index
262
         * @param ziel target to move to (page index)
263
         * @param art Before, After or at the end
3531 cbradney 264
         */
4650 subik 265
        void movePage(const int from, const int to, const int ziel, const int art);
3843 cbradney 266
 
267
        /**
268
         * @brief Copy a page (pageNumberToCopy) copyCount times, whereToInsert(before or after) the existingPage or at the end.
269
         * @param pageNumberToCopy
270
         * @param existingPage
271
         * @param whereToInsert
272
         * @param copyCount
273
         */
274
        void copyPage(int pageNumberToCopy, int existingPage, int whereToInsert, int copyCount);
275
 
2937 cbradney 276
        // Add, delete and move layers
3201 subik 277
        /**
2947 cbradney 278
         * @brief Add a layer to the current document
4645 subik 279
         * @param layerName name of layer
4650 subik 280
         * @param activate the layer active
2947 cbradney 281
         * @return Number of the layer created
282
         */
4645 subik 283
        int addLayer(const QString& layerName=QString::null, const bool activate=false);
3201 subik 284
        /**
6290 fschmid 285
         * @brief Copies a layer from the current document
13875 jghali 286
         * @param layerIDToCopy source layer
6290 fschmid 287
         * @param whereToInsert target layer
288
         * @return Success or failure
289
         */
13875 jghali 290
        void copyLayer(int layerIDToCopy, int whereToInsert);
6290 fschmid 291
        /**
2947 cbradney 292
         * @brief Delete a layer from the current document
13875 jghali 293
         * @param layerID of layer
4645 subik 294
         * @param deleteItems the items on the layer too?
2947 cbradney 295
         * @return Success or failure
296
         */
13875 jghali 297
        bool deleteLayer(const int layerID, const bool deleteItems);
2947 cbradney 298
        /**
299
         * @brief Return the number of the current layer
300
         * @return Active layer number
301
         */
3985 cbradney 302
        int activeLayer();
3201 subik 303
 
2947 cbradney 304
        /**
305
         * @brief Return the name of the current layer
306
         * @return Name of the layer
307
         */
2937 cbradney 308
        const QString& activeLayerName();
2947 cbradney 309
        /**
310
         * @brief Set the active layer via the layer number
4650 subik 311
         * @param layerToActivate Number of the layer
2947 cbradney 312
         * @return Success or failure
313
         */
4650 subik 314
        bool setActiveLayer(const int layerToActivate);
2947 cbradney 315
        /**
316
         * @brief Set the active layer via the layer name
4650 subik 317
         * @param layerNameToActivate Name of the layer
2947 cbradney 318
         * @return Success or failure
319
         */
4650 subik 320
        bool setActiveLayer(const QString & layerNameToActivate);
2947 cbradney 321
        /**
322
         * @brief Set the layer printable via the layer number
13875 jghali 323
         * @param layerID ID of the layer
4650 subik 324
         * @param isPrintable bool true = layer is prantable
2947 cbradney 325
         * @return Success or failure
326
         */
13875 jghali 327
        bool setLayerPrintable(const int layerID, const bool isPrintable);
2947 cbradney 328
        /**
329
         * @brief Is the layer printable
13875 jghali 330
         * @param layerID ID of the layer
2947 cbradney 331
         * @return Printable or not
332
         */
13875 jghali 333
        bool layerPrintable(const int layerID);
2947 cbradney 334
        /**
335
         * @brief Set the layer visible via the layer number
13875 jghali 336
         * @param layerID ID of the layer
4650 subik 337
         * @param isViewable true = layer is visible
2947 cbradney 338
         * @return Success or failure
339
         */
13875 jghali 340
        bool setLayerVisible(const int layerID, const bool isViewable);
2947 cbradney 341
        /**
342
         * @brief Is the layer visible
13875 jghali 343
         * @param layerID ID of the layer
2947 cbradney 344
         * @return Visible or not
345
         */
13875 jghali 346
        bool layerVisible(const int layerID);
2947 cbradney 347
        /**
4832 fschmid 348
         * @brief Set the layer locked via the layer number
13875 jghali 349
         * @param layerID ID of the layer
12071 subik 350
         * @param isLocked true = layer is locked
4832 fschmid 351
         * @return Success or failure
352
         */
13875 jghali 353
        bool setLayerLocked(const int layerID, const bool isLocked);
4832 fschmid 354
        /**
355
         * @brief Is the layer locked
13875 jghali 356
         * @param layerID ID of the layer
4832 fschmid 357
         * @return Locked or not
358
         */
13875 jghali 359
        bool layerLocked(const int layerID);
4832 fschmid 360
        /**
5359 fschmid 361
         * @brief Set the layer flow via the layer number
13875 jghali 362
         * @param layerID ID of the layer
5359 fschmid 363
         * @param flow true = Text flows around objects on this layer
364
         * @return Success or failure
365
         */
13875 jghali 366
        bool setLayerFlow(const int layerID, const bool flow);
5359 fschmid 367
        /**
368
         * @brief does text flow around objects on this layer
13875 jghali 369
         * @param layerID ID of the layer
5359 fschmid 370
         * @return flow or not
371
         */
13875 jghali 372
        bool layerFlow(const int layerID);
5359 fschmid 373
        /**
5373 fschmid 374
         * @brief Set the layer transparency via the layer number
13875 jghali 375
         * @param layerID ID of the layer
5373 fschmid 376
         * @param trans transparency value 0.0 - 1.0
377
         * @return Success or failure
378
         */
13875 jghali 379
        bool setLayerTransparency(const int layerID, double trans);
5373 fschmid 380
        /**
381
         * @brief returns the layer transparency
13875 jghali 382
         * @param layerID ID of the layer
5373 fschmid 383
         * @return transparency value 0.0 - 1.0
384
         */
13875 jghali 385
        double layerTransparency(const int layerID);
5373 fschmid 386
        /**
5375 fschmid 387
         * @brief Set the layer layerBlendMode via the layer number
13875 jghali 388
         * @param layerID ID of the layer
12071 subik 389
         * @param blend layerBlendMode
5375 fschmid 390
         * @return Success or failure
391
         */
13875 jghali 392
        bool setLayerBlendMode(const int ID, int blend);
5375 fschmid 393
        /**
394
         * @brief returns the layer BlendMode
13875 jghali 395
         * @param layerID ID of the layer
5375 fschmid 396
         * @return layerBlendMode
397
         */
13875 jghali 398
        int layerBlendMode(const int ID);
5375 fschmid 399
        /**
2947 cbradney 400
         * @brief Return the level of the requested layer
13875 jghali 401
         * @param layerID ID of the layer
2947 cbradney 402
         * @return Level of the layer
403
         */
13875 jghali 404
        int layerLevelFromID(const int layerID);
2947 cbradney 405
        /**
5572 fschmid 406
         * @brief Set the layer marker color
13875 jghali 407
         * @param ID Number of the layer
5572 fschmid 408
         * @param color color of the marker
409
         * @return Success or failure
410
         */
13875 jghali 411
        bool setLayerMarker(const int layerID, QColor color);
5572 fschmid 412
        /**
413
         * @brief returns the layer marker color
13875 jghali 414
         * @param layerID ID of the layer
5572 fschmid 415
         * @return marker color
416
         */
13875 jghali 417
        QColor layerMarker(const int layerID);
5572 fschmid 418
        /**
419
         * @brief Set the layer outline mode via the layer number
13875 jghali 420
         * @param layerID ID of the layer
5572 fschmid 421
         * @param outline true = layer is displayed in outlines only
422
         * @return Success or failure
423
         */
13875 jghali 424
        bool setLayerOutline(const int layerID, const bool outline);
5572 fschmid 425
        /**
426
         * @brief is this layer in outline mode
13875 jghali 427
         * @param layerID ID of the layer
5572 fschmid 428
         * @return outline or not
429
         */
13875 jghali 430
        bool layerOutline(const int layerID);
5572 fschmid 431
        /**
2947 cbradney 432
         * @brief Return the number of the layer at a certain level
4650 subik 433
         * @param layerLevel Layer level
13875 jghali 434
         * @return Layer ID
2947 cbradney 435
         */
13875 jghali 436
        int layerIDFromLevel(const int layerLevel);
2947 cbradney 437
        /**
438
         * @brief Return the layer count
439
         * @return Number of layers in doc
440
         */
3985 cbradney 441
        int layerCount() const;
2947 cbradney 442
        /**
443
         * @brief Lower a layer
13875 jghali 444
         * @param layerID ID of the layer
2947 cbradney 445
         * @return Success or failure
446
         */
13875 jghali 447
        bool lowerLayer(const int layerID);
2947 cbradney 448
        /**
449
         * @brief Lower a layer using the level
4650 subik 450
         * @param layerLevel Level of the layer
2947 cbradney 451
         * @return Success or failure
452
         */
4650 subik 453
        bool lowerLayerByLevel(const int layerLevel);
2947 cbradney 454
        /**
455
         * @brief Raise a layer
13875 jghali 456
         * @param layerID ID of the layer
2947 cbradney 457
         * @return Success or failure
458
         */
13875 jghali 459
        bool raiseLayer(const int layerID);
2947 cbradney 460
        /**
461
         * @brief Raise a layer using the level
4650 subik 462
         * @param layerLevel Level of the layer
2947 cbradney 463
         * @return Success or failure
464
         */
4650 subik 465
        bool raiseLayerByLevel(const int layerLevel);
2947 cbradney 466
        /**
467
         * @brief Return the layer name
13875 jghali 468
         * @param layerID ID of the layer
3201 subik 469
         * @return Name of the layer
2947 cbradney 470
         */
13875 jghali 471
        QString layerName(const int layerID) const;
2947 cbradney 472
        /**
473
         * @brief Change the name of a layer
13875 jghali 474
         * @param layerID ID of the layer
4645 subik 475
         * @param newName new name of the layer
2947 cbradney 476
         * @return Success or failure
477
         */
13875 jghali 478
        bool changeLayerName(const int layerID, const QString& newName);
2947 cbradney 479
        /**
480
         * @brief Does the layer have items on it?
13875 jghali 481
         * @param layerID ID of the layer
2947 cbradney 482
         * @return Layer contains items bool
483
         */
13875 jghali 484
        bool layerContainsItems(const int layerID);
2947 cbradney 485
        /**
486
         * @brief Renumber a layer. Used in particular for reinsertion for undo/redo
13875 jghali 487
         * @param layerID old layer ID
488
         * @param newLayerID New layer ID
2947 cbradney 489
         * @return Success or failure
490
         */
13875 jghali 491
        bool renumberLayer(const int layerID, const int newLayerID);
2947 cbradney 492
        /**
493
         * @brief Return a list of the layers in their order
4650 subik 494
         * @param list QStringList to insert the layer names into
2947 cbradney 495
         */
4650 subik 496
        void orderedLayerList(QStringList* list);
2937 cbradney 497
        //Items
3985 cbradney 498
        bool deleteTaggedItems();
3201 subik 499
 
7442 avox 500
        /*!
501
                * @brief Builds a qmap of the icc profiles used within the document
502
         */
503
        void getUsedProfiles(ProfilesL& usedProfiles);
5345 mrdocs 504
        bool OpenCMSProfiles(ProfilesL InPo, ProfilesL InPoCMYK, ProfilesL MoPo, ProfilesL PrPo);
1330 fschmid 505
        void CloseCMSProfiles();
10338 jghali 506
        void SetDefaultCMSParams();
6726 fschmid 507
        /**
7442 avox 508
         * @brief Switch Colormanagement on or of
6726 fschmid 509
         * @param enable bool, if true Colormanagement is switched on, else off
510
         */
511
        void enableCMS(bool enable);
7442 avox 512
 
8521 cbradney 513
        const ParagraphStyle& paragraphStyle(QString name) { return docParagraphStyles.get(name); }
7442 avox 514
        const StyleSet<ParagraphStyle>& paragraphStyles()   { return docParagraphStyles; }
7944 cbradney 515
        bool isDefaultStyle( const ParagraphStyle& p ) const { return docParagraphStyles.isDefault(p); }
516
        bool isDefaultStyle( const CharStyle& c ) const { return docCharStyles.isDefault(c); }
517
//      bool isDefaultStyle( LineStyle& l ) const { return MLineStyles......; }
8455 avox 518
 
519
        void getNamedResources(ResourceCollection& lists) const;
16386 fschmid 520
        void replaceNamedResources(ResourceCollection& newNames);
521
        bool styleExists(QString styleName);
16396 fschmid 522
        QList<int> getSortedStyleList();
523
        QList<int> getSortedCharStyleList();
8455 avox 524
 
7595 avox 525
        void redefineStyles(const StyleSet<ParagraphStyle>& newStyles, bool removeUnused=false);
7442 avox 526
        /**
527
         * @brief Remove any reference to old styles and replace with new name. This needs to be
528
         *        called when a style was removed. New name may be "".
529
         * @param newNameForOld a map which maps the name of any style to remove to a new stylename
530
         */
7944 cbradney 531
        void replaceStyles(const QMap<QString,QString>& newNameForOld);
12548 pierre 532
        /**
533
         * @brief Insert styles from another document in this document.
534
         *        
535
         * @param fileName The path of the document we want to extract its styles
536
         */
537
        void loadStylesFromFile(QString fileName);
538
        /**
539
         * @brief Gather styles from another document.
540
         *        
541
         * @param fileName The path of the document we want to extract its styles
542
         * @param tempStyles A pointer to a StyleSet which will be filled by paragraph styles
543
         * @param tempCharStyles A pointer to a StyleSet which will be filled by character styles
544
         * @param tempLineStyles A map which will be filled by line styles
545
         */
546
        void loadStylesFromFile(QString fileName, StyleSet<ParagraphStyle> *tempStyles,
547
                                                  StyleSet<CharStyle> *tempCharStyles,
548
                                                  QMap<QString, multiLine> *tempLineStyles);
7442 avox 549
 
8521 cbradney 550
        const CharStyle& charStyle(QString name) { return docCharStyles.get(name); }
7442 avox 551
        const StyleSet<CharStyle>& charStyles()  { return docCharStyles; }
7595 avox 552
        void redefineCharStyles(const StyleSet<CharStyle>& newStyles, bool removeUnused=false);
3201 subik 553
        /**
7442 avox 554
         * @brief Remove any reference to old styles and replace with new name. This needs to be
555
         *        called when a style was removed. New name may be "".
556
         * @param newNameForOld a map which maps the name of any style to remove to a new stylename
557
         */
7944 cbradney 558
        void replaceCharStyles(const QMap<QString,QString>& newNameForOld);
7442 avox 559
 
560
        /**
1179 tsoots 561
         * @brief Should guides be locked or not
562
         * @param isLocked If true guides on pages cannot be moved if false they
563
         * can be dragged to new positions.
564
         * @author Riku Leino
565
         */
566
        void lockGuides(bool isLocked);
1190 tsoots 567
        /**
1179 tsoots 568
         * @brief Method used when an undo/redo is requested.
569
         * @param state State describing the action that is wanted to be undone/redone
570
         * @param isUndo If true undo is wanted else if false redo.
571
         * @author Riku Leino
572
         */
573
        void restore(UndoState* state, bool isUndo);
574
        /**
575
         * @brief Sets the name of the document
576
         * @param name Name for the document
577
         * @author Riku Leino
578
         */
579
        void setName(const QString& name);
1694 cbradney 580
        /*!
581
         * @brief Returns a stringlist of the item attributes within the document
582
         */
583
        QStringList getItemAttributeNames();
3201 subik 584
 
7442 avox 585
        bool AddFont(QString name, int fsize = 10);
2960 cbradney 586
        /*!
12319 cbradney 587
         * @brief TODO: Reorganise the fonts.. how? Moved from scribus.cpp
588
         * CB: almost the same as getUsedFonts???
589
         */
12953 fschmid 590
        QMap<QString,int> reorganiseFonts();
12319 cbradney 591
        /*!
5387 avox 592
         * @brief Returns a qmap of the fonts and  their glyphs used within the document
2960 cbradney 593
         */
5387 avox 594
        void getUsedFonts(QMap<QString,QMap<uint, FPointArray> > &Really);
6407 fschmid 595
        void checkItemForFonts(PageItem *it, QMap<QString, QMap<uint, FPointArray> > & Really, uint lc);
8985 jghali 596
 
2960 cbradney 597
        /*!
8985 jghali 598
         * @brief Replace line style colors
599
         */
600
        void replaceLineStyleColors(const QMap<QString, QString>& colorMap);
601
        /*!
3057 fschmid 602
        * @brief Builds a qmap of the colours used within the document
603
        */
3068 fschmid 604
        void getUsedColors(ColorList &colorsToUse, bool spot = false);
3057 fschmid 605
        /*!
8950 jghali 606
        * @brief Return if a specific color is used by line styles
607
        */
608
        bool lineStylesUseColor(const QString& colorName);
609
        /*!
16016 fschmid 610
        * @brief Builds a qmap of the gradients used within the document
611
        */
612
        void getUsedGradients(QMap<QString, VGradient> &Gradients);
613
        /*!
14150 fschmid 614
        * @brief Set the gradients for a document
615
        */
616
        bool addGradient(QString &name, VGradient &gradient);
617
        void setGradients(QMap<QString, VGradient> &gradients);
618
        /*!
6517 cbradney 619
        * @brief Set the patterns for a document
620
        */
621
        bool addPattern(QString &name, ScPattern& pattern);
622
        void setPatterns(QMap<QString, ScPattern> &patterns);
623
        /*!
6400 fschmid 624
        * @brief Builds a QStringList of the patterns used within the document
625
        */
626
        QStringList getUsedPatterns();
12744 fschmid 627
        QStringList getUsedPatternsSelection(Selection* customSelection);
6400 fschmid 628
        QStringList getUsedPatternsHelper(QString pattern, QStringList &results);
16052 fschmid 629
        QStringList getPatternDependencyList(QStringList used);
15077 fschmid 630
        /*!
631
        * @brief Builds a QStringList of the symbols used within the document
632
        */
633
        QStringList getUsedSymbols();
634
        QStringList getUsedSymbolsHelper(QString pattern, QStringList &results);
2965 cbradney 635
        /**
636
         * @brief Set and get the document's unit index
637
         */
638
        void setUnitIndex(const int);
3985 cbradney 639
        int unitIndex() const;
640
        double unitRatio() const;
3004 cbradney 641
        /**
642
         * @brief Apply a master page
643
         */
6578 cbradney 644
        bool applyMasterPage(const QString& pageName, const int pageNumber);
3004 cbradney 645
        /**
646
         * @brief Undo function for applying a master page
647
         */
648
        void restoreMasterPageApplying(SimpleState *state, bool isUndo);
7897 tsoots 649
        void restorePageCopy(SimpleState *state, bool isUndo);
3020 cbradney 650
        /**
13194 jghali 651
         * @brief Undo function for grouping/ungrouping
652
         */
653
        void restoreGrouping(SimpleState *state, bool isUndo);
654
        void restoreUngrouping(SimpleState *state, bool isUndo);
655
        /**
3020 cbradney 656
         * @brief Save function
657
         */
11212 jghali 658
        bool save(const QString& fileName, QString* savedFile = NULL);
3025 cbradney 659
        /**
660
         * @brief Set the page margins. Current code uses current page only, also provide a (currently, TODO) option for this.
661
         */
3985 cbradney 662
        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);
3123 cbradney 663
        /**
664
         * @brief Recalculate the colors after CMS settings change. Update the items in the doc accordingly.
665
         */
666
         void recalculateColors();
3179 cbradney 667
        /**
668
         * @brief Sets up the ScText defaults from the document
669
         */
670
        void setScTextDefaultsFromDoc(ScText *);
3200 cbradney 671
        /**
672
         * @brief Copies a normal page to be a master pages
673
         */
10833 cbradney 674
        bool copyPageToMasterPage(const int, const int, const int, const QString&, bool);
3263 cbradney 675
 
676
        /**
677
         * @brief Add an Item to the document.
678
         * A simple function to create an item of a defined type and add it to the document
679
         * Will need extensive rewriting once we have various classes of PageItems, at a guess.
680
         *
681
         * @param itemFinalised Used to handle item creation for undo while the user is still dragging.
682
         * @return Number of created item, -1 on failure.
4650 subik 683
        \param itemType type
684
        \param frameType frame type
685
        \param x X pos
686
        \param y Y pos
687
        \param b width
688
        \param h height
689
        \param w ?
690
        \param fill fill color name
691
        \param outline outline color name
692
        */
3263 cbradney 693
        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);
5164 tsoots 694
 
695
        /** Add an item to the page based on the x/y position. Item will be fitted to the closest guides/margins */
696
        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);
6115 cbradney 697
 
6137 cbradney 698
        /**
699
         * @brief Allow the user to create a frame easily with some simple placement and sizing options
12071 subik 700
         * @param iafData a InsertAFrameData structure with params
701
         * @return int item id? FIXME
6137 cbradney 702
         */
6657 cbradney 703
        int itemAddUserFrame(InsertAFrameData &iafData);
5164 tsoots 704
 
3263 cbradney 705
        /**
706
         * @brief Commit item creation when a user has click-drag created an item
707
         * Only called from ScribusView. Note the undo target is the page, so the undo code remains their for now.
708
         * @return If an item was committed and the view must emit its signal, which needs removing from here, TODO.
709
         */
710
        bool itemAddCommit(const int itemNumber);
711
 
712
        /**
713
         * @brief Finalise item creation. Simply split off code from itemAdd
714
         * Only to be called from itemAdd()
715
         */
716
        void itemAddDetails(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, const int itemNumber);
7068 fschmid 717
 
718
        uint getItemNrfromUniqueID(uint unique);
3263 cbradney 719
        //itemDelete
720
        //itemBlah...
3628 cbradney 721
 
722
        /**
723
         * @brief Run this common frame item update code
724
         */
725
        void updateFrameItems();
3648 cbradney 726
        /**
7697 cbradney 727
         * @brief Renumbers the items into the order they are stored in in the lists.
728
         * Utility function used in various places, basically handles keeping items numbered in the way
729
         * they are layered. When layer is a property and not a fuction of storage, this should be removed.
730
         * Depends on the Items pointer pointing to the correct item list (doc, master, etc).
731
         * @sa updateFrameItems();
732
         */
733
        void renumberItemsInListOrder();
734
        /**
10140 jghali 735
         * @brief Rebuild item lists taking into account layer order.
736
         * Utility function used in various places, basically handles keeping items numbered in the way
737
         * they are layered. When layer is a property and not a fuction of storage, this should be removed.
738
         * @sa updateFrameItems();
739
         */
740
        void rebuildItemLists();
741
        /**
3648 cbradney 742
         * @brief Doc uses automatic text frames?
743
         */
3985 cbradney 744
        bool usesAutomaticTextFrames() const;
3648 cbradney 745
        void setUsesAutomaticTextFrames(const bool);
3650 cbradney 746
 
747
        /**
748
         * @brief Load images into an image frame, moved from the view
749
         * @retval Return false on failure
750
         */
5977 jghali 751
        bool LoadPict(QString fn, int ItNr, bool reload = false, bool showMsg = false);
3942 cbradney 752
        /**
753
         *
754
         * @param fn
755
         * @param pageItem
756
         * @param reload
757
         * @return
758
         */
5977 jghali 759
        bool loadPict(QString fn, PageItem *pageItem, bool reload = false, bool showMsg = false);
3656 cbradney 760
        /**
4650 subik 761
         * \brief Handle image with color profiles
762
         * @param Pr profile
763
           @param PrCMYK cmyk profile
764
           @param dia optional progress widget
3942 cbradney 765
         */
9953 cbradney 766
        void RecalcPictures(ProfilesL *Pr, ProfilesL *PrCMYK, QProgressBar *dia = 0);
3942 cbradney 767
        /**
14532 jghali 768
         * \brief Handle image with color profiles
769
         * @param items list of page items to update
770
         * @param Pr profile
771
         * @param PrCMYK cmyk profile
772
         * @param dia optional progress widget
773
         */
774
        void RecalcPictures(QList<PageItem*>* items, ProfilesL *Pr, ProfilesL *PrCMYK, QProgressBar *dia = 0);
775
        /**
14535 fschmid 776
         *
3656 cbradney 777
         * @brief Find the minX,MinY and maxX,maxY for the canvas required for the doc
778
         */
779
        void canvasMinMax(FPoint&, FPoint&);
3657 cbradney 780
 
781
        int OnPage(double x2, double  y2);
782
        int OnPage(PageItem *currItem);
783
        void GroupOnPage(PageItem *currItem);
4672 cbradney 784
        //void reformPages(double& maxX, double& maxY, bool moveObjects = true);
785
        void reformPages(bool moveObjects = true);
3664 cbradney 786
 
787
        /**
3670 cbradney 788
         * @brief Return the x or y offset for a page on the canvas
789
         * @retval double containing the offset. Returns -1.0 if page not in Pages list (as -ve is not possible).
790
         * Mostly saves bringing in extra includes into files that already have scribusdoc.h
3664 cbradney 791
         */
10508 cbradney 792
        double getXOffsetForPage(const int);
793
        double getYOffsetForPage(const int);
12419 cbradney 794
        void getBleeds(int pageNumber, MarginStruct& bleedData);
14080 jghali 795
        void getBleeds(const Page* page, MarginStruct& bleedData);
796
        void getBleeds(const Page* page, const MarginStruct& baseValues, MarginStruct& bleedData);
3670 cbradney 797
 
798
        /**
799
         * @brief Item type conversion functions
800
         */
3676 cbradney 801
        PageItem* convertItemTo(PageItem *currItem, PageItem::ItemType newType, PageItem* secondaryItem=NULL);
3670 cbradney 802
 
803
        /**
804
         * @brief The page number of the current page
805
         */
10508 cbradney 806
        int currentPageNumber();
3689 cbradney 807
 
808
        /**
809
         * @brief Return true iff the passed name is not used by any existing PageItem
810
         *        in the same document as this PageItem.
811
         * @author Craig Ringer
812
         ** CB Moved from PageItem
813
         */
814
        bool itemNameExists(const QString itemName);
3724 cbradney 815
 
816
        /**
817
         * @brief Set the doc into Master page mode
818
         * Do we need to return if the move to master page mode was successful?
819
         */
4738 cbradney 820
        void setMasterPageMode(bool);
4061 craig 821
 
822
        /*** Is the document in master page mode? */
823
        bool masterPageMode() const { return m_masterPageMode; }
16029 fschmid 824
        /**
825
         * @brief Set the doc into symbol edit mode
826
         */
827
        void setSymbolEditMode(bool mode, QString symbolName = "");
828
 
829
        /*** Is the document in symbol edit mode? */
830
        bool symbolEditMode() const { return m_symbolEditMode; }
3757 cbradney 831
 
832
        /**
833
         * @brief Add a section to the document sections list
3776 cbradney 834
         * Set number to -1 to add in the default section if the map is empty
3757 cbradney 835
         */
15534 craig 836
        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, const QChar fillChar=QChar(), int fieldWidth=0);
3757 cbradney 837
        /**
838
         * @brief Delete a section from the document sections list
839
         */
3985 cbradney 840
        bool deleteSection(const uint);
3757 cbradney 841
        /**
842
         * @brief Gets the page number to be printed based on the section it is in.
843
         * Returns QString::null on failure to find the pageIndex
844
         */
845
        const QString getSectionPageNumberForPageIndex(const uint) const;
3776 cbradney 846
        /**
15534 craig 847
         * @brief Gets the page number fill character to be printed based on the section it is in.
848
         * Returns QString::null on failure to find the pageIndex
849
         */
850
        const QChar getSectionPageNumberFillCharForPageIndex(const uint) const;
851
        /**
852
         * @brief Gets the page number fill character to be printed based on the section it is in.
853
         * Returns QString::null on failure to find the pageIndex
854
         */
855
        int getSectionPageNumberWidthForPageIndex(const uint) const;
856
        /**
3776 cbradney 857
         * @brief Gets the key of the sections map based on the section the page index is in.
858
         * Returns -1 on failure to find the pageIndex
859
         */
3985 cbradney 860
        int getSectionKeyForPageIndex(const uint pageIndex) const;
3778 cbradney 861
        /**
862
         *
863
         *
864
         */
865
        void updateSectionPageNumbersToPages();
3792 cbradney 866
        /**
3894 cbradney 867
         *
868
         * @param otherPageIndex
869
         * @param location
870
         * @param count
871
         */
3792 cbradney 872
        void addPageToSection(const uint otherPageIndex, const uint location, const uint count=1);
3894 cbradney 873
        /**
874
         *
875
         * @param pageIndex
876
         */
3793 cbradney 877
        void removePageFromSection(const uint pageIndex);
3894 cbradney 878
        /**
879
         *
880
         */
3793 cbradney 881
        void setFirstSectionFromFirstPageNumber();
3894 cbradney 882
        /**
883
         * @brief Update the fill and line QColors for all items in the doc
884
         */
885
        void updateAllItemQColors();
5334 cbradney 886
        //! @brief Some internal align tools
887
        typedef enum {alignFirst, alignLast, alignPage, alignMargins, alignGuide, alignSelection } AlignTo;
15220 cbradney 888
        typedef enum {alignByMoving, alignByResizing } AlignMethod;
5334 cbradney 889
        void buildAlignItemList(Selection* customSelection=0);
890
        bool startAlign();
5355 cbradney 891
        void endAlign();
3942 cbradney 892
        /**
4650 subik 893
         * \brief Insert a color into the documents color list
4010 cbradney 894
         * @param nam Name of the colour
895
         * @param c Cyan component
896
         * @param m Magenta component
897
         * @param y Yellow component
898
         * @param k Black component
899
         */
900
        void insertColor(QString nam, double c, double m, double y, double k);
4110 cbradney 901
 
902
        QMap<QString, double>& constants() { return m_constants; }
4122 cbradney 903
        /**
4650 subik 904
         * \brief Get the location of the page on the canvas, ie, left, middle, or right
4122 cbradney 905
         * Does not give information about middle left, etc.
4650 subik 906
         * @param pageIndex Index of page to find location for
4122 cbradney 907
         * @return LeftPage, MiddlePage, RightPage, enum from pagestructs.h
908
         */
10060 craig 909
        PageLocation locationOfPage(int pageIndex) const;
12487 cbradney 910
        /**
911
         * \brief Get the column of the page on the canvas, ie, left, middle, or right
912
         * @param pageIndex Index of page to find location for
913
         * @return int of 0,1,2,3
914
         */
915
        int columnOfPage(int pageIndex) const;
4301 cbradney 916
 
917
        bool sendItemSelectionToBack();
918
        bool bringItemSelectionToFront();
5184 avox 919
 
16192 fschmid 920
        QList<PageItem*>* GroupOfItem(QList<PageItem*>* itemList, PageItem* item);
16105 fschmid 921
        PageItem* groupObjectsSelection(Selection* customSelection=0);
922
        PageItem* groupObjectsList(QList<PageItem*> &itemList);
923
        void groupObjectsToItem(PageItem* groupItem, QList<PageItem*> &itemList);
14714 jghali 924
        const PageItem * itemSelection_GroupObjects  (bool changeLock, bool lock, Selection* customSelection=0);
9918 jghali 925
        void itemSelection_UnGroupObjects(Selection* customSelection=0);
12779 cbradney 926
        void itemSelection_convertItemsTo(const PageItem::ItemType newType, Selection* restoredSelection=0, Selection* customSelection=0);
9918 jghali 927
 
13290 jghali 928
        void itemSelection_ApplyParagraphStyle(const ParagraphStyle & newstyle, Selection* customSelection=0, bool rmDirectFormatting = false);
7563 cbradney 929
        void itemSelection_SetParagraphStyle(const ParagraphStyle & newstyle, Selection* customSelection=0);
930
        void itemSelection_ApplyCharStyle(const CharStyle & newstyle, Selection* customSelection=0);
931
        void itemSelection_SetCharStyle(const CharStyle & newstyle, Selection* customSelection=0);
8455 avox 932
        void itemSelection_EraseParagraphStyle(Selection* customSelection=0);
933
        void itemSelection_EraseCharStyle(Selection* customSelection=0);
5184 avox 934
 
7563 cbradney 935
        void itemSelection_SetNamedParagraphStyle(const QString & name, Selection* customSelection=0);
936
        void itemSelection_SetNamedCharStyle(const QString & name, Selection* customSelection=0);
10367 jghali 937
        void itemSelection_SetNamedLineStyle(const QString & name, Selection* customSelection=0);
6917 avox 938
 
12420 cbradney 939
        void itemSelection_SetLineWidth(double w);
940
        void itemSelection_SetLineArt(Qt::PenStyle w);
941
        void itemSelection_SetLineJoin(Qt::PenJoinStyle w);
942
        void itemSelection_SetLineEnd(Qt::PenCapStyle w);
7563 cbradney 943
        void itemSelection_SetAlignment(int w, Selection* customSelection=0);
944
        void itemSelection_SetLineSpacing(double w, Selection* customSelection=0);
945
        void itemSelection_SetLineSpacingMode(int w, Selection* customSelection=0);
4830 cbradney 946
        //void ChLocalXY(double x, double y);
947
        //void ChLocalSc(double x, double y);
7563 cbradney 948
        void itemSelection_SetFont(QString fon, Selection* customSelection=0);
949
        void itemSelection_SetFillColor(QString farbe, Selection* customSelection=0);
950
        void itemSelection_SetFillShade(int sha, Selection* customSelection=0);
951
        void itemSelection_SetStrokeColor(QString farbe, Selection* customSelection=0);
952
        void itemSelection_SetStrokeShade(int sha, Selection* customSelection=0);
953
        void itemSelection_SetScaleV(int, Selection* customSelection=0);
954
        void itemSelection_SetScaleH(int, Selection* customSelection=0);
955
        void itemSelection_SetBaselineOffset(int, Selection* customSelection=0);
956
        void itemSelection_SetOutlineWidth(int, Selection* customSelection=0);
957
        void itemSelection_SetShadowOffsets(int shx, int shy, Selection* customSelection=0);
958
        void itemSelection_SetUnderline(int pos, int wid, Selection* customSelection=0);
959
        void itemSelection_SetStrikethru(int pos, int wid, Selection* customSelection=0);
960
        void itemSelection_SetEffects(int s, Selection* customSelection=0);
8057 cbradney 961
        void itemSelection_SetOpticalMargins(int i, Selection* customSelection=0);
13298 cbradney 962
        void itemSelection_resetOpticalMargins(Selection* customSelection=0);
11663 cbradney 963
        void itemSelection_SetColorProfile(const QString& profileName, Selection* customSelection=0);
964
        void itemSelection_SetRenderIntent(int intentIndex, Selection* customSelection=0);
14444 fschmid 965
        void itemSelection_SetCompressionMethod(int cmIndex, Selection* customSelection=0);
966
        void itemSelection_SetCompressionQuality(int cqIndex, Selection* customSelection=0);
15309 cbradney 967
 
6733 avox 968
 
969
//      void chAbStyle(PageItem *currItem, int s);
970
 
7563 cbradney 971
        void itemSelection_SetTracking(int us, Selection* customSelection=0);
972
        void itemSelection_SetFontSize(int size, Selection* customSelection=0);
4699 cbradney 973
        //void FlipImageH();
974
        //void FlipImageV();
975
        void MirrorPolyH(PageItem *currItem);
976
        void MirrorPolyV(PageItem *currItem);
4584 cbradney 977
 
4672 cbradney 978
        void setRedrawBounding(PageItem *currItem);
979
        void adjustCanvas(FPoint minPos, FPoint maxPos, bool absolute = false);
7570 fschmid 980
        void recalcPicturesRes(bool applyNewRes = false);
4672 cbradney 981
        void connectDocSignals();
4713 cbradney 982
        void removeLayer(int l, bool dl = false); //FIXME: Make protected once scripter function no longer uses this directly
5781 cbradney 983
        /*! \brief We call changed() whenever the document needs to know it has been changed.
984
         *  If the document is the primary document in a main window, it will signal to enable/disable
985
         * certain operations.
986
         */
4738 cbradney 987
        void changed();
5087 subik 988
        /*! \brief Get pointer to the current page
989
        \retval Page* current page object */
990
        Page* currentPage();
991
        /*! \brief Set new current page
992
        \param newPage New current page */
993
        void setCurrentPage(Page *newPage);
5823 cbradney 994
        bool hasGUI() const {return m_hasGUI;}
6137 cbradney 995
        /*! \brief Apply grid to a QPoint, from ScribusView */
996
        QPoint ApplyGrid(const QPoint& in);
997
        /*! \brief Apply grid to an FPoint, from ScribusView */
998
        FPoint ApplyGridF(const FPoint& in);
6565 cbradney 999
        /*! \brief Does this doc have any TOC setups and potentially a TOC to generate */
14927 cbradney 1000
        bool hasTOCSetup() { return !docPrefsData.tocPrefs.defaultToCSetups.empty(); }
7736 cbradney 1001
        //! \brief Get the closest guide to the given point
15301 jghali 1002
        void getClosestGuides(double xin, double yin, double *xout, double *yout, int *GxM, int *GyM, Page* refPage = NULL);
7736 cbradney 1003
        //! \brief Snap an item to the guides
1004
        void SnapToGuides(PageItem *currItem);
1005
        bool ApplyGuides(double *x, double *y);
1006
        bool MoveItem(double newX, double newY, PageItem* ite, bool fromMP = false);
1007
        void RotateItem(double win, int ite);
1008
        void RotateItem(double win, PageItem *currItem);
1009
        void MoveRotated(PageItem *currItem, FPoint npv, bool fromMP = false);
1010
        bool SizeItem(double newX, double newY, int ite, bool fromMP = false, bool DoUpdateClip = true, bool redraw = true);
1011
        bool SizeItem(double newX, double newY, PageItem *pi, bool fromMP = false, bool DoUpdateClip = true, bool redraw = true);
1012
        bool MoveSizeItem(FPoint newX, FPoint newY, int ite, bool fromMP = false, bool constrainRotation=false);
16122 fschmid 1013
        bool MoveSizeItem(FPoint newX, FPoint newY, PageItem* currItem, bool fromMP = false, bool constrainRotation = false);
16236 fschmid 1014
        void AdjustItemSize(PageItem *currItem, bool includeGroup = false, bool moveInGroup = true);
10532 avox 1015
        void moveGroup(double x, double y, bool fromMP = false, Selection* customSelection = 0);
1016
        void rotateGroup(double angle, FPoint RCenter);
16105 fschmid 1017
        void scaleGroup(double scx, double scy, bool scaleText=true, Selection* customSelection = 0, bool scaleLine = false);
12339 cbradney 1018
        //! \brief Get a list of frames of certain type
1019
        QMap<PageItem*, QString> getDocItemNames(PageItem::ItemType itemType);
13659 cbradney 1020
        //! \brief Returns a serializer for this document
1021
        Serializer *serializer();
1022
 
13799 pierre 1023
        //! \brief Get rotation mode
1024
        int RotMode() const {return rotMode;}
1025
        //! \brief Set rotation mode
1026
        void RotMode(const int& val);
1027
 
14405 jghali 1028
        //! \brief Fonctions which avoid doc updater and update manager to send too much
1029
        // unncessary signals when doing updates on multiple items
1030
        void beginUpdate();
1031
        void endUpdate();
1032
 
168 Franz 1033
protected:
2891 cbradney 1034
        void addSymbols();
15096 cbradney 1035
        void applyPrefsPageSizingAndMargins(bool resizePages, bool resizeMasterPages, bool resizePageMargins, bool resizeMasterPageMargins);
1036
 
5823 cbradney 1037
        bool m_hasGUI;
14871 cbradney 1038
        ApplicationPrefs& appPrefsData;
1039
        ApplicationPrefs docPrefsData;
3983 craig 1040
        UndoManager * const undoManager;
2891 cbradney 1041
        bool loading;
2937 cbradney 1042
        bool modified;
1043
        int ActiveLayer;
2965 cbradney 1044
        double docUnitRatio;
13799 pierre 1045
        int rotMode;
3648 cbradney 1046
        bool automaticTextFrames; // Flag for automatic Textframes
3724 cbradney 1047
        bool m_masterPageMode;
16029 fschmid 1048
        bool m_symbolEditMode;
4110 cbradney 1049
        QMap<QString, double> m_constants;
5781 cbradney 1050
        ScribusMainWindow* m_ScMW;
1051
        ScribusView* m_View;
7906 jghali 1052
        ScGuardedObject<ScribusDoc> m_guardedObject;
13659 cbradney 1053
        Serializer *m_serializer;
16029 fschmid 1054
        QString currentEditedSymbol;
3757 cbradney 1055
 
168 Franz 1056
public: // Public attributes
2937 cbradney 1057
        bool is12doc; //public for now, it will be removed later
1330 fschmid 1058
        int NrItems;
1059
        int First;
1060
        int Last;
1061
        int viewCount;
1062
        int viewID;
3 paul 1063
        bool SnapGuides;
1064
        bool GuideLock;
5087 subik 1065
        /** \brief Minimum and Maximum Points of Document */
2837 fschmid 1066
        FPoint minCanvasCoordinate;
1067
        FPoint maxCanvasCoordinate;
2867 fschmid 1068
        double rulerXoffset;
1069
        double rulerYoffset;
5087 subik 1070
        /** \brief List of Pages */
10013 cbradney 1071
        QList<Page*>* Pages;
5087 subik 1072
        /** \brief List of Master Pages */
10013 cbradney 1073
        QList<Page*> MasterPages;
5087 subik 1074
        /** \brief List of Document Pages */
10013 cbradney 1075
        QList<Page*> DocPages;
16029 fschmid 1076
        /** \brief List for temporary Pages */
1077
        QList<Page*> TempPages;
5087 subik 1078
        /** \brief Mapping Master Page Name to Master Page numbers */
456 fschmid 1079
        QMap<QString,int> MasterNames;
5087 subik 1080
        /** \brief List of Objects */
9856 fschmid 1081
        QList<PageItem*>* Items;
1082
        QList<PageItem*> MasterItems;
1083
        QList<PageItem*> DocItems;
1084
        QList<PageItem*> FrameItems;
4847 cbradney 1085
        Selection* const m_Selection;
5087 subik 1086
        /** \brief Number of Columns */
168 Franz 1087
        double PageSp;
5087 subik 1088
        /** \brief Distance of Columns */
168 Franz 1089
        double PageSpa;
15407 craig 1090
        ///** \brief current Pagelayout */
1091
        //int currentPageLayout;
5087 subik 1092
        /** \brief Erste Seitennummer im Dokument */
3 paul 1093
        int FirstPnum;
5087 subik 1094
        /** \brief Flag fuer Rasterbenutzung */
168 Franz 1095
        bool useRaster;
5087 subik 1096
        /** \brief Im Dokument benutzte Farben */
1065 cbradney 1097
        ColorList PageColors;
1098
        int appMode;
123 Franz 1099
        int SubMode;
1100
        double *ShapeValues;
1101
        int ValCount;
168 Franz 1102
        QString DocName;
3544 avox 1103
        QMap<QString,int> UsedFonts;
3983 craig 1104
        SCFonts * const AllFonts;
9767 cbradney 1105
        QList<AlignObjs> AObjects;
168 Franz 1106
        int CurrentSel;
5559 avox 1107
        ParagraphStyle currentStyle;
10532 avox 1108
        NodeEditContext nodeEdit;
5087 subik 1109
        /** \brief Letztes Element fuer AutoTextrahmen */
168 Franz 1110
        PageItem *LastAuto;
5087 subik 1111
        /** \brief Erstes Element fuer AutoTextrahmen */
168 Franz 1112
        PageItem *FirstAuto;
1113
        bool DragP;
227 Franz 1114
        bool leaveDrag;
168 Franz 1115
        PageItem *DraggedElem;
1116
        PageItem *ElemToLink;
9803 fschmid 1117
        QList<uint> DragElements;
7442 avox 1118
private:
5980 avox 1119
        StyleSet<ParagraphStyle> docParagraphStyles;
1120
        StyleSet<CharStyle> docCharStyles;
7442 avox 1121
public:
10140 jghali 1122
        ScLayers Layers;
14971 cbradney 1123
        //bool marginColored;
168 Franz 1124
        int GroupCounter;
14170 jghali 1125
 
14491 jghali 1126
        ScColorMgmtEngine colorEngine;
14170 jghali 1127
        ScColorProfile DocInputImageRGBProf;
1128
        ScColorProfile DocInputImageCMYKProf;
1129
        ScColorProfile DocInputRGBProf;
1130
        ScColorProfile DocInputCMYKProf;
14281 jghali 1131
        ScColorProfile DocDisplayProf;
14170 jghali 1132
        ScColorProfile DocPrinterProf;
1133
        ScColorTransform stdTransRGBMon;
1134
        ScColorTransform stdTransCMYKMon;
1135
        ScColorTransform stdProof;
1136
        ScColorTransform stdTransImg;
1137
        ScColorTransform stdProofImg;
1138
        ScColorTransform stdProofImgCMYK;
1139
        ScColorTransform stdTransCMYK;
1140
        ScColorTransform stdProofCMYK;
1141
        ScColorTransform stdTransRGB;
1142
        ScColorTransform stdProofGC;
1143
        ScColorTransform stdProofCMYKGC;
10338 jghali 1144
        bool BlackPoint;
1330 fschmid 1145
        bool SoftProofing;
1146
        bool Gamut;
14170 jghali 1147
        eRenderIntent IntentColors;
1148
        eRenderIntent IntentImages;
168 Franz 1149
        bool HasCMS;
3 paul 1150
        QMap<QString,QString> JavaScripts;
1151
        int TotalItems;
7104 fschmid 1152
        PrintOptions Print_Options;
3 paul 1153
        bool RePos;
3201 subik 1154
        struct BookMa {
168 Franz 1155
                                        QString Title;
1156
                                        QString Text;
1157
                                        QString Aktion;
4679 fschmid 1158
                                        PageItem *PageObject;
168 Franz 1159
                                        int Parent;
1160
                                        int ItemNr;
1161
                                        int First;
1162
                                        int Last;
1163
                                        int Prev;
1164
                                        int Next;
1165
                                        };
9803 fschmid 1166
        QList<BookMa> BookMarks;
3 paul 1167
        bool OldBM;
1168
        bool hasName;
3984 craig 1169
        QTimer * const autoSaveTimer;
27 Franz 1170
        QMap<QString,multiLine> MLineStyles;
6368 fschmid 1171
        QMap<QString, ScPattern> docPatterns;
14150 fschmid 1172
        QMap<QString, VGradient> docGradients;
59 Franz 1173
        QWidget* WinHan;
63 Franz 1174
        bool DoDrawing;
16177 fschmid 1175
        bool drawAsPreview;
16241 fschmid 1176
        bool viewAsPreview;
1177
        int previewVisual;
8220 fschmid 1178
        struct OpenNodesList
1179
        {
1180
                int type;
1181
                Page *page;
1182
                PageItem *item;
1183
        };
9803 fschmid 1184
        QList<OpenNodesList> OpenNodes;
139 Franz 1185
        QTimer *CurTimer;
5674 fschmid 1186
        QMap<int, errorCodes> docLayerErrors;
16122 fschmid 1187
        QMap<PageItem*, errorCodes> docItemErrors;
1188
        QMap<PageItem*, errorCodes> masterItemErrors;
2353 fschmid 1189
        FPointArray symReturn;
1190
        FPointArray symNewLine;
1191
        FPointArray symTab;
1192
        FPointArray symNonBreak;
2389 fschmid 1193
        FPointArray symNewCol;
1194
        FPointArray symNewFrame;
3263 cbradney 1195
 
5781 cbradney 1196
        Hyphenator * docHyphenator;
3263 cbradney 1197
private:
11576 avox 1198
        UndoTransaction* m_itemCreationTransaction;
1199
        UndoTransaction* m_alignTransaction;
1200
 
11625 jghali 1201
        Page* m_currentPage;
10532 avox 1202
        UpdateManager m_updateManager;
1203
        MassObservable<PageItem*> m_itemsChanged;
1204
        MassObservable<Page*> m_pagesChanged;
10701 avox 1205
        MassObservable<QRectF> m_regionsChanged;
10532 avox 1206
        DocUpdater* m_docUpdater;
3695 cbradney 1207
 
1208
signals:
1209
        //Lets make our doc talk to our GUI rather than confusing all our normal stuff
1210
        /**
4584 cbradney 1211
         * @brief Let the document tell whatever is listening that it has changed
1212
         */
4738 cbradney 1213
        void docChanged();
4688 cbradney 1214
        void updateContents();
7736 cbradney 1215
        void updateContents(const QRect &r);
4585 cbradney 1216
        void refreshItem(PageItem *);
4672 cbradney 1217
        void canvasAdjusted(double width, double height, double dX, double dY);
4688 cbradney 1218
        void firstSelectedItemType(int);
1219
        void setApplicationMode(int);
4584 cbradney 1220
        /**
3695 cbradney 1221
         * @brief A signal for when the outline palette needs to rebuild itself
1222
         * Emit when:
1223
         * - An item is created or deleted
1224
         * - An item changes page
1225
         * - An page is created or deleted
1226
         * - Some items are grouped or a group is ungrouped
1227
         * This also applies to Master Pages
1228
         */
1229
        void signalRebuildOutLinePalette();
7736 cbradney 1230
        //! Temporary signal for SizeItem
1231
        void widthAndHeight(double, double);
13799 pierre 1232
 
1233
        //! Signal a change in rotation mode (aka basepoint)
1234
        void rotationMode(int);
16289 fschmid 1235
        void updateEditItem();
4688 cbradney 1236
 
1237
public slots:
16016 fschmid 1238
        void selectionChanged();
4688 cbradney 1239
        void itemSelection_ToggleLock();
1240
        void itemSelection_ToggleSizeLock();
1241
        void itemSelection_ToggleImageShown();
4698 cbradney 1242
        void itemSelection_TogglePrintEnabled();
15309 cbradney 1243
        void itemSelection_Transform(int nrOfCopies, QTransform matrix, int basepoint);
4705 cbradney 1244
        void itemSelection_ChangePreviewResolution(int id);
13075 subik 1245
 
1246
        /*! \brief Change display quality of all images in document.
1247
        \author  OssiLehtinen
1248
        */
1249
        void allItems_ChangePreviewResolution(int id);
1250
 
4855 cbradney 1251
        void itemSelection_ClearItem(Selection* customSelection=0);
6601 cbradney 1252
        //! Delete the items in the current selection. When force is true, we do not warn the user and make SE happy too. Force is used from @sa Page::restorePageItemCreation
1253
        void itemSelection_DeleteItem(Selection* customSelection=0, bool forceDeletion=false);
4713 cbradney 1254
        void itemSelection_SetItemFillTransparency(double t);
1255
        void itemSelection_SetItemLineTransparency(double t);
5746 fschmid 1256
        void itemSelection_SetItemFillBlend(int t);
1257
        void itemSelection_SetItemLineBlend(int t);
6578 cbradney 1258
        void itemSelection_SetLineGradient(VGradient& newGradient, Selection* customSelection=0);
1259
        void itemSelection_SetFillGradient(VGradient& newGradient, Selection* customSelection=0);
14297 fschmid 1260
        void itemSelection_SetMaskGradient(VGradient& newGradient, Selection* customSelection=0);
10335 jghali 1261
        void itemSelection_SetOverprint(bool overprint, Selection* customSelection=0);
6578 cbradney 1262
        void itemSelection_ApplyImageEffects(ScImageEffectList& newEffectList, Selection* customSelection=0);
4699 cbradney 1263
        void itemSelection_FlipH();
1264
        void itemSelection_FlipV();
4713 cbradney 1265
        void itemSelection_DoHyphenate();
1266
        void itemSelection_DoDeHyphenate();
13875 jghali 1267
        void itemSelection_SendToLayer(int layerID);
4847 cbradney 1268
        void itemSelection_SetImageOffset(double x, double y, Selection* customSelection=0);
1269
        void itemSelection_SetImageScale(double x, double y, Selection* customSelection=0);
1270
        void itemSelection_SetImageScaleAndOffset(double ox, double oy, double sx, double sy, Selection* customSelection=0);
14861 fschmid 1271
        void itemSelection_SetImageRotation(double rot, Selection* customSelection=0);
15220 cbradney 1272
        void itemSelection_AlignItemLeft(int i, double newX, AlignMethod how);
1273
        void itemSelection_AlignItemRight(int i, double newX, AlignMethod how);
1274
        void itemSelection_AlignItemTop(int i, double newY, AlignMethod how);
1275
        void itemSelection_AlignItemBottom(int i, double newY, AlignMethod how);
1276
        void itemSelection_AlignLeftOut(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
1277
        void itemSelection_AlignRightOut(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
1278
        void itemSelection_AlignBottomIn(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
1279
        void itemSelection_AlignRightIn(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
1280
        void itemSelection_AlignBottomOut(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
1281
        void itemSelection_AlignCenterHor(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
1282
        void itemSelection_AlignLeftIn(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
1283
        void itemSelection_AlignCenterVer(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
1284
        void itemSelection_AlignTopOut(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
1285
        void itemSelection_AlignTopIn(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
1286
 
15237 cbradney 1287
        void itemSelection_DistributeDistH(bool usingDistance=false, double distance=0.0, bool reverseDistribute=false);
6488 cbradney 1288
        void itemSelection_DistributeAcrossPage(bool useMargins=false);
5334 cbradney 1289
        void itemSelection_DistributeRight();
1290
        void itemSelection_DistributeBottom();
1291
        void itemSelection_DistributeCenterH();
15237 cbradney 1292
        void itemSelection_DistributeDistV(bool usingDistance=false, double distance=0.0, bool reverseDistribute=false);
6488 cbradney 1293
        void itemSelection_DistributeDownPage(bool useMargins=false);
5334 cbradney 1294
        void itemSelection_DistributeLeft();
1295
        void itemSelection_DistributeCenterV();
1296
        void itemSelection_DistributeTop();
13772 cbradney 1297
        void itemSelection_SwapLeft();
1298
        void itemSelection_SwapRight();
6657 cbradney 1299
        void itemSelection_MultipleDuplicate(ItemMultipleDuplicateData&);
7739 cbradney 1300
        void itemSelection_UniteItems(Selection* customSelection=0);
1301
        void itemSelection_SplitItems(Selection* customSelection=0);
1302
        /**
1303
         * Adjust an image frame's size to fit the size of the image in it
1304
         */
12420 cbradney 1305
        void itemSelection_AdjustFrametoImageSize(Selection* customSelection=0);
12591 fschmid 1306
        /**
1307
         * Adjust an image size to fit the size of the frame
1308
         */
1309
        void itemSelection_AdjustImagetoFrameSize(Selection* customSelection=0);
7676 cbradney 1310
        //! @brief startArrowID or endArrowID of -1 mean not applying a selection at this point.
1311
        void itemSelection_ApplyArrowHead(int startArrowID=-1, int endArrowID=-1, Selection* customSelection=0);
15345 fschmid 1312
        void itemSelection_ApplyArrowScale(int startArrowSc, int endArrowSc, Selection* customSelection);
6414 fschmid 1313
 
12420 cbradney 1314
        void itemSelection_SetItemPen(QString farbe);
1315
        void itemSelection_SetItemPenShade(int sha);
14197 fschmid 1316
        void itemSelection_SetItemGradStroke(int typ);
12420 cbradney 1317
        void itemSelection_SetItemBrush(QString farbe);
1318
        void itemSelection_SetItemBrushShade(int sha);
14300 fschmid 1319
        void itemSelection_SetItemGradMask(int typ);
12420 cbradney 1320
        void itemSelection_SetItemGradFill(int typ);
1321
        void itemSelection_SetItemPatternFill(QString pattern);
14276 fschmid 1322
        void itemSelection_SetItemPatternProps(double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, bool mirrorX, bool mirrorY);
14168 fschmid 1323
        void itemSelection_SetItemStrokePattern(QString pattern);
14403 fschmid 1324
        void itemSelection_SetItemStrokePatternProps(double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, double space, bool mirrorX, bool mirrorY);
1325
        void itemSelection_SetItemStrokePatternType(bool type);
14308 fschmid 1326
        void itemSelection_SetItemPatternMask(QString pattern);
1327
        void itemSelection_SetItemPatternMaskProps(double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, bool mirrorX, bool mirrorY);
6414 fschmid 1328
 
13349 jghali 1329
        void undoRedoBegin();
1330
        void undoRedoDone();
1331
 
4688 cbradney 1332
        void updatePic();
1333
        void updatePict(QString name);
12660 fschmid 1334
        void updatePictDir(QString name);
4688 cbradney 1335
        void removePict(QString name);
3 paul 1336
};
1337
 
13170 jghali 1338
Q_DECLARE_METATYPE(ScribusDoc*);
1339
 
3 paul 1340
#endif