Scribus
Open source desktop publishing at your fingertips
ScribusDoc Class Reference

the Document Class More...

#include <scribusdoc.h>

Inheritance diagram for ScribusDoc:
Collaboration diagram for ScribusDoc:

Classes

struct  BookMa
 
struct  OpenNodesList
 
struct  PicResMapped
 
struct  ResMapped
 

Public Types

enum  AlignTo {
  alignFirst, alignLast, alignPage, alignMargins,
  alignGuide, alignSelection
}
 Some internal align tools.
 
enum  AlignMethod { alignByMoving, alignByResizing }
 

Public Slots

void selectionChanged ()
 
void itemSelection_ToggleLock ()
 
void itemSelection_ToggleSizeLock ()
 
void itemSelection_ToggleImageShown ()
 
void itemSelection_TogglePrintEnabled ()
 
void itemSelection_ToggleBookMark (Selection *customSelection=0)
 
void itemSelection_ToggleAnnotation (Selection *customSelection=0)
 
void itemSelection_Transform (int nrOfCopies, QTransform matrix, int basepoint)
 
void itemSelection_ChangePreviewResolution (int id)
 
void allItems_ChangePreviewResolution (int id)
 Change display quality of all images in document. More...
 
void item_setFrameShape (PageItem *item, int frameType, int count, double *points)
 
void itemSelection_ClearItem (Selection *customSelection=0, bool useWarning=false)
 
void itemSelection_TruncateItem (Selection *customSelection=0)
 
void itemSelection_DeleteItem (Selection *customSelection=0, bool forceDeletion=false)
 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. More...
 
void itemSelection_SetItemTextReversed (bool reversed, Selection *customSelection=0)
 
void itemSelection_SetItemFillTransparency (double t)
 
void itemSelection_SetItemLineTransparency (double t)
 
void itemSelection_SetItemFillBlend (int t)
 
void itemSelection_SetItemLineBlend (int t)
 
void itemSelection_SetLineGradient (VGradient &newGradient, Selection *customSelection=0)
 
void itemSelection_SetFillGradient (VGradient &newGradient, Selection *customSelection=0)
 
void itemSelection_SetMaskGradient (VGradient &newGradient, Selection *customSelection=0)
 
void itemSelection_SetOverprint (bool overprint, Selection *customSelection=0)
 
void itemSelection_ApplyImageEffects (ScImageEffectList &newEffectList, Selection *customSelection=0)
 
void itemSelection_FlipH ()
 
void itemSelection_FlipV ()
 
void itemSelection_Rotate (double angle, Selection *customSelection=0)
 
void itemSelection_DoHyphenate ()
 
void itemSelection_DoDeHyphenate ()
 
void itemSelection_UnlinkTextFrameWithText (Selection *customSelection=0, bool cutText=false)
 
void itemSelection_UnlinkTextFrameWithTextCut (Selection *customSelection=0)
 
void itemSelection_SendToLayer (int layerID)
 
void itemSelection_SetImageOffset (double x, double y, Selection *customSelection=0)
 
void itemSelection_SetImageScale (double x, double y, Selection *customSelection=0)
 
void itemSelection_SetImageScaleAndOffset (double ox, double oy, double sx, double sy, Selection *customSelection=0)
 
void itemSelection_SetImageRotation (double rot, Selection *customSelection=0)
 
void itemSelection_AlignItemLeft (int i, double newX, AlignMethod how)
 
void itemSelection_AlignItemRight (int i, double newX, AlignMethod how)
 
void itemSelection_AlignItemTop (int i, double newY, AlignMethod how)
 
void itemSelection_AlignItemBottom (int i, double newY, AlignMethod how)
 
void itemSelection_AlignLeftOut (AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
 
void itemSelection_AlignRightOut (AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
 
void itemSelection_AlignBottomIn (AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
 
void itemSelection_AlignRightIn (AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
 
void itemSelection_AlignBottomOut (AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
 
void itemSelection_AlignCenterHor (AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
 
void itemSelection_AlignLeftIn (AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
 
void itemSelection_AlignCenterVer (AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
 
void itemSelection_AlignTopOut (AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
 
void itemSelection_AlignTopIn (AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
 
void sendItemSelectionToBack ()
 
void bringItemSelectionToFront ()
 
void itemSelection_LowerItem ()
 
void itemSelection_RaiseItem ()
 
void itemSelection_DistributeDistH (bool usingDistance=false, double distance=0.0, bool reverseDistribute=false)
 
void itemSelection_DistributeAcrossPage (bool useMargins=false)
 
void itemSelection_DistributeRight ()
 
void itemSelection_DistributeBottom ()
 
void itemSelection_DistributeCenterH ()
 
void itemSelection_DistributeDistV (bool usingDistance=false, double distance=0.0, bool reverseDistribute=false)
 
void itemSelection_DistributeDownPage (bool useMargins=false)
 
void itemSelection_DistributeLeft ()
 
void itemSelection_DistributeCenterV ()
 
void itemSelection_DistributeTop ()
 
void itemSelection_SwapLeft ()
 
void itemSelection_SwapRight ()
 
void itemSelection_MultipleDuplicate (ItemMultipleDuplicateData &)
 
void itemSelection_UniteItems (Selection *customSelection=0)
 
void itemSelection_SplitItems (Selection *customSelection=0)
 
void itemSelection_AdjustFrametoImageSize (Selection *customSelection=0)
 
void itemSelection_AdjustImagetoFrameSize (Selection *customSelection=0)
 
void itemSelection_AdjustFrameHeightToText (Selection *customSelection=0)
 
void itemSelection_ApplyArrowHead (int startArrowID=-1, int endArrowID=-1, Selection *customSelection=0)
 startArrowID or endArrowID of -1 mean not applying a selection at this point.
 
void itemSelection_ApplyArrowScale (int startArrowSc, int endArrowSc, Selection *customSelection)
 
void itemSelection_SetItemPen (QString farbe)
 
void itemSelection_SetItemPenShade (int sha)
 
void itemSelection_SetItemGradStroke (int typ)
 
void itemSelection_SetItemBrush (QString farbe)
 
void itemSelection_SetItemBrushShade (int sha)
 
void itemSelection_SetItemGradMask (int typ)
 
void itemSelection_SetItemGradFill (int typ)
 
void itemSelection_SetItemPatternFill (QString pattern)
 
void itemSelection_SetItemPatternProps (double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, bool mirrorX, bool mirrorY)
 
void itemSelection_SetItemStrokePattern (QString pattern)
 
void itemSelection_SetItemStrokePatternProps (double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, double space, bool mirrorX, bool mirrorY)
 
void itemSelection_SetItemStrokePatternType (bool type)
 
void itemSelection_SetItemPatternMask (QString pattern)
 
void itemSelection_SetItemPatternMaskProps (double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, bool mirrorX, bool mirrorY)
 
void itemSelection_InsertTableRows ()
 
void itemSelection_InsertTableColumns ()
 
void itemSelection_DeleteTableRows ()
 
void itemSelection_DeleteTableColumns ()
 
void itemSelection_MergeTableCells ()
 
void itemSelection_SplitTableCells ()
 
void itemSelection_SetTableRowHeights ()
 
void itemSelection_SetTableColumnWidths ()
 
void itemSelection_DistributeTableRowsEvenly ()
 
void itemSelection_DistributeTableColumnsEvenly ()
 
void itemSelection_AdjustFrameToTable ()
 
void itemSelection_AdjustTableToFrame ()
 
void undoRedoBegin ()
 
void undoRedoDone ()
 
void updatePic ()
 
void updatePict (QString name)
 
void updatePictDir (QString name)
 
void removePict (QString name)
 
bool updateMarks (bool updateNotesMarks=false)
 
void itemSelection_UnWeld ()
 
void itemSelection_Weld ()
 
void itemSelection_EditWeld ()
 
void restartAutoSaveTimer ()
 

Signals

void docChanged ()
 Let the document tell whatever is listening that it has changed.
 
void saved (QString name)
 
void updateContents ()
 
void updateContents (const QRect &r)
 
void refreshItem (PageItem *)
 
void canvasAdjusted (double width, double height, double dX, double dY)
 
void firstSelectedItemType (int)
 
void setApplicationMode (int)
 
void signalRebuildOutLinePalette ()
 A signal for when the outline palette needs to rebuild itself Emit when: More...
 
void widthAndHeight (double, double)
 Temporary signal for SizeItem.
 
void rotationMode (int)
 Signal a change in rotation mode (aka basepoint)
 
void updateEditItem ()
 
void updateAutoSaveClock ()
 
void addBookmark (PageItem *)
 
void deleteBookmark (PageItem *)
 
void changeLayers (int)
 

Public Member Functions

 ScribusDoc (const QString &docName, int unitIndex, const PageSize &pagesize, const MarginStruct &margins, const DocPagesSetup &pagesSetup)
 
void init ()
 
bool inAnEditMode () const
 
bool inASpecialEditMode () const
 
QList< PageItem * > getAllItems (QList< PageItem * > &items)
 
QList< PageItem * > * parentGroup (PageItem *item, QList< PageItem * > *list)
 
void setup (const int, const int, const int, const int, const int, const QString &, const QString &)
 
void setLoading (const bool)
 
bool isLoading () const
 
void setModified (const bool)
 
bool isModified () const
 
void setPage (double w, double h, double t, double l, double r, double b, double sp, double ab, bool atf, int fp)
 
void resetPage (int fp, MarginStruct *newMargins=0)
 
ScribusViewview () const
 Return the view associated with the document.
 
ScribusMainWindowscMW () const
 
void setGUI (bool hasgui, ScribusMainWindow *mw, ScribusView *view)
 
const ScGuardedPtr< ScribusDoc > & guardedPtr () const
 Return the guarded object associated with the document.
 
UpdateManagerupdateManager ()
 
MassObservable< PageItem * > * itemsChanged ()
 
MassObservable< ScPage * > * pagesChanged ()
 
MassObservable< QRectF > * regionsChanged ()
 
void invalidateAll ()
 
void invalidateLayer (int layerID)
 
void invalidateRegion (QRectF region)
 
MarginStructscratch ()
 
MarginStructbleeds ()
 
MarginStructbleedsVal ()
 
MarginStructmargins ()
 
MarginStructmarginsVal ()
 
double pageGapHorizontal () const
 
double pageGapVertical () const
 
void setPageGapHorizontal (double h)
 
void setPageGapVertical (double v)
 
const QList< PageSet > & pageSets () const
 
void setPageSetFirstPage (int layout, int fp)
 
void clearPageSets ()
 
void appendToPageSets (const PageSet &ps)
 
void setPaperColor (const QColor &c)
 
const QColor & paperColor () const
 
int hyphMinimumWordLength () const
 
int hyphConsecutiveLines () const
 
const QString & hyphLanguage () const
 
bool hyphAutomatic () const
 
bool hyphAutoCheck () const
 
void setHyphMinimumWordLength (int i)
 
void setHyphConsecutiveLines (int i)
 
void setHyphLanguage (const QString &s)
 
void setHyphAutomatic (bool b)
 
void setHyphAutoCheck (bool b)
 
bool autoSave () const
 
int autoSaveTime () const
 
bool autoSaveClockDisplay () const
 
void setAutoSave (bool b)
 
void setAutoSaveTime (int i)
 
PDFOptionspdfOptions ()
 
ObjAttrVector & itemAttributes ()
 
void setItemAttributes (ObjAttrVector &oav)
 
void clearItemAttributes ()
 
void appendToItemAttributes (const ObjectAttribute &oa)
 
ToCSetupVector & tocSetups ()
 
void setTocSetups (ToCSetupVector &tsv)
 
void clearTocSetups ()
 
void appendToTocSetups (const ToCSetup &ts)
 
void setArrowStyles (QList< ArrowDesc > &as)
 
QList< ArrowDesc > & arrowStyles ()
 
void appendToArrowStyles (const struct ArrowDesc &as)
 
const bool marginColored () const
 
void setMarginColored (bool b)
 
QMap< QString, CheckerPrefs > & checkerProfiles ()
 
void setCheckerProfiles (const QMap< QString, CheckerPrefs > &cl)
 
void set1CheckerProfile (const QString profileName, const struct CheckerPrefs &cs)
 
void clearCheckerProfiles ()
 
const QString & curCheckProfile () const
 
void setCurCheckProfile (const QString &s)
 
int pageOrientation () const
 
void setPageOrientation (int o)
 
int pagePositioning () const
 
void setPagePositioning (int p)
 
double pageHeight () const
 
double pageWidth () const
 
const QString & pageSize () const
 
void setPageHeight (double h)
 
void setPageWidth (double w)
 
void setPageSize (const QString &s)
 
int marginPreset () const
 
void setMarginPreset (int mp)
 
TypoPrefstypographicPrefs ()
 
GuidesPrefsguidesPrefs ()
 
ItemToolPrefsitemToolPrefs ()
 
OperatorToolPrefsopToolPrefs ()
 
ColorPrefscolorPrefs ()
 
CMSDatacmsSettings ()
 
DocumentInformationdocumentInfo ()
 
void setDocumentInfo (DocumentInformation di)
 
DocumentSectionMap & sections ()
 
void setSections (DocumentSectionMap dsm)
 
const QMap< QString, int > & usedFonts ()
 
const ApplicationPrefsprefsData ()
 
void setNewPrefs (const ApplicationPrefs &prefsData, const ApplicationPrefs &oldPrefsData, bool resizePages, bool resizeMasterPages, bool resizePageMargins, bool resizeMasterPageMargins)
 
ScPageaddPage (const int pageNumber, const QString &masterPageName=QString::null, const bool addAutoFrame=false)
 
void deletePage (const int)
 
ScPageaddMasterPage (const int, const QString &)
 Add a master page with this function, do not use addPage.
 
void deleteMasterPage (const int)
 
void rebuildMasterNames (void)
 Rebuild master name list.
 
void replaceMasterPage (const QString &oldMasterPage)
 Replace a master page by default one.
 
bool renameMasterPage (const QString &oldPageName, const QString &newPageName)
 Rename a master page.
 
void createDefaultMasterPages ()
 Create the default master pages based on the layout selected by the user, ie, Normal, Normal Left, etc.
 
void createNewDocPages (int pageCount)
 Create the requested pages in a new document, run after createDefaultMasterPages()
 
int addAutomaticTextFrame (const int pageNumber)
 Add the automatic text frame to the page. More...
 
void setLocationBasedPageLRMargins (uint pageIndex)
 
void swapPage (const int a, const int b)
 Swap two pages. More...
 
void movePage (const int fromPage, const int toPage, const int dest, const int position)
 Move page(s) within the document. More...
 
void copyPage (int pageNumberToCopy, int existingPage, int whereToInsert, int copyCount)
 Copy a page (pageNumberToCopy) copyCount times, whereToInsert(before or after) the existingPage or at the end. More...
 
int addLayer (const QString &layerName=QString::null, const bool activate=false)
 Add a layer to the current document. More...
 
void copyLayer (int layerIDToCopy, int whereToInsert)
 Copies a layer from the current document. More...
 
bool deleteLayer (const int layerID, const bool deleteItems)
 Delete a layer from the current document. More...
 
int activeLayer ()
 Return the number of the current layer. More...
 
const QString & activeLayerName ()
 Return the name of the current layer. More...
 
bool setActiveLayer (const int layerToActivate)
 Set the active layer via the layer number. More...
 
bool setActiveLayer (const QString &layerNameToActivate)
 Set the active layer via the layer name. More...
 
bool setLayerPrintable (const int layerID, const bool isPrintable)
 Set the layer printable via the layer number. More...
 
bool layerPrintable (const int layerID)
 Is the layer printable. More...
 
bool setLayerVisible (const int layerID, const bool isViewable)
 Set the layer visible via the layer number. More...
 
bool layerVisible (const int layerID)
 Is the layer visible. More...
 
bool layerSelectable (const int layerID)
 are objects on the layer selectable More...
 
bool setLayerSelectable (const int layerID, const bool isSelectable)
 Set objects on the layer selectable via the layer ID. More...
 
bool setLayerLocked (const int layerID, const bool isLocked)
 Set the layer locked via the layer number. More...
 
bool layerLocked (const int layerID)
 Is the layer locked. More...
 
bool setLayerFlow (const int layerID, const bool flow)
 Set the layer flow via the layer number. More...
 
bool layerFlow (const int layerID)
 does text flow around objects on this layer More...
 
bool setLayerTransparency (const int layerID, double trans)
 Set the layer transparency via the layer number. More...
 
double layerTransparency (const int layerID)
 returns the layer transparency More...
 
bool setLayerBlendMode (const int ID, int blend)
 Set the layer layerBlendMode via the layer number. More...
 
int layerBlendMode (const int ID)
 returns the layer BlendMode More...
 
int layerLevelFromID (const int layerID)
 Return the level of the requested layer. More...
 
bool setLayerMarker (const int layerID, QColor color)
 Set the layer marker color. More...
 
QColor layerMarker (const int layerID)
 returns the layer marker color More...
 
bool setLayerOutline (const int layerID, const bool outline)
 Set the layer outline mode via the layer number. More...
 
bool layerOutline (const int layerID)
 is this layer in outline mode More...
 
int layerIDFromLevel (const int layerLevel)
 Return the number of the layer at a certain level. More...
 
int layerIDFromName (QString name)
 Return the layer count. More...
 
int layerCount () const
 
bool lowerLayer (const int layerID)
 Lower a layer. More...
 
bool lowerLayerByLevel (const int layerLevel)
 Lower a layer using the level. More...
 
bool raiseLayer (const int layerID)
 Raise a layer. More...
 
bool raiseLayerByLevel (const int layerLevel)
 Raise a layer using the level. More...
 
QString layerName (const int layerID) const
 Return the layer name. More...
 
bool changeLayerName (const int layerID, const QString &newName)
 Change the name of a layer. More...
 
bool layerContainsItems (const int layerID)
 Does the layer have items on it? More...
 
bool renumberLayer (const int layerID, const int newLayerID)
 Renumber a layer. Used in particular for reinsertion for undo/redo. More...
 
void orderedLayerList (QStringList *list)
 Return a list of the layers in their order. More...
 
int firstLayerID ()
 
bool deleteTaggedItems ()
 
void getUsedProfiles (ProfilesL &usedProfiles)
 Builds a qmap of the icc profiles used within the document.
 
bool OpenCMSProfiles (ProfilesL InPo, ProfilesL InPoCMYK, ProfilesL MoPo, ProfilesL PrPo)
 
void CloseCMSProfiles ()
 
void SetDefaultCMSParams ()
 
void enableCMS (bool enable)
 Switch Colormanagement on or of. More...
 
const ParagraphStyleparagraphStyle (QString name)
 
const StyleSet< ParagraphStyle > & paragraphStyles ()
 
bool isDefaultStyle (const ParagraphStyle &p) const
 
bool isDefaultStyle (const CharStyle &c) const
 
const TableStyletableStyle (QString name)
 
const StyleSet< TableStyle > & tableStyles ()
 
bool isDefaultStyle (const TableStyle &style) const
 
void redefineTableStyles (const StyleSet< TableStyle > &newStyles, bool removeUnused=false)
 
void replaceTableStyles (const QMap< QString, QString > &newNameForOld)
 
const CellStylecellStyle (QString name)
 
const StyleSet< CellStyle > & cellStyles ()
 
bool isDefaultStyle (const CellStyle &style) const
 
void redefineCellStyles (const StyleSet< CellStyle > &newStyles, bool removeUnused=false)
 
void replaceCellStyles (const QMap< QString, QString > &newNameForOld)
 
void getNamedResources (ResourceCollection &lists) const
 
void replaceNamedResources (ResourceCollection &newNames)
 
bool styleExists (QString styleName)
 
QList< int > getSortedStyleList ()
 
QList< int > getSortedCharStyleList ()
 
QList< int > getSortedTableStyleList ()
 
QList< int > getSortedCellStyleList ()
 
void redefineStyles (const StyleSet< ParagraphStyle > &newStyles, bool removeUnused=false)
 
void replaceStyles (const QMap< QString, QString > &newNameForOld)
 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 "". More...
 
void loadStylesFromFile (QString fileName)
 Insert styles from another document in this document. More...
 
void loadStylesFromFile (QString fileName, StyleSet< ParagraphStyle > *tempStyles, StyleSet< CharStyle > *tempCharStyles, QHash< QString, multiLine > *tempLineStyles)
 Gather styles from another document. More...
 
const CharStylecharStyle (QString name)
 
const StyleSet< CharStyle > & charStyles ()
 
void redefineCharStyles (const StyleSet< CharStyle > &newStyles, bool removeUnused=false)
 
void replaceCharStyles (const QMap< QString, QString > &newNameForOld)
 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 "". More...
 
void lockGuides (bool isLocked)
 Should guides be locked or not. More...
 
void restore (UndoState *state, bool isUndo)
 Method used when an undo/redo is requested. More...
 
void setName (const QString &name)
 Sets the name of the document. More...
 
QStringList getItemAttributeNames ()
 Returns a stringlist of the item attributes within the document.
 
bool AddFont (QString name, int fsize=10)
 
QMap< QString, int > reorganiseFonts ()
 TODO: Reorganise the fonts.. how? Moved from scribus.cpp CB: almost the same as getUsedFonts???
 
void getUsedFonts (QMap< QString, QMap< uint, FPointArray > > &Really)
 Returns a qmap of the fonts and their glyphs used within the document.
 
void checkItemForFonts (PageItem *it, QMap< QString, QMap< uint, FPointArray > > &Really, uint lc)
 
void replaceLineStyleColors (const QMap< QString, QString > &colorMap)
 Replace line style colors.
 
void getUsedColors (ColorList &colorsToUse, bool spot=false)
 Builds a qmap of the colours used within the document.
 
bool lineStylesUseColor (const QString &colorName)
 Return if a specific color is used by line styles.
 
void getUsedGradients (QHash< QString, VGradient > &Gradients)
 Builds a qmap of the gradients used within the document.
 
bool addGradient (QString &name, VGradient &gradient)
 Set the gradients for a document.
 
void setGradients (QHash< QString, VGradient > &gradients)
 
bool addPattern (QString &name, ScPattern &pattern)
 Set the patterns for a document.
 
void removePattern (QString name)
 
void setPatterns (QHash< QString, ScPattern > &patterns)
 
ScPatterncheckedPattern (QString &name)
 Check pattern with specified name and return it if valid.
 
QStringList getUsedPatterns ()
 Builds a QStringList of the patterns used within the document.
 
QStringList getUsedPatternsSelection (Selection *customSelection)
 
QStringList getUsedPatternsHelper (QString pattern, QStringList &results)
 
QStringList getPatternDependencyList (QStringList used)
 
QStringList getUsedSymbols ()
 Builds a QStringList of the symbols used within the document.
 
QStringList getUsedSymbolsHelper (QString pattern, QStringList &results)
 
void setUnitIndex (const int)
 Set and get the document's unit index.
 
int unitIndex () const
 
double unitRatio () const
 
bool applyMasterPage (const QString &pageName, const int pageNumber)
 Apply a master page.
 
void restoreMasterPageApplying (SimpleState *ss, bool isUndo)
 Undo function for applying a master page.
 
void restoreMasterPageRenaming (SimpleState *ss, bool isUndo)
 
void restoreCopyPage (SimpleState *ss, bool isUndo)
 
void restoreMovePage (SimpleState *ss, bool isUndo)
 
void restoreSwapPage (SimpleState *ss, bool isUndo)
 
void restoreAddMasterPage (SimpleState *ss, bool isUndo)
 
void restoreChangePageProperties (SimpleState *ss, bool isUndo)
 
void restoreGrouping (SimpleState *ss, bool isUndo)
 Undo function for grouping/ungrouping.
 
void restoreLevelDown (SimpleState *ss, bool isUndo)
 Undo function for level.
 
void restoreLevelBottom (SimpleState *ss, bool isUndo)
 
void restoreGuideLock (SimpleState *ss, bool isUndo)
 
bool save (const QString &fileName, QString *savedFile=NULL)
 Save function.
 
bool changePageProperties (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 marginPreset, const bool moveObjects, const int pageNumber=-1, const int pageType=0)
 Set the page margins. Current code uses current page only, also provide a (currently, TODO) option for this.
 
void recalculateColorsList (QList< PageItem * > *itemList)
 Recalculate the colors after CMS settings change. Update the items in the doc accordingly.
 
void recalculateColors ()
 
bool copyPageToMasterPage (const int, const int, const int, const QString &, bool)
 Sets up the ScText defaults from the document. More...
 
PageItemcreatePageItem (const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, double x, double y, double b, double h, double w, const QString &fill, const QString &outline)
 Just create but don't add to items list and don't create undo record.
 
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, const bool noteFrame=false)
 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. More...
 
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)
 
int itemAddUserFrame (InsertAFrameData &iafData)
 Allow the user to create a frame easily with some simple placement and sizing options. More...
 
bool itemAddCommit (PageItem *item)
 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. More...
 
void itemAddDetails (const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, PageItem *newItem)
 Finalise item creation. Simply split off code from itemAdd Only to be called from itemAdd()
 
uint getItemNrfromUniqueID (uint unique)
 
PageItemgetItemFromName (QString name)
 
void rebuildItemLists ()
 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. More...
 
bool usesAutomaticTextFrames () const
 Doc uses automatic text frames?
 
void setUsesAutomaticTextFrames (const bool)
 
bool loadPict (QString fn, PageItem *pageItem, bool reload=false, bool showMsg=false)
 Load images into an image frame, moved from the view. More...
 
void RecalcPictures (ProfilesL *Pr, ProfilesL *PrCMYK, QProgressBar *dia=0)
 Handle image with color profiles. More...
 
void RecalcPictures (QList< PageItem * > *items, ProfilesL *Pr, ProfilesL *PrCMYK, QProgressBar *dia=0)
 Handle image with color profiles. More...
 
void canvasMinMax (FPoint &, FPoint &)
 Find the minX,MinY and maxX,maxY for the canvas required for the doc.
 
int OnPage (double x2, double y2)
 
int OnPage (PageItem *currItem)
 
void GroupOnPage (PageItem *currItem)
 
void reformPages (bool moveObjects=true)
 
void refreshGuides ()
 Refresh automatic guides once Margin struct has been properly configure by reformPages()
 
void fixItemPageOwner ()
 Check and fix if needed PageItem OwnPage member.
 
void fixParagraphStyles ()
 Fix paragraph styles.
 
void fixNotesStyles ()
 Fix notes styles.
 
double getXOffsetForPage (const int)
 Return the x or y offset for a page on the canvas. More...
 
double getYOffsetForPage (const int)
 
void getBleeds (int pageNumber, MarginStruct &bleedData)
 
void getBleeds (const ScPage *page, MarginStruct &bleedData)
 
void getBleeds (const ScPage *page, const MarginStruct &baseValues, MarginStruct &bleedData)
 
PageItemconvertItemTo (PageItem *currItem, PageItem::ItemType newType, PageItem *secondaryItem=NULL)
 Item type conversion functions.
 
int currentPageNumber ()
 The page number of the current page.
 
bool itemNameExists (const QString itemName)
 Return true iff the passed name is not used by any existing PageItem in the same document as this PageItem. More...
 
void setMasterPageMode (bool)
 Set the doc into Master page mode Do we need to return if the move to master page mode was successful?
 
bool masterPageMode () const
 
void setSymbolEditMode (bool mode, QString symbolName="")
 Set the doc into symbol edit mode.
 
bool symbolEditMode () const
 
QString getEditedSymbol () const
 
void setInlineEditMode (bool mode, int id=-1)
 Set the doc into inline edit mode.
 
bool inlineEditMode () const
 
void addSection (const int number=0, const QString &name=QString::null, const uint fromindex=0, const uint toindex=0, const NumFormat type=Type_1_2_3, const uint sectionstartindex=0, const bool reversed=false, const bool active=true, const QChar fillChar=QChar(), int fieldWidth=0)
 Add a section to the document sections list Set number to -1 to add in the default section if the map is empty.
 
bool deleteSection (const uint)
 Delete a section from the document sections list.
 
const QString getSectionPageNumberForPageIndex (const uint) const
 Gets the page number to be printed based on the section it is in. Returns QString::null on failure to find the pageIndex.
 
const QChar getSectionPageNumberFillCharForPageIndex (const uint) const
 Gets the page number fill character to be printed based on the section it is in. Returns QString::null on failure to find the pageIndex.
 
int getSectionPageNumberWidthForPageIndex (const uint) const
 Gets the page number fill character to be printed based on the section it is in. Returns QString::null on failure to find the pageIndex.
 
int getSectionKeyForPageIndex (const uint pageIndex) 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.
 
void updateSectionPageNumbersToPages ()
 
void addPageToSection (const uint otherPageIndex, const uint location, const uint count=1)
 
void removePageFromSection (const uint pageIndex)
 
void setFirstSectionFromFirstPageNumber ()
 
QString getSectionNameForPageIndex (const uint pageIndex) const
 Returns name of section where page is located. More...
 
void buildAlignItemList (Selection *customSelection=0)
 
bool startAlign (uint minObjects=1)
 
void endAlign ()
 
void insertColor (QString nam, double c, double m, double y, double k)
 Insert a color into the documents color list. More...
 
QMap< QString, double > & constants ()
 
PageLocation locationOfPage (int pageIndex) const
 Get the location of the page on the canvas, ie, left, middle, or right Does not give information about middle left, etc. More...
 
int columnOfPage (int pageIndex) const
 Get the column of the page on the canvas, ie, left, middle, or right. More...
 
QList< PageItem * > * GroupOfItem (QList< PageItem * > *itemList, PageItem *item)
 
PageItemgroupObjectsSelection (Selection *customSelection=0)
 
PageItemgroupObjectsList (QList< PageItem * > &itemList)
 
void groupObjectsToItem (PageItem *groupItem, QList< PageItem * > &itemList)
 
PageItemitemSelection_GroupObjects (bool changeLock, bool lock, Selection *customSelection=0)
 
void itemSelection_UnGroupObjects (Selection *customSelection=0)
 
void addToGroup (PageItem *group, PageItem *item)
 
void removeFromGroup (PageItem *item)
 
void rescaleGroup (PageItem *group, double scale)
 
void resizeGroupToContents (PageItem *group)
 
void itemSelection_resizeGroupToContents (Selection *customSelection=0)
 
void itemSelection_convertItemsTo (const PageItem::ItemType newType, Selection *restoredSelection=0, Selection *customSelection=0)
 
void itemSelection_convertItemsToSymbol (QString &patternName)
 
void itemSelection_ApplyParagraphStyle (const ParagraphStyle &newstyle, Selection *customSelection=0, bool rmDirectFormatting=false)
 
void itemSelection_SetParagraphStyle (const ParagraphStyle &newstyle, Selection *customSelection=0)
 
void itemSelection_ApplyCharStyle (const CharStyle &newstyle, Selection *customSelection=0, QString ETEA="")
 
void itemSelection_SetCharStyle (const CharStyle &newstyle, Selection *customSelection=0)
 
void itemSelection_EraseParagraphStyle (Selection *customSelection=0)
 
void itemSelection_EraseCharStyle (Selection *customSelection=0)
 
void itemSelection_SetNamedParagraphStyle (const QString &name, Selection *customSelection=0)
 
void itemSelection_SetNamedCharStyle (const QString &name, Selection *customSelection=0)
 
void itemSelection_SetNamedLineStyle (const QString &name, Selection *customSelection=0)
 
void itemSelection_SetSoftShadow (bool has, QString color, double dx, double dy, double radius, int shade, double opac, int blend, bool erase, bool objopa)
 
void itemSelection_SetLineWidth (double w)
 
void itemSelection_SetLineArt (Qt::PenStyle w)
 
void itemSelection_SetLineJoin (Qt::PenJoinStyle w)
 
void itemSelection_SetLineEnd (Qt::PenCapStyle w)
 
void itemSelection_SetAlignment (int w, Selection *customSelection=0)
 
void itemSelection_SetLineSpacing (double w, Selection *customSelection=0)
 
void itemSelection_SetLineSpacingMode (int w, Selection *customSelection=0)
 
void itemSetFont (const QString &newFont)
 
void itemSelection_SetFont (QString fon, Selection *customSelection=0)
 
void itemSelection_SetFillColor (QString farbe, Selection *customSelection=0)
 
void itemSelection_SetFillShade (int sha, Selection *customSelection=0)
 
void itemSelection_SetStrokeColor (QString farbe, Selection *customSelection=0)
 
void itemSelection_SetStrokeShade (int sha, Selection *customSelection=0)
 
void itemSelection_SetScaleV (int, Selection *customSelection=0)
 
void itemSelection_SetScaleH (int, Selection *customSelection=0)
 
void itemSelection_SetBaselineOffset (int, Selection *customSelection=0)
 
void itemSelection_SetOutlineWidth (int, Selection *customSelection=0)
 
void itemSelection_SetShadowOffsets (int shx, int shy, Selection *customSelection=0)
 
void itemSelection_SetUnderline (int pos, int wid, Selection *customSelection=0)
 
void itemSelection_SetStrikethru (int pos, int wid, Selection *customSelection=0)
 
void itemSelection_SetEffects (int s, Selection *customSelection=0)
 
void itemSelection_SetOpticalMargins (int i, Selection *customSelection=0)
 
void itemSelection_resetOpticalMargins (Selection *customSelection=0)
 
void itemSelection_SetColorProfile (const QString &profileName, Selection *customSelection=0)
 
void itemSelection_SetRenderIntent (int intentIndex, Selection *customSelection=0)
 
void itemSelection_SetCompressionMethod (int cmIndex, Selection *customSelection=0)
 
void itemSelection_SetCompressionQuality (int cqIndex, Selection *customSelection=0)
 
void itemSelection_SetTracking (int us, Selection *customSelection=0)
 
void itemSelection_SetFontSize (int size, Selection *customSelection=0)
 
void MirrorPolyH (PageItem *currItem)
 
void MirrorPolyV (PageItem *currItem)
 
bool getItem (PageItem **currItem, int nr=-1)
 
void setFrameRect ()
 
void setFrameRounded ()
 
void setFrameOval ()
 
void setRedrawBounding (PageItem *currItem)
 
void adjustCanvas (FPoint minPos, FPoint maxPos, bool absolute=false)
 
void recalcPicturesRes (bool applyNewRes=false)
 
int previewQuality ()
 
void connectDocSignals ()
 
void disconnectDocSignals ()
 
void removeLayer (int l, bool dl=false)
 
void changed ()
 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.
 
ScPagecurrentPage ()
 Get pointer to the current page. More...
 
void setCurrentPage (ScPage *newPage)
 Set new current page. More...
 
bool hasGUI () const
 
QPoint ApplyGrid (const QPoint &in)
 Apply grid to a QPoint, from ScribusView.
 
FPoint ApplyGridF (const FPoint &in)
 Apply grid to an FPoint, from ScribusView.
 
bool hasTOCSetup ()
 Does this doc have any TOC setups and potentially a TOC to generate.
 
void getClosestGuides (double xin, double yin, double *xout, double *yout, int *GxM, int *GyM, ScPage *refPage=NULL)
 Get the closest guide to the given point.
 
void getClosestElementBorder (double xin, double yin, double *xout, double *yout, int *GxM, int *GyM, ScPage *refPage=NULL)
 Get the closest border of another element to the given point.
 
void SnapToGuides (PageItem *currItem)
 Snap an item to the guides.
 
bool ApplyGuides (double *x, double *y, bool elementSnap=false)
 
bool ApplyGuides (FPoint *point, bool elementSnap=false)
 
bool MoveItem (double newX, double newY, PageItem *ite)
 
void RotateItem (double win, PageItem *currItem)
 
void MoveRotated (PageItem *currItem, FPoint npv)
 
bool SizeItem (double newX, double newY, PageItem *pi, bool fromMP=false, bool DoUpdateClip=true, bool redraw=true)
 
bool MoveSizeItem (FPoint newX, FPoint newY, PageItem *currItem, bool fromMP=false, bool constrainRotation=false)
 
void AdjustItemSize (PageItem *currItem, bool includeGroup=false, bool moveInGroup=true)
 
void moveGroup (double x, double y, Selection *customSelection=0)
 
void rotateGroup (double angle, Selection *customSelection=0)
 
void rotateGroup (double angle, FPoint RCenter, Selection *customSelection=0)
 
void scaleGroup (double scx, double scy, bool scaleText=true, Selection *customSelection=0, bool scaleLine=false)
 
QMap< PageItem *, QString > getDocItemNames (PageItem::ItemType itemType)
 Get a list of frames of certain type.
 
Serializerserializer ()
 Returns a serializer for this document.
 
SerializertextSerializer ()
 Returns a text serializer for this document, used to paste text chunks.
 
int RotMode () const
 Get rotation mode.
 
void RotMode (const int &val)
 Set rotation mode.
 
void beginUpdate ()
 Fonctions which avoid doc updater and update manager to send too much.
 
void endUpdate ()
 
int addToInlineFrames (PageItem *item)
 
void removeInlineFrame (int fIndex)
 
void checkItemForFrames (PageItem *it, int fIndex)
 
bool hasPreflightErrors ()
 
QFileDevice::Permissions filePermissions ()
 
void saveFilePermissions (QFileDevice::Permissions p)
 
void itemResizeToMargin (PageItem *item, int direction)
 
const ScPagepage4EndNotes (NotesStyle *NS, PageItem *item)
 
const QList< Mark * > marksList ()
 
const QList< TextNote * > notesList ()
 
QList< PageItem_NoteFrame * > listNotesFrames (NotesStyle *NS)
 
bool notesChanged ()
 
void setNotesChanged (bool on)
 
QStringList marksLabelsList (MarkType type)
 
MarkgetMark (QString label, MarkType type)
 
MarknewMark (Mark *mrk=NULL)
 
TextNotenewNote (NotesStyle *NS)
 
bool isMarkUsed (Mark *mrk, bool visible=false)
 
void setCursor2MarkPos (Mark *mark)
 
bool eraseMark (Mark *mrk, bool fromText=false, PageItem *item=NULL, bool force=false)
 
void setUndoDelMark (Mark *mrk)
 
bool invalidateVariableTextFrames (Mark *mrk, bool forceUpdate=false)
 
NotesStylenewNotesStyle (NotesStyle NS)
 
void renameNotesStyle (NotesStyle *NS, QString newName)
 
void deleteNotesStyle (QString nsName)
 
void undoSetNotesStyle (SimpleState *ss, NotesStyle *ns)
 
NotesStylegetNotesStyle (QString nsName)
 
void deleteNote (TextNote *note)
 
void setUndoDelNote (TextNote *note)
 
PageItem_NoteFramecreateNoteFrame (PageItem_TextFrame *inFrame, NotesStyle *nStyle, int index=-1)
 
PageItem_NoteFramecreateNoteFrame (NotesStyle *nStyle, double x, double y, double w, double h, double w2, QString fill, QString outline)
 
void delNoteFrame (PageItem_NoteFrame *nF, bool removeMarks=true, bool forceDeletion=true)
 
bool updateNotesNums (NotesStyle *nStyle)
 
void updateNotesFramesStyles (NotesStyle *nStyle)
 
bool validateNSet (NotesStyle NS, QString newName="")
 
bool notesFramesUpdate ()
 
void updateNotesFramesSettings (NotesStyle *NS)
 
PageItem_NoteFrameendNoteFrame (NotesStyle *nStyle, PageItem_TextFrame *master)
 
void setEndNoteFrame (PageItem_NoteFrame *nF, void *ptr)
 
void setEndNoteFrame (PageItem_NoteFrame *nF, int section)
 
void updateEndnotesFrames (NotesStyle *nStyle=NULL, bool invalidate=false)
 
void updateEndNotesFrameContent (PageItem_NoteFrame *nF, bool invalidate=false)
 
void endNoteFrameChanged (PageItem_NoteFrame *nF)
 
void updateChangedEndNotesFrames ()
 
int findMarkCPos (Mark *mrk, PageItem *&item, int Start=0)
 
PageItemfindMarkItem (Mark *mrk, int &lastItem)
 
void setupNumerations ()
 
QString getNumberStr (QString numName, int level, bool reset, ParagraphStyle &style)
 
void setNumerationCounter (QString numName, int level, int number)
 
bool updateLocalNums (StoryText &itemText)
 
void updateNumbers (bool updateNumerations=false)
 
void itemSelection_ClearBulNumStrings (Selection *customSelection)
 
void SubmitForm ()
 
void ImportData ()
 
void ResetFormFields ()
 
- Public Member Functions inherited from UndoObject
 UndoObject ()
 Creates a new anonymous UndoObject instance.
 
 UndoObject (const UndoObject &other)
 Creates a copy of an UndoObject instance.
 
 UndoObject (const QString &objectName, QPixmap *objectIcon=0)
 Creates a new UndoObject instance with the name objectName More...
 
virtual ~UndoObject ()
 Destroys the object.
 
virtual QString getUName ()
 Returns the name of the UndoObject. More...
 
virtual void setUName (QString newUName)
 Set the name of the UndoObject. More...
 
virtual QPixmap * getUPixmap ()
 Returns the pixmap connected to this object. More...
 
virtual void setUPixmap (QPixmap *newUPixmap)
 Set the pixmap for this object. More...
 
ulong getUId () const
 Returns an unique identifier number for the UndoObject. More...
 
const ScGuardedPtr< UndoObject > & undoObjectPtr ()
 Returns a guarded pointer.
 
- Public Member Functions inherited from Observable< ScribusDoc >
 Observable (UpdateManager *um=NULL)
 
virtual void update ()
 
- Public Member Functions inherited from MassObservable< ScribusDoc * >
 MassObservable (UpdateManager *um=NULL)
 
void setUpdateManager (UpdateManager *um)
 
virtual void update (ScribusDoc *what)
 
virtual void updateLayout (ScribusDoc *what)
 
void connectObserver (Observer< ScribusDoc * > *o)
 
bool connectObserver (QObject *o, const char *slot)
 
void disconnectObserver (Observer< ScribusDoc * > *o)
 
bool disconnectObserver (QObject *o, const char *slot=0)
 

Static Public Member Functions

static void recalculateColorItem (PageItem *item)
 

Public Attributes

bool is12doc
 
int NrItems
 
int First
 
int Last
 
int viewCount
 
int viewID
 
bool SnapGrid
 
bool SnapGuides
 
bool SnapElement
 
bool GuideLock
 
bool dontResize
 
FPoint minCanvasCoordinate
 Minimum and Maximum Points of Document.
 
FPoint maxCanvasCoordinate
 
FPoint stored_minCanvasCoordinate
 
FPoint stored_maxCanvasCoordinate
 
double rulerXoffset
 
double rulerYoffset
 
QList< ScPage * > * Pages
 List of Pages.
 
QList< ScPage * > MasterPages
 List of Master Pages.
 
QList< ScPage * > DocPages
 List of Document Pages.
 
QList< ScPage * > TempPages
 List for temporary Pages.
 
QMap< QString, int > MasterNames
 Mapping Master Page Name to Master Page numbers.
 
QList< PageItem * > * Items
 List of Objects.
 
QList< PageItem * > MasterItems
 
QList< PageItem * > DocItems
 
QHash< int, PageItem * > FrameItems
 
QList< PageItem * > EditFrameItems
 
PageItemcurrentEditedTextframe
 
Selection *const m_Selection
 
double PageSp
 Number of Columns.
 
double PageSpa
 Distance of Columns.
 
int FirstPnum
 current Pagelayout More...
 
ColorList PageColors
 Im Dokument benutzte Farben.
 
int appMode
 
int SubMode
 
double * ShapeValues
 
int ValCount
 
QString DocName
 
QMap< QString, int > UsedFonts
 
SCFonts *const AllFonts
 
QList< AlignObjsAObjects
 
int CurrentSel
 
ParagraphStyle currentStyle
 
NodeEditContext nodeEdit
 
PageItemLastAuto
 Letztes Element fuer AutoTextrahmen.
 
PageItemFirstAuto
 Erstes Element fuer AutoTextrahmen.
 
bool DragP
 
bool leaveDrag
 
PageItemDraggedElem
 
PageItemElemToLink
 
QList< PageItem * > DragElements
 
ScLayers Layers
 
int GroupCounter
 
ScColorMgmtEngine colorEngine
 
ScColorProfile DocInputImageRGBProf
 
ScColorProfile DocInputImageCMYKProf
 
ScColorProfile DocInputRGBProf
 
ScColorProfile DocInputCMYKProf
 
ScColorProfile DocDisplayProf
 
ScColorProfile DocPrinterProf
 
ScColorTransform stdTransRGBMon
 
ScColorTransform stdTransCMYKMon
 
ScColorTransform stdProof
 
ScColorTransform stdTransImg
 
ScColorTransform stdProofImg
 
ScColorTransform stdProofImgCMYK
 
ScColorTransform stdTransCMYK
 
ScColorTransform stdProofCMYK
 
ScColorTransform stdTransRGB
 
ScColorTransform stdProofGC
 
ScColorTransform stdProofCMYKGC
 
ScColorTransform stdLabToRGBTrans
 
ScColorTransform stdLabToCMYKTrans
 
ScColorTransform stdProofLab
 
ScColorTransform stdProofLabGC
 
bool BlackPoint
 
bool SoftProofing
 
bool Gamut
 
eRenderIntent IntentColors
 
eRenderIntent IntentImages
 
bool HasCMS
 
QMap< QString, QString > JavaScripts
 
int TotalItems
 
PrintOptions Print_Options
 
bool RePos
 
QList< BookMaBookMarks
 
bool OldBM
 
bool hasName
 
bool isConverted
 
QTimer *const autoSaveTimer
 
QHash< QString, multiLineMLineStyles
 
QHash< QString, ScPatterndocPatterns
 
QHash< QString, VGradientdocGradients
 
QWidget * WinHan
 
bool DoDrawing
 
bool drawAsPreview
 
bool viewAsPreview
 
bool editOnPreview
 
int previewVisual
 
QList< OpenNodesListOpenNodes
 
QTimer * CurTimer
 
QMap< int, errorCodes > pageErrors
 
QMap< int, errorCodes > docLayerErrors
 
QMap< PageItem *, errorCodes > docItemErrors
 
QMap< PageItem *, errorCodes > masterItemErrors
 
FPointArray symReturn
 
FPointArray symNewLine
 
FPointArray symTab
 
FPointArray symNonBreak
 
FPointArray symNewCol
 
FPointArray symNewFrame
 
HyphenatordocHyphenator
 
QList< NotesStyle * > m_docNotesStylesList
 
QMap< PageItem_NoteFrame *, rangeItemm_docEndNotesFramesMap
 
QList< NotesStyle * > ns2Update
 
bool flag_restartMarksRenumbering
 
bool flag_updateMarksLabels
 
bool flag_updateEndNotes
 
bool flag_layoutNotesFrames
 
QList< PageItem_NoteFrame * > m_docEndNotesFramesChanged
 
QMap< QString, NumStruct * > numerations
 
QStringList orgNumNames
 
bool flag_Renumber
 
bool flag_NumUpdateRequest
 

Protected Slots

void slotAutoSave ()
 

Protected Member Functions

void addSymbols ()
 
void applyPrefsPageSizingAndMargins (bool resizePages, bool resizeMasterPages, bool resizePageMargins, bool resizeMasterPageMargins)
 
- Protected Member Functions inherited from MassObservable< ScribusDoc * >
virtual void updateNow (UpdateMemento *what)
 

Protected Attributes

bool m_hasGUI
 
QFileDevice::Permissions docFilePermissions
 
ApplicationPrefsappPrefsData
 
ApplicationPrefs docPrefsData
 
UndoManager *const undoManager
 
bool loading
 
bool modified
 
int ActiveLayer
 
double docUnitRatio
 
int rotMode
 
bool automaticTextFrames
 
bool m_masterPageMode
 
bool m_symbolEditMode
 
bool m_inlineEditMode
 
int m_storedLayerID
 
bool m_storedLayerLock
 
bool m_storedLayerVis
 
QMap< QString, double > m_constants
 
ScribusMainWindowm_ScMW
 
ScribusViewm_View
 
ScGuardedObject< ScribusDocm_guardedObject
 
Serializerm_serializer
 
Serializerm_tserializer
 
QString currentEditedSymbol
 
int currentEditedIFrame
 
- Protected Attributes inherited from MassObservable< ScribusDoc * >
QSet< Observer< ScribusDoc * > * > m_observers
 
Private_SignalchangedSignal
 
UpdateManagerm_um
 

Detailed Description

the Document Class

!

Member Function Documentation

int ScribusDoc::activeLayer ( )

Return the number of the current layer.

Returns
Active layer number
const QString & ScribusDoc::activeLayerName ( )

Return the name of the current layer.

Returns
Name of the layer
int ScribusDoc::addAutomaticTextFrame ( const int  pageNumber)

Add the automatic text frame to the page.

Parameters
pageNumberpage number
Returns
number of frame
int ScribusDoc::addLayer ( const QString &  layerName = QString::null,
const bool  activate = false 
)

Add a layer to the current document.

Parameters
layerNamename of layer
activatethe layer active
Returns
Number of the layer created
void ScribusDoc::addPageToSection ( const uint  otherPageIndex,
const uint  location,
const uint  count = 1 
)
Parameters
otherPageIndex
location
count
void ScribusDoc::allItems_ChangePreviewResolution ( int  id)
slot

Change display quality of all images in document.

Author
OssiLehtinen
const CellStyle& ScribusDoc::cellStyle ( QString  name)
inline

Returns the table cell style named name.

const StyleSet<CellStyle>& ScribusDoc::cellStyles ( )
inline

Returns the set of table cell styles in the document.

bool ScribusDoc::changeLayerName ( const int  layerID,
const QString &  newName 
)

Change the name of a layer.

Parameters
layerIDID of the layer
newNamenew name of the layer
Returns
Success or failure
int ScribusDoc::columnOfPage ( int  pageIndex) const

Get the column of the page on the canvas, ie, left, middle, or right.

Parameters
pageIndexIndex of page to find location for
Returns
int of 0,1,2,3
void ScribusDoc::copyLayer ( int  layerIDToCopy,
int  whereToInsert 
)

Copies a layer from the current document.

Parameters
layerIDToCopysource layer
whereToInserttarget layer
Returns
Success or failure
void ScribusDoc::copyPage ( int  pageNumberToCopy,
int  existingPage,
int  whereToInsert,
int  copyCount 
)

Copy a page (pageNumberToCopy) copyCount times, whereToInsert(before or after) the existingPage or at the end.

Parameters
pageNumberToCopy
existingPage
whereToInsert
copyCount
bool ScribusDoc::copyPageToMasterPage ( const int  pageNumber,
const int  leftPage,
const int  maxLeftPage,
const QString &  masterPageName,
bool  copyFromAppliedMaster 
)

Sets up the ScText defaults from the document.

Copies a normal page to be a master pages

ScPage * ScribusDoc::currentPage ( )

Get pointer to the current page.

Return values
Page*current page object
bool ScribusDoc::deleteLayer ( const int  layerID,
const bool  deleteItems 
)

Delete a layer from the current document.

Parameters
layerIDof layer
deleteItemsthe items on the layer too?
Returns
Success or failure
void ScribusDoc::enableCMS ( bool  enable)

Switch Colormanagement on or of.

Parameters
enablebool, if true Colormanagement is switched on, else off
QString ScribusDoc::getSectionNameForPageIndex ( const uint  pageIndex) const

Returns name of section where page is located.

Parameters
pageIndexpage nr
double ScribusDoc::getXOffsetForPage ( const int  pageNumber)

Return the x or y offset for a page on the canvas.

Return values
doublecontaining 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
void ScribusDoc::insertColor ( QString  nam,
double  c,
double  m,
double  y,
double  k 
)

Insert a color into the documents color list.

Parameters
namName of the colour
cCyan component
mMagenta component
yYellow component
kBlack component
bool ScribusDoc::isDefaultStyle ( const TableStyle style) const
inline

Returns true if style is the default table style.

bool ScribusDoc::isDefaultStyle ( const CellStyle style) const
inline

Returns true if style is the default table cell style.

int ScribusDoc::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,
const bool  noteFrame = false 
)

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.

Parameters
itemFinalisedUsed to handle item creation for undo while the user is still dragging.
Returns
Number of created item, -1 on failure.
Parameters
itemTypetype
frameTypeframe type
xX pos
yY pos
bwidth
hheight
w?
fillfill color name
outlineoutline color name
noteFrameoptional (default false) indicates that noteframes should be created, not text frame
int ScribusDoc::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 
)

Add an item to the page based on the x/y position. Item will be fitted to the closest guides/margins

bool ScribusDoc::itemAddCommit ( PageItem item)

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.

Returns
If an item was committed and the view must emit its signal, which needs removing from here, TODO.
int ScribusDoc::itemAddUserFrame ( InsertAFrameData iafData)

Allow the user to create a frame easily with some simple placement and sizing options.

Parameters
iafDataa InsertAFrameData structure with params
Returns
int item id? FIXME
bool ScribusDoc::itemNameExists ( const QString  itemName)

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
void ScribusDoc::itemSelection_AdjustFrametoImageSize ( Selection customSelection = 0)
slot

Adjust an image frame's size to fit the size of the image in it

void ScribusDoc::itemSelection_AdjustFrameToTable ( )
slot

Adjusts the size of the frames of any selected tables to fit the size of the tables they contain.

If there are no tables in the current selection, then this slot does nothing.

void ScribusDoc::itemSelection_AdjustImagetoFrameSize ( Selection customSelection = 0)
slot

Adjust an image size to fit the size of the frame

void ScribusDoc::itemSelection_AdjustTableToFrame ( )
slot

Adjusts the size of any selected tables to fit the size of their frames.

If there are no tables in the current selection, then this slot does nothing.

void ScribusDoc::itemSelection_DeleteItem ( Selection customSelection = 0,
bool  forceDeletion = false 
)
slot

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.

See also
Page::restorePageItemCreation
void ScribusDoc::itemSelection_DeleteTableColumns ( )
slot

Deletes columns in a table.

If the there is a cell selection, all columns spanned by the selection will be deleted. If there is no cell selection, the columns spanned by the active cell will be deleted.

If no table is selected, or if the application is not in table edit mode, then this slot does nothing.

void ScribusDoc::itemSelection_DeleteTableRows ( )
slot

Deletes rows in a table.

If the there is a cell selection, all rows spanned by the selection will be deleted. If there is no cell selection, the rows spanned by the active cell will be deleted.

If no table is selected, or if the application is not in table edit mode, then this slot does nothing.

void ScribusDoc::itemSelection_DistributeTableColumnsEvenly ( )
slot

Distributes columns in a table evenly.

If in table edit mode and there is a cell selection, each contigous range of selected columns is distributed. If there is no cell selection, all columns in the table are distributed.

If there is no table selected, then this slot does nothing.

void ScribusDoc::itemSelection_DistributeTableRowsEvenly ( )
slot

Distributes rows in a table evenly.

If in table edit mode and there is a cell selection, each contigous range of selected rows is distributed. If there is no cell selection, all rows in the table are distributed.

If there is no table selected, then this slot does nothing.

void ScribusDoc::itemSelection_InsertTableColumns ( )
slot

Inserts columns in a table.

The user will be prompted by a dialog for the number of columns and where they should be inserted. If in table edit mode, columns may be inserted before or after the active cell. If in normal mode, columns may be inserted at the beginning or end of the selected table.

If no table is selected, then this slot does nothing.

void ScribusDoc::itemSelection_InsertTableRows ( )
slot

Inserts rows in a table.

The user will be prompted by a dialog for the number of rows and where they should be inserted. If in table edit mode, rows may be inserted before or after the active cell. If in normal mode, rows may be inserted at the beginning or end of the selected table.

If no table is selected, then this slot does nothing.

void ScribusDoc::itemSelection_MergeTableCells ( )
slot

Merges the selected cells in a table.

The merged area will span from the top left to the bottom right of the selected cells.

If no table is selected, or if the application is not in table edit mode, or if less than two cells is selected, then this slot does nothing.

void ScribusDoc::itemSelection_SetTableColumnWidths ( )
slot

Sets the width of columns in a table.

The user will be prompted by a dialog for entering a column width. If in table editing mode, all columns of the table will get their width set. If the there is a cell selection, all columns spanned by the selection will get their width set. If there is no cell selection, the columns spanned by the active cell will get their width set.

If no table is selected, then this slot does nothing.

void ScribusDoc::itemSelection_SetTableRowHeights ( )
slot

Sets the height of rows in a table.

The user will be prompted by a dialog for entering a row height. If in table editing mode, all rows of the table will get their height set. If the there is a cell selection, all rows spanned by the selection will get their height set. If there is no cell selection, the rows spanned by the active cell will get their height set.

If no table is selected, then this slot does nothing.

void ScribusDoc::itemSelection_SplitTableCells ( )
inlineslot

Splits cells in a table.

TODO: Implement this.

int ScribusDoc::layerBlendMode ( const int  ID)

returns the layer BlendMode

Parameters
layerIDID of the layer
Returns
layerBlendMode
bool ScribusDoc::layerContainsItems ( const int  layerID)

Does the layer have items on it?

Parameters
layerIDID of the layer
Returns
Layer contains items bool
bool ScribusDoc::layerFlow ( const int  layerID)

does text flow around objects on this layer

Parameters
layerIDID of the layer
Returns
flow or not
int ScribusDoc::layerIDFromLevel ( const int  layerLevel)

Return the number of the layer at a certain level.

Parameters
layerLevelLayer level
Returns
Layer ID
int ScribusDoc::layerIDFromName ( QString  name)

Return the layer count.

Returns
Number of layers in doc
int ScribusDoc::layerLevelFromID ( const int  layerID)

Return the level of the requested layer.

Parameters
layerIDID of the layer
Returns
Level of the layer
bool ScribusDoc::layerLocked ( const int  layerID)

Is the layer locked.

Parameters
layerIDID of the layer
Returns
Locked or not
QColor ScribusDoc::layerMarker ( const int  layerID)

returns the layer marker color

Parameters
layerIDID of the layer
Returns
marker color
QString ScribusDoc::layerName ( const int  layerID) const

Return the layer name.

Parameters
layerIDID of the layer
Returns
Name of the layer
bool ScribusDoc::layerOutline ( const int  layerID)

is this layer in outline mode

Parameters
layerIDID of the layer
Returns
outline or not
bool ScribusDoc::layerPrintable ( const int  layerID)

Is the layer printable.

Parameters
layerIDID of the layer
Returns
Printable or not
bool ScribusDoc::layerSelectable ( const int  layerID)

are objects on the layer selectable

Parameters
layerIDID of the layer
Returns
Items selectable or not
double ScribusDoc::layerTransparency ( const int  layerID)

returns the layer transparency

Parameters
layerIDID of the layer
Returns
transparency value 0.0 - 1.0
bool ScribusDoc::layerVisible ( const int  layerID)

Is the layer visible.

Parameters
layerIDID of the layer
Returns
Visible or not
bool ScribusDoc::loadPict ( QString  fn,
PageItem pageItem,
bool  reload = false,
bool  showMsg = false 
)

Load images into an image frame, moved from the view.

Return values
Returnfalse on failure
Parameters
fn
pageItem
reload
Returns
void ScribusDoc::loadStylesFromFile ( QString  fileName)

Insert styles from another document in this document.

Parameters
fileNameThe path of the document we want to extract its styles
void ScribusDoc::loadStylesFromFile ( QString  fileName,
StyleSet< ParagraphStyle > *  tempStyles,
StyleSet< CharStyle > *  tempCharStyles,
QHash< QString, multiLine > *  tempLineStyles 
)

Gather styles from another document.

Parameters
fileNameThe path of the document we want to extract its styles
tempStylesA pointer to a StyleSet which will be filled by paragraph styles
tempCharStylesA pointer to a StyleSet which will be filled by character styles
tempLineStylesA map which will be filled by line styles
PageLocation ScribusDoc::locationOfPage ( int  pageIndex) const

Get the location of the page on the canvas, ie, left, middle, or right Does not give information about middle left, etc.

Parameters
pageIndexIndex of page to find location for
Returns
LeftPage, MiddlePage, RightPage, enum from pagestructs.h
void ScribusDoc::lockGuides ( bool  isLocked)

Should guides be locked or not.

Parameters
isLockedIf true guides on pages cannot be moved if false they can be dragged to new positions.
Author
Riku Leino
bool ScribusDoc::lowerLayer ( const int  layerID)

Lower a layer.

Parameters
layerIDID of the layer
Returns
Success or failure
bool ScribusDoc::lowerLayerByLevel ( const int  layerLevel)

Lower a layer using the level.

Parameters
layerLevelLevel of the layer
Returns
Success or failure
void ScribusDoc::movePage ( const int  fromPage,
const int  toPage,
const int  dest,
const int  position 
)

Move page(s) within the document.

Parameters
fromPagepage index
toPagepage index
counttarget to move to (page index)
positionBefore, After or at the end
void ScribusDoc::orderedLayerList ( QStringList *  list)

Return a list of the layers in their order.

Parameters
listQStringList to insert the layer names into
const ScPage * ScribusDoc::page4EndNotes ( NotesStyle NS,
PageItem item 
)

Explanation master frame - text frame with marks for notes notesframe - frame with notes master & note mark - master is mark in "master" text, note mark is at begining of note in noteframe

bool ScribusDoc::raiseLayer ( const int  layerID)

Raise a layer.

Parameters
layerIDID of the layer
Returns
Success or failure
bool ScribusDoc::raiseLayerByLevel ( const int  layerLevel)

Raise a layer using the level.

Parameters
layerLevelLevel of the layer
Returns
Success or failure
void ScribusDoc::rebuildItemLists ( )

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.

See also
updateFrameItems();
void ScribusDoc::RecalcPictures ( ProfilesL *  Pr,
ProfilesL *  PrCMYK,
QProgressBar *  dia = 0 
)

Handle image with color profiles.

Parameters
Prprofile
PrCMYKcmyk profile
diaoptional progress widget
void ScribusDoc::RecalcPictures ( QList< PageItem * > *  items,
ProfilesL *  Pr,
ProfilesL *  PrCMYK,
QProgressBar *  dia = 0 
)

Handle image with color profiles.

Parameters
itemslist of page items to update
Prprofile
PrCMYKcmyk profile
diaoptional progress widget
void ScribusDoc::redefineCellStyles ( const StyleSet< CellStyle > &  newStyles,
bool  removeUnused = false 
)

Redefines the set of table cell styles in the document using styles in newStyles. Removes unused table cell styles if removeUnused is true.

void ScribusDoc::redefineTableStyles ( const StyleSet< TableStyle > &  newStyles,
bool  removeUnused = false 
)

Redefines the set of table styles in the document using styles in newStyles. Removes unused table styles if removeUnused is true.

void ScribusDoc::removePageFromSection ( const uint  pageIndex)
Parameters
pageIndex
bool ScribusDoc::renumberLayer ( const int  layerID,
const int  newLayerID 
)

Renumber a layer. Used in particular for reinsertion for undo/redo.

Parameters
layerIDold layer ID
newLayerIDNew layer ID
Returns
Success or failure
void ScribusDoc::replaceCellStyles ( const QMap< QString, QString > &  newNameForOld)

Remove any reference to old table cell styles and replace with new name. This needs to be called when a style was removed. New name may be "". newNameForOld is a map which maps the name of any style to remove to a new table cell style name

void ScribusDoc::replaceCharStyles ( const QMap< QString, QString > &  newNameForOld)

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 "".

Parameters
newNameForOlda map which maps the name of any style to remove to a new stylename
void ScribusDoc::replaceStyles ( const QMap< QString, QString > &  newNameForOld)

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 "".

Parameters
newNameForOlda map which maps the name of any style to remove to a new stylename
void ScribusDoc::replaceTableStyles ( const QMap< QString, QString > &  newNameForOld)

Remove any reference to old table styles and replace with new name. This needs to be called when a style was removed. New name may be "". newNameForOld is a map which maps the name of any style to remove to a new table style name

void ScribusDoc::restore ( UndoState state,
bool  isUndo 
)
virtual

Method used when an undo/redo is requested.

Parameters
stateState describing the action that is wanted to be undone/redone
isUndoIf true undo is wanted else if false redo.
Author
Riku Leino

Implements UndoObject.

bool ScribusDoc::setActiveLayer ( const int  layerToActivate)

Set the active layer via the layer number.

Parameters
layerToActivateNumber of the layer
Returns
Success or failure
bool ScribusDoc::setActiveLayer ( const QString &  layerNameToActivate)

Set the active layer via the layer name.

Parameters
layerNameToActivateName of the layer
Returns
Success or failure
void ScribusDoc::setCurrentPage ( ScPage newPage)

Set new current page.

Parameters
newPageNew current page
bool ScribusDoc::setLayerBlendMode ( const int  ID,
int  blend 
)

Set the layer layerBlendMode via the layer number.

Parameters
layerIDID of the layer
blendlayerBlendMode
Returns
Success or failure
bool ScribusDoc::setLayerFlow ( const int  layerID,
const bool  flow 
)

Set the layer flow via the layer number.

Parameters
layerIDID of the layer
flowtrue = Text flows around objects on this layer
Returns
Success or failure
bool ScribusDoc::setLayerLocked ( const int  layerID,
const bool  isLocked 
)

Set the layer locked via the layer number.

Parameters
layerIDID of the layer
isLockedtrue = layer is locked
Returns
Success or failure
bool ScribusDoc::setLayerMarker ( const int  layerID,
QColor  color 
)

Set the layer marker color.

Parameters
IDNumber of the layer
colorcolor of the marker
Returns
Success or failure
bool ScribusDoc::setLayerOutline ( const int  layerID,
const bool  outline 
)

Set the layer outline mode via the layer number.

Parameters
layerIDID of the layer
outlinetrue = layer is displayed in outlines only
Returns
Success or failure
bool ScribusDoc::setLayerPrintable ( const int  layerID,
const bool  isPrintable 
)

Set the layer printable via the layer number.

Parameters
layerIDID of the layer
isPrintablebool true = layer is prantable
Returns
Success or failure
bool ScribusDoc::setLayerSelectable ( const int  layerID,
const bool  isSelectable 
)

Set objects on the layer selectable via the layer ID.

Parameters
layerIDID of the layer
isSelectabletrue = layer objects are selectable
Returns
bool Success or failure
bool ScribusDoc::setLayerTransparency ( const int  layerID,
double  trans 
)

Set the layer transparency via the layer number.

Parameters
layerIDID of the layer
transtransparency value 0.0 - 1.0
Returns
Success or failure
bool ScribusDoc::setLayerVisible ( const int  layerID,
const bool  isViewable 
)

Set the layer visible via the layer number.

Parameters
layerIDID of the layer
isViewabletrue = layer is visible
Returns
Success or failure
void ScribusDoc::setLocationBasedPageLRMargins ( uint  pageIndex)

Set the left and right margins based on the location of the page

Parameters
pageIndex
void ScribusDoc::setName ( const QString &  name)

Sets the name of the document.

Parameters
nameName for the document
Author
Riku Leino
void ScribusDoc::setPage ( double  w,
double  h,
double  t,
double  l,
double  r,
double  b,
double  sp,
double  ab,
bool  atf,
int  fp 
)

Setzt die Seitenattribute

sets page properties

void ScribusDoc::signalRebuildOutLinePalette ( )
signal

A signal for when the outline palette needs to rebuild itself Emit when:

  • An item is created or deleted
  • An item changes page
  • An page is created or deleted
  • Some items are grouped or a group is ungrouped This also applies to Master Pages
void ScribusDoc::swapPage ( const int  a,
const int  b 
)

Swap two pages.

Parameters
apage index
bpage index
const TableStyle& ScribusDoc::tableStyle ( QString  name)
inline

Returns the table style named name.

const StyleSet<TableStyle>& ScribusDoc::tableStyles ( )
inline

Returns the set of table styles in the document.

Member Data Documentation

int ScribusDoc::FirstPnum

current Pagelayout

Erste Seitennummer im Dokument


The documentation for this class was generated from the following files: