Tooltips and fonts stuff.
[qsnippetsmanager.git] / mainwindow.h
blobeb2412419aebc2f29aafe3caa5b0c8ba48e76f59
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
4 #include <QtGui/QMainWindow>
6 #include <QDir>
7 #include <QDomDocument>
8 #include <QDomElement>
9 #include <QDomNode>
10 #include <QHash>
11 #include <QFile>
12 #include <QFileDialog>
13 #include <QInputDialog>
14 #include <QList>
15 #include <QMessageBox>
16 #include <QStandardItemModel>
17 #include <QTextStream>
18 #include <QTimer>
19 #include <QTreeWidgetItem>
21 #include "Snippet.h"
22 #include "standarditemmodel.h"
23 #include "textedit.h"
24 #include "workmodedialog.h"
26 namespace Ui
28 class MainWindowClass;
31 class MainWindow : public QMainWindow
33 Q_OBJECT
35 public:
36 MainWindow(QWidget *parent = 0);
37 ~MainWindow();
39 private:
40 Ui::MainWindowClass *ui;
42 QByteArray mainWindowGeometry;
43 QByteArray workModeDialogGeometry;
44 QHash< QStandardItem*, Snippet* > snippetForItem;
45 QIcon categoryIcon;
46 QIcon snippetIcon;
47 StandardItemModel model;
48 WorkModeDialog workModeDialog;
50 private slots:
51 void on_actionAbout_Qt_activated();
52 void on_action_About_activated();
53 void on_tabWidget_currentChanged(int index);
54 void on_descTextEdit_textChanged();
55 void on_actionHide_description_activated();
56 void on_actionHide_categories_activated();
57 void on_WorkModeDialog_finished(int result);
58 void on_action_Normal_activated();
59 void on_action_Work_activated();
60 void on_action_Delete_activated();
61 void on_searchLineEdit_textChanged(QString );
62 void on_action_Exit_activated();
63 void on_actionSave_snippets_as_activated();
64 void on_action_Save_2_activated();
65 void on_action_Main_category_activated();
66 void on_actionClos_e_all_activated();
67 void on_action_Close_activated();
68 void on_actionSave_all_activated();
69 void on_action_Save_activated();
70 void on_action_Snippet_activated();
71 void on_action_Category_activated();
72 void on_snippetTreeView_activated(QModelIndex index);
74 void deleteChildItems( QStandardItem* parent );
75 Snippet* findSnippetByTab( int atab );
76 void insertItem( QStandardItem* item, QStandardItem* parent );
77 void loadSnippets();
78 void parseCategoryElement( const QDomElement &element, QStandardItem* parent );
79 void parseModel( QStandardItem* parent, QString& xml );
80 void setToolTips();
81 void resetToolTips();
82 void restoreTabNumbers();
83 void saveSnippets( const QString& fileName = "" );
84 bool searchModelForString( const QString &searchString, QStandardItem* parent );
85 void showAllSnippets( QStandardItem* parent );
86 void snippetsCodeModified();
87 QString createToolTip( const Snippet* snippet );
88 QString toValidXml( QString string );
89 void updateSnippetsTitle( QStandardItem* item );
91 // friends
92 friend class StandardItemModel;
93 friend class WorkModeDialog;
96 #endif // MAINWINDOW_H