summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/QTReader.h
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-reader/QTReader.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/QTReader.h56
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
@@ -14,4 +14,6 @@ class CDrawBuffer;
class QPainter;
class QTimer;
+class QPixmap;
+class statedata;
class QTReader : public QWidget
@@ -20,4 +22,5 @@ class QTReader : public QWidget
friend class QTReaderApp;
+ void suspend() { buffdoc.suspend(); }
void drawText(QPainter& p, int x, int y, tchar* text);
int m_delay;
@@ -38,5 +41,16 @@ public:
// 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);
@@ -109,4 +123,16 @@ public:
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)
{
@@ -191,6 +217,10 @@ public:
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);
@@ -217,7 +247,8 @@ private slots:
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();
@@ -230,10 +261,17 @@ private slots:
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;
@@ -242,10 +280,10 @@ private slots:
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();
@@ -257,5 +295,5 @@ private slots:
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;
@@ -263,4 +301,5 @@ private slots:
QFontMetrics* m_fm;
QString firstword();
+ void setstate(const statedata& sd);
signals:
@@ -268,4 +307,5 @@ private slots:
void OnWordSelected(const QString&, size_t, const QString&);
void OnActionPressed();
+ void OnShowPicture(QPixmap&);
};