4 #include <QtGui/QMainWindow>
7 #include <QDomDocument>
12 #include <QFileDialog>
13 #include <QInputDialog>
15 #include <QMessageBox>
16 #include <QStandardItemModel>
17 #include <QTextStream>
19 #include <QTreeWidgetItem>
22 #include "standarditemmodel.h"
24 #include "workmodedialog.h"
28 class MainWindowClass
;
31 class MainWindow
: public QMainWindow
36 MainWindow(QWidget
*parent
= 0);
40 Ui::MainWindowClass
*ui
;
42 QByteArray mainWindowGeometry
;
43 QByteArray workModeDialogGeometry
;
44 QHash
< QStandardItem
*, Snippet
* > snippetForItem
;
47 StandardItemModel model
;
48 WorkModeDialog workModeDialog
;
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
);
78 void parseCategoryElement( const QDomElement
&element
, QStandardItem
* parent
);
79 void parseModel( QStandardItem
* parent
, QString
& xml
);
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
);
92 friend class StandardItemModel
;
93 friend class WorkModeDialog
;
96 #endif // MAINWINDOW_H