MagicSmoke  $VERSION$
odfedit.h
Go to the documentation of this file.
1 //
2 // C++ Interface: ODF template editor
3 //
4 // Description:
5 //
6 //
7 // Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2010-2012
8 //
9 // Copyright: See README/COPYING.GPL files that come with this distribution
10 //
11 //
12 
13 #ifndef MAGICSMOKE_ODFEDIT_H
14 #define MAGICSMOKE_ODFEDIT_H
15 
16 #include <QMainWindow>
17 #include <QMap>
18 #include <QItemDelegate>
19 
20 #include <DPtrBase>
21 
22 class MOEvent;
23 class QFile;
24 class QIODevice;
25 class QDomNode;
27 class MOdfEditor:public QMainWindow
28 {
29  Q_OBJECT
30  DECLARE_DPTR(d);
31  public:
33  MOdfEditor(QWidget* parent = 0, Qt::WindowFlags f = 0);
35  virtual ~MOdfEditor();
36 
37  public slots:
39  void loadFile(QString,bool isTemplate=true);
41  void openFile(bool isTemplate=true);
43  void openFile2();
45  void saveFile();
47  void saveFileAs();
49  void saveFile(QString);
50 
51  private slots:
53  void parseTemplate(QByteArray,bool isTemplate=true);
55  void updateDisplay();
57  void saveTemplate(QFile&);
59  void saveXmlPart(QIODevice&);
61  void selectionChange();
63  void setChanged(bool ch=true);
65  void insCalcIntoCurrent();
67  void insCalcBehindCurrent();
69  void insCommentIntoCurrent();
71  void insCommentBehindCurrent();
73  void insElse();
75  void delItem();
77  void wrapInCond(QString tag="if");
79  void wrapInLoop();
81  void unwrapItem();
83  void copyItem();
85  void pasteItemInto();
87  void pasteItemBehind();
88 
90  void testOrder();
92  void testEventSum();
94  void testSave();
95  signals:
97  void switchStack(int);
99  void getEvent(int&,bool&);
100  private:
102  void saveCurrentNode();
104  void displayTag();
107  QString detectTemplateType()const;
109  void cleanTestFile();
110 };
111 
112 #endif
virtual ~MOdfEditor()
clean it up
Definition: odfedit.cpp:292
void switchStack(int)
used to switch to the correct editor widget
void loadFile(QString, bool isTemplate=true)
loads a template file, this is a helper for openFile and download
Definition: odfedit.cpp:316
encapsulation of an event, this class wraps the auto-generated event class to provide some convenienc...
Definition: event.h:25
void saveFileAs()
asks for a new file name
Definition: odfedit.cpp:432
MOdfEditor(QWidget *parent=0, Qt::WindowFlags f=0)
instantiates the editor
Definition: odfedit.cpp:142
void openFile2()
shows a file open dialog and then opens the selected file
Definition: odfedit.cpp:409
An editor for ticket templates.
Definition: odfedit.h:27
void openFile(bool isTemplate=true)
shows a file open dialog and then opens the selected file
Definition: odfedit.cpp:396
void saveFile()
saves the file - if it is local, otherwise calls saveFileAs
Definition: odfedit.cpp:414
void getEvent(int &, bool &)
used to select an event