Scribus
Open source desktop publishing at your fingertips
api_page.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_PAGE_H_
8 #define API_PAGE_H_
9 
10 #include <QObject>
11 #include <QtDebug>
12 #include <QApplication>
13 
14 #include "scripterimpl.h"
15 #include "scpage.h"
16 
17 
18 class PageAPI : public QObject
19 {
20  Q_OBJECT
21  Q_PROPERTY(int number READ number)
22  Q_PROPERTY(int position READ position)
23  Q_PROPERTY(QList<QVariant> items READ items)
24  Q_PROPERTY(QList<QVariant> selection READ selection)
25  Q_PROPERTY(int type READ type)
26 
27 public slots:
28  void remove();
29  QObject *newRectangle(double x, double y, double width, double height);
30  QObject *newEllipse(double x, double y, double width, double height);
31  QObject *newImage(double x, double y, double width, double height);
32  QObject *newText(double x, double y, double width, double height);
33  QObject *newLine(double x, double y, double width, double height);
34  void placeSVG(const QString & filename, const double x, const double y);
35  void placeODG(const QString & filename, const double x, const double y);
36  void placeEPS(const QString & filename, const double x, const double y);
37  void placeSXD(const QString & filename, const double x, const double y);
38  void savePageAsEPS(const QString & filename);
39 
40 public:
41  PageAPI(ScPage* thisPage);
42  virtual ~PageAPI();
43 
44 private:
45  int position();
46  int number();
47  QList<QVariant> items();
48  QList<QVariant> selection();
49  PageItem *newItem(const PageItem::ItemType itemType,
50  const PageItem::ItemFrameType frameType,
51  const double x, const double y, const double width,
52  const double height, const double w,
53  const QString& fill, const QString& outline);
54  void placeImage(const QString formatExt, const QString & filename, const double x, const double y);
55 
56  bool isMasterPage;
57  int type();
58  double pageYtoDocY(double y);
59  double pageXtoDocX(double x);
60 
61  ScPage* page;
62 };
63 #endif /*API_PAGE_H_*/
void placeEPS(const QString &filename, const double x, const double y)
Definition: api_page.cpp:346
QObject * newEllipse(double x, double y, double width, double height)
Definition: api_page.cpp:203
QObject * newRectangle(double x, double y, double width, double height)
Definition: api_page.cpp:183
QObject * newImage(double x, double y, double width, double height)
Definition: api_page.cpp:223
void placeSXD(const QString &filename, const double x, const double y)
Definition: api_page.cpp:360
Definition: scpage.h:46
void savePageAsEPS(const QString &filename)
Definition: api_page.cpp:370
void placeSVG(const QString &filename, const double x, const double y)
Definition: api_page.cpp:318
QObject * newText(double x, double y, double width, double height)
Definition: api_page.cpp:245
void remove()
Definition: api_page.cpp:45
QObject * newLine(double x, double y, double width, double height)
Definition: api_page.cpp:265
void placeODG(const QString &filename, const double x, const double y)
Definition: api_page.cpp:332
Definition: api_page.h:18
Definition: pageitem.h:92