• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdehtml
 

tdehtml

  • tdehtml
tdehtmlview.h
1/* This file is part of the KDE project
2
3 Copyright (C) 1997 Martin Jones (mjones@kde.org)
4 (C) 1998 Waldo Bastian (bastian@kde.org)
5 (C) 1998, 1999 Torben Weis (weis@kde.org)
6 (C) 1999 Lars Knoll (knoll@kde.org)
7 (C) 1999 Antti Koivisto (koivisto@kde.org)
8
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
13
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Library General Public License for more details.
18
19 You should have received a copy of the GNU Library General Public License
20 along with this library; see the file COPYING.LIB. If not, write to
21 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 Boston, MA 02110-1301, USA.
23*/
24
25#ifndef TDEHTMLVIEW_H
26#define TDEHTMLVIEW_H
27
28// qt includes and classes
29#include <tqscrollview.h>
30
31#include <tdelibs_export.h>
32
33class TQPainter;
34class TQRect;
35template< typename T > class TQValueVector;
36
37namespace DOM {
38 class HTMLDocumentImpl;
39 class DocumentImpl;
40 class ElementImpl;
41 class HTMLElementImpl;
42 class HTMLTitleElementImpl;
43 class HTMLGenericFormElementImpl;
44 class HTMLFormElementImpl;
45 class HTMLAnchorElementImpl;
46 class HTMLInputElementImpl;
47 class Range;
48 class NodeImpl;
49 class CSSProperty;
50}
51
52namespace KJS {
53 class WindowFunc;
54 class ExternalFunc;
55}
56
57namespace tdehtml {
58 class RenderObject;
59 class RenderCanvas;
60 class RenderStyle;
61 class RenderLineEdit;
62 class RenderPartObject;
63 class RenderWidget;
64 class CSSStyleSelector;
65 class LineEditWidget;
66 class CaretBox;
67 void applyRule(DOM::CSSProperty *prop);
68}
69
70class TDEHTMLPart;
71class TDEHTMLViewPrivate;
72
78class TDEHTML_EXPORT TDEHTMLView : public TQScrollView
79{
80 TQ_OBJECT
81
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;
89 friend class TDEHTMLPart;
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);
100
101
102public:
106 TDEHTMLView( TDEHTMLPart *part, TQWidget *parent, const char *name=0 );
107 virtual ~TDEHTMLView();
108
113 TDEHTMLPart *part() const { return m_part; }
114
115 int frameWidth() const { return _width; }
116
120 void setMarginWidth(int x);
121
127 int marginWidth() const { return _marginWidth; }
128
129 /*
130 * Sets a margin in y direction.
131 */
132 void setMarginHeight(int y);
133
139 int marginHeight() { return _marginHeight; }
140
144 virtual void setVScrollBarMode ( ScrollBarMode mode );
145
149 virtual void setHScrollBarMode ( ScrollBarMode mode );
150
154 void print();
155
160 void print( bool quick ); // KDE 4.0: merge with above
161
165 void layout(); // KDE 4.0: make private
169 void displayAccessKeys();
170
171
172
173signals:
178 void finishedLayout();
179 void cleared();
180 void zoomView( int );
181 void hideAccessKeys();
182 void repaintAccessKeys();
183 void findAheadActive( bool );
184//#define NO_SMOOTH_SCROLL_HACK
185#ifndef NO_SMOOTH_SCROLL_HACK
186public slots:
187 void scrollBy(int dx, int dy);
188#endif
189
190protected:
191 void clear();
192
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*);
208#endif
209 virtual void dragEnterEvent( TQDragEnterEvent* );
210 virtual void dropEvent( TQDropEvent* );
211 virtual void closeEvent ( TQCloseEvent * );
212 virtual bool eventFilter(TQObject *, TQEvent *);
213
214 void keyPressEvent( TQKeyEvent *_ke );
215 void keyReleaseEvent ( TQKeyEvent *_ke );
216 void contentsContextMenuEvent ( TQContextMenuEvent *_ce );
217 void doAutoScroll();
218 void timerEvent ( TQTimerEvent * );
219
220#ifndef NO_SMOOTH_SCROLL_HACK
221 void startScrolling();
222 void stopScrolling();
223#ifndef TQT_NO_WHEELEVENT
224 void scrollViewWheelEvent( TQWheelEvent* e );
225#endif
226#endif
227
228protected slots:
229 void slotPaletteChanged();
230 void slotScrollBarMoved();
231#ifndef NO_SMOOTH_SCROLL_HACK
232 void scrollTick();
233#else
234 void scrollTick() {}; // moc cannot handle #if
235#endif
236
237private slots:
238 void tripleClickTimeout();
239 void findTimeout();
240 void accessKeysTimeout();
241
247 void slotMouseScrollTimer();
248
249private:
250
251 void scheduleRelayout(tdehtml::RenderObject* clippedObj=0);
252 void unscheduleRelayout();
253
254 void scheduleRepaint(int x, int y, int w, int h, bool asap=false);
255 void unscheduleRepaint();
256
257 bool needsFullRepaint() const;
258
259 void closeChildDialogs();
260 bool dialogsAllowed();
261
270 void paint(TQPainter *p, const TQRect &rc, int yOff = 0, bool *more = 0);
271
272#if 0
277 void paint(TQPainter *p, int width);
278#endif
279
290 void setMediaType( const TQString &medium );
291 TQString mediaType() const;
292
293 bool pagedMode() const;
294
295 bool scrollTo(const TQRect &);
296
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 );
302
303 void useSlowRepaints();
304
305 void setIgnoreWheelEvents(bool e);
306
307 void init();
308
309 DOM::NodeImpl *nodeUnderMouse() const;
310 DOM::NodeImpl *nonSharedNodeUnderMouse() const;
311
312 void restoreScrollBar();
313
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);
318
319 void addNonPasswordStorableSite( const TQString& host );
320 bool nonPasswordStorableSite( const TQString& host ) const;
321
322 bool dispatchMouseEvent(int eventId, DOM::NodeImpl *targetNode,
323 DOM::NodeImpl *targetNodeNonShared, bool cancelable,
324 int detail,TQMouseEvent *_mouse, bool setUnder,
325 int mouseEventType);
326 bool dispatchKeyEvent( TQKeyEvent *_ke );
327 bool dispatchKeyEventHelper( TQKeyEvent *_ke, bool generate_keypress );
328
329 void complete( bool pendingAction );
330
331#ifndef TDEHTML_NO_TYPE_AHEAD_FIND
332 void findAhead(bool increase);
333 void updateFindAheadTimeout();
334 void startFindAhead( bool linksOnly );
335#endif // TDEHTML_NO_TYPE_AHEAD_FIND
336
337#ifndef TDEHTML_NO_CARET
338 // -- caret-related member functions (for caretMode as well as designMode)
339
350 void initCaret(bool keepSelection = false);
353 bool caretOverrides() const;
361 void ensureNodeHasFocus(DOM::NodeImpl *node);
368 void recalcAndStoreCaretPos(tdehtml::CaretBox *hintBox = 0);
375 void caretOn();
381 void caretOff();
390 void showCaret(bool forceRepaint = false);
397 void hideCaret();
402 void ensureCaretVisible();
403
419 bool foldSelectionToCaret(DOM::NodeImpl *startNode, long startOffset,
420 DOM::NodeImpl *endNode, long endOffset);
421
431 bool placeCaret(tdehtml::CaretBox *hintBox = 0);
432
449 bool extendSelection(DOM::NodeImpl *startNode, long startOffset,
450 DOM::NodeImpl *endNode, long endOffset);
451
461 void updateSelection(DOM::NodeImpl *startNode, long startOffset,
462 DOM::NodeImpl *endNode, long endOffset);
463
468 int caretDisplayPolicyNonFocused() const;
469
476 void setCaretDisplayPolicyNonFocused(int policy);
477
478 // -- caret event handler
479
483 void caretKeyPressEvent(TQKeyEvent *);
484
485 // -- caret navigation member functions
486
498 bool moveCaretTo(DOM::NodeImpl *node, long offset, bool clearSelection);
499
505 enum CaretMovement { CaretByCharacter, CaretByWord };
506
517 void moveCaretBy(bool next, CaretMovement cmv, int n);
518
521 void moveCaretByLine(bool next, int n);
522
527 void moveCaretToLineBoundary(bool end);
528
533 void moveCaretToDocumentBoundary(bool end);
534
543 void placeCaretOnChar(tdehtml::CaretBox *hintBox);
544
561 void placeCaretOnLine(tdehtml::CaretBox *caretBox, int x, int absx, int absy);
562
566 void moveCaretByPage(bool next);
567
570 void moveCaretPrevWord();
571
574 void moveCaretNextWord();
575
580 void moveCaretPrevLine(int n = 1);
581
586 void moveCaretNextLine(int n = 1);
587
590 void moveCaretPrevPage();
591
594 void moveCaretNextPage();
595
598 void moveCaretToLineBegin();
599
602 void moveCaretToLineEnd();
603
604#endif // TDEHTML_NO_CARET
605
606 // ------------------------------------- member variables ------------------------------------
607 private:
608
609 void setWidgetVisible(::tdehtml::RenderWidget*, bool visible);
610
611 int _width;
612 int _height;
613
614 int _marginWidth;
615 int _marginHeight;
616
617 TDEHTMLPart *m_part;
618 TDEHTMLViewPrivate *d;
619
620 TQString m_medium; // media type
621};
622
623#endif
624
TDEHTMLPart
This class is tdehtml's main class.
Definition: tdehtml_part.h:184
TDEHTMLView
Renders and displays HTML in a TQScrollView.
Definition: tdehtmlview.h:79
TDEHTMLView::marginWidth
int marginWidth() const
Returns the margin width.
Definition: tdehtmlview.h:127
TDEHTMLView::part
TDEHTMLPart * part() const
Returns a pointer to the TDEHTMLPart that is rendering the page.
Definition: tdehtmlview.h:113
TDEHTMLView::finishedLayout
void finishedLayout()
This signal is used for internal layouting.
TDEHTMLView::marginHeight
int marginHeight()
Returns the margin height.
Definition: tdehtmlview.h:139
DOM
The Document Object Model (DOM) is divided into two parts, the COREDOM core DOM, specifying some core...
Definition: design.h:57

tdehtml

Skip menu "tdehtml"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdehtml

Skip menu "tdehtml"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdehtml by doxygen 1.9.4
This website is maintained by Timothy Pearson.