author | groucho <groucho> | 2003-05-07 09:01:39 (UTC) |
---|---|---|
committer | groucho <groucho> | 2003-05-07 09:01:39 (UTC) |
commit | 118d03d815a7615b9c53363218a7ac45b3f4c514 (patch) (side-by-side diff) | |
tree | 356953e2413cddcec0f35bd47bb6439767da7051 /noncore/apps/opie-reader/QTReaderApp.h | |
parent | 00894537decf01c5a5cdc565b2740b5e67a2e90f (diff) | |
download | opie-118d03d815a7615b9c53363218a7ac45b3f4c514.zip opie-118d03d815a7615b9c53363218a7ac45b3f4c514.tar.gz opie-118d03d815a7615b9c53363218a7ac45b3f4c514.tar.bz2 |
Incorporated TimWs current source tree and make it compile
Diffstat (limited to 'noncore/apps/opie-reader/QTReaderApp.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/QTReaderApp.h | 259 |
1 files changed, 205 insertions, 54 deletions
diff --git a/noncore/apps/opie-reader/QTReaderApp.h b/noncore/apps/opie-reader/QTReaderApp.h index cb33e4a..2765d47 100644 --- a/noncore/apps/opie-reader/QTReaderApp.h +++ b/noncore/apps/opie-reader/QTReaderApp.h @@ -22,11 +22,15 @@ +//#define _SCROLLPIPE //#define __ISEARCH -#define MAX_ENCODING 6 -#define MAX_ACTIONS 4 +//#define MAX_ENCODING 6 +#define MAX_ACTIONS 5 +#include "useqpe.h" +#include <sys/timeb.h> #include <qmainwindow.h> #include "CExpander.h" +#include "CEncoding.h" #include <qlist.h> -#include <qpe/filemanager.h> +//#include <qpe/filemanager.h> #include <qmap.h> @@ -41,3 +45,6 @@ class QPopupMenu; class QToolBar; -//class QPEToolBar; +#ifdef USEQPE
+class QPEToolBar; +class QPEMenuBar;
+#endif class CBkmkSelector; @@ -49,3 +56,4 @@ class CDrawBuffer; class QTReader; -class QPixmap; +class QImage; +class Config; @@ -53,6 +61,65 @@ enum ActionTypes { - cesOpenFile = 0, + cesNone = 0, + cesOpenFile, cesAutoScroll, cesActionMark, - cesFullScreen + cesActionAnno, + cesFullScreen, + cesZoomIn, + cesZoomOut, + cesBack, + cesForward, + cesHome, + cesPageUp, + cesPageDown, + cesLineUp, + cesLineDown, + cesStartDoc, + cesEndDoc +}; +/* +*m_preferences_action, *m_close_action *m_info_action, *m_touch_action, +*m_find_action, *m_jump_action, *m_setfont_action *m_goto_action, +*m_delete_action; *m_autogen_action, *m_clear_action, *m_save_action; +*m_tidy_action, *m_startBlock_action, *m_endBlock_action; +*m_setenc_action, *m_setmono_action; +*/ +enum ToolbarPolicy +{ + cesSingle = 0, + cesMenuTool, + cesMultiple +}; + +enum regedit_type +{ + cAutoGen, + cAddBkmk, + cJump, + cMonoSpace, + cSetTarget, +#ifdef _SCROLLPIPE + cSetPipeTarget, +#endif + cSetConfigName, + cMargin, + cExtraSpace, + cExtraLead +}; + +enum bkmk_action +{ + cOpenFile, + cGotoBkmk, + cDelBkmk, + cRmBkmkFile, + cLdConfig, + cRmConfig, + cExportLinks +}; + +enum fontselector_action +{ + cChooseFont, + cChooseEncoding }; @@ -76,3 +143,9 @@ class QTReaderApp : public QMainWindow unsigned long m_savedpos; + int m_debounce; + timeb m_lastkeytime; bool m_annoIsEditing; + bool m_propogatefontchange, m_bFloatingDialog; + bool m_url_clipboard, m_url_localfile, m_url_globalfile; + fontselector_action m_fontAction; + void doAction(ActionTypes a, QKeyEvent* e); @@ -81,2 +154,9 @@ class QTReaderApp : public QMainWindow ~QTReaderApp(); + + void handlekey(QKeyEvent* e); + void hideEvent(QHideEvent*) + { + suspend(); + } + void suspend(); @@ -92,3 +172,2 @@ class QTReaderApp : public QMainWindow // void resizeEvent(QResizeEvent* e); - void keyPressEvent(QKeyEvent* e); void closeEvent( QCloseEvent *e ); @@ -97,5 +176,9 @@ class QTReaderApp : public QMainWindow void do_jump(const QString&); - void do_overlap(const QString&); void do_settarget(const QString&); - int EncNameToInt(const QString&); +#ifdef _SCROLLPIPE +// void do_setpipetarget(const QString&); +#endif + void do_saveconfig(const QString&, bool); + bool readconfig(const QString&, bool); + bool PopulateConfig(const char*); ActionTypes ActNameToInt(const QString&); @@ -105,10 +188,20 @@ class QTReaderApp : public QMainWindow bool m_fullscreen; - + bool m_loadedconfig; public: void saveprefs(); +public slots: + void setDocument(const QString&); private slots: +#ifdef _SCRIPT +// void RunScript(); +#endif + void SaveConfig(); + void LoadConfig(); + void TidyConfig(); + void ExportLinks(); void zoomin(); void zoomout(); + void chooseencoding(); void setfullscreen(bool sfs); - void setcontinuous(bool sfs); +// void setcontinuous(bool sfs); void setTwoTouch(bool _b); @@ -128,3 +221,4 @@ private slots: void OnWordSelected(const QString&, size_t, const QString&); - void showgraphic(QPixmap&); + void OnURLSelected(const QString& href); + void showgraphic(QImage&); void addAnno(const QString&, const QString&, size_t); @@ -133,11 +227,14 @@ private slots: void showAnnotation(); + void do_setencoding(int i); void do_setfont(const QString&); - void encodingSelected(QAction*); void buttonActionSelected(QAction*); - void msgHandler(const QCString&, const QByteArray&); - void monospace(bool); +// void msgHandler(const QCString&, const QByteArray&); + void monospace(bool); void jump(); - void setoverlap(); void settarget(); - void setspacing(); +#ifdef _SCROLLPIPE +// void setpipetarget(); +// void setpause(bool); +#endif +// void setspacing(); void setfont(); @@ -150,2 +247,4 @@ private slots: // void importFiles(); + void showprefs(); + void showtoolbarprefs(); void infoClose(); @@ -153,6 +252,5 @@ private slots: void showinfo(); - void setDocument(const QString&); - void indentplus(); - void indentminus(); +// void indentplus(); +// void indentminus(); @@ -164,2 +262,5 @@ private slots: + void gotoStart(); + void gotoEnd(); + void pageup(); @@ -180,4 +281,5 @@ private slots: - void stripcr(bool); - void onespace(bool); +// void stripcr(bool); +// void setfulljust(bool); +// void onespace(bool); #ifdef REPALM @@ -185,14 +287,15 @@ private slots: #endif - void peanut(bool _b); - void remap(bool); - void embolden(bool); - void autofmt(bool); - void textfmt(bool); - void striphtml(bool); - void dehyphen(bool); - void unindent(bool); - void repara(bool); - void dblspce(bool); +// void peanut(bool _b); +// void remap(bool); +// void embolden(bool); +// void autofmt(bool); +// void textfmt(bool); +// void striphtml(bool); +// void dehyphen(bool); +// void depluck(bool); +// void dejpluck(bool); +// void unindent(bool); +// void repara(bool); +// void dblspce(bool); void pagemode(bool); - void navkeys(bool); // void gotobkmk(const QString& bm); @@ -205,5 +308,34 @@ private slots: void OnRedraw(); - void OnActionPressed(); private: + void writeUrl(const QString& file, const QString& href); + QAction *m_preferences_action, *m_open_action, *m_close_action; + QAction *m_info_action, *m_touch_action, *m_find_action, *m_start_action; + QAction *m_end_action, *m_jump_action, *m_pageline_action; + QAction *m_pageup_action, *m_pagedn_action, *m_back_action; + QAction *m_home_action, *m_forward_action, *m_zoomin_action; + QAction *m_zoomout_action, *m_setfont_action, *m_mark_action; + QAction *m_annotate_action, *m_goto_action, *m_delete_action; + QAction *m_autogen_action, *m_clear_action, *m_save_action; + QAction *m_tidy_action, *m_startBlock_action, *m_endBlock_action; + QAction *m_setenc_action, *m_setmono_action, *m_saveconfig_action; + QAction *m_loadconfig_action, *m_toolbarprefs_action, *m_tidyconfig_action; + QAction *m_exportlinks_action; + void addtoolbars(Config* config); + ToolbarPolicy m_tbpol, m_tbpolsave; + ToolBarDock m_tbposition; + bool m_tbmove, m_tbmovesave; + QToolBar* filebar(); + QToolBar* viewbar(); + QToolBar* navbar(); + QToolBar* markbar(); + void hidetoolbars(); + void addfilebar(Config* _config, const QString& key, QAction* a); + void addviewbar(Config* _config, const QString& key, QAction* a); + void addnavbar(Config* _config, const QString& key, QAction* a); + void addmarkbar(Config* _config, const QString& key, QAction* a); + bool checkbar(Config* _config, const QString& key); +#ifdef _SCRIPT + void SaveScript(const char* sname); +#endif /* @@ -218,3 +350,3 @@ private slots: QString m_targetapp, m_targetmsg; - void listbkmk(CList<Bkmk>*, const QString& _lab = QString::null); + bool listbkmk(CList<Bkmk>*, const QString& _lab = QString::null); QString usefilebrowser(); @@ -232,4 +364,2 @@ private slots: - QAction* m_EncodingAction[MAX_ENCODING]; - QAction* m_buttonAction[MAX_ACTIONS]; @@ -238,3 +368,6 @@ private slots: - ActionTypes m_spaceTarget; + ActionTypes m_spaceTarget, m_escapeTarget, m_returnTarget, m_leftTarget, m_rightTarget, + m_upTarget, m_downTarget; + bool m_leftScroll, m_rightScroll, m_upScroll, m_downScroll; + bool m_bcloseDisabled, m_disableesckey; size_t searchStart; @@ -249,4 +382,9 @@ private slots: QComboBox* m_fontSelector; -// QPEToolBar /* *menu,*/ *editBar; - QToolBar /* *menu,*/ *editBar; +// QPEToolBar /* *menu,*/ *fileBar; + QToolBar *menubar, *fileBar, *navBar, *viewBar, *markBar; +#ifdef USEQPE
+ QPEMenuBar *mb;
+#else
+ QMenuBar *mb;
+#endif
QFloatBar *searchBar, *regBar/*, *m_fontBar*/; @@ -263,4 +401,4 @@ private slots: { - qDebug("resize:(%u,%u)", r->oldSize().width(), r->oldSize().height()); - qDebug("resize:(%u,%u)", r->size().width(), r->size().height()); +// qDebug("resize:(%u,%u)", r->oldSize().width(), r->oldSize().height()); +// qDebug("resize:(%u,%u)", r->size().width(), r->size().height()); // bgroup->move( width()-bgroup->width(), 0 ); @@ -274,3 +412,5 @@ private slots: bool m_fBkmksChanged; - int m_nRegAction; +// int m_nRegAction; + regedit_type m_nRegAction; + bkmk_action m_nBkmkAction; QString m_autogenstr; @@ -279,13 +419,24 @@ private slots: -const int cAutoGen = 0; -const int cAddBkmk = 1; -const int cDelBkmk = 2; -const int cGotoBkmk = 3; -const int cRmBkmkFile = 4; -const int cJump = 5; -const int cMonoSpace = 6; -const int cOverlap = 7; -const int cSetTarget = 8; -const int cOpenFile = 9; +//const int cAutoGen = 0; +//const int cAddBkmk = 1; +//const int cDelBkmk = 2; +//const int cGotoBkmk = 3; +//const int cRmBkmkFile = 4; +//const int cJump = 5; +//const int cMonoSpace = 6; +//const int cOverlap = 7; +//const int cSetTarget = 8; +//const int cOpenFile = 9; +//const int cSetPipeTarget = 10; +//const int cSetConfigName = 11; +//const int cMargin = 12; +//const int cExtraSpace = 14; +//const int cExtraLead = 15; +//const int cGfxSize = 16; +//const int cChooseFont = 2; +//const int cChooseEncoding = 1; #endif + + + |