Subversion Repositories Scribus

Rev

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

Rev Author Line No. Line
4430 cbradney 1
/*
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
6
*/
3 paul 7
/***************************************************************************
8
                          pageitem.h  -  description
9
                             -------------------
10
    begin                : Sat Apr 7 2001
11
    copyright            : (C) 2001 by Franz Schmid
12
    email                : Franz.Schmid@altmuehlnet.de
13
 ***************************************************************************/
14
 
15
/***************************************************************************
16
 *                                                                         *
17
 *   This program is free software; you can redistribute it and/or modify  *
18
 *   it under the terms of the GNU General Public License as published by  *
19
 *   the Free Software Foundation; either version 2 of the License, or     *
20
 *   (at your option) any later version.                                   *
21
 *                                                                         *
22
 ***************************************************************************/
23
 
24
#ifndef PAGEITEM_H
25
#define PAGEITEM_H
26
 
27
#include <qobject.h>
28
#include <qwidget.h>
29
#include <qpointarray.h>
30
#include <qptrlist.h>
31
#include <qpixmap.h>
32
#include <qvaluestack.h>
33
#include <qvaluelist.h>
2969 craig 34
 
35
#include "scribusapi.h"
68 Franz 36
#include "scpainter.h"
1204 tsoots 37
#include "undoobject.h"
2004 fschmid 38
#include "scimage.h"
1644 cbradney 39
#include "pagestructs.h"
4084 cbradney 40
#include "annotation.h"
4129 cbradney 41
#include "sctextstruct.h"
4670 avox 42
#include "text/storytext.h"
43
 
838 cbradney 44
class ScribusDoc;
1204 tsoots 45
class UndoManager;
46
class UndoState;
1789 fschmid 47
class Foi;
3618 avox 48
 
3985 cbradney 49
class PageItem_ImageFrame;
50
class PageItem_Line;
3618 avox 51
class PageItem_Polygon;
52
class PageItem_PolyLine;
53
class PageItem_TextFrame;
3939 cbradney 54
class PageItem_PathText;
3618 avox 55
 
3030 cbradney 56
struct CopyPasteBuffer;
3 paul 57
/**
58
  *@author Franz Schmid
59
  */
1489 tsoots 60
 
2969 craig 61
class SCRIBUS_API PageItem : public QObject, public UndoObject
270 Franz 62
{
63
        Q_OBJECT
1394 cbradney 64
 
1364 tsoots 65
        // Properties - see http://doc.trolltech.com/3.3/properties.html
4061 craig 66
        // See the accessors of these properties for details on their use.
1364 tsoots 67
        Q_PROPERTY(QString itemName READ itemName WRITE setItemName DESIGNABLE false)
1381 cbradney 68
        Q_PROPERTY(QString fillColor READ fillColor WRITE setFillColor DESIGNABLE false)
1394 cbradney 69
        Q_PROPERTY(QString lineColor READ lineColor WRITE setLineColor DESIGNABLE false)
1381 cbradney 70
        Q_PROPERTY(int fillShade READ fillShade WRITE setFillShade DESIGNABLE false)
1394 cbradney 71
        Q_PROPERTY(int lineShade READ lineShade WRITE setLineShade DESIGNABLE false)
1381 cbradney 72
        Q_PROPERTY(double fillTransparency READ fillTransparency WRITE setFillTransparency DESIGNABLE false)
73
        Q_PROPERTY(double lineTransparency READ lineTransparency WRITE setLineTransparency DESIGNABLE false)
74
        Q_PROPERTY(bool locked READ locked WRITE setLocked DESIGNABLE false)
75
        Q_PROPERTY(bool sizeLocked READ sizeLocked WRITE setSizeLocked DESIGNABLE false)
1392 cbradney 76
        Q_PROPERTY(bool imageFlippedV READ imageFlippedV WRITE setImageFlippedV DESIGNABLE false)
77
        Q_PROPERTY(bool imageFlippedH READ imageFlippedH WRITE setImageFlippedH DESIGNABLE false)
1394 cbradney 78
        Q_PROPERTY(double lineWidth READ lineWidth WRITE setLineWidth DESIGNABLE false)
79
        Q_PROPERTY(QString customLineStyle READ customLineStyle WRITE setCustomLineStyle DESIGNABLE false)
4061 craig 80
        Q_PROPERTY(int startArrowIndex READ startArrowIndex WRITE setStartArrowIndex DESIGNABLE false)
81
        Q_PROPERTY(int endArrowIndex READ endArrowIndex WRITE setEndArrowIndex DESIGNABLE false)
1422 tsoots 82
        Q_PROPERTY(QString font READ font WRITE setFont DESIGNABLE false)
83
        Q_PROPERTY(int fontSize READ fontSize WRITE setFontSize DESIGNABLE false)
84
        Q_PROPERTY(int fontWidth READ fontWidth WRITE setFontWidth DESIGNABLE false)
85
        Q_PROPERTY(QString fontFillColor READ fontFillColor WRITE setFontFillColor DESIGNABLE false)
86
        Q_PROPERTY(int fontFillShade READ fontFillShade WRITE setFontFillShade DESIGNABLE false)
87
        Q_PROPERTY(QString fontStrokeColor READ fontStrokeColor WRITE setFontStrokeColor DESIGNABLE false)
88
        Q_PROPERTY(int fontStrokeShade READ fontStrokeShade WRITE setFontStrokeShade DESIGNABLE false)
89
        Q_PROPERTY(int fontEffects READ fontEffects WRITE setFontEffects DESIGNABLE false)
2436 craig 90
        Q_PROPERTY(int kerning READ kerning WRITE setKerning  DESIGNABLE false)
1422 tsoots 91
        Q_PROPERTY(double lineSpacing READ lineSpacing WRITE setLineSpacing DESIGNABLE false)
92
        Q_PROPERTY(QString language READ language WRITE setLanguage DESIGNABLE false)
1651 craig 93
        Q_PROPERTY(bool textFlowsAroundFrame READ textFlowsAroundFrame WRITE setTextFlowsAroundFrame DESIGNABLE false)
1653 craig 94
        Q_PROPERTY(bool textFlowUsesBoundingBox READ textFlowUsesBoundingBox WRITE setTextFlowUsesBoundingBox DESIGNABLE false)
2449 cbradney 95
        Q_PROPERTY(bool isPrintable READ printable WRITE setPrintable DESIGNABLE false)
4061 craig 96
        Q_PROPERTY(double xPos READ xPos WRITE setXPos DESIGNABLE false)
97
        Q_PROPERTY(double yPos READ yPos WRITE setYPos DESIGNABLE false)
98
        Q_PROPERTY(double width READ width WRITE setWidth DESIGNABLE false)
99
        Q_PROPERTY(double height READ height WRITE setHeight DESIGNABLE false)
100
        Q_PROPERTY(double rotation READ rotation WRITE setRotation DESIGNABLE false)
101
        Q_PROPERTY(double imageXScale READ imageXScale WRITE setImageXScale DESIGNABLE false)
102
        Q_PROPERTY(double imageYScale READ imageYScale WRITE setImageYScale DESIGNABLE false)
103
        Q_PROPERTY(double imageXOffset READ imageXOffset WRITE setImageXOffset DESIGNABLE false)
104
        Q_PROPERTY(double imageYOffset READ imageYOffset WRITE setImageYOffset DESIGNABLE false)
105
        Q_PROPERTY(bool reversed READ reversed WRITE setReversed DESIGNABLE false)
106
        Q_PROPERTY(double cornerRadius READ cornerRadius WRITE setCornerRadius DESIGNABLE false)
107
        Q_PROPERTY(double textToFrameDistLeft READ textToFrameDistLeft WRITE setTextToFrameDistLeft DESIGNABLE false)
108
        Q_PROPERTY(double textToFrameDistRight READ textToFrameDistRight WRITE setTextToFrameDistRight DESIGNABLE false)
109
        Q_PROPERTY(double textToFrameDistTop READ textToFrameDistTop WRITE setTextToFrameDistTop DESIGNABLE false)
110
        Q_PROPERTY(double textToFrameDistBottom READ textToFrameDistBottom WRITE setTextToFrameDistBottom DESIGNABLE false)
2707 subik 111
 
1422 tsoots 112
        // FIXME: QMetaProperty can't translate these to/from enumerator names, probably because the
113
        // properties aren't moc'd in the Qt sources. They work fine in their
114
        // current state as plain integer properties.
1394 cbradney 115
        Q_ENUMS(PenStyle)
116
        Q_PROPERTY(PenStyle lineStyle READ lineStyle WRITE setLineStyle DESIGNABLE false)
117
        Q_ENUMS(PenCapStyle)
118
        Q_PROPERTY(PenCapStyle lineEnd READ lineEnd WRITE setLineEnd DESIGNABLE false)
119
        Q_ENUMS(PenJoinStyle)
120
        Q_PROPERTY(PenJoinStyle lineJoin READ lineJoin WRITE setLineJoin DESIGNABLE false)
121
 
1422 tsoots 122
        // This property may not hang around for too long, but should be useful
123
        // when testing out the pageitem refactoring work.  Setting it is unlikely
124
        // to currently have the desired effect.
125
        /**
3232 cbradney 126
         * @brief Item type.
1422 tsoots 127
         * @warning Do not set this property except for testing and debug purposes.
128
         */
1460 cbradney 129
        Q_ENUMS(ItemType)
130
        Q_PROPERTY(ItemType itemType READ itemType WRITE convertTo DESIGNABLE false)
1422 tsoots 131
 
1460 cbradney 132
public:
133
        // Enumerator definitions
1489 tsoots 134
 
3232 cbradney 135
        /** @brief Item Type
1460 cbradney 136
         *
3618 avox 137
         * Soon, item type will probably go away in favour of using
1460 cbradney 138
         * subclasses and checking types using more conventional methods
139
         * and using Qt's MetaObject introspection.
140
         */
141
        enum ItemType {
3232 cbradney 142
                ItemType1       = 1,
1460 cbradney 143
                ImageFrame      = 2,
3232 cbradney 144
                ItemType3       = 3,
1460 cbradney 145
                TextFrame       = 4,
146
                Line            = 5,
147
                Polygon         = 6,
148
                PolyLine        = 7,
149
                PathText        = 8
150
        };
3618 avox 151
 
152
        /* these do essentially the same as a dynamic cast but might be more readable */
153
        virtual PageItem_ImageFrame * asImageFrame() { return NULL; }
154
        virtual PageItem_Line * asLine() { return NULL; }
155
        virtual PageItem_PathText * asPathText() { return NULL; }
156
        virtual PageItem_Polygon * asPolygon() { return NULL; }
157
        virtual PageItem_PolyLine * asPolyLine() { return NULL; }
158
        virtual PageItem_TextFrame * asTextFrame() { return NULL; }
159
 
160
 
3232 cbradney 161
        /** @brief Frame Type
162
         *
163
         *
164
         */
3233 cbradney 165
        enum ItemFrameType {
166
                Unspecified =-1,
167
                Rectangle       = 0,
3232 cbradney 168
                Ellipse         = 1,
3233 cbradney 169
                Round           = 2,
170
                Other           = 3
3232 cbradney 171
        };
1460 cbradney 172
 
2282 fschmid 173
struct TabRecord
174
{
175
        double tabPosition;
176
        int tabType;
177
        QChar tabFillChar;
178
};
1460 cbradney 179
 
3625 avox 180
protected:
181
        PageItem(const PageItem & other);
182
 
183
public:
1460 cbradney 184
        PageItem(ScribusDoc *pa, ItemType newType, double x, double y, double w, double h, double w2, QString fill, QString outline);
3 paul 185
        ~PageItem() {};
1489 tsoots 186
        struct ZZ {
168 Franz 187
                                double xco;
188
                                double yco;
268 Franz 189
                                double wide;
190
                                double kern;
168 Franz 191
                                int Siz;
2185 fschmid 192
                                int realSiz;
168 Franz 193
                                int Style;
194
                                int scale;
2230 fschmid 195
                                int scalev;
268 Franz 196
                                int shade;
197
                                int shade2;
2247 fschmid 198
                                int shadowX;
199
                                int shadowY;
2257 fschmid 200
                                int outline;
2234 fschmid 201
                                int base;
2262 fschmid 202
                                int underpos;
203
                                int underwidth;
2272 fschmid 204
                                int strikepos;
205
                                int strikewidth;
268 Franz 206
                                bool Sele;
207
                                QString Zeich;
208
                                QString Farb;
209
                                QString Farb2;
1789 fschmid 210
                                Foi* ZFo;
2434 fschmid 211
                                PageItem* embedded;
3627 cbradney 212
                        };
213
        /**
214
         * @brief Clear the contents of a frame.
215
         * WARNING: Currently *they* do not check if the user wants this.
216
         * The view does when these are called.
217
         */    
218
        virtual void clearContents() {};
3651 cbradney 219
 
220
        /**
221
         * @brief Adjust the picture scale, moved from the view, no view code here
222
         * FIXME: Move to PageItem_TextFrame
223
         */
224
        void AdjustPictScale();
3656 cbradney 225
 
226
        /**
227
         * @brief Set or get the redraw bounding box of the item, moved from the View
228
         */
229
        QRect getRedrawBounding(const double);
230
        void setRedrawBounding();
3627 cbradney 231
 
3657 cbradney 232
        /**
233
         * @brief Update the gradient vectors, moved from the View
234
         */            
235
        void updateGradientVectors();
4593 cbradney 236
        /**
237
         * @brief Move the image within the frame
238
         * Old ScribusView::MoveItemI
239
         * @todo Move to PageItem_ImageFrame
240
         */
241
        void moveImageInFrame(double newX, double newY);
1460 cbradney 242
 
1649 cbradney 243
        ObjAttrVector* getObjectAttributes();
1676 cbradney 244
        /*!
245
         * brief Returns a complete ObjectAttribute struct if 1 is found, or ObjectAttribute.name will be QString::null if 0 or >1 are found
246
         */
247
        ObjectAttribute getObjectAttribute(QString);
1649 cbradney 248
        void setObjectAttributes(ObjAttrVector*);
3 paul 249
  /** Zeichnet das Item */
168 Franz 250
        void paintObj(QRect e=QRect(), QPixmap *ppX = 0);
251
        void DrawObj(ScPainter *p, QRect e);
2434 fschmid 252
        void DrawObj_Pre(ScPainter *p, double &sc);
4142 cbradney 253
        virtual void DrawObj_Post(ScPainter *p);
3617 cbradney 254
        virtual void DrawObj_Item(ScPainter *p);
255
        virtual void DrawObj_Item(ScPainter *p, double sc);
256
        virtual void DrawObj_Item(ScPainter *p, QRect e, double sc);
2434 fschmid 257
        void DrawObj_ImageFrame(ScPainter *p, double sc);
3617 cbradney 258
        //void DrawObj_TextFrame(ScPainter *p, QRect e, double sc);
259
        //void DrawObj_Line(ScPainter *p);
2434 fschmid 260
        void DrawObj_Polygon(ScPainter *p);
261
        void DrawObj_PolyLine(ScPainter *p);
262
        void DrawObj_PathText(ScPainter *p, double sc);
263
        void DrawObj_Embedded(ScPainter *p, QRect e, struct ZZ *hl);
3242 cbradney 264
 
265
        void SetFrameShape(int count, double *vals);
266
        void SetRectFrame();
267
        void SetOvalFrame();
268
        void SetFrameRound();
3680 cbradney 269
        void SetPolyClip(int up);
270
        void UpdatePolyClip();
3242 cbradney 271
        //QRect getRedrawBounding(const double);
272
        //void setRedrawBounding();
273
        void getBoundingRect(double *x1, double *y1, double *x2, double *y2);
4019 cbradney 274
        /**
275
         * @brief Check if a QPoint is within the items boundaries
4476 cbradney 276
         * No coordinates transformation is performed
4645 subik 277
         * @param x X position
278
                @param y Y position
279
         * @return bool true if x, i in the item
4019 cbradney 280
         */
281
        bool pointWithinItem(const int x, const int y);
4476 cbradney 282
        /**
283
         * @brief Check if the mouse is within the items boundaries
284
         * This method performs necessary page to device transformations
4645 subik 285
         * @param vport a view port
286
                @param x X position
287
                @param y Y position
288
                @param scale scale of the vport
289
         * @return bool true if the x, y is in the bounds
4476 cbradney 290
         */
291
        bool mouseWithinItem(QWidget* vport, const int x, const int y, double scale);
3030 cbradney 292
        void copyToCopyPasteBuffer(struct CopyPasteBuffer *Buffer);
3242 cbradney 293
 
3829 cbradney 294
        virtual void handleModeEditKey(QKeyEvent *k, bool &keyRepeat);
3680 cbradney 295
 
296
 
1065 cbradney 297
        double SetZeichAttr(struct ScText *hl, int *chs, QString *chx);
3 paul 298
        void SetFarbe(QColor *tmp, QString farbe, int shad);
68 Franz 299
        void DrawZeichenS(ScPainter *p, struct ZZ *hl);
3 paul 300
        void DrawPolyL(QPainter *p, QPointArray pts);
301
        QString ExpandToken(uint base);
4084 cbradney 302
 
303
        bool AutoName; 
2955 fschmid 304
        double gXpos;
305
        double gYpos;
306
        double gWidth;
307
        double gHeight;
3 paul 308
        int GrType;
292 Franz 309
        double GrStartX;
310
        double GrStartY;
311
        double GrEndX;
312
        double GrEndY;
68 Franz 313
        QString TxtStroke;
314
        QString TxtFill;
315
        int ShTxtStroke;
316
        int ShTxtFill;
317
        int TxtScale;
2230 fschmid 318
        int TxtScaleV;
68 Franz 319
        int TxTStyle;
2234 fschmid 320
        int TxtBase;
2247 fschmid 321
        int TxtShadowX;
322
        int TxtShadowY;
2257 fschmid 323
        int TxtOutline;
2262 fschmid 324
        int TxtUnderPos;
325
        int TxtUnderWidth;
2272 fschmid 326
        int TxtStrikePos;
327
        int TxtStrikeWidth;
134 Franz 328
        int Cols;
135 Franz 329
        double ColGap;
3 paul 330
  /** Linienart */
168 Franz 331
        PenStyle PLineArt;
332
        PenCapStyle PLineEnd;
333
        PenJoinStyle PLineJoin;
27 Franz 334
        QString NamedLStyle;
3 paul 335
  /** Definiert die Clipping-Region des Elements; */
168 Franz 336
        QPointArray Clip;
3 paul 337
        FPointArray PoLine;
340 Franz 338
        FPointArray ContourLine;
2040 fschmid 339
        FPointArray imageClip;
3 paul 340
        QValueList<uint> Segments;
2074 fschmid 341
        QValueList<ScImage::imageEffect> effectsInUse;
3 paul 342
        bool PoShow;
80 Franz 343
        double BaseOffs;
168 Franz 344
        bool ClipEdited;
1460 cbradney 345
        // Don't know exactly what this is, but it's not the same as itemType
168 Franz 346
        int FrameType;
3 paul 347
  /** Interne Item-Nummer */
168 Franz 348
        uint ItemNr;
3 paul 349
  /** Hat Element Rahmen? */
168 Franz 350
        bool Frame;
3 paul 351
  /** Seite zu der das Element gehoert */
456 fschmid 352
        int OwnPage;
1211 tsoots 353
        /** @brief Old page number tracked for the move undo action */
354
        int oldOwnPage;
4401 fschmid 355
        int savedOwnPage;
3 paul 356
  /** Darzustellendes Bild */
2004 fschmid 357
        ScImage pixm;
3 paul 358
  /** Dateiname des Bildes */
168 Franz 359
        QString Pfile;
360
        QString Pfile2;
361
        QString Pfile3;
362
        QString IProfile;
363
        bool UseEmbedded;
364
        QString EmProfile;
365
        int IRender;
3 paul 366
  /** Bild verfuegbar */
168 Franz 367
        bool PicAvail;
3 paul 368
        int OrigW;
369
        int OrigH;
370
  /** BoundigBox-X */
168 Franz 371
        double BBoxX;
3 paul 372
  /** BoundingBox-H */
168 Franz 373
        double BBoxH;
3 paul 374
  /** Zeichen X-Position */
168 Franz 375
        double CurX;
3 paul 376
  /** Zeichen Y-Position */
168 Franz 377
        double CurY;
3 paul 378
  /** Cursorposition */
168 Franz 379
        int CPos;
3 paul 380
  /** Text des Elements */
4670 avox 381
        StoryText itemText;
3 paul 382
  /** Flag fuer PDF-Bookmark */
168 Franz 383
        bool isBookmark;
3 paul 384
  /** Flag fuer neuzeichnen im EditMode */
168 Franz 385
        bool Dirty;
3 paul 386
  /** Flag fuer Auswahl */
168 Franz 387
        bool HasSel;
3 paul 388
  /** Flag fuer Textfluss */
168 Franz 389
        bool FrameOnly;
390
        PageItem *BackBox;
391
        PageItem *NextBox;
392
        int NextIt;
393
        int NextPg;
394
        bool Tinput;
395
        bool isAutoText;
1065 cbradney 396
        int textAlignment;
168 Franz 397
        uint MaxChars;
398
        bool Redrawn;
2382 fschmid 399
        int ExtraV;
168 Franz 400
        bool isRaster;
401
        double OldB;
402
        double OldH;
403
        double OldB2;
404
        double OldH2;
405
        bool Sizing;
406
        bool toPixmap;
3 paul 407
        int LayerNr;
408
        bool ScaleType;
409
        bool AspectRatio;
168 Franz 410
        QValueStack<int> Groups;
80 Franz 411
        QValueList<double> DashValues;
2282 fschmid 412
        QValueList<TabRecord> TabValues;
80 Franz 413
        double DashOffset;
68 Franz 414
        VGradient fill_gradient;
1905 fschmid 415
        bool fillRule;
68 Franz 416
        QString Language;
232 Franz 417
/* Additions for Table Support */
418
        PageItem* LeftLink;
419
        PageItem* RightLink;
420
        PageItem* TopLink;
421
        PageItem* BottomLink;
234 Franz 422
        int LeftLinkID;
423
        int RightLinkID;
424
        int TopLinkID;
425
        int BottomLinkID;
232 Franz 426
        bool LeftLine;
427
        bool RightLine;
428
        bool TopLine;
429
        bool BottomLine;
430
        bool isTableItem;
431
        bool isSingleSel;
456 fschmid 432
        double BoundingX;
433
        double BoundingY;
434
        double BoundingW;
435
        double BoundingH;
436
        bool ChangedMasterItem;
537 fschmid 437
        QString OnMasterPage;
2434 fschmid 438
        bool isEmbedded;
3903 cbradney 439
 
3934 cbradney 440
        //Position
4061 craig 441
        double xPos() const { return Xpos; }
442
        double yPos() const { return Ypos; }
443
        FPoint xyPos() const { return FPoint(Xpos, Ypos); }
4644 cbradney 444
        void setXPos(const double, bool drawingOnly=false);
445
        void setYPos(const double, bool drawingOnly=false);
446
        void setXYPos(const double, const double, bool drawingOnly=false);
447
        void moveBy(const double, const double, bool drawingOnly=false);
3934 cbradney 448
        //Size
4061 craig 449
        double width() const { return Width; }
450
        double height() const { return Height; }
3934 cbradney 451
        void setWidth(const double);
452
        void setHeight(const double);
453
        void setWidthHeight(const double, const double);
454
        void resizeBy(const double, const double);
455
        //Rotation
4061 craig 456
        double rotation() const { return Rot; }
4663 cbradney 457
        void setRotation(const double, bool drawingOnly=false);
3934 cbradney 458
        void rotateBy(const double);
459
        //Selection
4061 craig 460
        bool isSelected() const { return Select; }
3934 cbradney 461
        void setSelected(const bool);
3985 cbradney 462
        //Image Data
4061 craig 463
        double imageXScale() const { return LocalScX; }
464
        double imageYScale() const { return LocalScY; }
3985 cbradney 465
        void setImageXScale(const double);
466
        void setImageYScale(const double);
467
        void setImageXYScale(const double, const double);
4061 craig 468
        double imageXOffset() const { return LocalX; }
469
        double imageYOffset() const { return LocalY; }
3985 cbradney 470
        void setImageXOffset(const double);
471
        void setImageYOffset(const double);
472
        void moveImageXYOffsetBy(const double, const double);
473
        void setImageXYOffset(const double, const double);
3988 cbradney 474
        //Reverse
4061 craig 475
        bool reversed() const { return Reverse; }
3988 cbradney 476
        void setReversed(bool);
3989 cbradney 477
        //Rounded Corners
4061 craig 478
        double cornerRadius() const { return RadRect; }
3989 cbradney 479
        void setCornerRadius(double);
1250 tsoots 480
 
3988 cbradney 481
 
482
        //Text Data - Move to PageItem_TextFrame at some point?
4061 craig 483
        double textToFrameDistLeft() const { return Extra; }
484
        double textToFrameDistRight() const { return RExtra; }
485
        double textToFrameDistTop() const { return TExtra; }
486
        double textToFrameDistBottom() const { return BExtra; }
3988 cbradney 487
        void setTextToFrameDistLeft(double);
488
        void setTextToFrameDistRight(double);
489
        void setTextToFrameDistTop(double);
490
        void setTextToFrameDistBottom(double);
491
        /**
4645 subik 492
         * \brief Set the text to frame distances all at once
493
         * @param newLeft left distance
494
         * @param newRight right distance
495
         * @param newTop top distance
496
         * @param newBottom bottom distance
3988 cbradney 497
         */
498
        void setTextToFrameDist(double newLeft, double newRight, double newTop, double newBottom);
499
 
1361 tsoots 500
        /**  @brief Get name of the item
501
         *
502
         * This is unrelated to QObject::name(); the pageItem's name is independent
503
         * of its Qt name.
504
         * See also PageItem::setItemName()
505
         */
4061 craig 506
        QString itemName() const { return AnName; }
1361 tsoots 507
        /**
1204 tsoots 508
         * @brief Set name of the item
509
         * @param newName name for the item
510
         * @author Riku Leino
1361 tsoots 511
         *
512
         * Note that this is unrelated to QObject::setName()
513
         * See also PageItem::itemName()
1204 tsoots 514
         */
1361 tsoots 515
        void setItemName(const QString& newName);
1381 cbradney 516
 
517
        /** @brief Get the (name of the) fill color of the object */
4061 craig 518
        QString fillColor() const { return fillColorVal; }
1286 tsoots 519
        /**
520
         * @brief Set the fill color of the object.
521
         * @param newColor fill color for the object
522
         */
523
        void setFillColor(const QString &newColor);
1381 cbradney 524
 
525
        /** @brief Get the shade of the fill color */
4061 craig 526
        int fillShade() const { return fillShadeVal; }
1286 tsoots 527
        /**
528
         * @brief Set the fill color shade.
529
         * @param newShade shade for the fill color
530
         */
531
        void setFillShade(int newShade);
1381 cbradney 532
 
533
        /** @brief Get the transparency of the fill color */
4061 craig 534
        double fillTransparency() const { return fillTransparencyVal; }
1286 tsoots 535
        /**
1371 tsoots 536
         * @brief Set the transparency of the fill color.
537
         * @param newTransparency transparency of the fill color
538
         */
539
        void setFillTransparency(double newTransparency);
1381 cbradney 540
 
541
        /** @brief Get the line color of the object */
4061 craig 542
        QString lineColor() const { return lineColorVal; }
1371 tsoots 543
        /**
1286 tsoots 544
         * @brief Set the line color of the object.
4645 subik 545
         * @param newColor line color for the object
1286 tsoots 546
         */
547
        void setLineColor(const QString &newColor);
1381 cbradney 548
 
549
        /** @brief Get the line color shade */
4061 craig 550
        int lineShade() const { return lineShadeVal; }
1286 tsoots 551
        /**
552
         * @brief Set the line color shade.
4645 subik 553
         * @param newShade shade for the line color
1286 tsoots 554
         */
555
        void setLineShade(int newShade);
1381 cbradney 556
 
557
        /** @brief Get the line transparency */
4061 craig 558
        double lineTransparency() const { return lineTransparencyVal; }
1371 tsoots 559
        /**
560
         * @brief Set the transparency of the line color.
561
         * @param newTransparency transparency of the line color
562
         */
563
        void setLineTransparency(double newTransparency);
1394 cbradney 564
 
3894 cbradney 565
        /** @brief Set the QColor for the line */
566
        void setLineQColor();
567
        /** @brief Set the QColor for the fill */
568
        void setFillQColor();
569
 
1394 cbradney 570
        /** @brief Get the style of line */
4061 craig 571
        PenStyle lineStyle() const { return PLineArt; }
1383 tsoots 572
        /**
573
         * @brief Set the style of line.
574
         * @param newStyle style of line
575
         * @sa Qt::PenStyle
576
         */
577
        void setLineStyle(PenStyle newStyle);
1394 cbradney 578
 
579
        /** @brief Get the width of the line */
4580 cbradney 580
        double lineWidth() const { return m_lineWidth; }
1385 tsoots 581
        /**
582
         * @brief Set the width of line
583
         * @param newWidth width of line
584
         */
585
        void setLineWidth(double newWidth);
1394 cbradney 586
 
587
        /** @brief Get the end cap style of the line */
4061 craig 588
        PenCapStyle lineEnd() const { return PLineEnd; }
1385 tsoots 589
        /**
590
         * @brief Set the end style of line
591
         * @param newStyle end style of line
592
         * @sa Qt::PenCapStyle
593
         */
594
        void setLineEnd(PenCapStyle newStyle);
1394 cbradney 595
 
596
        /** @brief Get the join style of multi-segment lines */
4061 craig 597
        PenJoinStyle lineJoin() const { return PLineJoin; }
1385 tsoots 598
        /**
599
         * @brief Set the join style of line
600
         * @param newStyle join style of line
601
         * @sa Qt::PenJoinStyle
602
         */
603
        void setLineJoin(PenJoinStyle newStyle);
1392 cbradney 604
 
1394 cbradney 605
        /** @brief Get name of active custom line style */
4061 craig 606
        QString customLineStyle() const { return NamedLStyle; }
1489 tsoots 607
        /**
1386 tsoots 608
         * @brief Set custom line style
609
         * @param newStyle name of the custom style
610
         */
611
        void setCustomLineStyle(const QString& newStyle);
1392 cbradney 612
 
1394 cbradney 613
        /** @brief Get start arrow index
4061 craig 614
         * @sa PageItem::endArrowIndex(), PageItem::setStartArrowIndex()
1394 cbradney 615
         */
4061 craig 616
        int startArrowIndex() const { return m_startArrowIndex; }
1391 tsoots 617
        /**
618
         * @brief Set start arrow index
619
         * @param newIndex index for start arrow
620
         */
621
        void setStartArrowIndex(int newIndex);
1394 cbradney 622
 
623
        /** @brief Get end arrow index
4061 craig 624
         * @sa PageItem::startArrowIndex(), PageItem::setEndArrowIndex()
1394 cbradney 625
         */
4061 craig 626
        int endArrowIndex() const { return m_endArrowIndex; }
1391 tsoots 627
        /**
628
         * @brief Set end arrow index
629
         * @param newIndex index for end arrow
630
         */
631
        void setEndArrowIndex(int newIndex);
1392 cbradney 632
 
1394 cbradney 633
        /** @brief Is the image flipped horizontally? */
4061 craig 634
        bool imageFlippedH() const { return imageIsFlippedH; }
1394 cbradney 635
        /** @brief Horizontally flip / unflip the image */
636
        void setImageFlippedH(bool flipped);
1287 tsoots 637
        /** @brief Flip an image horizontally. */
638
        void flipImageH();
1392 cbradney 639
 
640
        /** @brief Is the image flipped vertically? */
4061 craig 641
        bool imageFlippedV() const { return imageIsFlippedV; }
1392 cbradney 642
        /** @brief Vertically flip / unflip the image */
643
        void setImageFlippedV(bool flipped);
1287 tsoots 644
        /** @brief Flip an image vertically */
645
        void flipImageV();
1381 cbradney 646
 
1495 tsoots 647
        /**
648
         * @brief Set the image scaling mode.
649
         * @param freeScale is the scaling free (not forced to frame size)
650
         * @param keepRatio should the image's aspect ratio be respected
651
         */
652
        void setImageScalingMode(bool freeScale, bool keepRatio);
653
 
1290 tsoots 654
        /** @brief Lock or unlock this pageitem. */
655
        void toggleLock();
1381 cbradney 656
        /** @brief is the item locked ? */
4061 craig 657
        bool locked() const { return Locked; }
1293 tsoots 658
        /** @brief Lock or unlock this pageitem */
659
        void setLocked(bool isLocked);
1381 cbradney 660
 
1290 tsoots 661
        /** @brief Toggle lock for resizing */
662
        void toggleSizeLock();
1381 cbradney 663
        /** @brief Is the item's size locked? */
4061 craig 664
        bool sizeLocked() const { return LockRes; }
1381 cbradney 665
        /** @brief set lock for resizing */
1298 fschmid 666
        void setSizeLocked(bool isLocked);
1381 cbradney 667
 
1422 tsoots 668
        /** @brief Get the PageItem-wide font name */
4073 cbradney 669
        QString font() const { return m_Font; }
1399 tsoots 670
        /**
671
         * @brief Set font for the PageItem.
672
         * @param newFont name of the font
673
         */
674
        void setFont(const QString& newFont);
1422 tsoots 675
 
676
        /** @brief Get the PageItem-wide font size */
4073 cbradney 677
        int fontSize() const { return m_FontSize; }
1400 tsoots 678
        /**
679
         * @brief Set the font size of the frame
680
         * @param newSize font size
681
         */
682
        void setFontSize(int newSize);
1422 tsoots 683
 
2230 fschmid 684
        /** @brief Get the PageItem-wide character height scaling percentage */
4061 craig 685
        int fontHeight() const { return TxtScaleV; }
2230 fschmid 686
        /**
687
         * @brief Set scaling height of character
4645 subik 688
         * @param newHeight height of character
2230 fschmid 689
         */
690
        void setFontHeight(int newHeight);
691
 
1422 tsoots 692
        /** @brief Get the PageItem-wide character width scaling percentage */
4061 craig 693
        int fontWidth() const { return TxtScale; }
1400 tsoots 694
        /**
695
         * @brief Set scaling width of character
696
         * @param newWidth width of character
697
         */
698
        void setFontWidth(int newWidth);
1422 tsoots 699
 
700
        /** @brief Get the name of the PageItem-wide font fill color */
4061 craig 701
        QString fontFillColor() const { return TxtFill; }
1489 tsoots 702
        /**
1401 tsoots 703
         * @brief Set font fill color
704
         * @param newColor font fill color
705
         */
706
        void setFontFillColor(const QString& newColor);
1422 tsoots 707
 
708
        /** @brief Get the PageItem-wide font fill shade */
4061 craig 709
        int fontFillShade() const { return ShTxtFill; }
1402 tsoots 710
        /**
711
         * @brief Set the shade of font fill color
712
         * @param newShade shade of font fill color
713
         */
714
        void setFontFillShade(int newShade);
1422 tsoots 715
 
716
        /** @brief Get the PageItem-wide font stroke color */
4061 craig 717
        QString fontStrokeColor() const { return TxtStroke; }
1489 tsoots 718
        /**
1401 tsoots 719
         * @brief Set the color of font stroke
720
         * @param newColor color of font stroke
721
         */
722
        void setFontStrokeColor(const QString& newColor);
1422 tsoots 723
 
724
        /** @brief Get the PageItem-wide font stroke shade */
4061 craig 725
        int fontStrokeShade() const { return ShTxtStroke; }
1402 tsoots 726
        /**
727
         * @brief Set the shade of font stroke color
728
         * @param newShade shade of font stroke color
729
         */
730
        void setFontStrokeShade(int newShade);
1422 tsoots 731
 
732
        /** @brief Get the PageItem-wide font effects flags
733
         *
734
         * TODO This should probably be an enum set
735
         */
4061 craig 736
        int fontEffects() const { return TxTStyle; }
1403 tsoots 737
        /**
1415 tsoots 738
         * @brief Set font effects
739
         * @param newEffects font effects
740
         */
741
        void setFontEffects(int newEffects);
1422 tsoots 742
 
743
        /** @brief Get PageItem-wide text kerning */
4061 craig 744
        int kerning() const { return ExtraV; }
1415 tsoots 745
        /**
1403 tsoots 746
         * @brief Set kerning for the text
747
         * @param newKerning kerning for the text
748
         */
2382 fschmid 749
        void setKerning(int newKerning);
1422 tsoots 750
 
751
        /** @brief Get the PageItem-wide line spacing */
4061 craig 752
        double lineSpacing() const { return LineSp; }
1403 tsoots 753
        /**
754
         * @brief Set a line spacing for the frame
755
         * @param newSpacing line spacing for the frame
756
         */
757
        void setLineSpacing(double newSpacing);
1422 tsoots 758
 
4584 cbradney 759
        /** @brief Get the PageItem-wide line spacing mode */
4643 fschmid 760
        int lineSpacingMode() const { return LineSpMode; }
4584 cbradney 761
        /**
762
         * @brief Set a line spacing for the frame
4645 subik 763
         * @param newLineSpacingMode line spacing for the frame
4584 cbradney 764
         */
765
        void setLineSpacingMode(int newLineSpacingMode);
766
 
1422 tsoots 767
        /** @brief Get the hyphenation language for the frame */
4061 craig 768
        QString language() const { return Language; }
1403 tsoots 769
        /**
770
         * @brief Set the hyphenation language for the frame
771
         * @param newLanguage hyphenation language for the frame
772
         */
773
        void setLanguage(const QString& newLanguage);
1399 tsoots 774
 
1489 tsoots 775
        /**
1651 craig 776
         * @brief Does text flow around this object
1656 craig 777
         * @sa setTextFlowsAroundFrame()
1651 craig 778
         */
4061 craig 779
        bool textFlowsAroundFrame() const { return textFlowsAroundFrameVal; }
1651 craig 780
        /**
781
         * @brief Enable/disable text flowing around this item
1489 tsoots 782
         * @param isFlowing true if text is wanted to flow around this object or false if not
1656 craig 783
         * @sa textFlowsAroundFrame()
1489 tsoots 784
         */
1651 craig 785
        void setTextFlowsAroundFrame(bool isFlowing);
1489 tsoots 786
 
787
        /**
1653 craig 788
         * @brief Should text flow around the object's bounding box if text flow is enabled?
789
         * @sa PageItem::setTextFlowUsesBoundingBox()
790
         */
4061 craig 791
        bool textFlowUsesBoundingBox() const { return textFlowUsesBoundingBoxVal; }
1653 craig 792
        /**
1489 tsoots 793
         * @brief Tells if the text flow should follow the square frame border if <code>useBounding</code>
794
         * @brief is true, if it is set false text fill flow around the object border rather than frame.
795
         *
796
         * Setting this to true will unset contour line to false. Bounding box and contour line cannot
797
         * be used at the same time.
798
         * @param useBounding true if text should flow around the frame border false if it should follow
799
         * the actual shape of the object.
1656 craig 800
         * @sa setTextFlowsAroundFrame()
801
         * @sa setTextFlowUsesContourLine()
802
         * @sa textFlowUsesBoundingBox()
1489 tsoots 803
         */
1653 craig 804
        void setTextFlowUsesBoundingBox(bool useBounding);
1489 tsoots 805
 
806
        /**
1656 craig 807
         * @brief Should text flow around the contour line of the frame?
808
         * @sa setTextFlowUsesContourLine()
809
         */
4061 craig 810
        bool textFlowUsesContourLine() const { return textFlowUsesContourLineVal; }
1656 craig 811
        /**
1489 tsoots 812
         * @brief Tells if the text flow should follow the contour line of the frame.
813
         *
814
         * Setting this to true will unset bounding box to false. Contour line and bounding box cannot
815
         * be used at the same time.
816
         * @param useContour true if text should flow around the contour line of the frame false if
817
         * it should flow around the actual shap of the object.
1656 craig 818
         * @sa setTextFlowsAroundFrame()
819
         * @sa setTextFlowUsesBoundingBox()
820
         * @sa textFlowUsesContourLine()
1489 tsoots 821
         */
1656 craig 822
        void setTextFlowUsesContourLine(bool useContour);
1489 tsoots 823
 
1422 tsoots 824
        /** @brief Get the frame type
825
         *
826
         * @attention The whole concept of frame types is due for some radical
827
         *            re-working, so don't rely on this interface staying stable.
828
         *            It's here as an interim step to eliminate direct member access
829
         *            on PageItems.
830
         */
4593 cbradney 831
        ItemType itemType() const { return m_ItemType; }
1416 tsoots 832
        /**
833
         * @brief Convert this PageItem to PageItem type <code>newType</code>
834
         * @param newType PageItem type for conversion
835
         */
1460 cbradney 836
        void convertTo(ItemType newType);
1416 tsoots 837
 
1489 tsoots 838
        /**
1688 tsoots 839
        * Set the layer for the item
840
        * @param layerId layer where this item is moved
841
        */
842
        void setLayer(int layerId);
843
 
844
        /**
1211 tsoots 845
         * @brief Check the changes to the item and add undo actions for them.
846
         * @param force Force the check. Do not care if mouse button or arrow key is down
847
         * check anyway.
848
         * @author Riku Leino
849
         */
850
        void checkChanges(bool force = false);
1204 tsoots 851
        /**
1211 tsoots 852
         * @name Store undo actions
1204 tsoots 853
         * @brief Add an undo action to the undo guis
854
         * @author Riku Leino
855
         */
1211 tsoots 856
        /*@{*/
1204 tsoots 857
        void moveUndoAction();
1211 tsoots 858
        void resizeUndoAction();
859
        void rotateUndoAction();
860
        /*@}*/
861
        /** @brief Required by the UndoObject */
862
        void restore(UndoState *state, bool isUndo);
1361 tsoots 863
 
2058 craig 864
        /**
865
         * @brief Return a variant of `originalName' that is guaranteed to be unique
866
         *        in the same document as this PageItem.  If the passed name is not
867
         *        in use it is returned unchanged.
868
         * @author Craig Ringer
869
         *
4645 subik 870
         * Usually of the form 'Copy of [name]' or 'Copy of [name] (n)'
2058 craig 871
         */
872
        QString generateUniqueCopyName(const QString originalName) const;
2449 cbradney 873
        /**
874
         * @brief Is this item printed?
875
         * @sa setPrintable()
876
         */
4061 craig 877
        bool printable() const { return isPrintable; }
2449 cbradney 878
        /**
879
         * @brief Tells if the frame is set to be printed or not
880
         * @sa printable()
881
         */
882
        void setPrintable(bool toPrint);
2937 cbradney 883
 
884
        /**
4061 craig 885
         * @brief Tells if the frame is tagged or not
886
         * @sa isTagged()
887
         */
888
        bool isTagged() const { return tagged; }
889
        /**
2937 cbradney 890
         * @brief Set the tagged member for use when deleting items, instead of reselecting them.
891
         * @sa setTagged()
892
         */
893
        void setTagged(bool);
4061 craig 894
 
3302 cbradney 895
        /**
896
         * @brief Load an image into an image frame, moved from ScribusView
897
         * @return True if load succeeded
898
         */
899
        bool loadImage(const QString& filename, const bool reload, const int gsResolution=-1);
2937 cbradney 900
 
3903 cbradney 901
 
3936 cbradney 902
        /**
4026 craig 903
         * @brief Connect the item's signals to the GUI, primarily the Properties palette, also some to ScMW
3936 cbradney 904
         * @return
905
         */
3903 cbradney 906
        bool connectToGUI();
907
        bool disconnectFromGUI();
3936 cbradney 908
        /**
909
         * @brief Emit the items properties to the GUI in one go
910
         */
911
        void emitAllToGUI();
3903 cbradney 912
 
4084 cbradney 913
        /**
914
         * @brief Get the document that this item belongs to
915
         */
916
        ScribusDoc* document();
917
 
918
        bool isAnnotation() const { return m_isAnnotation; }
919
        void setIsAnnotation(bool);
920
        void setAnnotation(const Annotation& ad);
921
        Annotation& annotation() { return m_annotation; }
922
 
4492 cbradney 923
        bool imageShown() const { return PicArt; }
924
        void setImageShown(bool);
925
 
4110 cbradney 926
        void updateConstants();
927
 
1361 tsoots 928
protected:
4142 cbradney 929
 
930
        void drawLockedMarker(ScPainter *p);
931
 
4061 craig 932
        /** @brief Manages undostack and is where all undo actions/states are sent. */
933
        UndoManager * const undoManager;
1206 tsoots 934
        /**
1211 tsoots 935
         * @name Restore helper methods
936
         * Split the restore method for easier handling.
1206 tsoots 937
         * @author Riku Leino
938
         */
1211 tsoots 939
        /*@{*/
940
        void restoreMove(SimpleState *state, bool isUndo);
941
        void restoreResize(SimpleState *state, bool isUndo);
942
        void restoreRotate(SimpleState *state, bool isUndo);
1286 tsoots 943
        void restoreFill(SimpleState *state, bool isUndo);
944
        void restoreShade(SimpleState *state, bool isUndo);
945
        void restoreLineColor(SimpleState *state, bool isUndo);
946
        void restoreLineShade(SimpleState *state, bool isUndo);
1357 tsoots 947
        void restoreName(SimpleState *state, bool isUndo);
1371 tsoots 948
        void restoreFillTP(SimpleState *state, bool isUndo);
949
        void restoreLineTP(SimpleState *state, bool isUndo);
1383 tsoots 950
        void restoreLineStyle(SimpleState *state, bool isUndo);
1385 tsoots 951
        void restoreLineEnd(SimpleState *state, bool isUndo);
952
        void restoreLineJoin(SimpleState *state, bool isUndo);
953
        void restoreLineWidth(SimpleState *state, bool isUndo);
1386 tsoots 954
        void restoreCustomLineStyle(SimpleState *state, bool isUndo);
1391 tsoots 955
        void restoreArrow(SimpleState *state, bool isUndo, bool isStart);
1399 tsoots 956
        void restoreFont(SimpleState *state, bool isUndo);
1400 tsoots 957
        void restoreFontSize(SimpleState *state, bool isUndo);
958
        void restoreFontWidth(SimpleState *state, bool isUndo);
1401 tsoots 959
        void restoreFontFill(SimpleState *state, bool isUndo);
960
        void restoreFontStroke(SimpleState *state, bool isUndo);
1402 tsoots 961
        void restoreFontFillShade(SimpleState *state, bool isUndo);
962
        void restoreFontStrokeShade(SimpleState *state, bool isUndo);
1403 tsoots 963
        void restoreKerning(SimpleState *state, bool isUndo);
964
        void restoreLineSpacing(SimpleState *state, bool isUndo);
965
        void restoreLanguage(SimpleState *state, bool isUndo);
1404 tsoots 966
        void restorePStyle(SimpleState *state, bool isUndo);
1415 tsoots 967
        void restoreFontEffect(SimpleState *state, bool isUndo);
1416 tsoots 968
        void restoreType(SimpleState *state, bool isUndo);
1489 tsoots 969
        void restoreTextFlowing(SimpleState *state, bool isUndo);
1495 tsoots 970
        void restoreImageScaling(SimpleState *state, bool isUndo);
1509 tsoots 971
        void restorePoly(SimpleState *state, bool isUndo, bool isContour);
1518 tsoots 972
        void restoreContourLine(SimpleState *state, bool isUndo);
1688 tsoots 973
        void restoreLayer(SimpleState *state, bool isUndo);
1832 tsoots 974
        void restoreGetImage(SimpleState *state, bool isUndo);
1211 tsoots 975
        /*@}*/
1238 tsoots 976
 
977
        /**
978
         * @brief Returns true if the actions should be sent to the UndoManager.
979
         *
980
         * Checks the state of the arrow keys and mouse buttons. If a key or a
981
         * mouse button is down PageItem is under some action which should only be
982
         * stored after the action has been finished (to get a single undo action).
983
         * @return true if the actions should be sent to the UndoManager based on the
984
         * state of arrow keys and mouse buttons else returns false.
985
         */
986
        bool shouldCheck();
1290 tsoots 987
        /** @brief Clears the current selection and selects this PageItem. */
988
        void select();
1361 tsoots 989
 
990
        // Protected members
991
 
992
        /**
1460 cbradney 993
         * @brief Frame Type, eg line, text frame, etc.
994
         *
995
         * This will probably go away when pageitem is split into
996
         * subclasses.
997
         */
4593 cbradney 998
        ItemType m_ItemType;
1460 cbradney 999
 
1000
        /**
1361 tsoots 1001
         * @brief Item name. Unicode. User visible (outline, property palette, etc).
4084 cbradney 1002
         * @todo This is Annotation Name.. not item name, needs splitting up.
1392 cbradney 1003
         * @sa PageItem::itemName(), PageItem::setItemName()
1004
         */
4084 cbradney 1005
        QString AnName;
1392 cbradney 1006
 
1007
        /**
1394 cbradney 1008
         * @brief Fill color name
1009
         * @sa PageItem::fillColor(), PageItem::setFillColor()
1010
         */
1011
        QString fillColorVal;
1012
 
1013
        /**
1014
         * @brief Line color name
1015
         * @sa PageItem::lineColor(), PageItem::setLineColor()
1016
         */
1017
        QString lineColorVal;
1018
 
1019
        /**
1020
         * @brief Line shade
1021
         * @sa PageItem::lineShade, PageItem::setLineShade()
1022
         */
1023
        int lineShadeVal;
1024
 
1025
        /**
1026
         * @brief Fill shade
1027
         * @sa PageItem::fillShade, PageItem::setFillShade()
1028
         */
1029
        int fillShadeVal;
1030
 
1031
        /**
1032
         * @brief Fill transparency
1033
         * @sa PageItem::fillTransparency(), PageItem::setFillTransparency()
1034
         */
1035
        double fillTransparencyVal;
1036
 
1037
        /**
1038
         * @brief Line stroke transparency.
1039
         * @sa PageItem::lineTransparency(), PageItem::setLineTransparency()
1040
         */
1041
        double lineTransparencyVal;
1042
 
1043
        /**
1392 cbradney 1044
         * @brief Is the image in this image item flipped horizontally?
1045
         * @sa PageItem::isImageFlippedH(), PageItem::setImageFlippedH(),
1046
         *     PageItem::flipImageH(), PageItem::flippedV
1047
         */
1048
        bool imageIsFlippedH;
1049
 
1050
        /**
1051
         * @brief Is the image in this image item flipped vertically?
1052
         * @sa PageItem::isImageFlippedV(), PageItem::setImageFlippedV(),
1053
         *     PageItem::flipImageV(), PageItem::flippedH
1054
         */
1055
        bool imageIsFlippedV;
1056
 
1057
        /**
1058
         * @brief Is the item locked (cannot be moved, resized, etc)?
1059
         * @sa PageItem::locked(), PageItem::setLocked(), PageItem::toggleLock()
1060
         */
1061
        bool Locked;
1062
 
1063
        /**
1064
         * @brief Is the item's size locked?
1065
         * @sa PageItem::sizeLocked(), PageItem::setSizeLocked(), PageItem::toggleSizeLock()
1066
         */
1067
        bool LockRes;
1653 craig 1068
 
1644 cbradney 1069
        /**
1653 craig 1070
         * @brief Should text flow around the item
1071
         * @sa PageItem::textFlowsAroundFrame(), PateItem::setTextFlowsAroundFrame()
1072
         */
1073
        bool textFlowsAroundFrameVal;
1074
 
1075
        /**
1076
         * @brief Should text flow around the item's bounding box?
1656 craig 1077
         * @sa PageItem::textFlowUsesBoundingBox(), PageItem::setTextFlowUsesBoundingBox()
1653 craig 1078
         */
1079
        bool textFlowUsesBoundingBoxVal;
1080
 
1081
        /**
1656 craig 1082
         * @brief Should text flow around the item's contour line?
2449 cbradney 1083
         * @sa PageItem::textFlowUsesContourLine(), PageItem::setTextFlowUsesContourLine()
1656 craig 1084
         */
1085
        bool textFlowUsesContourLineVal;
1086
 
1087
        /**
1644 cbradney 1088
         * @brief Stores the attributes of the pageitem (NOT properties, the user defined ATTRIBUTES)
2707 subik 1089
         * @sa
1090
         */
1649 cbradney 1091
        ObjAttrVector pageItemAttributes;
2707 subik 1092
 
2449 cbradney 1093
        /**
1094
         * @brief Is this item set to be printed/exported
1095
         * @sa PageItem::printable(), PageItem::setPrintable()
2707 subik 1096
         */
2449 cbradney 1097
        bool isPrintable;
2937 cbradney 1098
 
1099
        /**
1100
         * @brief Is this item set to have an action done to it, eg deleted
1101
         * @sa PageItem::isTagged(), PageItem::setTagged()
1102
         */
1103
        bool tagged;
3894 cbradney 1104
 
1105
        QColor fillQColor;
1106
        QColor strokeQColor;
3903 cbradney 1107
 
1108
        /** X position on the page */
1109
        double Xpos;
1110
        /** Y position on the page */
1111
        double Ypos;
3934 cbradney 1112
        /** Width of the item */
1113
        double Width;
1114
        /** Height of the item */
1115
        double Height;
1116
        /** Rotation of the item */
1117
        double Rot;
1118
        /** Element selected? */
1119
        bool Select;
3985 cbradney 1120
        /** Scaling X Factor for images */
1121
        double LocalScX;
1122
        /** Scaling Y Factor for images*/
1123
        double LocalScY;
1124
        /** Image X Offset to frame */
1125
        double LocalX;
1126
        /** Image Y Offset to frame */
1127
        double LocalY;
3988 cbradney 1128
        /** If the frame is reversed */
1129
        bool Reverse;
4061 craig 1130
 
1131
        int m_startArrowIndex;
1132
        int m_endArrowIndex;
3985 cbradney 1133
 
3988 cbradney 1134
        /** Left, Top, Bottom, Right distances of text from the frame */
1135
        double Extra;
1136
        double TExtra;
1137
        double BExtra;
1138
        double RExtra;
3989 cbradney 1139
        /** Radius of rounded corners */
1140
        double RadRect;
3985 cbradney 1141
 
1142
        //Undo Data
1143
        /** @brief Stores the old X-position for undo action. Is used to detect move actions.*/
1144
        double oldXpos;
1145
        /** @brief Stores the old Y-position for undo action. Is used to detect move actions. */
1146
        double oldYpos;
1147
        /** @brief Stores the old width for undo action. Is used to detect resize actions. */
1148
        double oldWidth;
1149
        /** @brief Stores the old height for undo action. Is used to detect resize actions. */
1150
        double oldHeight;
3988 cbradney 1151
        /** @brief Stores the old rotation value for undo action. Is used to detect rotation actions. */
1152
        double oldRot;
3985 cbradney 1153
 
4073 cbradney 1154
        /** Item Font */
1155
        QString m_Font;
1156
        /** Item Fontsize */
1157
        int m_FontSize;
1158
 
4084 cbradney 1159
        /** Document this item belongs to */
1160
        ScribusDoc *m_Doc;
3985 cbradney 1161
 
4084 cbradney 1162
        /** Flags and data for PDF Annotations */
1163
        bool m_isAnnotation;
1164
        Annotation m_annotation;
4492 cbradney 1165
 
1166
        /** Darstellungsart Bild/Titel */
1167
        bool PicArt;
4580 cbradney 1168
 
1169
         /** Line width */
1170
        double m_lineWidth;
1171
        double Oldm_lineWidth;
4084 cbradney 1172
 
4584 cbradney 1173
/** Linespacing */
1174
        double LineSp;
1175
        int LineSpMode;
1176
 
3903 cbradney 1177
signals:
1178
        //Frame signals
3946 cbradney 1179
        void myself(PageItem *);
1180
        void frameType(int);
3903 cbradney 1181
        void position(double, double); //X,Y
1182
        void widthAndHeight(double, double); //W,H
3934 cbradney 1183
        void rotation(double); //Degrees rotation       
3903 cbradney 1184
        void colors(QString, QString, int, int); //lineColor, fillColor, lineShade, fillShade
1185
        void gradientType(int); //Normal, horizontal, vertical, etc.
3941 cbradney 1186
        void gradientColorUpdate(double, double, double, double, double, double); //Cpal updatespecialgradient
3903 cbradney 1187
        void transparency(double, double); //fillTransparency, lineTransparency
1188
        //Shape signals
1189
        void columns(int, double); //Number, gap
1190
        void cornerRadius(double); //Corner radius of the shape
1191
        //Line signals
1192
        void lineWidth(double);
3934 cbradney 1193
        void lineStyleCapJoin(Qt::PenStyle, Qt::PenCapStyle, Qt::PenJoinStyle);
3903 cbradney 1194
        //Frame text signals
1195
        void lineSpacing(double);
1196
        void textToFrameDistances(double, double, double, double); //left, top, bottom, right: Extra, TExtra, BExtra, RExtra
1197
        void textKerning(int); //ExtraV
1198
        void textStyle(int); //Style setting
1199
        void textFont(QString); //Text font
1200
        void textSize(int); //Text size
1201
        void textWidthScale(int); //Scaling width of text, ChScale in mpalette
1202
        void textHeightScale(int); //Scaling height of text, ChScaleV in mpalette
1203
        void textBaseLineOffset(int); //Offset from baseline to text
1204
        void textOutline(int); //Outline
1205
        void textShadow(int, int); //Shadow
1206
        void textUnderline(int, int); //Underline
1207
        void textStrike(int, int); //Strikethrough
1208
        void textColor(QString, QString, int, int); //itemText.at(i)-> cstroke, ccolor, cshade2, cshade
1209
        void textFormatting(int); //Underline, subscript, etc
1210
        //Frame image signals
1211
        void imageOffsetScale(double, double, double, double);
3 paul 1212
};
1213
 
1214
#endif