Scribus
Open source desktop publishing at your fingertips
api_textitem.h
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 */
7 #ifndef API_TEXTITEM_H_
8 #define API_TEXTITEM_H_
9 
10 #include <QObject>
11 #include <QtDebug>
12 #include <QApplication>
13 
14 #include "scripterimpl.h"
15 #include "pageitem_textframe.h"
16 #include "api_item.h"
17 
18 class TextAPI : public ItemAPI
19 {
20  Q_OBJECT
21 
22  Q_PROPERTY(QString font READ font WRITE setFont)
23  Q_PROPERTY(double fontSize READ fontSize WRITE setFontSize)
24  Q_PROPERTY(QString text READ text WRITE setText)
25  Q_PROPERTY(int textLines READ textLines)
26  Q_PROPERTY(int textLength READ textLength)
27  Q_PROPERTY(double lineSpacing READ lineSpacing WRITE setLineSpacing)
28  Q_PROPERTY(QList<QVariant> distances READ distances)
29  Q_PROPERTY(bool deleteText READ deleteText)
30  Q_PROPERTY(bool traceText READ traceText)
31  Q_PROPERTY(bool hyphenate READ hyphenate)
32  Q_PROPERTY(bool dehyphenate READ dehyphenate)
33  Q_PROPERTY(bool PDFBookMark READ PDFBookMark WRITE setPDFBookMark)
34 
35 public:
37  ~TextAPI();
38 
39 public slots:
40  void insertText(QString text, int position);
41  void setLineSpacingMode(int mode);
42  void setDistances(double left, double right, double top, double bottom);
43  void setTextAlignment(int alignment);
44  void setTextColor(QString color);
45  void setTextStroke(QString color);
46  void setTextScalingV(double value);
47  void setTextScalingH(double value);
48  void setTextShade(int w);
49  void selectText(int start, int selcount);
50  void linkToTextFrame(QString name2);
51  void unLinkTextFrames();
52 
53 private:
54  QString font();
55  void setFont(QString name);
56 
57  double fontSize();
58  void setFontSize(double size);
59 
60  QString text();
61  void setText(QString text);
62 
63  int textLines();
64  int textLength();
65 
66  double lineSpacing();
67  void setLineSpacing(double value);
68 
69  QList<QVariant> distances();
70 
71  bool deleteText();
72  bool traceText();
73 
74  int textOverFlows(bool checkLinks);
75 
76  bool hyphenate();
77  bool dehyphenate();
78 
79  bool PDFBookMark();
80  void setPDFBookMark(bool toggle);
81 
82  PageItem_TextFrame* item;
83 };
84 
85 #endif /*API_TEXTITEM_H_*/
Definition: pageitem_textframe.h:45
Definition: api_textitem.h:18
Definition: api_item.h:16