diff --git a/Scribus/devel-doc/Doxyfile b/Scribus/devel-doc/Doxyfile index e238da4..474e952 100644 --- a/Scribus/devel-doc/Doxyfile +++ b/Scribus/devel-doc/Doxyfile @@ -144,7 +144,7 @@ JAVADOC_AUTOBRIEF = NO # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) -QT_AUTOBRIEF = NO +QT_AUTOBRIEF = YES # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// diff --git a/Scribus/scribus/scribusdoc.h b/Scribus/scribus/scribusdoc.h index 7336ceb..12ffa5f 100644 --- a/Scribus/scribus/scribusdoc.h +++ b/Scribus/scribus/scribusdoc.h @@ -119,340 +119,898 @@ public: ~ScribusDoc(); void init(); void setup(const int, const int, const int, const int, const int, const QString&, const QString&); + +// States + /*! + * Set the loading state of the document + * See ScribusDoc.isLoading() + */ void setLoading(const bool); + /*! + * Is the document loading ? + * See ScribusDoc.setLoading() + */ bool isLoading() const; + /*! + * Set modified state of the document + * If state changed, update the document + * See ScribusDoc.isModified() + */ void setModified(const bool); + /*! + * Is the document modified ? + * See ScribusDoc.setModified() + */ bool isModified() const; -/** Setzt die Seitenattribute */ - void setPage(double b, double h, double t, double l, double r, double bo, double sp, double ab, bool atf, int fp); - void resetPage(MarginStruct& newMargins, int fp); - /** - * @brief Return the view associated with the document +// GUI + /*! + * Associate document and GUI. + * See ScribusDoc.hasGUI(), ScribusDoc.scMW() and ScribusDoc.view() + * @param hasgui Is document associated with gui ? + * @param mainWindow scribus main window + * @param view scribus view */ - ScribusView* view() const; + void setGUI(bool hasgui, ScribusMainWindow* mainWindow, ScribusView* view); + /*! + * Is the document associated with GUI ? + * See Scribus.setGUI() + */ + bool hasGUI() const {return m_hasGUI;} + /*! + * Get the scribus main window associated with the document. + * See Scribus.setGUI() + * @return the scribus man window + */ +//ivro: rename this function (mainWindow or scribusMainWindow) ? ScribusMainWindow* scMW() const {return m_ScMW;} - void setGUI(bool hasgui, ScribusMainWindow* mw, ScribusView* view); + /*! + * Get the view associated with the document. + * See Scribus.setGUI() + * @return the scribus view + */ + ScribusView* view() const; - /** - * @brief Return the guarded object associated with the document +// Automatic Text Frames + /*! + * Set if doc uses automatic text frames. + * See ScribusDoc.usesAutomaticTextFrames(), ScribusDoc.PageSp and ScribusDoc.PageSpa + */ + void setUsesAutomaticTextFrames(const bool); + /*! + * Is document using automatic text frames ? + * See ScribusDoc.setUsesAutomaticTextFrames + */ + bool usesAutomaticTextFrames() const; + +// Grid and Guides + /*! + * Should guides be locked or not ? + * @param isLocked If true guides on pages cannot be moved if false they + * can be dragged to new positions. + * @author Riku Leino + */ + void lockGuides(bool isLocked); + +// Current Page + /*! + * Set new current page. + */ + void setCurrentPage(Page*); + /*! + * Get the current page. + */ + Page* currentPage(); + /*! + * Get the current page number. + */ + int currentPageNumber(); + +// Unit index and unit ratio + /*! + * Set the document's unit index and update the document's unit ratio. + * See ScribusDoc.unitIndex() and ScribusDoc.unitRatio() + */ + void setUnitIndex(const int); + /*! + * Get the document's unit index. + * See ScribusDoc.setUnitIndex() + */ + int unitIndex() const; + /*! + * Get the document's unit ratio. + * See ScribusDoc.setUnitIndex() + */ + double unitRatio() const; + +// Document's properties + /*! + * Sets the name of the document. + * @param name Name for the document + * @author Riku Leino + */ + void setName(const QString& name); + +/*! @name Master Page + * Master page related functions. + * + * A master page is a model for page. Items on master pages will be repeated on each page with the master page. + * Use applyMasterPage() to associate a master page to a page and copyPageToMasterPage() to make a master page from a page. + * + * The master page mode allow to work with master pages and items with the same functions you use for pages and items. + * See masterPageMode() and setMasterPageMode(). + */ //@{ + /*! + * Is the document in master page mode ? + * In master page mode + * ScribusDoc.Pages = &ScribusDoc.MasterPages + * ScribusDoc.Items = &ScribusDoc.MasterItems + * In normal mode (ie not in master mode) + * ScribusDoc.Pages = &ScribusDoc.DocPages + * ScribusDoc.Items = &ScribusDoc.DocItems + */ + bool masterPageMode() const { return m_masterPageMode; } + /*! + * Set the doc into Master page mode. + */ +// Do we need to return if the move to master page mode was successful? + void setMasterPageMode(bool); + + /*! + * Add a master page. + * Use this function to add a master page, do not use addPage + * @param pageNumber index for the master page + * @param pageName name of the master page + * @return added page + */ + Page* addMasterPage(const int pageNumber, const QString& pageName); + /*! + * Delete a master page. + * @param pageNumber index of the master page + */ + void deleteMasterPage(const int pageNumber); + /*! + * Replace a master page by default one. + * @param oldMasterPage name of the master page to remplace */ - const ScGuardedPtr& guardedPtr() const; - - UpdateManager* updateManager() { return &m_updateManager; } - MassObservable * itemsChanged() { return &m_itemsChanged; } - MassObservable * pagesChanged() { return &m_pagesChanged; } - MassObservable * regionsChanged() { return &m_regionsChanged; } - void invalidateRegion(QRectF region); - - // Add, delete and move pages - - Page* addPage(const int pageNumber, const QString& masterPageName=QString::null, const bool addAutoFrame=false); - void deletePage(const int); - //! @brief Add a master page with this function, do not use addPage - Page* addMasterPage(const int, const QString&); - void deleteMasterPage(const int); - //! @brief Rebuild master name list - void rebuildMasterNames(void); - //! @brief Replace a master page by default one void replaceMasterPage(const QString& oldMasterPage); - //! @brief Rename a master page + /*! + * Rename a master page. + * @param oldPageName old name of the master page + * @param newPageName new name for the master page + */ bool renameMasterPage(const QString& oldPageName, const QString& newPageName); - //! @brief Create the default master pages based on the layout selected by the user, ie, Normal, Normal Left, etc. - void createDefaultMasterPages(); - //! @brief Create the requested pages in a new document, run after createDefaultMasterPages() - void createNewDocPages(int pageCount); - /** - * @brief Add the automatic text frame to the page - * @param pageNumber page number - * @return number of frame + /*! + * Rebuild master name list. + * Rebuild ScribusDoc.MasterName list from the master page name */ - int addAutomaticTextFrame(const int pageNumber); - /** - * Set the left and right margins based on the location of the page - * @param pageIndex + void rebuildMasterNames(void); +//@} // End of master page group + +/*! @name Page + * Page related functions. + * + * A page represents a paper page. See Page::Page + */ //@{ + // Add, delete and move page + + /*! + * Add a page. + * Do not use this to add a master page, use addMasterPage instead + * @param pageNumber index for the page + * @param masterPageName master page to use + * @param addAutoFrame add automatic text frame + * @return addedpage */ - void setLocationBasedPageLRMargins(uint pageIndex); - /** - * @brief Move page(s) within the document + Page* addPage(const int pageNumber, const QString& masterPageName=QString::null, const bool addAutoFrame=false); + /*! + * Delete a page. + * @param pageNumber index of the page + */ + void deletePage(const int pageNumber); + /*! + * Move page(s) within the document. * @param from page index * @param to page index - * @param ziel target to move to (page index) - * @param art Before, After or at the end + * @param ziel page index of the target to move to + * @param art Before (0), After (1) or At the end (2) */ +//ivro: create typedef for param art (like whereToMove) ? void movePage(const int from, const int to, const int ziel, const int art); - - /** - * @brief Copy a page (pageNumberToCopy) copyCount times, whereToInsert(before or after) the existingPage or at the end. - * @param pageNumberToCopy - * @param existingPage - * @param whereToInsert - * @param copyCount - */ + /*! + * Copy a page. + * Copy a page (pageNumberToCopy) copyCount times, whereToInsert(before or after) the existingPage or at the end. + * @param pageNumberToCopy index of the page + * @param existingPage where to copy (page index) + * @param whereToInsert Before (0), After (1) or At the end (2) + * @param copyCount number of copy + */ +//ivro: use typedef whereToMove for param whereToInsert ? void copyPage(int pageNumberToCopy, int existingPage, int whereToInsert, int copyCount); - + + // Properties of page + + /*! + * Set page properties. + * @param width page width + * @param height page height + * @param marginsTop page margins top + * @param marginsLeft page margins left + * @param marginsRight page margins right + * @param marginsBottom page margins bottom + * @param numberOfColumns number of automaticTextFrames columns + * @param distanceOfColumns distance between automaticTextFrams columns + * @param automaticTextFrames is automaticTextFrames enabled ? + * @param pageLayout index of the page layout in ScribusDoc.pageSets + */ + void setPage(double width, double height, double marginsTop, double marginsLeft, double marginsRight, double marginsBottom, double numberOfColums, double distanceOfColumns, bool automatictTextFrames, int pageLayout); + /*! + * Reset the page properties. + * @param newMargins margins to apply + * @param pageLayout index of the page layout in Scribus.pageSets + */ + void resetPage(MarginStruct& newMargins, int pageLayout); + /*! + * Apply a master page. + * @param masterPageName name of the master page + * @param pageNumber index of the page + */ + bool applyMasterPage(const QString& masterPageName, const int pageNumber); + /*! + * Copies a normal page to be a master pages. + * @param pageNumber index of the page to copy + * @param leftPage + * @param maxLeftPage + * @param masterPageName name for the master page + * @param copyFromAppliedMaster + */ + bool copyPageToMasterPage(const int pageNumber, const int leftPage, const int maxLeftPage, const QString& masterPageName, bool copyFromAppliedMaster); + + /*! + * Add the automatic text frame to the page. + * @param pageNumber index of page + * @return number of text frame created, -1 on error + */ + int addAutomaticTextFrame(const int pageNumber); + + /*! + * Set the page margins. Current code uses current page only, also provide a (currently, TODO) option for this. + * @param initialTop + * @param initialBottom + * @param initialLeft + * @param initialRight + * @param initialHeight + * @param initialWight + * @param height + * @param width + * @param orientation + * @param pageSize + * @param pageNumber if equal to -1, do nothing and return false. Caution default is -1. + * @param pageType see Page.LeftPg, default to 0 (Right page) + */ +//ivro: is this fuction name goods as it does things that not only about margins ? + 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); + + /*! + * Get page's bleeds. + * @param pageNumber index of the page + * @param bleedData struct to get the bleed + */ +//ivro: is this not better in Page ? + void getBleeds(int pageNumber, MarginStruct& bleedData); + /*! + * Get page's bleeds. + * @param page page to look at + * @param bleedData struct to get the bleed + */ + void getBleeds(Page* page, MarginStruct& bleedData); + + + // Canvas + + /*! + * Get the location of the page on the canvas, ie, left, middle, or right. + * Does not give information about middle left, etc. + * @param pageIndex Index of page to find location for + * @return LeftPage, MiddlePage, RightPage, enum from pagestructs.h + */ + PageLocation locationOfPage(int pageIndex) const; + /*! + * Get the column of the page on the canvas, ie, left, middle, or right. + * @param pageIndex Index of page to find location for + * @return int of 0,1,2,3 + */ + int columnOfPage(int pageIndex) const; + /*! + * Return the x offset for a page on the canvas. + * @retval double containing the offset. Returns -1.0 if page not in Pages list (as -ve is not possible). + * Mostly saves bringing in extra includes into files that already have scribusdoc.h + */ + double getXOffsetForPage(const int); + /*! + * Return the y offset for a page on the canvas. + * @retval double coutaining the offset. Returns -1.0 if page not in pages list (as -ve is not possible). + */ + double getYOffsetForPage(const int); + + /*! + * Set the left and right margins based on the location of the page. + * @param pageIndex index of the page + */ + void setLocationBasedPageLRMargins(uint pageIndex); +//@} // End of Page group + +/*! @name Layer + * layer related functions. + */ //@{ // Add, delete and move layers - /** - * @brief Add a layer to the current document + + /*! + * Add a layer to the current document. * @param layerName name of layer * @param activate the layer active * @return Number of the layer created */ int addLayer(const QString& layerName=QString::null, const bool activate=false); - /** - * @brief Copies a layer from the current document + /*! + * Copies a layer from the current document. * @param layerNumberToCopy source layer * @param whereToInsert target layer * @return Success or failure */ void copyLayer(int layerNumberToCopy, int whereToInsert); - /** - * @brief Delete a layer from the current document + /*! + * Delete a layer from the current document. * @param layerNumber of layer * @param deleteItems the items on the layer too? * @return Success or failure */ bool deleteLayer(const int layerNumber, const bool deleteItems); - /** - * @brief Return the number of the current layer - * @return Active layer number + /*! + * FIXME: Make protected once scripter function no longer uses this directly */ - int activeLayer(); + void removeLayer(int l, bool dl = false); - /** - * @brief Return the name of the current layer - * @return Name of the layer - */ - const QString& activeLayerName(); - /** - * @brief Set the active layer via the layer number + // Active layer + + /*! + * Set the active layer via the layer number. * @param layerToActivate Number of the layer * @return Success or failure */ bool setActiveLayer(const int layerToActivate); - /** - * @brief Set the active layer via the layer name + /*! + * Set the active layer via the layer name. * @param layerNameToActivate Name of the layer * @return Success or failure */ bool setActiveLayer(const QString & layerNameToActivate); - /** - * @brief Set the layer printable via the layer number + /*! + * Return the number of the current layer. + * @return Active layer number + */ + int activeLayer(); + /*! + * Return the name of the current layer. + * @return Name of the layer + */ + const QString& activeLayerName(); + + // Layer properties + + /*! + * Return the layer name. + * @param layerNumber Number of the layer + * @return Name of the layer + */ + QString layerName(const int layerNumber) const; + /*! + * Change the name of a layer. + * @param layerNumber number of the layer + * @param newName new name of the layer + * @return Success or failure + */ + bool changeLayerName(const int layerNumber, const QString& newName); + /*! + * Set the layer printable via the layer number. * @param layerNumber Number of the layer * @param isPrintable bool true = layer is prantable * @return Success or failure */ bool setLayerPrintable(const int layerNumber, const bool isPrintable); - /** - * @brief Is the layer printable + /*! + * Is the layer printable ? * @param layerNumber Number of the layer * @return Printable or not */ bool layerPrintable(const int layerNumber); - /** - * @brief Set the layer visible via the layer number + /*! + * Set the layer visible via the layer number. * @param layerNumber Number of the layer * @param isViewable true = layer is visible * @return Success or failure */ bool setLayerVisible(const int layerNumber, const bool isViewable); - /** - * @brief Is the layer visible + /*! + * Is the layer visible ? * @param layerNumber Number of the layer * @return Visible or not */ bool layerVisible(const int layerNumber); - /** - * @brief Set the layer locked via the layer number + /*! + * Set the layer locked via the layer number. * @param layerNumber Number of the layer * @param isLocked true = layer is locked * @return Success or failure */ bool setLayerLocked(const int layerNumber, const bool isLocked); - /** - * @brief Is the layer locked + /*! + * Is the layer locked ? * @param layerNumber Number of the layer * @return Locked or not */ bool layerLocked(const int layerNumber); - /** - * @brief Set the layer flow via the layer number + /*! + * Set the layer flow via the layer number. * @param layerNumber Number of the layer * @param flow true = Text flows around objects on this layer * @return Success or failure */ bool setLayerFlow(const int layerNumber, const bool flow); - /** - * @brief does text flow around objects on this layer + /*! + * does text flow around objects on this layer ? * @param layerNumber Number of the layer * @return flow or not */ bool layerFlow(const int layerNumber); - /** - * @brief Set the layer transparency via the layer number + /*! + * Set the layer transparency via the layer number. * @param layerNumber Number of the layer * @param trans transparency value 0.0 - 1.0 * @return Success or failure */ bool setLayerTransparency(const int layerNumber, double trans); - /** - * @brief returns the layer transparency + /*! + * returns the layer transparency. * @param layerNumber Number of the layer * @return transparency value 0.0 - 1.0 */ double layerTransparency(const int layerNumber); - /** - * @brief Set the layer layerBlendMode via the layer number + /*! + * Set the layer layerBlendMode via the layer number. * @param layerNumber Number of the layer * @param blend layerBlendMode * @return Success or failure */ bool setLayerBlendMode(const int layerNumber, int blend); - /** - * @brief returns the layer BlendMode + /*! + * Returns the layer BlendMode. * @param layerNumber Number of the layer * @return layerBlendMode */ int layerBlendMode(const int layerNumber); - /** - * @brief Return the level of the requested layer + /*! + * Set the layer outline mode via the layer number. * @param layerNumber Number of the layer - * @return Level of the layer + * @param outline true = layer is displayed in outlines only + * @return Success or failure */ - int layerLevelFromNumber(const int layerNumber); - /** - * @brief Set the layer marker color + bool setLayerOutline(const int layerNumber, const bool outline); + /*! + * Is this layer in outline mode ? + * @param layerNumber Number of the layer + * @return outline or not + */ + bool layerOutline(const int layerNumber); + + // Layer marker color + + /*! + * Set the layer marker color. * @param layerNumber Number of the layer * @param color color of the marker * @return Success or failure */ bool setLayerMarker(const int layerNumber, QColor color); - /** - * @brief returns the layer marker color + /*! + * Returns the layer marker color. * @param layerNumber Number of the layer * @return marker color */ QColor layerMarker(const int layerNumber); - /** - * @brief Set the layer outline mode via the layer number - * @param layerNumber Number of the layer - * @param outline true = layer is displayed in outlines only - * @return Success or failure - */ - bool setLayerOutline(const int layerNumber, const bool outline); - /** - * @brief is this layer in outline mode + + // Layer level + + /*! + * Returns the level of the requested layer. * @param layerNumber Number of the layer - * @return outline or not + * @return Level of the layer */ - bool layerOutline(const int layerNumber); - /** - * @brief Return the number of the layer at a certain level + int layerLevelFromNumber(const int layerNumber); + /*! + * Returns the number of the layer at a certain level. * @param layerLevel Layer level * @return Layer number */ int layerNumberFromLevel(const int layerLevel); - /** - * @brief Return the layer count - * @return Number of layers in doc - */ - int layerCount() const; - /** - * @brief Lower a layer + + // Lower and Raise Layer + + /*! + * Lowers a layer. * @param layerNumber Number of the layer * @return Success or failure */ bool lowerLayer(const int layerNumber); - /** - * @brief Lower a layer using the level + /*! + * Lowers a layer using the level. * @param layerLevel Level of the layer * @return Success or failure */ bool lowerLayerByLevel(const int layerLevel); - /** - * @brief Raise a layer + /*! + * Raises a layer. * @param layerNumber Number of the layer * @return Success or failure */ bool raiseLayer(const int layerNumber); - /** - * @brief Raise a layer using the level + /*! + * Raises a layer using the level. * @param layerLevel Level of the layer * @return Success or failure */ bool raiseLayerByLevel(const int layerLevel); - /** - * @brief Return the layer name - * @param layerNumber Number of the layer - * @return Name of the layer - */ - QString layerName(const int layerNumber) const; - /** - * @brief Change the name of a layer - * @param layerNumber number of the layer - * @param newName new name of the layer - * @return Success or failure + + // Various functions on layer + + /*! + * Returns the layer count. + * @return Number of layers in doc */ - bool changeLayerName(const int layerNumber, const QString& newName); - /** - * @brief Does the layer have items on it? + int layerCount() const; + /*! + * Does the layer have items on it ? * @param layerNumber Number of the layer * @return Layer contains items bool */ bool layerContainsItems(const int layerNumber); - /** - * @brief Renumber a layer. Used in particular for reinsertion for undo/redo + /*! + * Renumbers a layer. Used in particular for reinsertion for undo/redo. * @param layerNumber old layer number * @param newLayerNumber New layer number * @return Success or failure */ bool renumberLayer(const int layerNumber, const int newLayerNumber); - /** - * @brief Return a list of the layers in their order + /*! + * Returns a list of the layers in their order. * @param list QStringList to insert the layer names into */ void orderedLayerList(QStringList* list); - //Items +//@} // End of Layer function + +/*! @name Item + * Item related functions. + */ //@{ + // Add + + /*! + * Add an Item to the document. + * A simple function to create an item of a defined type and add it to the document + * Will need extensive rewriting once we have various classes of PageItems, at a guess. + * + * @param itemType type + * @param frameType frame type + * @param x X pos + * @param y Y pos + * @param b width + * @param h height + * @param w ? + * @param fill fill color name + * @param outline outline color name + * @param itemFinalised Used to handle item creation for undo while the user is still dragging. + * @return Number of created item, -1 on failure. + */ + 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); + /*! + * Add an Item to the page. + * Item will be fitted to the closest guides/margins of the x/y position. + * + * @param itemType type + * @param itemFramType frame type + * @param x X pos + * @param y Y pos + * @param w ? + * @param fill fill color name + * @param outline outline color name + * @param itemFinalised Used to handle item creation for undo while the user is still dragging + * @return Number of created item, -1 on failure. + */ + 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); + /*! + * Allow the user to create a frame easily with some simple placement and sizing options. + * @param iafData a InsertAFrameData structure with params + * @return int item id? FIXME + */ + int itemAddUserFrame(InsertAFrameData &iafData); + /*! + * Commit item creation when a user has click-drag created an item. + * Only called from ScribusView. Note the undo target is the page, so the undo code remains their for now. + * + * @return If an item was committed and the view must emit its signal, which needs removing from here, TODO. + */ + bool itemAddCommit(const int itemNumber); + /*! + * Finalise item creation, only to be called from itemAdd(). + * Simply split off code from itemAdd. + * + * @param itemType type + * @param frameType frame type + * @param itemNumber item index + */ + void itemAddDetails(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, const int itemNumber); + /*! + * Item type conversion functions. + * @param currItem item to convert + * @param newType + * @param secondaryItem ? + */ + PageItem* convertItemTo(PageItem *currItem, PageItem::ItemType newType, PageItem* secondaryItem=NULL); + /*! + * Paste an item to the document. + * The bulk of a paste item process runs here for want of a better place, but its a better place + * than the view where it used to be. + * TODO Once the pageitem restructure is done, this is probably unnecessary but it removes the + * unnecessary part from the view for now which is overloaded with non ScrollView code. + */ + //TODO: void PasteItem(struct CopyPasteBuffer *Buffer, bool loading, bool drag = false); + + //itemDelete + //itemBlah... + + // move, rotate, resize items + + /*! + * Move item. + * @param newX new X coord + * @param newY new Y coord + * @param item page item to move + * @param fromMP ? + */ +//ivro: standardize param order as PageItem changed each function ? +// something like item, args, options ? + bool MoveItem(double newX, double newY, PageItem* ite, bool fromMP = false); + /*! + * Rotate Item. + * @param angle angle to rotate + * @param itemNumber index of the item to rotate + */ + void RotateItem(double angle, int itemNumber); + /*! + * Rotate Item. + * @param angle angle to rotate + * @param currItem page item to rotate + */ + void RotateItem(double angle, PageItem *currItem); + /*! + * Move and Rotate Item. + * @param currItem page item to transform + * @param npv ? + * @param fromMP ? + */ + void MoveRotated(PageItem *currItem, FPoint npv, bool fromMP = false); + /*! + * Resize item. + * @param newX new X coord + * @param newY new Y coord + * @param ite index of page item to resize + * @param fromMp ? + * @param DoUpdateClip ? + * @param redraw ? + */ + bool SizeItem(double newX, double newY, int ite, bool fromMP = false, bool DoUpdateClip = true, bool redraw = true); + /*! + * Resize item. + * @param newX new X coord + * @param newY new Y coord + * @param pi page item to resize + * @param fromMp ? + * @param DoUpdateClip ? + * @param redraw ? + */ + bool SizeItem(double newX, double newY, PageItem *pi, bool fromMP = false, bool DoUpdateClip = true, bool redraw = true); + /*! + * Size and Move item. + * @param newX new X coord + * @param newY new Y coord + * @param ite index of page item to transform + * @param fromMp ? + * @param constrainRotation ? + */ + bool MoveSizeItem(FPoint newX, FPoint newY, int ite, bool fromMP = false, bool constrainRotation=false); +//ivro: don't know what it does + void AdjustItemSize(PageItem *currItem); + + //void FlipImageH(); + //void FlipImageV(); + void MirrorPolyH(PageItem *currItem); + void MirrorPolyV(PageItem *currItem); + + // Various + + /*! + * Delete the tagged items. + * Currently does nothing + */ bool deleteTaggedItems(); + /*! + * Get the item index from a unique ID. + * @param unique ID of item + * @return index of the item + */ + uint getItemNrfromUniqueID(uint unique); + /*! + * Run this common frame item update code. + */ + void updateFrameItems(); + /*! + * Renumbers the items into the order they are stored in in the lists. + * Utility function used in various places, basically handles keeping items numbered in the way + * they are layered. When layer is a property and not a fuction of storage, this should be removed. + * Depends on the Items pointer pointing to the correct item list (doc, master, etc). + * @sa updateFrameItems(); + */ + void renumberItemsInListOrder(); + /*! + * Rebuild item lists taking into account layer order. + * Utility function used in various places, basically handles keeping items numbered in the way + * they are layered. When layer is a property and not a fuction of storage, this should be removed. + * @sa updateFrameItems(); + */ + void rebuildItemLists(); + /*! + * Find if item is not an already used item. + * Return true if the passed name is not used by any existing PageItem + * in the same document as this PageItem. + * @author Craig Ringer + ** CB Moved from PageItem + */ +//ivro: is returning true if the passed name exists not better ? (or rename to itemNameDontUses ?) + bool itemNameExists(const QString itemName); + /*! + * Returns a stringlist of the item attributes within the document. + */ + QStringList getItemAttributeNames(); + + /*! Get a list of frames of certain type. */ + QMap getDocItemNames(PageItem::ItemType itemType); +//@} //End Items group + +/*! @name Sections + * Sections related functions + */ //@{ + // add, delete, use sections /*! - * @brief Builds a qmap of the icc profiles used within the document + * Add a section to the document sections list. + * Set number to -1 to add in the default section if the map is empty */ - void getUsedProfiles(ProfilesL& usedProfiles); - bool OpenCMSProfiles(ProfilesL InPo, ProfilesL InPoCMYK, ProfilesL MoPo, ProfilesL PrPo); - void CloseCMSProfiles(); - void SetDefaultCMSParams(); - /** - * @brief Switch Colormanagement on or of - * @param enable bool, if true Colormanagement is switched on, else off + 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); + /*! + * Delete a section from the document sections list. + */ + bool deleteSection(const uint); + /*! + * Gets the page number to be printed based on the section it is in. + * Returns QString::null on failure to find the pageIndex + */ + const QString getSectionPageNumberForPageIndex(const uint) const; + /*! + * Gets the key of the sections map based on the section the page index is in. + * Returns -1 on failure to find the pageIndex + */ + int getSectionKeyForPageIndex(const uint pageIndex) const; + /*! + * + * + */ + void updateSectionPageNumbersToPages(); + /*! + * + * @param otherPageIndex + * @param location + * @param count + */ + void addPageToSection(const uint otherPageIndex, const uint location, const uint count=1); + /*! + * + * @param pageIndex + */ + void removePageFromSection(const uint pageIndex); + /*! + * + */ + void setFirstSectionFromFirstPageNumber(); +//@} // End of Sections group + +/*! @name Align + * Align related functions + */ //@{ + void buildAlignItemList(Selection* customSelection=0); + bool startAlign(); + void endAlign(); +//@} // End of align functions + +/*! @name Styles + * Style related functions + */ //@{ + // Paragraphe style + + /*! + * Get a paragraph style by its name. */ - void enableCMS(bool enable); - const ParagraphStyle& paragraphStyle(QString name) { return docParagraphStyles.get(name); } + /*! + * Get all the paragraph style. + */ const StyleSet& paragraphStyles() { return docParagraphStyles; } - bool isDefaultStyle( const ParagraphStyle& p ) const { return docParagraphStyles.isDefault(p); } - bool isDefaultStyle( const CharStyle& c ) const { return docCharStyles.isDefault(c); } -// bool isDefaultStyle( LineStyle& l ) const { return MLineStyles......; } - - void getNamedResources(ResourceCollection& lists) const; - void replaceNamedResources(ResourceCollection& newNames); - + /*! + * Redefine Paragraphes style. + */ +//ivro: rename rededineParaStyles ? void redefineStyles(const StyleSet& newStyles, bool removeUnused=false); - /** - * @brief Remove any reference to old styles and replace with new name. This needs to be - * called when a style was removed. New name may be "". + /*! + * Remove any reference to old styles and replace with new name. + * This needs to be called when a style was removed. New name may be "". * @param newNameForOld a map which maps the name of any style to remove to a new stylename */ +//ivro: rename replaceParaStyles ? void replaceStyles(const QMap& newNameForOld); - /** - * @brief Insert styles from another document in this document. - * + /*! + * Is the default paragraph style ? + * @param p paragraph style to test + */ +//ivro: is this must be with the one for char style ? + bool isDefaultStyle( const ParagraphStyle& p ) const { return docParagraphStyles.isDefault(p); } + + // Character style + + /*! + * Get a character style by name. + * @param name char style name + */ + const CharStyle& charStyle(QString name) { return docCharStyles.get(name); } + /*! + * Get all the Character styles. + */ + const StyleSet& charStyles() { return docCharStyles; } + /*! + * Redefine Character styles. + * @param newStyle character styles + * @param removeUnused + */ + void redefineCharStyles(const StyleSet& newStyles, bool removeUnused=false); + /*! + * Remove any reference to old styles and replace with new name. + * This needs to be called when a style was removed. New name may be "". + * @param newNameForOld a map which maps the name of any style to remove to a new stylename + */ + void replaceCharStyles(const QMap& newNameForOld); + /*! + * Is the default character style ? + * @param c character style to test + */ + bool isDefaultStyle( const CharStyle& c ) const { return docCharStyles.isDefault(c); } +// bool isDefaultStyle( LineStyle& l ) const { return MLineStyles......; } + + // Load Style + + /*! + * Insert styles from another document in this document. * @param fileName The path of the document we want to extract its styles */ void loadStylesFromFile(QString fileName); - /** - * @brief Gather styles from another document. - * + /*! + * Gather styles from another document. * @param fileName The path of the document we want to extract its styles * @param tempStyles A pointer to a StyleSet which will be filled by paragraph styles * @param tempCharStyles A pointer to a StyleSet which will be filled by character styles @@ -461,87 +1019,116 @@ public: void loadStylesFromFile(QString fileName, StyleSet *tempStyles, StyleSet *tempCharStyles, QMap *tempLineStyles); +//@} // End of style group - const CharStyle& charStyle(QString name) { return docCharStyles.get(name); } - const StyleSet& charStyles() { return docCharStyles; } - void redefineCharStyles(const StyleSet& newStyles, bool removeUnused=false); - /** - * @brief Remove any reference to old styles and replace with new name. This needs to be - * called when a style was removed. New name may be "". - * @param newNameForOld a map which maps the name of any style to remove to a new stylename - */ - void replaceCharStyles(const QMap& newNameForOld); - - /** - * @brief Should guides be locked or not - * @param isLocked If true guides on pages cannot be moved if false they - * can be dragged to new positions. - * @author Riku Leino - */ - void lockGuides(bool isLocked); - /** - * @brief Method used when an undo/redo is requested. - * @param state State describing the action that is wanted to be undone/redone - * @param isUndo If true undo is wanted else if false redo. - * @author Riku Leino - */ - void restore(UndoState* state, bool isUndo); - /** - * @brief Sets the name of the document - * @param name Name for the document - * @author Riku Leino - */ - void setName(const QString& name); +/*! @name Color Management + * Color Management related functions. + */ //@{ /*! - * @brief Returns a stringlist of the item attributes within the document + * Builds a qmap of the icc profiles used within the document. */ - QStringList getItemAttributeNames(); - - bool AddFont(QString name, int fsize = 10); + void getUsedProfiles(ProfilesL& usedProfiles); + bool OpenCMSProfiles(ProfilesL InPo, ProfilesL InPoCMYK, ProfilesL MoPo, ProfilesL PrPo); + void CloseCMSProfiles(); + void SetDefaultCMSParams(); /*! - * @brief TODO: Reorganise the fonts.. how? Moved from scribus.cpp - * CB: almost the same as getUsedFonts??? + * Switch Colormanagement on or of. + * @param enable bool, if true Colormanagement is switched on, else off */ - QMap reorganiseFonts(); + void enableCMS(bool enable); /*! - * @brief Returns a qmap of the fonts and their glyphs used within the document + * Recalculate the colors after CMS settings change. Update the items in the doc accordingly. */ - void getUsedFonts(QMap > &Really); - void checkItemForFonts(PageItem *it, QMap > & Really, uint lc); + void recalculateColors(); /*! - * @brief Replace line style colors + * Insert a color into the documents color list. + * @param colorList Name of the color list + * @param cyan Cyan component + * @param magenta Magenta component + * @param yellow Yellow component + * @param black Black component + */ + void insertColor(QString colorList, double cryan, double magenta, double yellow, double black); + /*! + * Replace line style colors. */ void replaceLineStyleColors(const QMap& colorMap); /*! - * @brief Builds a qmap of the colours used within the document + * Builds a qmap of the colours used within the document. */ void getUsedColors(ColorList &colorsToUse, bool spot = false); /*! - * @brief Return if a specific color is used by line styles + * Is this specific color is used by line styles. */ bool lineStylesUseColor(const QString& colorName); +//@} // End of color functions + +/*! @name Font + * font related funtions. + */ //@{ /*! - * @brief Set the patterns for a document + * Add a font + */ + bool AddFont(QString name, int fsize = 10); + /*! + * TODO: Reorganise the fonts.. how? Moved from scribus.cpp + * CB: almost the same as getUsedFonts??? + */ + QMap reorganiseFonts(); + /*! + * Returns a qmap of the fonts and their glyphs used within the document. + */ + void getUsedFonts(QMap > &Really); + void checkItemForFonts(PageItem *it, QMap > & Really, uint lc); +//@} // End of font functions + +/*! @name Patterns + * Pattern related functions + */ //@{ + /*! + * Set the patterns for a document. */ bool addPattern(QString &name, ScPattern& pattern); void setPatterns(QMap &patterns); /*! - * @brief Builds a QStringList of the patterns used within the document + * Builds a QStringList of the patterns used within the document. */ QStringList getUsedPatterns(); QStringList getUsedPatternsSelection(Selection* customSelection); QStringList getUsedPatternsHelper(QString pattern, QStringList &results); +//@} // End of patterns functions + /** - * @brief Set and get the document's unit index + * @brief Return the guarded object associated with the document */ - void setUnitIndex(const int); - int unitIndex() const; - double unitRatio() const; + const ScGuardedPtr& guardedPtr() const; + + UpdateManager* updateManager() { return &m_updateManager; } + MassObservable * itemsChanged() { return &m_itemsChanged; } + MassObservable * pagesChanged() { return &m_pagesChanged; } + MassObservable * regionsChanged() { return &m_regionsChanged; } + void invalidateRegion(QRectF region); + + // Add, delete and move pages + + //! @brief Create the default master pages based on the layout selected by the user, ie, Normal, Normal Left, etc. + void createDefaultMasterPages(); + //! @brief Create the requested pages in a new document, run after createDefaultMasterPages() + void createNewDocPages(int pageCount); + + + void getNamedResources(ResourceCollection& lists) const; + void replaceNamedResources(ResourceCollection& newNames); + /** - * @brief Apply a master page + * @brief Method used when an undo/redo is requested. + * @param state State describing the action that is wanted to be undone/redone + * @param isUndo If true undo is wanted else if false redo. + * @author Riku Leino */ - bool applyMasterPage(const QString& pageName, const int pageNumber); + void restore(UndoState* state, bool isUndo); + /** * @brief Undo function for applying a master page */ @@ -557,100 +1144,9 @@ public: */ bool save(const QString& fileName, QString* savedFile = NULL); /** - * @brief Set the page margins. Current code uses current page only, also provide a (currently, TODO) option for this. - */ - 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); - /** - * @brief Recalculate the colors after CMS settings change. Update the items in the doc accordingly. - */ - void recalculateColors(); - /** * @brief Sets up the ScText defaults from the document */ void setScTextDefaultsFromDoc(ScText *); - /** - * @brief Copies a normal page to be a master pages - */ - bool copyPageToMasterPage(const int, const int, const int, const QString&, bool); - /** - * @brief Paste an item to the document. - * The bulk of a paste item process runs here for want of a better place, but its a better place - * than the view where it used to be. - * TODO Once the pageitem restructure is done, this is probably unnecessary but it removes the - * unnecessary part from the view for now which is overloaded with non ScrollView code. - */ - //TODO: void PasteItem(struct CopyPasteBuffer *Buffer, bool loading, bool drag = false); - - /** - * @brief Add an Item to the document. - * A simple function to create an item of a defined type and add it to the document - * Will need extensive rewriting once we have various classes of PageItems, at a guess. - * - * @param itemFinalised Used to handle item creation for undo while the user is still dragging. - * @return Number of created item, -1 on failure. - \param itemType type - \param frameType frame type - \param x X pos - \param y Y pos - \param b width - \param h height - \param w ? - \param fill fill color name - \param outline outline color name - */ - 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); - - /** Add an item to the page based on the x/y position. Item will be fitted to the closest guides/margins */ - 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); - - /** - * @brief Allow the user to create a frame easily with some simple placement and sizing options - * @param iafData a InsertAFrameData structure with params - * @return int item id? FIXME - */ - int itemAddUserFrame(InsertAFrameData &iafData); - - /** - * @brief Commit item creation when a user has click-drag created an item - * Only called from ScribusView. Note the undo target is the page, so the undo code remains their for now. - * @return If an item was committed and the view must emit its signal, which needs removing from here, TODO. - */ - bool itemAddCommit(const int itemNumber); - - /** - * @brief Finalise item creation. Simply split off code from itemAdd - * Only to be called from itemAdd() - */ - void itemAddDetails(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, const int itemNumber); - - uint getItemNrfromUniqueID(uint unique); - //itemDelete - //itemBlah... - - /** - * @brief Run this common frame item update code - */ - void updateFrameItems(); - /** - * @brief Renumbers the items into the order they are stored in in the lists. - * Utility function used in various places, basically handles keeping items numbered in the way - * they are layered. When layer is a property and not a fuction of storage, this should be removed. - * Depends on the Items pointer pointing to the correct item list (doc, master, etc). - * @sa updateFrameItems(); - */ - void renumberItemsInListOrder(); - /** - * @brief Rebuild item lists taking into account layer order. - * Utility function used in various places, basically handles keeping items numbered in the way - * they are layered. When layer is a property and not a fuction of storage, this should be removed. - * @sa updateFrameItems(); - */ - void rebuildItemLists(); - /** - * @brief Doc uses automatic text frames? - */ - bool usesAutomaticTextFrames() const; - void setUsesAutomaticTextFrames(const bool); /** * @brief Load images into an image frame, moved from the view @@ -684,115 +1180,13 @@ public: void reformPages(bool moveObjects = true); /** - * @brief Return the x or y offset for a page on the canvas - * @retval double containing the offset. Returns -1.0 if page not in Pages list (as -ve is not possible). - * Mostly saves bringing in extra includes into files that already have scribusdoc.h - */ - double getXOffsetForPage(const int); - double getYOffsetForPage(const int); - void getBleeds(int pageNumber, MarginStruct& bleedData); - void getBleeds(Page* page, MarginStruct& bleedData); - - /** - * @brief Item type conversion functions - */ - PageItem* convertItemTo(PageItem *currItem, PageItem::ItemType newType, PageItem* secondaryItem=NULL); - - /** - * @brief The page number of the current page - */ - int currentPageNumber(); - - /** - * @brief Return true iff the passed name is not used by any existing PageItem - * in the same document as this PageItem. - * @author Craig Ringer - ** CB Moved from PageItem - */ - bool itemNameExists(const QString itemName); - - /** - * @brief Set the doc into Master page mode - * Do we need to return if the move to master page mode was successful? - */ - void setMasterPageMode(bool); - - /*** Is the document in master page mode? */ - bool masterPageMode() const { return m_masterPageMode; } - - /** - * @brief Add a section to the document sections list - * Set number to -1 to add in the default section if the map is empty - */ - 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); - /** - * @brief Delete a section from the document sections list - */ - bool deleteSection(const uint); - /** - * @brief Gets the page number to be printed based on the section it is in. - * Returns QString::null on failure to find the pageIndex - */ - const QString getSectionPageNumberForPageIndex(const uint) const; - /** - * @brief Gets the key of the sections map based on the section the page index is in. - * Returns -1 on failure to find the pageIndex - */ - int getSectionKeyForPageIndex(const uint pageIndex) const; - /** - * - * - */ - void updateSectionPageNumbersToPages(); - /** - * - * @param otherPageIndex - * @param location - * @param count - */ - void addPageToSection(const uint otherPageIndex, const uint location, const uint count=1); - /** - * - * @param pageIndex - */ - void removePageFromSection(const uint pageIndex); - /** - * - */ - void setFirstSectionFromFirstPageNumber(); - /** * @brief Update the fill and line QColors for all items in the doc */ void updateAllItemQColors(); //! @brief Some internal align tools typedef enum {alignFirst, alignLast, alignPage, alignMargins, alignGuide, alignSelection } AlignTo; - void buildAlignItemList(Selection* customSelection=0); - bool startAlign(); - void endAlign(); - /** - * \brief Insert a color into the documents color list - * @param nam Name of the colour - * @param c Cyan component - * @param m Magenta component - * @param y Yellow component - * @param k Black component - */ - void insertColor(QString nam, double c, double m, double y, double k); QMap& constants() { return m_constants; } - /** - * \brief Get the location of the page on the canvas, ie, left, middle, or right - * Does not give information about middle left, etc. - * @param pageIndex Index of page to find location for - * @return LeftPage, MiddlePage, RightPage, enum from pagestructs.h - */ - PageLocation locationOfPage(int pageIndex) const; - /** - * \brief Get the column of the page on the canvas, ie, left, middle, or right - * @param pageIndex Index of page to find location for - * @return int of 0,1,2,3 - */ - int columnOfPage(int pageIndex) const; bool sendItemSelectionToBack(); bool bringItemSelectionToFront(); @@ -843,28 +1237,18 @@ public: void itemSelection_SetTracking(int us, Selection* customSelection=0); void itemSelection_SetFontSize(int size, Selection* customSelection=0); - //void FlipImageH(); - //void FlipImageV(); - void MirrorPolyH(PageItem *currItem); - void MirrorPolyV(PageItem *currItem); + + void setRedrawBounding(PageItem *currItem); void adjustCanvas(FPoint minPos, FPoint maxPos, bool absolute = false); void recalcPicturesRes(bool applyNewRes = false); void connectDocSignals(); - void removeLayer(int l, bool dl = false); //FIXME: Make protected once scripter function no longer uses this directly /*! \brief We call changed() whenever the document needs to know it has been changed. * If the document is the primary document in a main window, it will signal to enable/disable * certain operations. */ void changed(); - /*! \brief Get pointer to the current page - \retval Page* current page object */ - Page* currentPage(); - /*! \brief Set new current page - \param newPage New current page */ - void setCurrentPage(Page *newPage); - bool hasGUI() const {return m_hasGUI;} /*! \brief Apply grid to a QPoint, from ScribusView */ QPoint ApplyGrid(const QPoint& in); /*! \brief Apply grid to an FPoint, from ScribusView */ @@ -876,35 +1260,16 @@ public: //! \brief Snap an item to the guides void SnapToGuides(PageItem *currItem); bool ApplyGuides(double *x, double *y); - bool MoveItem(double newX, double newY, PageItem* ite, bool fromMP = false); - void RotateItem(double win, int ite); - void RotateItem(double win, PageItem *currItem); - void MoveRotated(PageItem *currItem, FPoint npv, bool fromMP = false); - bool SizeItem(double newX, double newY, int ite, bool fromMP = false, bool DoUpdateClip = true, bool redraw = true); - bool SizeItem(double newX, double newY, PageItem *pi, bool fromMP = false, bool DoUpdateClip = true, bool redraw = true); - bool MoveSizeItem(FPoint newX, FPoint newY, int ite, bool fromMP = false, bool constrainRotation=false); - void AdjustItemSize(PageItem *currItem); void moveGroup(double x, double y, bool fromMP = false, Selection* customSelection = 0); void rotateGroup(double angle, FPoint RCenter); void scaleGroup(double scx, double scy, bool scaleText=true, Selection* customSelection = 0); - //! \brief Get a list of frames of certain type - QMap getDocItemNames(PageItem::ItemType itemType); protected: void addSymbols(); - bool m_hasGUI; ApplicationPrefs& prefsData; UndoManager * const undoManager; - bool loading; - bool modified; int ActiveLayer; - int docUnitIndex; - double docUnitRatio; - bool automaticTextFrames; // Flag for automatic Textframes - bool m_masterPageMode; QMap m_constants; - ScribusMainWindow* m_ScMW; - ScribusView* m_View; ScGuardedObject m_guardedObject; public: // Public attributes @@ -915,7 +1280,6 @@ public: // Public attributes int viewCount; int viewID; bool SnapGuides; - bool GuideLock; /** \brief Scratch space around Pages */ MarginStruct scratch; double GapHorizontal; @@ -929,18 +1293,7 @@ public: // Public attributes FPoint maxCanvasCoordinate; double rulerXoffset; double rulerYoffset; - /** \brief List of Pages */ - QList* Pages; - /** \brief List of Master Pages */ - QList MasterPages; /** \brief List of Document Pages */ - QList DocPages; - /** \brief Mapping Master Page Name to Master Page numbers */ - QMap MasterNames; - /** \brief List of Objects */ - QList* Items; - QList MasterItems; - QList DocItems; QList FrameItems; Selection* const m_Selection; /** \brief Pagewidth */ @@ -979,7 +1332,6 @@ public: // Public attributes int SubMode; double *ShapeValues; int ValCount; - QString DocName; QMap UsedFonts; SCFonts * const AllFonts; QList AObjects; @@ -1082,7 +1434,7 @@ public: //Attributes to be applied to frames ObjAttrVector docItemAttributes; ToCSetupVector docToCSetups; - DocumentSectionMap sections; + DocumentSectionMap sections; /*< Map of document's sections */ FPointArray symReturn; FPointArray symNewLine; FPointArray symTab; @@ -1095,7 +1447,6 @@ private: UndoTransaction* m_itemCreationTransaction; UndoTransaction* m_alignTransaction; - Page* m_currentPage; UpdateManager m_updateManager; MassObservable m_itemsChanged; MassObservable m_pagesChanged; @@ -1207,6 +1558,36 @@ public slots: void updatePict(QString name); void updatePictDir(QString name); void removePict(QString name); + +public: + QList* Pages; /*!< Pointer on a list of pages. See masterPageMode() */ + QList MasterPages; /*!< List of Master Pages. */ + QList DocPages; /*!< List of Document Pages. */ + + QList* Items; /*!< Pointer on a list of items. See masterPageMode() */ + QList MasterItems; /*!< List of items that belongs to Master Pages. */ + QList DocItems; /*!< List of items that belongs to Document Pages. */ + + QMap MasterNames; /*!< Mapping Master Page Name to Master Page numbers. See rebuildMasterNames() */ + bool GuideLock; /*!< Is the guides must be locked ? See LockGuides() */ + + QString DocName; /*!< Document's name. */ +protected: + bool loading; /*!< Is the document loading ? See isLoading() and setLoading(). */ + bool modified; /*!< Is the document modified ? See isModified() and setModified(). */ + + bool m_hasGUI; /*!< Is document associated with a GUI ? See hasGUI() and setGUI(). */ + ScribusMainWindow* m_ScMW; /*!< Main window associated with the document. See scMW() and setGUI(). */ + ScribusView* m_View; /*!< View associated with the document. See view() and setGUI(). */ + + bool automaticTextFrames; /*!< Is the document using automaticTextFrames ? See usesAutomaticTextFrames() and setUsesAutomagicTextFrames(). */ + + int docUnitIndex; /*!< Document's unit index. See setUnitIndex() and unitIndex(). */ + double docUnitRatio; /*!< Document's unit ratio. See unitRatio(). */ + + bool m_masterPageMode; /*!< Is the document in master page mode ? See masterPageMode() and setMasterPageMode(). */ +private: + Page* m_currentPage; /*!< Current page. See setCurrentPage() and currentPage(). */ }; Q_DECLARE_METATYPE(ScribusDoc*);