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/QTReader.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/QTReader.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/QTReader.h | 150 |
1 files changed, 55 insertions, 95 deletions
diff --git a/noncore/apps/opie-reader/QTReader.h b/noncore/apps/opie-reader/QTReader.h index 3d5f57d..dfbdfb9 100644 --- a/noncore/apps/opie-reader/QTReader.h +++ b/noncore/apps/opie-reader/QTReader.h @@ -3,2 +3,4 @@ +//#define _SCROLLPIPE + #include <qwidget.h> @@ -16,3 +18,2 @@ class QTimer; class QPixmap; -class statedata; @@ -22,4 +23,8 @@ class QTReader : public QWidget + static tchar pluckernextpart[]; + static tchar jplucknextpart[]; friend class QTReaderApp; - void suspend() { buffdoc.suspend(); } + void suspend(); + void increaseScroll(); + void reduceScroll(); void drawText(QPainter& p, int x, int y, tchar* text); @@ -27,8 +32,10 @@ class QTReader : public QWidget unsigned int m_overlap; - bool m_autoScroll; + bool m_autoScroll, m_swapmouse; void autoscroll(); QTimer* timer; - int m_scrolldy1, m_scrolldy2, m_encd; + int m_scrolldy1, m_scrolldy2, m_encd, m_scrollpart; void focusInEvent(QFocusEvent*); void focusOutEvent(QFocusEvent*); + void processmousepositionevent( QMouseEvent* _e ); + void processmousewordevent(size_t startpos, size_t startoffset, QMouseEvent* _e, int lineno); bool ChangeFont(int); @@ -37,3 +44,12 @@ class QTReader : public QWidget int m_charpc; + unsigned char m_border; FontControl m_fontControl; + void setBaseSize(unsigned char _s) { m_fontControl.setBaseSize(_s); } + unsigned char getBaseSize() { return m_fontControl.getBaseSize(); } +#ifdef _SCROLLPIPE + FILE* m_pipeout; + QString m_pipetarget; + bool m_isPaused; + bool m_pauseAfterEachPara; +#endif public: @@ -88,85 +104,18 @@ public: */ - void setpeanut(bool _b) - { - bpeanut = _b; - setfilter(getfilter()); - } - void setremap(bool _b) - { - bremap = _b; - setfilter(getfilter()); - } - void setmakebold(bool _b) - { - bmakebold = _b; - setfilter(getfilter()); - } - void setautofmt(bool _b) - { - bautofmt = _b; - if (bautofmt) + void setlead(int _lead) { - btextfmt = false; - bstriphtml = false;; - bpeanut = false; + m_fontControl.setlead(_lead); + } + int getlead() + { + return m_fontControl.getlead(); + } + void setextraspace(int _lead) + { + m_fontControl.setextraspace(_lead); + } + int getextraspace() + { + return m_fontControl.getextraspace(); } - setfilter(getfilter()); - } - void settextfmt(bool _b) - { - btextfmt = _b; - setfilter(getfilter()); - } - void setstripcr(bool _b) - { - bstripcr = _b; - setfilter(getfilter()); - } - void setonespace(bool _b) - { - bonespace = _b; - setfilter(getfilter()); - } -#ifdef REPALM - void setrepalm(bool _b) - { - brepalm = _b; - setfilter(getfilter()); - } -#endif - void setstriphtml(bool _b) - { - bstriphtml = _b; - setfilter(getfilter()); - } - void setdehyphen(bool _b) - { - bdehyphen = _b; - setfilter(getfilter()); - } - void setunindent(bool _b) - { - bunindent = _b; - setfilter(getfilter()); - } - void setrepara(bool _b) - { - brepara = _b; - setfilter(getfilter()); - } - void setdblspce(bool _b) - { - bdblspce = _b; - setfilter(getfilter()); - } - void indentplus() - { - if (bindenter < 15) bindenter += 2; - setfilter(getfilter()); - } - void indentminus() - { - if (bindenter > 1) bindenter -= 2; - setfilter(getfilter()); - } void setpagemode(bool _b) @@ -189,17 +138,22 @@ public: { +// qDebug("m_encd:%d", m_encd); switch (m_encd) { - case 5: - return new Ccp1252; case 4: +// qDebug("palm"); return new CPalm; case 1: +// qDebug("utf8"); return new CUtf8; case 2: +// qDebug("ucs16be"); return new CUcs16be; case 3: +// qDebug("ucs16le"); return new CUcs16le; case 0: - default: +// qDebug("ascii"); return new CAscii; + default: + return new CGeneral8Bit(m_encd-MAX_ENCODING+1); } @@ -225,3 +179,6 @@ public: if (bremap) filt->addfilter(new remap); + if (bdepluck) filt->addfilter(new DePluck(pluckernextpart)); + if (bdejpluck) filt->addfilter(new DePluck(jplucknextpart)); if (bmakebold) filt->addfilter(new embolden); + if (bfulljust) filt->addfilter(new FullJust); return filt; @@ -231,2 +188,5 @@ public: private slots: + void goHome(); + void goBack(); + void goForward(); void doscroll(); @@ -262,3 +222,4 @@ private slots: unsigned int numlines; - bool bstripcr, btextfmt, bstriphtml, bdehyphen, bunindent, brepara, bdblspce, btight, bmakebold, bremap, bpeanut, bautofmt, bonespace; +// bool m_showlast; + bool bstripcr, btextfmt, bstriphtml, bdehyphen, bdepluck, bdejpluck, bunindent, brepara, bdblspce, btight, bmakebold, bremap, bpeanut, bautofmt, bonespace, bfulljust; #ifdef REPALM @@ -272,6 +233,6 @@ private slots: bool bDoUpdates; - bool m_navkeys; void NavUp(); void NavDown(); - int getch() { return buffdoc.getch(); } + tchar getch() { return buffdoc.getch(); } + bool synch(size_t, size_t); bool tight; @@ -294,3 +255,3 @@ private slots: void textsize(int ts) { m_textsize = ts; } - bool fillbuffer(int ru = 0, int ht = 0); + bool fillbuffer(int ru = 0, int ht = 0, int newht = -1); unsigned int screenlines(); @@ -302,3 +263,2 @@ private slots: QString firstword(); - void setstate(const statedata& sd); @@ -307,4 +267,4 @@ private slots: void OnWordSelected(const QString&, size_t, const QString&); - void OnActionPressed(); - void OnShowPicture(QPixmap&); + void OnShowPicture(QImage&); + void OnURLSelected(const QString&); }; |