-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtreecle.h
157 lines (124 loc) · 3.38 KB
/
treecle.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/* Treecle
*
* Copyright (c) Kartik Patel
* E-mail: letapk@gmail.com
* Download from: https://letapk.wordpress.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QApplication>
#include <QMainWindow>
#include <QString>
#include <QStringList>
#include <QMenuBar>
#include <QSplitter>
#include <QFileDialog>
#include <QToolBar>
#include <QHeaderView>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QTextEdit>
#include <QTextBrowser>
#include <QLabel>
#include <QCloseEvent>
#include <QFontComboBox>
#include <QColorDialog>
#include <QTextStream>
#include <QMessageBox>
#include <QImageReader>
#include <QMouseEvent>
#include <QLineEdit>
#include <QSettings>
#include <QTranslator>
#include <QtWebKit>
#include <QtWebKitWidgets>
class MainWindow : public QMainWindow
{
Q_OBJECT
QMenu *filemenu, *helpmenu, *treemenu;
//toolbar
QToolBar *tb1, *tb2;
//some global actions needed in other methods
QAction *actionTextBold, *actionTextItalic, *actionTextUnderline;
QAction *actionAlignLeft, *actionAlignCenter, *actionAlignRight, *actionAlignJustify;
QAction *selectall;
QFontComboBox *comboFont;
QComboBox *comboSize;
QLineEdit *srchbox;
QSplitter *splitter;
QTreeWidget *tree;
QTreeWidgetItem *cur_branch, *cur_leaf;
//QWebEngineView *leafview;
QWebView *leafview;
//whether current branch is a top level category or a child, no. of categories
int catflag, catcount;
//whether the data has been altered
bool fmodified = false;
QLabel *statustext;
QString Gnugplfilename;
QString Helpfilename;
//stores the path to the data subdirectory
QString Homepath;
QString Currentfile;
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
public slots:
void setup_menu_and_toolbar ();
//file menu
void open_file ();
int new_file();
int save_file();
int save_file_as ();
void quit();
//help menu
void help();
void about();
//tree menu
void tree_addbranch();
void tree_addsubbranch();
void tree_cutbranch();
void tree_copybranch();
void tree_pastebranch();
void tree_delbranch_after_copy();
void tree_srch_nxt();
void tree_srch_pre();
void tree_delbranch();
//tree related data
void modify_name (QTreeWidgetItem *b);
void set_branch (QTreeWidgetItem *b);
void get_data_from_leaf();
void save_this_branch (QTreeWidgetItem *cat, QTextStream *out);
void read_this_branch (QTreeWidgetItem *cat, QTextStream *in);
void delete_tree();
void expand_tree();
void collapse_tree();
void sort_asc_tree();
void sort_desc_tree();
//editor toolbar
void textBold();
void textItalic();
void textUnderline();
void textAlign(QAction*);
void textColor();
void fontFamily();
void textSize();
void insertImage();
void adjustActions();
void select_all();
//virtual slots
void closeEvent(QCloseEvent *event);
void resizeEvent(QResizeEvent *event);
//load data in editor
void show_branch_data ();
//preferences
void writeprefs();
void readprefs();
};
#endif // MAINWINDOW_H