Scribus
Open source desktop publishing at your fingertips
api_dialogs.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_DIALOGS_H_
8 #define API_DIALOGS_H_
9 
10 #include <QObject>
11 #include <QtDebug>
12 #include <QApplication>
13 
14 #include "scripterimpl.h"
15 
16 class DialogsAPI : public QObject
17 {
18  Q_OBJECT
19  Q_PROPERTY(QWidget* mainWindow READ mainWindow)
20  Q_PROPERTY(QWidget* properties READ properties)
21  Q_PROPERTY(QWidget* nodes READ nodes)
22  Q_PROPERTY(QWidget* outline READ outline)
23  Q_PROPERTY(QWidget* scrapbook READ scrapbook)
24  Q_PROPERTY(QWidget* layers READ layers)
25  Q_PROPERTY(QWidget* documentChecker READ documentChecker)
26  Q_PROPERTY(QWidget* pages READ pages)
27  Q_PROPERTY(QWidget* bookmarks READ bookmarks)
28  Q_PROPERTY(bool newDocument READ newDocument)
29 public:
30  DialogsAPI();
31  virtual ~DialogsAPI();
32 
33 public slots:
34  void alert(const QString & message);
35 
36 private:
42  QWidget* mainWindow() {
43  return ScCore->primaryMainWindow();
44  };
50  QWidget* properties() {
51  return (QWidget*)ScCore->primaryMainWindow()->propertiesPalette;
52  };
58  QWidget* nodes() {
59  return (QWidget*)ScCore->primaryMainWindow()->nodePalette;
60  };
66  QWidget* outline() {
67  return (QWidget*)ScCore->primaryMainWindow()->outlinePalette;
68  };
74  QWidget* scrapbook() {
75  return (QWidget*)ScCore->primaryMainWindow()->scrapbookPalette;
76  };
82  QWidget* layers() {
83  return (QWidget*)ScCore->primaryMainWindow()->layerPalette;
84  };
90  QWidget* documentChecker() {
91  return (QWidget*)ScCore->primaryMainWindow()->docCheckerPalette;
92  };
98  QWidget* pages() {
99  return (QWidget*)ScCore->primaryMainWindow()->pagePalette;
100  };
106  QWidget* bookmarks() {
107  return (QWidget*)ScCore->primaryMainWindow()->bookmarkPalette;
108  };
112  bool newDocument() {
113  return ScCore->primaryMainWindow()->slotFileNew();
114  };
115 };
116 
117 #endif /*API_DIALOGS_H_*/
void alert(const QString &message)
Definition: api_dialogs.cpp:30
bool slotFileNew()
generate a new document in the current view
Definition: scribus.cpp:2121
Definition: api_dialogs.h:16