37 #include <QStringList>
41 #include "gtgettext.h"
42 #include "scribusapi.h"
43 #include "colormgmt/sccolormgmtengine.h"
44 #include "documentinformation.h"
45 #include "numeration.h"
47 #include "nodeeditcontext.h"
48 #include "notesstyles.h"
49 #include "observable.h"
51 #include "pageitem_group.h"
52 #include "pageitem_latexframe.h"
53 #include "pageitem_textframe.h"
54 #include "pagestructs.h"
55 #include "prefsstructs.h"
56 #include "scguardedptr.h"
59 #include "styles/styleset.h"
60 #include "styles/tablestyle.h"
61 #include "styles/cellstyle.h"
62 #include "undoobject.h"
63 #include "undostate.h"
64 #include "undotransaction.h"
65 #include "updatemanager.h"
66 #include "usertaskstructs.h"
99 bool inAnEditMode()
const;
100 bool inASpecialEditMode()
const;
101 QList<PageItem*> getAllItems(QList<PageItem*> &items);
102 QList<PageItem*> *parentGroup(
PageItem* item, QList<PageItem*> *list);
103 void setup(
const int,
const int,
const int,
const int,
const int,
const QString&,
const QString&);
104 void setLoading(
const bool);
105 bool isLoading()
const;
106 void setModified(
const bool);
107 bool isModified()
const;
109 void setPage(
double w,
double h,
double t,
double l,
double r,
double b,
double sp,
double ab,
bool atf,
int fp);
129 void invalidateAll();
130 void invalidateLayer(
int layerID);
131 void invalidateRegion(QRectF region);
134 MarginStruct* scratch() {
return &docPrefsData.displayPrefs.scratch; }
135 MarginStruct* bleeds() {
return &docPrefsData.docSetupPrefs.bleeds; }
136 MarginStruct& bleedsVal() {
return docPrefsData.docSetupPrefs.bleeds; }
137 MarginStruct* margins() {
return &docPrefsData.docSetupPrefs.margins; }
138 MarginStruct& marginsVal() {
return docPrefsData.docSetupPrefs.margins; }
139 double pageGapHorizontal()
const {
return docPrefsData.displayPrefs.pageGapHorizontal; }
140 double pageGapVertical()
const {
return docPrefsData.displayPrefs.pageGapVertical; }
141 void setPageGapHorizontal(
double h) { docPrefsData.displayPrefs.pageGapHorizontal=h; }
142 void setPageGapVertical(
double v) { docPrefsData.displayPrefs.pageGapVertical=v; }
143 const QList<PageSet>& pageSets()
const {
return docPrefsData.pageSets; }
144 void setPageSetFirstPage(
int layout,
int fp);
145 void clearPageSets() { docPrefsData.pageSets.clear(); }
146 void appendToPageSets(
const PageSet& ps) { docPrefsData.pageSets.append(ps); }
147 void setPaperColor(
const QColor &c) { docPrefsData.displayPrefs.paperColor=c; }
148 const QColor& paperColor()
const {
return docPrefsData.displayPrefs.paperColor; }
149 int hyphMinimumWordLength()
const {
return docPrefsData.hyphPrefs.MinWordLen; }
150 int hyphConsecutiveLines()
const {
return docPrefsData.hyphPrefs.HyCount; }
151 const QString& hyphLanguage()
const {
return docPrefsData.hyphPrefs.Language; }
152 bool hyphAutomatic()
const {
return docPrefsData.hyphPrefs.Automatic; }
153 bool hyphAutoCheck()
const {
return docPrefsData.hyphPrefs.AutoCheck; }
154 void setHyphMinimumWordLength(
int i) { docPrefsData.hyphPrefs.MinWordLen=i; }
155 void setHyphConsecutiveLines(
int i) { docPrefsData.hyphPrefs.HyCount=i; }
156 void setHyphLanguage(
const QString& s) { docPrefsData.hyphPrefs.Language=s; }
157 void setHyphAutomatic(
bool b) { docPrefsData.hyphPrefs.Automatic=b; }
158 void setHyphAutoCheck(
bool b) { docPrefsData.hyphPrefs.AutoCheck=b; }
159 bool autoSave()
const {
return docPrefsData.docSetupPrefs.AutoSave; }
160 int autoSaveTime()
const {
return docPrefsData.docSetupPrefs.AutoSaveTime; }
161 bool autoSaveClockDisplay()
const {
return docPrefsData.displayPrefs.showAutosaveClockOnCanvas; }
162 void setAutoSave(
bool b) { docPrefsData.docSetupPrefs.AutoSave=b; }
163 void setAutoSaveTime(
int i) { docPrefsData.docSetupPrefs.AutoSaveTime=i; }
165 PDFOptions& pdfOptions() {
return docPrefsData.pdfPrefs; }
166 ObjAttrVector& itemAttributes() {
return docPrefsData.itemAttrPrefs.defaultItemAttributes; }
167 void setItemAttributes(ObjAttrVector& oav) { docPrefsData.itemAttrPrefs.defaultItemAttributes=oav;}
168 void clearItemAttributes() { docPrefsData.itemAttrPrefs.defaultItemAttributes.clear(); }
169 void appendToItemAttributes(
const ObjectAttribute& oa) { docPrefsData.itemAttrPrefs.defaultItemAttributes.append(oa); }
170 ToCSetupVector& tocSetups() {
return docPrefsData.tocPrefs.defaultToCSetups; }
171 void setTocSetups(ToCSetupVector& tsv) { docPrefsData.tocPrefs.defaultToCSetups=tsv; }
172 void clearTocSetups() { docPrefsData.tocPrefs.defaultToCSetups.clear(); }
173 void appendToTocSetups(
const ToCSetup& ts) { docPrefsData.tocPrefs.defaultToCSetups.append(ts); }
174 void setArrowStyles(QList<ArrowDesc>& as) { docPrefsData.arrowStyles=as; }
175 QList<ArrowDesc>& arrowStyles() {
return docPrefsData.arrowStyles; }
176 void appendToArrowStyles(
const struct ArrowDesc& as) { docPrefsData.arrowStyles.append(as); }
177 const bool marginColored()
const {
return docPrefsData.displayPrefs.marginColored; }
178 void setMarginColored(
bool b) { docPrefsData.displayPrefs.marginColored=b; }
179 QMap<QString, CheckerPrefs>& checkerProfiles() {
return docPrefsData.verifierPrefs.checkerPrefsList; }
180 void setCheckerProfiles(
const QMap<QString, CheckerPrefs>& cl) { docPrefsData.verifierPrefs.checkerPrefsList=cl; }
181 void set1CheckerProfile(
const QString profileName,
const struct CheckerPrefs& cs) { docPrefsData.verifierPrefs.checkerPrefsList[profileName] = cs; }
182 void clearCheckerProfiles() { docPrefsData.verifierPrefs.checkerPrefsList.clear(); }
183 const QString& curCheckProfile()
const {
return docPrefsData.verifierPrefs.curCheckProfile; }
184 void setCurCheckProfile(
const QString& s) { docPrefsData.verifierPrefs.curCheckProfile=s; }
185 int pageOrientation()
const {
return docPrefsData.docSetupPrefs.pageOrientation; }
186 void setPageOrientation(
int o) { docPrefsData.docSetupPrefs.pageOrientation=o; }
187 int pagePositioning()
const {
return docPrefsData.docSetupPrefs.pagePositioning; }
188 void setPagePositioning(
int p) { docPrefsData.docSetupPrefs.pagePositioning=p; }
189 double pageHeight()
const {
return docPrefsData.docSetupPrefs.pageHeight; }
190 double pageWidth()
const {
return docPrefsData.docSetupPrefs.pageWidth; }
191 const QString& pageSize()
const {
return docPrefsData.docSetupPrefs.pageSize; }
192 void setPageHeight(
double h) { docPrefsData.docSetupPrefs.pageHeight=h; }
193 void setPageWidth(
double w) { docPrefsData.docSetupPrefs.pageWidth=w; }
194 void setPageSize(
const QString& s) { docPrefsData.docSetupPrefs.pageSize=s; }
195 int marginPreset()
const {
return docPrefsData.docSetupPrefs.marginPreset; }
196 void setMarginPreset(
int mp) { docPrefsData.docSetupPrefs.marginPreset=mp; }
198 TypoPrefs& typographicPrefs() {
return docPrefsData.typoPrefs; }
199 GuidesPrefs& guidesPrefs() {
return docPrefsData.guidesPrefs; }
200 ItemToolPrefs& itemToolPrefs() {
return docPrefsData.itemToolPrefs; }
202 ColorPrefs& colorPrefs() {
return docPrefsData.colorPrefs; }
203 CMSData& cmsSettings() {
return docPrefsData.colorPrefs.DCMSset; }
206 DocumentSectionMap& sections() {
return docPrefsData.docSectionMap; }
207 void setSections(DocumentSectionMap dsm) { docPrefsData.docSectionMap=dsm; }
208 const QMap<QString, int> & usedFonts() {
return UsedFonts; }
211 void setNewPrefs(
const ApplicationPrefs& prefsData,
const ApplicationPrefs& oldPrefsData,
bool resizePages,
bool resizeMasterPages,
bool resizePageMargins,
bool resizeMasterPageMargins);
215 ScPage* addPage(
const int pageNumber,
const QString& masterPageName=QString::null,
const bool addAutoFrame=
false);
216 void deletePage(
const int);
218 ScPage* addMasterPage(
const int,
const QString&);
219 void deleteMasterPage(
const int);
221 void rebuildMasterNames(
void);
223 void replaceMasterPage(
const QString& oldMasterPage);
225 bool renameMasterPage(
const QString& oldPageName,
const QString& newPageName);
227 void createDefaultMasterPages();
229 void createNewDocPages(
int pageCount);
235 int addAutomaticTextFrame(
const int pageNumber);
240 void setLocationBasedPageLRMargins(uint pageIndex);
246 void swapPage(
const int a,
const int b);
254 void movePage(
const int fromPage,
const int toPage,
const int dest,
const int position);
263 void copyPage(
int pageNumberToCopy,
int existingPage,
int whereToInsert,
int copyCount);
272 int addLayer(
const QString& layerName=QString::null,
const bool activate=
false);
279 void copyLayer(
int layerIDToCopy,
int whereToInsert);
286 bool deleteLayer(
const int layerID,
const bool deleteItems);
297 const QString& activeLayerName();
303 bool setActiveLayer(
const int layerToActivate);
309 bool setActiveLayer(
const QString & layerNameToActivate);
316 bool setLayerPrintable(
const int layerID,
const bool isPrintable);
322 bool layerPrintable(
const int layerID);
329 bool setLayerVisible(
const int layerID,
const bool isViewable);
335 bool layerVisible(
const int layerID);
341 bool layerSelectable(
const int layerID);
348 bool setLayerSelectable(
const int layerID,
const bool isSelectable);
355 bool setLayerLocked(
const int layerID,
const bool isLocked);
361 bool layerLocked(
const int layerID);
368 bool setLayerFlow(
const int layerID,
const bool flow);
374 bool layerFlow(
const int layerID);
381 bool setLayerTransparency(
const int layerID,
double trans);
387 double layerTransparency(
const int layerID);
394 bool setLayerBlendMode(
const int ID,
int blend);
400 int layerBlendMode(
const int ID);
406 int layerLevelFromID(
const int layerID);
413 bool setLayerMarker(
const int layerID, QColor color);
419 QColor layerMarker(
const int layerID);
426 bool setLayerOutline(
const int layerID,
const bool outline);
432 bool layerOutline(
const int layerID);
438 int layerIDFromLevel(
const int layerLevel);
443 int layerIDFromName(QString name);
444 int layerCount()
const;
450 bool lowerLayer(
const int layerID);
456 bool lowerLayerByLevel(
const int layerLevel);
462 bool raiseLayer(
const int layerID);
468 bool raiseLayerByLevel(
const int layerLevel);
474 QString layerName(
const int layerID)
const;
481 bool changeLayerName(
const int layerID,
const QString& newName);
487 bool layerContainsItems(
const int layerID);
494 bool renumberLayer(
const int layerID,
const int newLayerID);
499 void orderedLayerList(QStringList* list);
503 bool deleteTaggedItems();
508 void getUsedProfiles(ProfilesL& usedProfiles);
509 bool OpenCMSProfiles(ProfilesL InPo, ProfilesL InPoCMYK, ProfilesL MoPo, ProfilesL PrPo);
510 void CloseCMSProfiles();
511 void SetDefaultCMSParams();
516 void enableCMS(
bool enable);
518 const ParagraphStyle& paragraphStyle(QString name) {
return docParagraphStyles.get(name); }
520 bool isDefaultStyle(
const ParagraphStyle& p )
const {
return docParagraphStyles.isDefault(p); }
521 bool isDefaultStyle(
const CharStyle& c )
const {
return docCharStyles.isDefault(c); }
547 void replaceTableStyles(
const QMap<QString, QString>& newNameForOld);
572 void replaceCellStyles(
const QMap<QString, QString>& newNameForOld);
581 item->replaceNamedResources(m_newNames);
587 bool styleExists(QString styleName);
589 QList<int> getSortedStyleList();
590 QList<int> getSortedCharStyleList();
591 QList<int> getSortedTableStyleList();
592 QList<int> getSortedCellStyleList();
600 void replaceStyles(
const QMap<QString,QString>& newNameForOld);
606 void loadStylesFromFile(QString fileName);
617 QHash<QString, multiLine> *tempLineStyles);
619 const CharStyle& charStyle(QString name) {
return docCharStyles.get(name); }
627 void replaceCharStyles(
const QMap<QString,QString>& newNameForOld);
635 void lockGuides(
bool isLocked);
648 void setName(
const QString& name);
652 QStringList getItemAttributeNames();
654 bool AddFont(QString name,
int fsize = 10);
659 QMap<QString,int> reorganiseFonts();
663 void getUsedFonts(QMap<QString,QMap<uint, FPointArray> > &Really);
664 void checkItemForFonts(
PageItem *it, QMap<QString, QMap<uint, FPointArray> > & Really, uint lc);
669 void replaceLineStyleColors(
const QMap<QString, QString>& colorMap);
673 void getUsedColors(
ColorList &colorsToUse,
bool spot =
false);
677 bool lineStylesUseColor(
const QString& colorName);
681 void getUsedGradients(QHash<QString, VGradient> &Gradients);
685 bool addGradient(QString &name,
VGradient &gradient);
686 void setGradients(QHash<QString, VGradient> &gradients);
690 bool addPattern(QString &name,
ScPattern& pattern);
691 void removePattern(QString name);
692 void setPatterns(QHash<QString, ScPattern> &patterns);
696 ScPattern* checkedPattern(QString &name);
700 QStringList getUsedPatterns();
701 QStringList getUsedPatternsSelection(
Selection* customSelection);
702 QStringList getUsedPatternsHelper(QString pattern, QStringList &results);
703 QStringList getPatternDependencyList(QStringList used);
707 QStringList getUsedSymbols();
708 QStringList getUsedSymbolsHelper(QString pattern, QStringList &results);
712 void setUnitIndex(
const int);
713 int unitIndex()
const;
714 double unitRatio()
const;
718 bool applyMasterPage(
const QString& pageName,
const int pageNumber);
722 void restoreMasterPageApplying(
SimpleState* ss,
bool isUndo);
723 void restoreMasterPageRenaming(
SimpleState* ss,
bool isUndo);
724 void restoreCopyPage(
SimpleState* ss,
bool isUndo);
725 void restoreMovePage(
SimpleState* ss,
bool isUndo);
726 void restoreSwapPage(
SimpleState* ss,
bool isUndo);
727 void restoreAddMasterPage(
SimpleState* ss,
bool isUndo);
728 void restoreChangePageProperties(
SimpleState* ss,
bool isUndo);
732 void restoreGrouping(
SimpleState* ss,
bool isUndo);
736 void restoreLevelDown(
SimpleState* ss,
bool isUndo);
737 void restoreLevelBottom(
SimpleState* ss,
bool isUndo);
738 void restoreGuideLock(
SimpleState* ss,
bool isUndo);
742 bool save(
const QString& fileName, QString* savedFile = NULL);
746 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);
750 void recalculateColorsList(QList<PageItem *> *itemList);
751 static void recalculateColorItem(
PageItem *item);
752 void recalculateColors();
760 bool copyPageToMasterPage(
const int,
const int,
const int,
const QString&,
bool);
786 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);
789 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);
811 uint getItemNrfromUniqueID(uint unique);
813 PageItem* getItemFromName(QString name);
823 void rebuildItemLists();
827 bool usesAutomaticTextFrames()
const;
828 void setUsesAutomaticTextFrames(
const bool);
842 bool loadPict(QString fn,
PageItem *pageItem,
bool reload =
false,
bool showMsg =
false);
849 void RecalcPictures(ProfilesL *Pr, ProfilesL *PrCMYK, QProgressBar *dia = 0);
857 void RecalcPictures(QList<PageItem*>* items, ProfilesL *Pr, ProfilesL *PrCMYK, QProgressBar *dia = 0);
864 int OnPage(
double x2,
double y2);
866 void GroupOnPage(
PageItem *currItem);
868 void reformPages(
bool moveObjects =
true);
870 void refreshGuides();
873 void fixItemPageOwner();
875 void fixParagraphStyles();
877 void fixNotesStyles();
884 double getXOffsetForPage(
const int);
885 double getYOffsetForPage(
const int);
886 void getBleeds(
int pageNumber,
MarginStruct& bleedData);
898 int currentPageNumber();
906 bool itemNameExists(
const QString itemName);
912 void setMasterPageMode(
bool);
915 bool masterPageMode()
const {
return m_masterPageMode; }
919 void setSymbolEditMode(
bool mode, QString symbolName =
"");
922 bool symbolEditMode()
const {
return m_symbolEditMode; }
925 QString getEditedSymbol()
const {
return currentEditedSymbol; }
929 void setInlineEditMode(
bool mode,
int id = -1);
932 bool inlineEditMode()
const {
return m_inlineEditMode; }
938 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);
942 bool deleteSection(
const uint);
947 const QString getSectionPageNumberForPageIndex(
const uint)
const;
952 const QChar getSectionPageNumberFillCharForPageIndex(
const uint)
const;
957 int getSectionPageNumberWidthForPageIndex(
const uint)
const;
962 int getSectionKeyForPageIndex(
const uint pageIndex)
const;
967 void updateSectionPageNumbersToPages();
974 void addPageToSection(
const uint otherPageIndex,
const uint location,
const uint count=1);
979 void removePageFromSection(
const uint pageIndex);
983 void setFirstSectionFromFirstPageNumber();
988 QString getSectionNameForPageIndex(
const uint pageIndex)
const;
991 typedef enum {alignFirst, alignLast, alignPage, alignMargins, alignGuide, alignSelection } AlignTo;
992 typedef enum {alignByMoving, alignByResizing } AlignMethod;
993 void buildAlignItemList(
Selection* customSelection=0);
994 bool startAlign(uint minObjects = 1);
1004 void insertColor(QString nam,
double c,
double m,
double y,
double k);
1006 QMap<QString, double>& constants() {
return m_constants; }
1013 PageLocation locationOfPage(
int pageIndex)
const;
1019 int columnOfPage(
int pageIndex)
const;
1022 QList<PageItem*>* GroupOfItem(QList<PageItem*>* itemList,
PageItem* item);
1024 PageItem* groupObjectsList(QList<PageItem*> &itemList);
1025 void groupObjectsToItem(
PageItem* groupItem, QList<PageItem*> &itemList);
1026 PageItem * itemSelection_GroupObjects (
bool changeLock,
bool lock,
Selection* customSelection=0);
1027 void itemSelection_UnGroupObjects(
Selection* customSelection=0);
1029 void removeFromGroup(
PageItem* item);
1030 void rescaleGroup(
PageItem* group,
double scale);
1031 void resizeGroupToContents(
PageItem* group);
1032 void itemSelection_resizeGroupToContents(
Selection *customSelection=0);
1034 void itemSelection_convertItemsToSymbol(QString& patternName);
1035 void itemSelection_ApplyParagraphStyle(
const ParagraphStyle & newstyle,
Selection* customSelection=0,
bool rmDirectFormatting =
false);
1037 void itemSelection_ApplyCharStyle(
const CharStyle & newstyle,
Selection* customSelection=0, QString ETEA =
"");
1038 void itemSelection_SetCharStyle(
const CharStyle & newstyle,
Selection* customSelection=0);
1039 void itemSelection_EraseParagraphStyle(
Selection* customSelection=0);
1040 void itemSelection_EraseCharStyle(
Selection* customSelection=0);
1042 void itemSelection_SetNamedParagraphStyle(
const QString & name,
Selection* customSelection=0);
1043 void itemSelection_SetNamedCharStyle(
const QString & name,
Selection* customSelection=0);
1044 void itemSelection_SetNamedLineStyle(
const QString & name,
Selection* customSelection=0);
1046 void itemSelection_SetSoftShadow(
bool has, QString color,
double dx,
double dy,
double radius,
int shade,
double opac,
int blend,
bool erase,
bool objopa);
1048 void itemSelection_SetLineWidth(
double w);
1049 void itemSelection_SetLineArt(Qt::PenStyle w);
1050 void itemSelection_SetLineJoin(Qt::PenJoinStyle w);
1051 void itemSelection_SetLineEnd(Qt::PenCapStyle w);
1052 void itemSelection_SetAlignment(
int w,
Selection* customSelection=0);
1053 void itemSelection_SetLineSpacing(
double w,
Selection* customSelection=0);
1054 void itemSelection_SetLineSpacingMode(
int w,
Selection* customSelection=0);
1055 void itemSetFont(
const QString& newFont);
1056 void itemSelection_SetFont(QString fon,
Selection* customSelection=0);
1057 void itemSelection_SetFillColor(QString farbe,
Selection* customSelection=0);
1058 void itemSelection_SetFillShade(
int sha,
Selection* customSelection=0);
1059 void itemSelection_SetStrokeColor(QString farbe,
Selection* customSelection=0);
1060 void itemSelection_SetStrokeShade(
int sha,
Selection* customSelection=0);
1061 void itemSelection_SetScaleV(
int,
Selection* customSelection=0);
1062 void itemSelection_SetScaleH(
int,
Selection* customSelection=0);
1063 void itemSelection_SetBaselineOffset(
int,
Selection* customSelection=0);
1064 void itemSelection_SetOutlineWidth(
int,
Selection* customSelection=0);
1065 void itemSelection_SetShadowOffsets(
int shx,
int shy,
Selection* customSelection=0);
1066 void itemSelection_SetUnderline(
int pos,
int wid,
Selection* customSelection=0);
1067 void itemSelection_SetStrikethru(
int pos,
int wid,
Selection* customSelection=0);
1068 void itemSelection_SetEffects(
int s,
Selection* customSelection=0);
1069 void itemSelection_SetOpticalMargins(
int i,
Selection* customSelection=0);
1070 void itemSelection_resetOpticalMargins(
Selection* customSelection=0);
1071 void itemSelection_SetColorProfile(
const QString& profileName,
Selection* customSelection=0);
1072 void itemSelection_SetRenderIntent(
int intentIndex,
Selection* customSelection=0);
1073 void itemSelection_SetCompressionMethod(
int cmIndex,
Selection* customSelection=0);
1074 void itemSelection_SetCompressionQuality(
int cqIndex,
Selection* customSelection=0);
1075 void itemSelection_SetTracking(
int us,
Selection* customSelection=0);
1076 void itemSelection_SetFontSize(
int size,
Selection* customSelection=0);
1077 void MirrorPolyH(
PageItem *currItem);
1078 void MirrorPolyV(
PageItem *currItem);
1079 bool getItem(
PageItem **currItem,
int nr = -1);
1080 void setFrameRect();
1081 void setFrameRounded();
1082 void setFrameOval();
1084 void setRedrawBounding(
PageItem *currItem);
1085 void adjustCanvas(
FPoint minPos,
FPoint maxPos,
bool absolute =
false);
1088 PicResMapped(
bool applyNewRes,
int lowResType) { m_applyNewRes = applyNewRes; m_lowResType = lowResType;}
1092 QList<PageItem*> allItems;
1096 allItems.append(item);
1097 for (
int ii = 0; ii < allItems.count(); ii++)
1099 item = allItems.at(ii);
1105 item->
pixm.imgInfo.lowResType = m_lowResType;
1121 void recalcPicturesRes(
bool applyNewRes =
false);
1122 int previewQuality();
1123 void connectDocSignals();
1124 void disconnectDocSignals();
1125 void removeLayer(
int l,
bool dl =
false);
1136 void setCurrentPage(
ScPage *newPage);
1137 bool hasGUI()
const {
return m_hasGUI;}
1139 QPoint ApplyGrid(
const QPoint& in);
1143 bool hasTOCSetup() {
return !docPrefsData.tocPrefs.defaultToCSetups.empty(); }
1145 void getClosestGuides(
double xin,
double yin,
double *xout,
double *yout,
int *GxM,
int *GyM,
ScPage* refPage = NULL);
1147 void getClosestElementBorder(
double xin,
double yin,
double *xout,
double *yout,
int *GxM,
int *GyM,
ScPage* refPage = NULL);
1149 void SnapToGuides(
PageItem *currItem);
1150 bool ApplyGuides(
double *x,
double *y,
bool elementSnap =
false);
1151 bool ApplyGuides(
FPoint* point,
bool elementSnap =
false);
1152 bool MoveItem(
double newX,
double newY,
PageItem* ite);
1153 void RotateItem(
double win,
PageItem *currItem);
1155 bool SizeItem(
double newX,
double newY,
PageItem *pi,
bool fromMP =
false,
bool DoUpdateClip =
true,
bool redraw =
true);
1156 bool MoveSizeItem(
FPoint newX,
FPoint newY,
PageItem* currItem,
bool fromMP =
false,
bool constrainRotation =
false);
1157 void AdjustItemSize(
PageItem *currItem,
bool includeGroup =
false,
bool moveInGroup =
true);
1158 void moveGroup(
double x,
double y,
Selection* customSelection = 0);
1159 void rotateGroup(
double angle,
Selection* customSelection = 0);
1160 void rotateGroup(
double angle,
FPoint RCenter,
Selection* customSelection = 0);
1161 void scaleGroup(
double scx,
double scy,
bool scaleText=
true,
Selection* customSelection = 0,
bool scaleLine =
false);
1172 void RotMode(
const int& val);
1178 int addToInlineFrames(
PageItem *item);
1179 void removeInlineFrame(
int fIndex);
1180 void checkItemForFrames(
PageItem *it,
int fIndex);
1181 bool hasPreflightErrors();
1182 QFileDevice::Permissions filePermissions() {
return docFilePermissions; }
1183 void saveFilePermissions(QFileDevice::Permissions p) { docFilePermissions=p; }
1187 void applyPrefsPageSizingAndMargins(
bool resizePages,
bool resizeMasterPages,
bool resizePageMargins,
bool resizeMasterPageMargins);
1189 QFileDevice::Permissions docFilePermissions;
1196 double docUnitRatio;
1198 bool automaticTextFrames;
1199 bool m_masterPageMode;
1200 bool m_symbolEditMode;
1201 bool m_inlineEditMode;
1202 int m_storedLayerID;
1203 bool m_storedLayerLock;
1204 bool m_storedLayerVis;
1205 QMap<QString, double> m_constants;
1210 QString currentEditedSymbol;
1211 int currentEditedIFrame;
1227 FPoint maxCanvasCoordinate;
1228 FPoint stored_minCanvasCoordinate;
1229 FPoint stored_maxCanvasCoordinate;
1230 double rulerXoffset;
1231 double rulerYoffset;
1244 QList<PageItem*> MasterItems;
1245 QList<PageItem*> DocItems;
1246 QHash<int, PageItem*> FrameItems;
1247 QList<PageItem*> EditFrameItems;
1262 double *ShapeValues;
1265 QMap<QString,int> UsedFonts;
1267 QList<AlignObjs> AObjects;
1279 QList<PageItem*> DragElements;
1315 eRenderIntent IntentColors;
1316 eRenderIntent IntentImages;
1318 QMap<QString,QString> JavaScripts;
1334 QList<BookMa> BookMarks;
1338 QTimer *
const autoSaveTimer;
1339 QHash<QString,multiLine> MLineStyles;
1340 QHash<QString, ScPattern> docPatterns;
1341 QHash<QString, VGradient> docGradients;
1354 QList<OpenNodesList> OpenNodes;
1356 QMap<int, errorCodes> pageErrors;
1357 QMap<int, errorCodes> docLayerErrors;
1358 QMap<PageItem*, errorCodes> docItemErrors;
1359 QMap<PageItem*, errorCodes> masterItemErrors;
1368 void itemResizeToMargin(
PageItem* item,
int direction);
1387 void saved(QString name);
1388 void updateContents();
1389 void updateContents(
const QRect &r);
1391 void canvasAdjusted(
double width,
double height,
double dX,
double dY);
1392 void firstSelectedItemType(
int);
1393 void setApplicationMode(
int);
1403 void signalRebuildOutLinePalette();
1405 void widthAndHeight(
double,
double);
1408 void rotationMode(
int);
1409 void updateEditItem();
1410 void updateAutoSaveClock();
1413 void changeLayers(
int);
1416 void selectionChanged();
1417 void itemSelection_ToggleLock();
1418 void itemSelection_ToggleSizeLock();
1419 void itemSelection_ToggleImageShown();
1420 void itemSelection_TogglePrintEnabled();
1421 void itemSelection_ToggleBookMark(
Selection* customSelection=0);
1422 void itemSelection_ToggleAnnotation(
Selection* customSelection=0);
1423 void itemSelection_Transform(
int nrOfCopies, QTransform matrix,
int basepoint);
1424 void itemSelection_ChangePreviewResolution(
int id);
1429 void allItems_ChangePreviewResolution(
int id);
1432 void item_setFrameShape(
PageItem* item,
int frameType,
int count,
double* points);
1434 void itemSelection_ClearItem(
Selection* customSelection=0,
bool useWarning=
false);
1435 void itemSelection_TruncateItem(
Selection* customSelection=0);
1437 void itemSelection_DeleteItem(
Selection* customSelection=0,
bool forceDeletion=
false);
1438 void itemSelection_SetItemTextReversed(
bool reversed,
Selection* customSelection=0);
1439 void itemSelection_SetItemFillTransparency(
double t);
1440 void itemSelection_SetItemLineTransparency(
double t);
1441 void itemSelection_SetItemFillBlend(
int t);
1442 void itemSelection_SetItemLineBlend(
int t);
1443 void itemSelection_SetLineGradient(
VGradient& newGradient,
Selection* customSelection=0);
1444 void itemSelection_SetFillGradient(
VGradient& newGradient,
Selection* customSelection=0);
1445 void itemSelection_SetMaskGradient(
VGradient& newGradient,
Selection* customSelection=0);
1446 void itemSelection_SetOverprint(
bool overprint,
Selection* customSelection=0);
1447 void itemSelection_ApplyImageEffects(ScImageEffectList& newEffectList,
Selection* customSelection=0);
1448 void itemSelection_FlipH();
1449 void itemSelection_FlipV();
1450 void itemSelection_Rotate(
double angle,
Selection* customSelection = 0);
1451 void itemSelection_DoHyphenate();
1452 void itemSelection_DoDeHyphenate();
1453 void itemSelection_UnlinkTextFrameWithText(
Selection *customSelection=0,
bool cutText=
false);
1454 void itemSelection_UnlinkTextFrameWithTextCut(
Selection *customSelection=0);
1455 void itemSelection_SendToLayer(
int layerID);
1456 void itemSelection_SetImageOffset(
double x,
double y,
Selection* customSelection=0);
1457 void itemSelection_SetImageScale(
double x,
double y,
Selection* customSelection=0);
1458 void itemSelection_SetImageScaleAndOffset(
double ox,
double oy,
double sx,
double sy,
Selection* customSelection=0);
1459 void itemSelection_SetImageRotation(
double rot,
Selection* customSelection=0);
1460 void itemSelection_AlignItemLeft(
int i,
double newX, AlignMethod how);
1461 void itemSelection_AlignItemRight(
int i,
double newX, AlignMethod how);
1462 void itemSelection_AlignItemTop(
int i,
double newY, AlignMethod how);
1463 void itemSelection_AlignItemBottom(
int i,
double newY, AlignMethod how);
1464 void itemSelection_AlignLeftOut(
AlignTo currAlignTo, AlignMethod currAlignMethod,
double guidePosition);
1465 void itemSelection_AlignRightOut(
AlignTo currAlignTo, AlignMethod currAlignMethod,
double guidePosition);
1466 void itemSelection_AlignBottomIn(
AlignTo currAlignTo, AlignMethod currAlignMethod,
double guidePosition);
1467 void itemSelection_AlignRightIn(
AlignTo currAlignTo, AlignMethod currAlignMethod,
double guidePosition);
1468 void itemSelection_AlignBottomOut(
AlignTo currAlignTo, AlignMethod currAlignMethod,
double guidePosition);
1469 void itemSelection_AlignCenterHor(
AlignTo currAlignTo, AlignMethod currAlignMethod,
double guidePosition);
1470 void itemSelection_AlignLeftIn(
AlignTo currAlignTo, AlignMethod currAlignMethod,
double guidePosition);
1471 void itemSelection_AlignCenterVer(
AlignTo currAlignTo, AlignMethod currAlignMethod,
double guidePosition);
1472 void itemSelection_AlignTopOut(
AlignTo currAlignTo, AlignMethod currAlignMethod,
double guidePosition);
1473 void itemSelection_AlignTopIn(
AlignTo currAlignTo, AlignMethod currAlignMethod,
double guidePosition);
1475 void sendItemSelectionToBack();
1476 void bringItemSelectionToFront();
1477 void itemSelection_LowerItem();
1478 void itemSelection_RaiseItem();
1479 void itemSelection_DistributeDistH(
bool usingDistance=
false,
double distance=0.0,
bool reverseDistribute=
false);
1480 void itemSelection_DistributeAcrossPage(
bool useMargins=
false);
1481 void itemSelection_DistributeRight();
1482 void itemSelection_DistributeBottom();
1483 void itemSelection_DistributeCenterH();
1484 void itemSelection_DistributeDistV(
bool usingDistance=
false,
double distance=0.0,
bool reverseDistribute=
false);
1485 void itemSelection_DistributeDownPage(
bool useMargins=
false);
1486 void itemSelection_DistributeLeft();
1487 void itemSelection_DistributeCenterV();
1488 void itemSelection_DistributeTop();
1489 void itemSelection_SwapLeft();
1490 void itemSelection_SwapRight();
1492 void itemSelection_UniteItems(
Selection* customSelection=0);
1493 void itemSelection_SplitItems(
Selection* customSelection=0);
1497 void itemSelection_AdjustFrametoImageSize(
Selection* customSelection=0);
1501 void itemSelection_AdjustImagetoFrameSize(
Selection* customSelection=0);
1502 void itemSelection_AdjustFrameHeightToText(
Selection *customSelection=0);
1504 void itemSelection_ApplyArrowHead(
int startArrowID=-1,
int endArrowID=-1,
Selection* customSelection=0);
1505 void itemSelection_ApplyArrowScale(
int startArrowSc,
int endArrowSc,
Selection* customSelection);
1507 void itemSelection_SetItemPen(QString farbe);
1508 void itemSelection_SetItemPenShade(
int sha);
1509 void itemSelection_SetItemGradStroke(
int typ);
1510 void itemSelection_SetItemBrush(QString farbe);
1511 void itemSelection_SetItemBrushShade(
int sha);
1512 void itemSelection_SetItemGradMask(
int typ);
1513 void itemSelection_SetItemGradFill(
int typ);
1514 void itemSelection_SetItemPatternFill(QString pattern);
1515 void itemSelection_SetItemPatternProps(
double scaleX,
double scaleY,
double offsetX,
double offsetY,
double rotation,
double skewX,
double skewY,
bool mirrorX,
bool mirrorY);
1516 void itemSelection_SetItemStrokePattern(QString pattern);
1517 void itemSelection_SetItemStrokePatternProps(
double scaleX,
double scaleY,
double offsetX,
double offsetY,
double rotation,
double skewX,
double skewY,
double space,
bool mirrorX,
bool mirrorY);
1518 void itemSelection_SetItemStrokePatternType(
bool type);
1519 void itemSelection_SetItemPatternMask(QString pattern);
1520 void itemSelection_SetItemPatternMaskProps(
double scaleX,
double scaleY,
double offsetX,
double offsetY,
double rotation,
double skewX,
double skewY,
bool mirrorX,
bool mirrorY);
1534 void itemSelection_InsertTableRows();
1546 void itemSelection_InsertTableColumns();
1557 void itemSelection_DeleteTableRows();
1568 void itemSelection_DeleteTableColumns();
1578 void itemSelection_MergeTableCells();
1597 void itemSelection_SetTableRowHeights();
1609 void itemSelection_SetTableColumnWidths();
1619 void itemSelection_DistributeTableRowsEvenly();
1629 void itemSelection_DistributeTableColumnsEvenly();
1636 void itemSelection_AdjustFrameToTable();
1643 void itemSelection_AdjustTableToFrame();
1645 void undoRedoBegin();
1646 void undoRedoDone();
1649 void updatePict(QString name);
1650 void updatePictDir(QString name);
1651 void removePict(QString name);
1667 QList<Mark*> m_docMarksList;
1668 QList<TextNote*> m_docNotesList;
1670 bool flag_notesChanged;
1673 const QList<Mark*> marksList() {
return m_docMarksList; }
1674 const QList<TextNote*> notesList() {
return m_docNotesList; }
1675 QList<NotesStyle*> m_docNotesStylesList;
1676 QMap<PageItem_NoteFrame*, rangeItem> m_docEndNotesFramesMap;
1677 QList<NotesStyle*> ns2Update;
1680 QList<PageItem_NoteFrame*> listNotesFrames(
NotesStyle* NS);
1683 bool notesChanged() {
return flag_notesChanged; }
1684 void setNotesChanged(
bool on) { flag_notesChanged = on; }
1685 bool flag_restartMarksRenumbering;
1686 bool flag_updateMarksLabels;
1687 bool flag_updateEndNotes;
1688 bool flag_layoutNotesFrames;
1691 QStringList marksLabelsList(MarkType type);
1694 Mark* getMark(QString label, MarkType type);
1698 bool isMarkUsed(
Mark* mrk,
bool visible =
false);
1700 void setCursor2MarkPos(
Mark* mark);
1702 bool eraseMark(
Mark* mrk,
bool fromText=
false,
PageItem* item=NULL,
bool force =
false);
1703 void setUndoDelMark(
Mark* mrk);
1707 bool invalidateVariableTextFrames(
Mark* mrk,
bool forceUpdate =
false);
1711 void renameNotesStyle(
NotesStyle* NS, QString newName);
1713 void deleteNotesStyle(QString nsName);
1718 void setUndoDelNote(
TextNote* note);
1720 PageItem_NoteFrame* createNoteFrame(
NotesStyle *nStyle,
double x,
double y,
double w,
double h,
double w2, QString fill, QString outline);
1722 void delNoteFrame(
PageItem_NoteFrame *nF,
bool removeMarks=
true,
bool forceDeletion =
true);
1727 void updateNotesFramesStyles(
NotesStyle* nStyle);
1729 bool validateNSet(
NotesStyle NS, QString newName =
"");
1731 bool notesFramesUpdate();
1733 void updateNotesFramesSettings(
NotesStyle* NS);
1739 void setEndNoteFrame(
PageItem_NoteFrame* nF,
int section) {
rangeItem rI; rI.sectionIndex = section; m_docEndNotesFramesMap.insert(nF, rI); }
1741 void updateEndnotesFrames(
NotesStyle* nStyle = NULL,
bool invalidate =
false);
1745 void endNoteFrameChanged(
PageItem_NoteFrame* nF) { m_docEndNotesFramesChanged.append(nF); }
1747 void updateChangedEndNotesFrames();
1751 int findMarkCPos(
Mark* mrk,
PageItem* &item,
int Start = 0);
1752 QList<PageItem_NoteFrame*> m_docEndNotesFramesChanged;
1759 NotesInFrameMap m_docNotesInFrameMap;
1761 PageItem* findFirstMarkItem(
Mark* mrk) {
int tmp = -1;
return findMarkItem(mrk, tmp); }
1767 void clearNotesInFrameList(
PageItem_NoteFrame* nF) { m_docNotesInFrameMap.insert(nF, QList<TextNote*>()); }
1774 bool updateEndNotesNums();
1775 void invalidateNoteFrames(
NotesStyle* nStyle);
1776 void invalidateMasterFrames(
NotesStyle* nStyle);
1780 bool updateMarks(
bool updateNotesMarks =
false);
1784 void itemSelection_UnWeld();
1785 void itemSelection_Weld();
1786 void itemSelection_EditWeld();
1787 void restartAutoSaveTimer();
1790 void slotAutoSave();
1794 QMap<QString, NumStruct*> numerations;
1795 QStringList orgNumNames;
1796 void setupNumerations();
1797 QString getNumberStr(QString numName,
int level,
bool reset,
ParagraphStyle &style);
1798 void setNumerationCounter(QString numName,
int level,
int number);
1800 bool flag_NumUpdateRequest;
1802 bool updateLocalNums(
StoryText& itemText);
1803 void updateNumbers(
bool updateNumerations =
false);
1804 void itemSelection_ClearBulNumStrings(
Selection *customSelection);
1810 void ResetFormFields();
Definition: prefsstructs.h:453
Definition: pageitem_noteframe.h:8
Definition: storytext.h:71
Definition: prefsstructs.h:177
Definition: charstyle.h:78
Definition: undotransaction.h:45
Definition: tablestyle.h:30
QList< ScPage * > MasterPages
List of Master Pages.
Definition: scribusdoc.h:1235
Definition: prefsstructs.h:29
Pagemargins and bleeds.
Definition: margins.h:25
QList< ScPage * > * Pages
List of Pages.
Definition: scribusdoc.h:1233
FPoint minCanvasCoordinate
Minimum and Maximum Points of Document.
Definition: scribusdoc.h:1226
Definition: scribusdoc.cpp:124
Definition: pageitem_textframe.h:45
Definition: sccolorprofile.h:16
Definition: usertaskstructs.h:15
const CellStyle & cellStyle(QString name)
Definition: scribusdoc.h:552
Definition: pagestructs.h:15
Definition: hyphenator.h:26
Definition: prefsstructs.h:70
bool hasTOCSetup()
Does this doc have any TOC setups and potentially a TOC to generate.
Definition: scribusdoc.h:1143
double PageSp
Number of Columns.
Definition: scribusdoc.h:1251
void setImageFlippedH(bool flipped)
Horizontally flip / unflip the image.
Definition: pageitem.cpp:4527
bool isDefaultStyle(const CellStyle &style) const
Definition: scribusdoc.h:560
UndoState describes an undoable state (action).
Definition: undostate.h:59
This Class is the base class for your application. It sets up the main window and providing a menubar...
Definition: scribus.h:123
void setImageFlippedV(bool flipped)
Vertically flip / unflip the image.
Definition: pageitem.cpp:4544
Definition: scribusstructs.h:90
QList< PageItem * > * Items
List of Objects.
Definition: scribusdoc.h:1243
Definition: scpattern.h:36
double PageSpa
Distance of Columns.
Definition: scribusdoc.h:1253
Definition: notesstyles.h:28
Definition: vgradient.h:78
const StyleSet< TableStyle > & tableStyles()
Definition: scribusdoc.h:531
Definition: paragraphstyle.h:27
Definition: nodeeditcontext.h:39
bool imageFlippedV() const
Is the image flipped vertically?
Definition: pageitem.h:987
Definition: sccolor.h:155
Definition: scribusstructs.h:75
Definition: pagestructs.h:30
A point with floating point precision.
Definition: fpoint.h:43
the Document Class
Definition: scribusdoc.h:90
Definition: cellstyle.h:32
QList< ScPage * > TempPages
List for temporary Pages.
Definition: scribusdoc.h:1239
Definition: usertaskstructs.h:35
ItemFrameType
Frame Type.
Definition: pageitem.h:208
Definition: scribusstructs.h:213
Definition: pagesize.h:40
Definition: observable.h:206
QString Pfile
Dateiname des Bildes.
Definition: pageitem.h:1278
virtual PageItem_LatexFrame * asLatexFrame()
Return self if Render frame item, otherwise null.
Definition: pageitem.h:226
bool loadImage(const QString &filename, const bool reload, const int gsResolution=-1, bool showMsg=false)
Load an image into an image frame, moved from ScribusView.
Definition: pageitem.cpp:9399
bool imageFlippedH() const
Is the image flipped horizontally?
Definition: pageitem.h:980
Definition: scribusdoc.h:1086
QList< ScPage * > DocPages
List of Document Pages.
Definition: scribusdoc.h:1237
Definition: scribusdoc.h:1348
Definition: prefsstructs.h:330
ColorList PageColors
Im Dokument benutzte Farben.
Definition: scribusdoc.h:1259
Superclass for all objects that are wanted to have undoable actions.
Definition: undoobject.h:59
Coord distance(Point const &a, Point const &b)
Definition: point.h:205
Definition: sccolormgmtengine.h:16
PDF Options struture. Capable of verifying its self, but otherwise largely a dumb struct...
Definition: pdfoptions.h:37
AlignTo
Some internal align tools.
Definition: scribusdoc.h:991
bool imageIsAvailable
Flag to hiold image file availability.
Definition: pageitem.h:1289
QMap< QString, int > MasterNames
Mapping Master Page Name to Master Page numbers.
Definition: scribusdoc.h:1241
const StyleSet< CellStyle > & cellStyles()
Definition: scribusdoc.h:556
void AdjustPictScale()
Adjust the picture scale, moved from the view, no view code here FIXME: Move to PageItem_TextFrame.
Definition: pageitem.cpp:9825
Definition: scribusdoc.h:575
Definition: serializer.h:49
void itemSelection_SplitTableCells()
Definition: scribusdoc.h:1585
virtual PageItem_Group * asGroupFrame()
Return self if Group item, otherwise null.
Definition: pageitem.h:224
Definition: scribusstructs.h:164
ItemType
Item Type.
Definition: pageitem.h:174
Definition: pageitem.h:92
bool isDefaultStyle(const TableStyle &style) const
Definition: scribusdoc.h:535
int RotMode() const
Get rotation mode.
Definition: scribusdoc.h:1170
UndoManager handles the undo stack.
Definition: undomanager.h:81
PageItem * LastAuto
Letztes Element fuer AutoTextrahmen.
Definition: scribusdoc.h:1272
Definition: scribusdoc.h:1322
Definition: fpointarray.h:42
Definition: notesstyles.h:20
virtual bool isGroup() const
Return true if Group item, otherwise false.
Definition: pageitem.h:241
Definition: updatemanager.h:66
const TableStyle & tableStyle(QString name)
Definition: scribusdoc.h:527
Definition: resourcecollection.h:41
PageItem * FirstAuto
Erstes Element fuer AutoTextrahmen.
Definition: scribusdoc.h:1274
Definition: scribusview.h:87
Main class SCFonts. Subclass of QDict. This class replaces the previous SCFonts typedef...
Definition: scfonts.h:36
Definition: scribusstructs.h:102
Definition: notesstyles.h:91
ScImage pixm
Darzustellendes Bild.
Definition: pageitem.h:1277
SimpleState provides a simple implementation of the UndoState.
Definition: undostate.h:145
int FirstPnum
current Pagelayout
Definition: scribusdoc.h:1257
virtual void restore(UndoState *state, bool isUndo)=0
Method used when an undo/redo is requested.
Definition: selection.h:34