-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaview.h
127 lines (107 loc) · 2.79 KB
/
aview.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
/**
* AView MainWindow class.
*
* It will process various request from viewer. Handling dialog and options.
*
* @file aview.h
* vim:sw=2:sts=2:et
*/
#ifndef __A_VIEW_H__
#define __A_VIEW_H__
#include <qmainwindow.h>
#include <qmenubar.h>
#include <qtoolbar.h>
#include <qaction.h>
#include <qmenubar.h>
#include <qpopupmenu.h>
#include "timestamp.h"
class QZFile;
class TParser;
class FileSelect;
class OptionDlg;
class GenConfig;
class AskDialog;
class BaseView;
class TextView;
class ImageView;
class FileLister;
enum {
VIEW_NONE,
VIEW_TEXT,
VIEW_IMAGE
};
class AView : public QMainWindow
{
Q_OBJECT
private:
BaseView *m_view;
ImageView *m_iview;
TextView *m_tview;
int m_mode;
FileSelect *m_browser;
OptionDlg *m_optiondlg;
AskDialog *m_wAsk;
FileLister *m_flist;
QString m_filename;
QWidget *m_dialog;
bool m_isDialog;
bool m_closeReal;
QToolBar *m_tbMain, *m_tbIcon;
QMenuBar *m_tbMenu;
QPopupMenu *m_mnFile, *m_mnRescent, *m_mnPopup;
QAction *m_open, *m_close, *m_find, *m_option;
QAction *m_rotateRight, *m_rotateLeft;
/* key press status */
int m_keyPressed;
TimeStamp m_keyPressTime, m_keyUsedTime;
int m_mousePressed;
bool m_mouseMove;
TimeStamp m_mousePressTime;
int m_mx, m_my;
/* ui status */
bool m_fullScreen, m_fullBeforeDialog;
int m_tbHeight;
private:
bool doAction(int key, int holding);
void resizeEvent(QResizeEvent *ev);
void keyPressEvent(QKeyEvent *ev);
void keyReleaseEvent(QKeyEvent *ev);
void closeEvent(QCloseEvent *ev);
void showScreen(bool isFull);
void updateViewSize();
void showView();
int getAreaIndex(int x, int y, int width, int height,
int rotation=-1);
public slots:
void openFile();
void closeFile();
void closeNow();
void closeDialog();
void openDialog(QWidget *w);
void openFile(QString name);
void openFile(QString name, int parser_id, int encoding_id);
void loadPrev();
void loadNext();
void toggleFullScreen();
void updateRescentFiles();
void rescentSelected(int id);
void showOptions();
void showPopup();
void showJump();
void showSearch();
void showMaximized();
void showNormal();
void rotateRight();
void rotateLeft();
void setParagraph(int para);
void search(QString key, int flags);
void reloadConfiguration();
public :
AView(QMainWindow *parent=NULL, const char *name=NULL,
WFlags f=WType_TopLevel);
~AView();
void viewMousePressEvent(QMouseEvent *ev);
void viewMouseReleaseEvent(QMouseEvent *ev);
void viewMouseMoveEvent(QMouseEvent *ev);
};
#endif