29 #include <tqscrollview.h>
31 #include <tdelibs_export.h>
35 template<
typename T >
class TQValueVector;
38 class HTMLDocumentImpl;
41 class HTMLElementImpl;
42 class HTMLTitleElementImpl;
43 class HTMLGenericFormElementImpl;
44 class HTMLFormElementImpl;
45 class HTMLAnchorElementImpl;
46 class HTMLInputElementImpl;
62 class RenderPartObject;
64 class CSSStyleSelector;
67 void applyRule(DOM::CSSProperty *prop);
71 class TDEHTMLViewPrivate;
82 friend class DOM::HTMLDocumentImpl;
83 friend class DOM::HTMLTitleElementImpl;
84 friend class DOM::HTMLGenericFormElementImpl;
85 friend class DOM::HTMLFormElementImpl;
86 friend class DOM::HTMLAnchorElementImpl;
87 friend class DOM::HTMLInputElementImpl;
88 friend class DOM::DocumentImpl;
90 friend class tdehtml::RenderCanvas;
91 friend class tdehtml::RenderObject;
92 friend class tdehtml::RenderLineEdit;
93 friend class tdehtml::RenderPartObject;
94 friend class tdehtml::RenderWidget;
95 friend class tdehtml::CSSStyleSelector;
96 friend class tdehtml::LineEditWidget;
97 friend class KJS::WindowFunc;
98 friend class KJS::ExternalFunc;
99 friend void tdehtml::applyRule(DOM::CSSProperty *prop);
115 int frameWidth()
const {
return _width; }
120 void setMarginWidth(
int x);
132 void setMarginHeight(
int y);
144 virtual void setVScrollBarMode ( ScrollBarMode mode );
149 virtual void setHScrollBarMode ( ScrollBarMode mode );
160 void print(
bool quick );
169 void displayAccessKeys();
180 void zoomView(
int );
181 void hideAccessKeys();
182 void repaintAccessKeys();
183 void findAheadActive(
bool );
185 #ifndef NO_SMOOTH_SCROLL_HACK
187 void scrollBy(
int dx,
int dy);
193 virtual void resizeEvent ( TQResizeEvent * event );
194 virtual void showEvent ( TQShowEvent * );
195 virtual void hideEvent ( TQHideEvent *);
196 virtual bool focusNextPrevChild(
bool next );
197 virtual void drawContents ( TQPainter * p,
int clipx,
int clipy,
int clipw,
int cliph );
198 virtual void drawContents( TQPainter* );
199 virtual void viewportMousePressEvent( TQMouseEvent * );
200 virtual void focusInEvent( TQFocusEvent * );
201 virtual void focusOutEvent( TQFocusEvent * );
202 virtual void viewportMouseDoubleClickEvent( TQMouseEvent * );
203 virtual void viewportMouseMoveEvent(TQMouseEvent *);
204 virtual void viewportMouseReleaseEvent(TQMouseEvent *);
205 virtual void viewportResizeEvent(TQResizeEvent*);
206 #ifndef TQT_NO_WHEELEVENT
207 virtual void viewportWheelEvent(TQWheelEvent*);
209 virtual void dragEnterEvent( TQDragEnterEvent* );
210 virtual void dropEvent( TQDropEvent* );
211 virtual void closeEvent ( TQCloseEvent * );
212 virtual bool eventFilter(TQObject *, TQEvent *);
214 void keyPressEvent( TQKeyEvent *_ke );
215 void keyReleaseEvent ( TQKeyEvent *_ke );
216 void contentsContextMenuEvent ( TQContextMenuEvent *_ce );
218 void timerEvent ( TQTimerEvent * );
220 #ifndef NO_SMOOTH_SCROLL_HACK
221 void startScrolling();
222 void stopScrolling();
223 #ifndef TQT_NO_WHEELEVENT
224 void scrollViewWheelEvent( TQWheelEvent* e );
229 void slotPaletteChanged();
230 void slotScrollBarMoved();
231 #ifndef NO_SMOOTH_SCROLL_HACK
234 void scrollTick() {};
238 void tripleClickTimeout();
240 void accessKeysTimeout();
247 void slotMouseScrollTimer();
251 void scheduleRelayout(tdehtml::RenderObject* clippedObj=0);
252 void unscheduleRelayout();
254 void scheduleRepaint(
int x,
int y,
int w,
int h,
bool asap=
false);
255 void unscheduleRepaint();
257 bool needsFullRepaint()
const;
259 void closeChildDialogs();
260 bool dialogsAllowed();
270 void paint(TQPainter *p,
const TQRect &rc,
int yOff = 0,
bool *more = 0);
277 void paint(TQPainter *p,
int width);
290 void setMediaType(
const TQString &medium );
291 TQString mediaType()
const;
293 bool pagedMode()
const;
295 bool scrollTo(
const TQRect &);
297 bool focusNextPrevNode(
bool next);
298 bool handleAccessKey(
const TQKeyEvent* ev);
299 bool focusNodeWithAccessKey(TQChar c,
TDEHTMLView* caller = NULL);
300 TQMap< DOM::ElementImpl*, TQChar > buildFallbackAccessKeys()
const;
301 void displayAccessKeys(
TDEHTMLView* caller,
TDEHTMLView* origview, TQValueVector< TQChar >& taken,
bool use_fallbacks );
303 void useSlowRepaints();
305 void setIgnoreWheelEvents(
bool e);
309 DOM::NodeImpl *nodeUnderMouse()
const;
310 DOM::NodeImpl *nonSharedNodeUnderMouse()
const;
312 void restoreScrollBar();
314 TQStringList formCompletionItems(
const TQString &name)
const;
315 void clearCompletionHistory(
const TQString& name);
316 void addFormCompletionItem(
const TQString &name,
const TQString &value);
317 void removeFormCompletionItem(
const TQString &name,
const TQString &value);
319 void addNonPasswordStorableSite(
const TQString& host );
320 bool nonPasswordStorableSite(
const TQString& host )
const;
322 bool dispatchMouseEvent(
int eventId, DOM::NodeImpl *targetNode,
323 DOM::NodeImpl *targetNodeNonShared,
bool cancelable,
324 int detail,TQMouseEvent *_mouse,
bool setUnder,
326 bool dispatchKeyEvent( TQKeyEvent *_ke );
327 bool dispatchKeyEventHelper( TQKeyEvent *_ke,
bool generate_keypress );
329 void complete(
bool pendingAction );
331 #ifndef TDEHTML_NO_TYPE_AHEAD_FIND
332 void findAhead(
bool increase);
333 void updateFindAheadTimeout();
334 void startFindAhead(
bool linksOnly );
337 #ifndef TDEHTML_NO_CARET
350 void initCaret(
bool keepSelection =
false);
353 bool caretOverrides()
const;
361 void ensureNodeHasFocus(DOM::NodeImpl *node);
368 void recalcAndStoreCaretPos(tdehtml::CaretBox *hintBox = 0);
390 void showCaret(
bool forceRepaint =
false);
402 void ensureCaretVisible();
419 bool foldSelectionToCaret(DOM::NodeImpl *startNode,
long startOffset,
420 DOM::NodeImpl *endNode,
long endOffset);
431 bool placeCaret(tdehtml::CaretBox *hintBox = 0);
449 bool extendSelection(DOM::NodeImpl *startNode,
long startOffset,
450 DOM::NodeImpl *endNode,
long endOffset);
461 void updateSelection(DOM::NodeImpl *startNode,
long startOffset,
462 DOM::NodeImpl *endNode,
long endOffset);
468 int caretDisplayPolicyNonFocused()
const;
476 void setCaretDisplayPolicyNonFocused(
int policy);
483 void caretKeyPressEvent(TQKeyEvent *);
498 bool moveCaretTo(DOM::NodeImpl *node,
long offset,
bool clearSelection);
505 enum CaretMovement { CaretByCharacter, CaretByWord };
517 void moveCaretBy(
bool next, CaretMovement cmv,
int n);
521 void moveCaretByLine(
bool next,
int n);
527 void moveCaretToLineBoundary(
bool end);
533 void moveCaretToDocumentBoundary(
bool end);
543 void placeCaretOnChar(tdehtml::CaretBox *hintBox);
561 void placeCaretOnLine(tdehtml::CaretBox *caretBox,
int x,
int absx,
int absy);
566 void moveCaretByPage(
bool next);
570 void moveCaretPrevWord();
574 void moveCaretNextWord();
580 void moveCaretPrevLine(
int n = 1);
586 void moveCaretNextLine(
int n = 1);
590 void moveCaretPrevPage();
594 void moveCaretNextPage();
598 void moveCaretToLineBegin();
602 void moveCaretToLineEnd();
609 void setWidgetVisible(::tdehtml::RenderWidget*,
bool visible);
618 TDEHTMLViewPrivate *d;
This class is tdehtml's main class.
Renders and displays HTML in a TQScrollView.
int marginWidth() const
Returns the margin width.
TDEHTMLPart * part() const
Returns a pointer to the TDEHTMLPart that is rendering the page.
void finishedLayout()
This signal is used for internal layouting.
int marginHeight()
Returns the margin height.
The Document Object Model (DOM) is divided into two parts, the COREDOM core DOM, specifying some core...