SymbolEditor  1.3.0
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
MainWindow.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2011 by Stephen Allewell *
3  * sallewell@users.sourceforge.net *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  ********************************************************************************/
10 
11 
18 #ifndef MainWindow_H
19 #define MainWindow_H
20 
21 
22 #include <QUndoGroup>
23 
24 #include <KUrl>
25 #include <KXmlGuiWindow>
26 
27 
28 class QListWidgetItem;
29 
30 class KTabWidget;
31 
32 class Editor;
33 class Symbol;
34 class SymbolLibrary;
35 class SymbolListWidget;
36 
37 
48 class MainWindow : public KXmlGuiWindow
49 {
50  Q_OBJECT
51 
52 public:
53  MainWindow();
54  ~MainWindow();
55 
56 protected:
57  virtual bool queryClose();
58  virtual bool queryExit();
59 
60 protected slots:
61  // File menu
62  void fileOpen();
63  void fileOpen(const KUrl &url);
64  void save();
65  void saveAs();
66  void newSymbol();
67  void saveSymbol();
68  void saveSymbolAsNew();
69  void importLibrary();
70  void close();
71  void quit();
72 
73  // Edit menu
74  void undo();
75  void redo();
76  void undoTextChanged(const QString &text);
77  void redoTextChanged(const QString &text);
78  void cleanChanged(bool clean);
79 
80  void currentChanged(int index);
81  void itemSelected(QListWidgetItem *item);
82  void listWidgetContextMenuRequested(const QPoint &pos);
83  void deleteSymbol();
84 
85  // Settings menu
86  void preferences();
87 
88 private:
89  bool editorClean();
90  bool libraryClean();
91  void setupActions();
92  void setActionsFromSymbol(const Symbol &symbol);
93 
94  KUrl m_url;
96  KTabWidget *m_tabWidget;
102  QListWidgetItem *m_item;
103  QMenu *m_menu;
105  QUndoGroup m_undoGroup;
106 };
107 
108 
109 #endif
110