author | llornkcor <llornkcor> | 2002-12-20 01:35:01 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-12-20 01:35:01 (UTC) |
commit | 876e1a4724a7bd75dc642e295de354241096e028 (patch) (side-by-side diff) | |
tree | a37c5dcc9d78e04bb6b859ab89d8cf81e6745087 /noncore/apps/opie-reader/QTReader.h | |
parent | 5fd6636ba3d94b48dd543887316c47c5388a43c2 (diff) | |
download | opie-876e1a4724a7bd75dc642e295de354241096e028.zip opie-876e1a4724a7bd75dc642e295de354241096e028.tar.gz opie-876e1a4724a7bd75dc642e295de354241096e028.tar.bz2 |
update - sorry it took so long. hope this works correctly
Diffstat (limited to 'noncore/apps/opie-reader/QTReader.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/QTReader.h | 56 |
1 files changed, 48 insertions, 8 deletions
diff --git a/noncore/apps/opie-reader/QTReader.h b/noncore/apps/opie-reader/QTReader.h index 78230b4..3d5f57d 100644 --- a/noncore/apps/opie-reader/QTReader.h +++ b/noncore/apps/opie-reader/QTReader.h @@ -10,18 +10,21 @@ //#include <qtimer.h> class CDrawBuffer; //class CBuffer; class QPainter; class QTimer; +class QPixmap; +class statedata; class QTReader : public QWidget { Q_OBJECT friend class QTReaderApp; + void suspend() { buffdoc.suspend(); } void drawText(QPainter& p, int x, int y, tchar* text); int m_delay; unsigned int m_overlap; bool m_autoScroll; void autoscroll(); QTimer* timer; @@ -34,13 +37,24 @@ class QTReader : public QWidget int m_charpc; FontControl m_fontControl; public: QTReader( QWidget *parent=0, const char *name=0, WFlags f = 0); // QTReader( const QString& filename, QWidget *parent=0, const tchar *name=0, WFlags f = 0); ~QTReader(); + void zoomin(); + void zoomout(); + void setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen) + { + buffdoc.setSaveData(data, len, src, srclen); + } + void putSaveData(unsigned char*& src, unsigned short& srclen) + { + buffdoc.putSaveData(src, srclen); + } bool empty(); + void setContinuous(bool _b); void toggle_autoscroll(); void setautoscroll(bool); void disableAutoscroll() { m_autoScroll = false; } void copy() { /* @@ -105,12 +119,24 @@ public: } 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) @@ -187,14 +213,18 @@ public: if (bpeanut || (bautofmt && (PreferredMarkup() == cPML))) filt->addfilter(new PeanutFormatter); if (bstriphtml || (bautofmt && (PreferredMarkup() == cHTML))) filt->addfilter(new striphtml); if (bdehyphen) filt->addfilter(new dehyphen); if (bunindent) filt->addfilter(new unindent); if (brepara) filt->addfilter(new repara); + if (bonespace) filt->addfilter(new OnePara); if (bindenter) filt->addfilter(new indenter(bindenter)); if (bdblspce) filt->addfilter(new dblspce); +#ifdef REPALM + if (brepalm) filt->addfilter(new repalm); +#endif if (bremap) filt->addfilter(new remap); if (bmakebold) filt->addfilter(new embolden); return filt; } @@ -213,60 +243,70 @@ private slots: // void mouseDoubleClickEvent( QMouseEvent* ); QString m_string, m_fontname; void setfont(); //myoutput stuff private: bool mouseUpOn; - bool getcurrentpos(int x, int y, size_t& start, size_t& offset, size_t& tgt); + linkType getcurrentpos(int x, int y, size_t& start, size_t& offset, size_t& tgt); bool m_twotouch, m_touchone; size_t m_startpos, m_startoffset; + void dopageup(unsigned int); void dopageup(); void lineDown(); void lineUp(); void dopagedn(); long real_delay(); int m_textsize; int m_lastwidth, m_lastheight; CBufferFace<CDrawBuffer*> textarray; CBufferFace<size_t> locnarray; unsigned int numlines; - bool bstripcr, btextfmt, bstriphtml, bdehyphen, bunindent, brepara, bdblspce, btight, bmakebold, bremap, bpeanut, bautofmt; - bool m_bpagemode, m_bMonoSpaced; + bool bstripcr, btextfmt, bstriphtml, bdehyphen, bunindent, brepara, bdblspce, btight, bmakebold, bremap, bpeanut, bautofmt, bonespace; +#ifdef REPALM + bool brepalm; +#endif + bool m_bpagemode, m_bMonoSpaced, m_continuousDocument; unsigned char bindenter; QString m_lastfile; size_t m_lastposn; public: + bool bDoUpdates; + bool m_navkeys; + void NavUp(); + void NavDown(); int getch() { return buffdoc.getch(); } bool tight; bool load_file(const char *newfile, unsigned int lcn=0); BuffDoc buffdoc; CList<Bkmk>* getbkmklist() { return buffdoc.getbkmklist(); } bool locate(unsigned long n); - void jumpto(unsigned long n) { buffdoc.locate(n); } - unsigned long locate() { return buffdoc.locate(); } - unsigned long explocate() { return buffdoc.explocate(); } + void jumpto(unsigned long n) { buffdoc.unsuspend(); buffdoc.locate(n); } + unsigned long locate() { buffdoc.unsuspend(); return buffdoc.locate(); } + unsigned long explocate() { buffdoc.unsuspend(); return buffdoc.explocate(); } unsigned long pagelocate() { return locnarray[0]; } unsigned long mylastpos; - void setfilter(CFilterChain *f) { buffdoc.setfilter(f); locate(pagelocate()); } + void setfilter(CFilterChain *f) { buffdoc.unsuspend(); buffdoc.setfilter(f); locate(pagelocate()); } void restore() { jumpto(mylastpos); } void goUp(); void refresh() { locate(pagelocate()); } void goDown(); // bool bold; int textsize() { return m_textsize; } void textsize(int ts) { m_textsize = ts; } bool fillbuffer(int ru = 0, int ht = 0); unsigned int screenlines(); - void sizes(unsigned long& fs, unsigned long& ts) { buffdoc.sizes(fs,ts); } + void sizes(unsigned long& fs, unsigned long& ts) { buffdoc.unsuspend(); buffdoc.sizes(fs,ts); } static const char *fonts[]; // unsigned int *fontsizes; int m_ascent, m_descent, m_linespacing; QFontMetrics* m_fm; QString firstword(); + void setstate(const statedata& sd); signals: void OnRedraw(); void OnWordSelected(const QString&, size_t, const QString&); void OnActionPressed(); + void OnShowPicture(QPixmap&); }; #endif |