Scribus
Open source desktop publishing at your fingertips
scgtplugin.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 
8 #ifndef SCGTPLUGIN_H
9 #define SCGTPLUGIN_H
10 
11 #include "scribusapi.h"
12 #include "scplugin.h"
13 #include "ui/customfdialog.h"
14 
15 class QString;
16 class QCheckBox;
17 class QStringList;
18 class QDir;
19 class QWidget;
20 
28 class SCRIBUS_API ScGTPlugin : public ScPlugin
29 {
30  Q_OBJECT
31 public:
32  ScGTPlugin();
33  ~ScGTPlugin() {};
34 
40  virtual QString fileFormatName() const = 0;
41 
47  virtual QStringList fileExtensions() const = 0;
48 
60  virtual void run(const QString &filename, const QString &encoding = QString::null) {};
61 
69  virtual void run(const QString &text /*, insert style stuff here */) {};
70 
71 };
72 
73 /***************************************************************************************/
74 /***************************************************************************************/
75 
85 class SCRIBUS_API ScGTPluginManager {
86 public:
87  static ScGTPluginManager* instance(); // singleton
88  static void deleteInstance();
89 
90  void registerGTPlugin(ScGTPlugin *plugin);
91  void unRegisterGTPlugin(ScGTPlugin *plugin);
92 
94  void run();
95 
96 private:
97  static ScGTPluginManager *instance_;
98 
99  QList<ScGTPlugin*> plugins_;
100 
103 
104  QString fileFilter();
105 
107  void options();
108 };
109 
110 /***************************************************************************************/
111 /***************************************************************************************/
112 
113 class SCRIBUS_API ScGTFileDialog : public CustomFDialog {
114  Q_OBJECT
115 public:
116  ScGTFileDialog(const QString & dirName,
117  const QString & filters,
118  QWidget * parent = 0, const char * name = 0);
119  ~ScGTFileDialog();
120 
121  bool showOptions() const;
122  bool append() const;
123 
124 private:
125  QWidget *diaExtension_;
126  QCheckBox *showOptionsBox_;
127  QCheckBox *appendBox_;
128  void customize();
129 };
130 
131 /***************************************************************************************/
132 /***************************************************************************************/
133 
134 class SCRIBUS_API ScGTOptions {
135 
136 };
137 
138 /***************************************************************************************/
139 /***************************************************************************************/
140 
141 class SCRIBUS_API ScGTOptionsWindow {
142 
143 };
144 
145 #endif
virtual void run(const QString &filename, const QString &encoding=QString::null)
Run the plugin and import from the file filename
Definition: scgtplugin.h:60
Definition: scgtplugin.h:113
virtual void run(const QString &text)
Run the plugin and do the magic with the text and.
Definition: scgtplugin.h:69
Definition: scgtplugin.h:134
Abstract super class for all Scribus plug-ins.
Definition: scplugin.h:90
Definition: scgtplugin.h:141
Super class for all text importer plugins.
Definition: scgtplugin.h:28
A Scribus own file dialog. Used almost everywhere. You can see extension handling in e...
Definition: customfdialog.h:87
Manages the import process.
Definition: scgtplugin.h:85