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) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/QTReader.h96
1 files changed, 28 insertions, 68 deletions
diff --git a/noncore/apps/opie-reader/QTReader.h b/noncore/apps/opie-reader/QTReader.h
index 3bcdde4..9daa07a 100644
--- a/noncore/apps/opie-reader/QTReader.h
+++ b/noncore/apps/opie-reader/QTReader.h
@@ -15,31 +15,34 @@ class CDrawBuffer;
#include <qpixmap.h>
class QPainter;
class QTimer;
class QImage;
#include "BGType.h"
-#include "striphtml.h"
-#define ROTATION_ENABLED
#define SPECIALSCROLL
-#define DOUBLEBUFFER
-#ifdef DOUBLEBUFFER
+
class QPainter;
-#endif
+class COutput;
class CStyle;
+#define USETIMER
class QTReader : public QWidget
{
Q_OBJECT
friend class QTReaderApp;
-#ifdef DOUBLEBUFFER
+#ifdef USETIMER
+ QTimer* m_dragtimer;
+ unsigned long m_dragtarget;
+#endif
+ COutput* m_output;
+ bool checkoutput();
+ bool m_outofdate, m_drageligible;
QPixmap *dbuff;
QPainter* dbp;
-#endif
void drawSingleLine(int lineno);
void gotoLink();
void emitRedraw();
CStyle* m_currentlinkstyle;
int m_currentlink;
int m_currentlinkoffset;
@@ -71,17 +74,15 @@ class QTReader : public QWidget
void dostaticscroll();
void suspend();
void redrawScroll(QPainter* p);
int m_delay, m_scrolltype;
unsigned int m_overlap;
bool m_autoScroll, m_swapmouse;
- void drawBackground();
-#ifdef ROTATION_ENABLED
+ void drawBackground(QPainter*);
bool m_rotated;
void setrotated(bool);
-#endif
void autoscroll();
QTimer* timer;
int m_scrolldy1, m_scrolldy2, m_encd, m_scrollpart, m_totalscroll;
void focusInEvent(QFocusEvent*);
void focusOutEvent(QFocusEvent*);
void processmousepositionevent( QMouseEvent* _e );
@@ -92,23 +93,25 @@ class QTReader : public QWidget
int m_charpc;
unsigned short m_absleft_border, m_absright_border;
unsigned short m_left_border, m_right_border;
FontControl m_fontControl;
void setBaseSize(unsigned char _s) { m_fontControl.setBaseSize(_s); }
unsigned char getBaseSize() { return m_fontControl.getBaseSize(); }
+ QString m_outputName;
#ifdef _SCROLLPIPE
FILE* m_pipeout;
QString m_pipetarget;
bool m_isPaused;
bool m_pauseAfterEachPara;
#endif
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();
QString about();
+ void readAloud();
CList<Bkmk>* Bkmklist() { return pBkmklist; }
void setBackground(const QColor& _c)
{
m_default_bg = _c;
reset_bg();
}
@@ -150,13 +153,13 @@ public:
}
QApplication::clipboard()->setText(text);
jumpto(nd);
*/
};
void clear() {};
- void setText(const QString& n, const QString& s) { m_string = n; load_file((const char*)s); };
+ void setText(const QString& n, const QString& s, unsigned int lcn = 0) { m_string = n; load_file((const char*)s, lcn); };
/*
void setText(bool oldfile)
{
if (oldfile)
{
m_string = m_lastfile;
@@ -222,117 +225,74 @@ public:
return new CAscii;
default:
return new CGeneral8Bit(m_encd-MAX_ENCODING+1);
}
}
HighlightFilter* m_highlightfilter;
- CFilterChain* getfilter()
- {
- CFilterChain * filt = new CFilterChain(getencoding());
- if (bstripcr) filt->addfilter(new stripcr);
-
- if (btextfmt || (bautofmt && (PreferredMarkup() == cTEXT))) filt->addfilter(new textfmt);
- if (bpeanut || (bautofmt && (PreferredMarkup() == cPML))) filt->addfilter(new PeanutFormatter);
- // if (bstriphtml || (bautofmt && (PreferredMarkup() == cHTML))) filt->addfilter(new striphtml(m_lastfile));
-
-#ifdef __STATIC
- if (bstriphtml || (bautofmt && (PreferredMarkup() == cHTML))) filt->addfilter(new striphtml(m_lastfile));
- if (bautofmt && (PreferredMarkup() == cCHM))
- {
- filt->addfilter(new striphtml(m_lastfile));
- }
-#else
- if (bstriphtml || (bautofmt && (PreferredMarkup() == cHTML))) filt->addfilter(new ExternFilter("HTMLfilter", m_lastfile));
- if (bautofmt && (PreferredMarkup() == cCHM))
- {
- ExternFilter* f = new ExternFilter("HTMLfilter",m_lastfile);
- ((striphtml*)f->filter())->setchm(true);
- filt->addfilter(f);
- }
-#endif
- m_highlightfilter = new HighlightFilter(this);
- filt->addfilter(m_highlightfilter);
-
- if (bdehyphen) filt->addfilter(new dehyphen);
- if (bunindent) filt->addfilter(new unindent);
- if (brepara) filt->addfilter(new repara(m_reparastring));
- if (bonespace) filt->addfilter(new OnePara);
- if (bindenter) filt->addfilter(new indenter(bindenter));
- if (bdblspce) filt->addfilter(new dblspce);
- if (bdepluck) filt->addfilter(new DePluck(pluckernextpart));
- if (bdejpluck) filt->addfilter(new DePluck(jplucknextpart));
- if (brepalm) filt->addfilter(new repalm);
- if (bkern) filt->addfilter(new kern);
- if (bremap) filt->addfilter(new remap);
- if (bmakebold) filt->addfilter(new embolden);
- if (bfulljust) filt->addfilter(new FullJust);
- int r,g,b;
- m_default_bg.rgb(&r, &g, &b);
- if (r != 255 || g != 255 || b != 255)
- filt->addfilter(new setbg(r,g,b));
- m_default_fg.rgb(&r, &g, &b);
- if (r != 0 || g != 0 || b != 0)
- filt->addfilter(new setfg(r,g,b));
- // if (bNegative) filt->addfilter(new makeNegative);
- if (bInverse) filt->addfilter(new makeInverse);
- return filt;
- }
-
+ CFilterChain* getfilter();
private slots:
+#ifdef USETIMER
+ void actionDrag();
+#endif
void dopageup();
void lineDown();
void lineUp();
void dopagedn();
void goHome();
void goBack();
void goForward();
void doscroll();
void paintEvent( QPaintEvent * );
-#ifdef DOUBLEBUFFER
+
void resizeEvent( QResizeEvent * p );
-#endif
+
void keyPressEvent(QKeyEvent*);
private:
// void drawIt( QPainter * );
void redrawall();
void drawFonts();
void DrawStraight(QPainter* p, int w, int h);
QColor m_scrollcolor, m_scrollbarcolor;
void setTwoTouch(bool _b);
void init();
+ void mouseMoveEvent( QMouseEvent* );
void mousePressEvent( QMouseEvent* );
void mouseReleaseEvent( QMouseEvent* );
// void mouseDoubleClickEvent( QMouseEvent* );
QString m_string, m_fontname, m_reparastring;
void setfont();
+ bool m_doubleBuffered;
+
+ void setDoubleBuffer(bool _b);
//myoutput stuff
private:
#ifdef SPECIALSCROLL
int m_scrolldy;
#endif
bool mouseUpOn;
- linkType getcurrentpos(int x, int y, int w, int h, int& lineno, size_t& start, size_t& offset, size_t& tgt, size_t& tgtoffset, size_t& pictgt, QImage*&);
+ linkType getcurrentpos(int x, int y, int w, int h, int& lineno, size_t& start, size_t& offset, size_t& tgt, size_t& tgtoffset, size_t& pictgt, QImage*&, size_t&);
bool m_twotouch, m_touchone;
size_t m_startpos, m_startoffset;
void dopageup(unsigned int);
long real_delay();
int m_textsize;
int m_lastwidth, m_lastheight;
CBufferFace<CDrawBuffer*> textarray;
CBufferFace<size_t> locnarray;
unsigned int numlines;
// bool m_showlast;
- bool bstripcr, btextfmt, bstriphtml, bdehyphen, bdepluck, bdejpluck, bunindent, brepara, bdblspce, btight, bmakebold, bremap, bpeanut, bautofmt, bonespace, bfulljust, /*bNegative,*/ bInverse;
- bool bkern, brepalm;
+ bool bstripcr, btextfmt, bstriphtml, bdehyphen, bdepluck, bdejpluck, bunindent, brepara, bdblspce, btight, bmakebold, bremap, bpeanut, bautofmt, bonespace, bfulljust, /*bNegative,*/ bInverse, bNoInlineTables;
+ bool bkern, brepalm, bunderlineLink;
bool m_bpagemode, m_bMonoSpaced, m_continuousDocument;
unsigned char bindenter;
QString m_lastfile;
size_t m_lastposn;
bool bDoUpdates;
public:
+ bool doOutput(const QString& wrd);
void setDoUpdates(bool b) { bDoUpdates = b; }
void setStripCR(bool b) { bstripcr = b; }
void NavUp();
void NavDown();
tchar getch() { return buffdoc.getch(); }
bool synch(size_t, size_t);