• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KHTML

  • khtml
khtml_caret_p.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 *
3 * Copyright (C) 2003-2004 Leo Savernik <l.savernik@aon.at>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef KHTML_CARET_P_H
22#define KHTML_CARET_P_H
23
24#include "rendering/render_table.h"
25
26
27#define DEBUG_CARETMODE 0
28
29class QFontMetrics;
30
31namespace DOM {
32 class NodeImpl;
33 class ElementImpl;
34}
35
36namespace khtml {
37
53enum CaretAdvancePolicy {
54 LeafsOnly, IndicatedFlows, VisibleFlows
55};
56
60struct CaretViewContext {
61 int freqTimerId; // caret blink frequency timer id
62 int x, y; // caret position in viewport coordinates
63 // (y specifies the top, not the baseline)
64 int width; // width of caret in pixels
65 int height; // height of caret in pixels
66 bool visible; // true if currently visible.
67 bool displayed; // true if caret is to be displayed at all.
68 bool caretMoved; // set to true once caret has been moved in page
69 // how to display the caret when view is not focused
70 KHTMLPart::CaretDisplayPolicy displayNonFocused;
71
79 int origX;
80
81 bool keyReleasePending; // true if keypress under caret mode awaits
82 // corresponding release event
83 CaretViewContext() : freqTimerId(-1), x(0), y(0), width(1), height(16),
84 visible(true), displayed(false), caretMoved(false),
85 displayNonFocused(KHTMLPart::CaretInvisible), origX(0),
86 keyReleasePending(false)
87 {}
88};
89
90class LinearDocument;
91
102template<class T> class MassDeleter : public QVector<T *> {
103public:
104 MassDeleter(size_t reserved = 1) { this->reserve(reserved); }
105 ~MassDeleter()
106 {
107 typename QVector<T *>::Iterator nd = this->end();
108 for (typename QVector<T *>::Iterator it = this->begin(); it != nd; ++it)
109 delete *it;
110 }
111};
112
113class CaretBoxLine;
114
126class CaretBox {
127protected:
128 InlineBox *_box; // associated inline box if available.
129 short _w; // width of box in pixels
130 int _h; // height of box in pixels
131 int _x; // x coordinate relative to containing block
132 int _y; // y coordinate relative to containing block
133 RenderBox *cb; // containing block
134 bool _outside:1; // true when representing the outside of the element
135 bool outside_end:1; // at ending outside of element rather than at beginning
136 // 29 bits unused
137
138public:
140 CaretBox() {}
142 CaretBox(InlineBox *ibox, bool outside, bool outsideEnd) : _box(ibox),
143 _w((short)ibox->width()), _h(ibox->height()), _x(ibox->xPos()),
144 _y(ibox->yPos()), cb(0), _outside(outside), outside_end(outsideEnd)
145 {
146 RenderObject *r = ibox->object();
147 if (r) cb = r->containingBlock();
148 }
150 CaretBox(int x, int y, int w, int h, RenderBox *cb, bool outside, bool outsideEnd) :
151 _box(0), _w((short)w), _h(h), _x(x), _y(y), cb(cb), _outside(outside),
152 outside_end(outsideEnd)
153 {}
154
155 int width() const { return _w; }
156 int height() const { return _h; }
157 int xPos() const { return _x; }
158 int yPos() const { return _y; }
159 RenderBox *enclosingObject() const { return cb; }
160 InlineBox *inlineBox() const { return _box; }
161
165 RenderBlock *containingBlock() const { return _box ? static_cast<RenderBlock *>(cb) : cb->containingBlock(); }
166
175 bool isInline() const { return _box; }
178 bool isInlineTextBox() const { return _box && _box->isInlineTextBox(); }
181 bool isLineBreak() const
182 {
183 return _box && _box->object() && _box->object()->isBR();
184 }
188 bool isOutside() const { return _outside; }
195 bool isOutsideEnd() const { return outside_end; }
197 RenderObject *object() const { return _box ? _box->object() : cb; }
198
201 long minOffset() const { return _box && !isLineBreak() ? _box->minOffset() : 0; }
204 long maxOffset() const { return _box && !isLineBreak() ? _box->maxOffset() : 0; }
205
206#if DEBUG_CARETMODE > 0
207 void dump(QTextStream &ts, const QString &ind) const;
208#endif
209
210 friend class CaretBoxLine;
211};
212
213typedef MassDeleter<CaretBox> CaretBoxDeleter;
214
221class CaretBoxIterator {
222protected:
223 CaretBoxLine *cbl; // associated caret box line
224 int index; // current index
225
226public:
227 // Let standard constructor/copy constructor/destructor/assignment operator
228 // be defined by the compiler. They do exactly what we want.
229 CaretBoxIterator()
230 : cbl( 0 ), index( 0 )
231 {
232 }
233
234 bool operator ==(const CaretBoxIterator &it) const
235 {
236 return cbl == it.cbl && index == it.index;
237 }
238
239 bool operator !=(const CaretBoxIterator &it) const
240 {
241 return !operator ==(it);
242 }
243
247 CaretBox *data() const;
251 CaretBox *operator *() const { return data(); }
252
255 CaretBoxIterator &operator ++() { index++; return *this; }
258 CaretBoxIterator &operator --() { index--; return *this; }
259
260 friend class CaretBoxLine;
261 friend class EditableCaretBoxIterator;
262};
263
290class CaretBoxLine {
291protected:
292 CaretBoxDeleter caret_boxes;
293 // base flow box which caret boxes have been constructed for
294 InlineFlowBox *basefb;
295
296 CaretBoxLine() : caret_boxes(8), basefb(0) {}
297 CaretBoxLine(InlineFlowBox *basefb) : caret_boxes(8), basefb(basefb) {}
298public:
299#if DEBUG_CARETMODE > 3
300 ~CaretBoxLine() { kDebug(6200) << "called"; }
301#endif
302
303 CaretBoxIterator begin()
304 {
305 CaretBoxIterator it;
306 it.cbl = this;
307 it.index = 0;
308 return it;
309 }
310 CaretBoxIterator end()
311 {
312 CaretBoxIterator it;
313 it.cbl = this;
314 it.index = caret_boxes.size();
315 return it;
316 }
317 CaretBoxIterator preBegin()
318 {
319 CaretBoxIterator it;
320 it.cbl = this;
321 it.index = -1;
322 return it;
323 }
324 CaretBoxIterator preEnd()
325 {
326 CaretBoxIterator it;
327 it.cbl = this;
328 it.index = caret_boxes.size() - 1;
329 return it;
330 }
331
338 InlineFlowBox *baseFlowBox() const { return basefb; }
339
341 RenderBlock *containingBlock() const { return caret_boxes[0]->containingBlock(); }
343 RenderBox *enclosingObject() const { return caret_boxes[0]->enclosingObject(); }
344
349 bool isOutside() const
350 {
351 const CaretBox *cbox = caret_boxes[0];
352 return !cbox->isInline() && cbox->isOutside();
353 }
354
359 bool isOutsideEnd() const { return caret_boxes[0]->isOutsideEnd(); }
360
373 static CaretBoxLine *constructCaretBoxLine(MassDeleter<CaretBoxLine> *deleter,
374 InlineFlowBox *baseFlowBox, InlineBox *seekBox, bool seekOutside,
375 bool seekOutsideEnd, CaretBoxIterator &iter,
376 RenderObject *seekObject = 0) /*KDE_NO_EXPORT*/;
377
386 static CaretBoxLine *constructCaretBoxLine(MassDeleter<CaretBoxLine> *deleter,
387 RenderBox *cb, bool outside, bool outsideEnd, CaretBoxIterator &iter) /*KDE_NO_EXPORT*/;
388
389#if DEBUG_CARETMODE > 0
390 void dump(QTextStream &ts, const QString &ind) const;
391 QString information() const
392 {
393 QString result;
394 QTextStream ts(&result, QIODevice::WriteOnly);
395 dump(ts, QString());
396 return result;
397 }
398#endif
399
400protected:
402 struct SeekBoxParams {
403 InlineBox *box;
404 bool outside;
405 bool outsideEnd;
406 bool found;
407 RenderObject *r; // if box is 0, seek for equal render objects instead
408 CaretBoxIterator &it;
409
410 SeekBoxParams(InlineBox *box, bool outside, bool outsideEnd, RenderObject *obj, CaretBoxIterator &it)
411 : box(box), outside(outside), outsideEnd(outsideEnd), found(false), r(obj), it(it)
412 {}
413
415 bool equalsBox(const InlineBox *box, bool outside, bool outsideEnd) const
416 {
417 return (this->box && this->box == box
418 || this->r == box->object())
419 && this->outside == outside
420 && (!this->outside || this->outsideEnd == outsideEnd);
421 }
423 bool operator ==(const CaretBox *cbox) const
424 {
425 return equalsBox(cbox->inlineBox(), cbox->isOutside(), cbox->isOutsideEnd());
426 }
432 bool check(const CaretBoxIterator &chit)
433 {
434 if (*this == *chit) {
435 Q_ASSERT(!found);
436 found = true;
437 it = chit;
438 }
439 return found;
440 }
441 };
442
448 void addConvertedInlineBox(InlineBox *, SeekBoxParams &) /*KDE_NO_EXPORT*/;
449
456 void addCreatedInlineBoxEdge(InlineBox *box, const QFontMetrics &fm,
457 bool left, bool rtl) /*KDE_NO_EXPORT*/;
464 void addCreatedFlowBoxEdge(InlineFlowBox *flowBox, const QFontMetrics &fm,
465 bool left, bool rtl) /*KDE_NO_EXPORT*/;
470 void addCreatedFlowBoxInside(InlineFlowBox *flowBox, const QFontMetrics &fm) /*KDE_NO_EXPORT*/;
471
472 friend class CaretBoxIterator;
473};
474
475typedef MassDeleter<CaretBoxLine> CaretBoxLineDeleter;
476
477inline CaretBox *CaretBoxIterator::data() const { return cbl->caret_boxes[index]; }
478
487class LineIterator
488{
489protected:
490 LinearDocument *lines; // associated document
491 CaretBoxLine *cbl; // current caret box line
492
493 static CaretBoxIterator currentBox; // current inline box
494 static long currentOffset;
495
496 // Note: cbl == 0 indicates a position beyond the beginning or the
497 // end of a document.
498
501 LineIterator() {}
502
509 LineIterator(LinearDocument *l, DOM::NodeImpl *node, long offset);
510
511public:
516 CaretBoxLine *operator *() const { return cbl; }
517
520 LinearDocument *linearDocument() const { return lines; }
521
526 LineIterator &operator ++() { advance(false); return *this; }
527
532 LineIterator &operator --() { advance(true); return *this; }
533
537 bool operator ==(const LineIterator &it) const
538 {
539 return lines == it.lines && cbl == it.cbl;
540 }
541
544 bool operator !=(const LineIterator &it) const
545 {
546 return !operator ==(it);
547 }
548
554 bool isOutsideEnd() { return cbl->isOutsideEnd(); }
555
559 bool isOutside() const { return cbl->isOutside(); }
560
564 void advance(bool toBegin);
565
576 static CaretBoxIterator &currentCaretBox() { return currentBox; }
577
586 static long currentModifiedOffset() { return currentOffset; }
587
588protected:
591 void nextBlock();
594 void prevBlock();
595
596 friend class CaretBoxIterator;
597 friend class EditableLineIterator;
598 friend class EditableCaretBoxIterator;
599 friend class EditableCharacterIterator;
600 friend class LinearDocument;
601};
602
622class LinearDocument {
623public:
624 typedef LineIterator Iterator;
625
640 LinearDocument(KHTMLPart *part, DOM::NodeImpl *node, long offset,
641 CaretAdvancePolicy advancePolicy, DOM::ElementImpl *baseElem);
642
643 virtual ~LinearDocument();
644
653 bool isValid() const // FIXME: not yet impl'd
654 {
655 return true;
656 }
657
665 int count() const;
666
671 Iterator current();
672
676 const Iterator &end() const { return _end; }
677
681 Iterator preEnd();
682
686 Iterator begin();
687
692 const Iterator &preBegin() const { return _preBegin; }
693
697 CaretAdvancePolicy advancePolicy() const { return advPol; }
698
706 RenderObject *baseObject() const { return base; }
707
708protected:
709 void initPreBeginIterator();
710 void initEndIterator();
711
712protected:
713 CaretBoxLineDeleter cblDeleter; // mass deleter for caret box lines
714 DOM::NodeImpl *node;
715 long offset;
716
717 Iterator _preBegin;
718 Iterator _end;
719
720 KHTMLPart *m_part;
721 CaretAdvancePolicy advPol;
722 RenderObject *base;
723
724 friend class LineIterator;
725 friend class EditableLineIterator;
726 friend class ErgonomicEditableLineIterator;
727 friend class CaretBoxIterator;
728 friend class EditableCaretBoxIterator;
729 friend class EditableCharacterIterator;
730};
731
742class EditableCaretBoxIterator : public CaretBoxIterator {
743 KHTMLPart *m_part;
744 bool adjacent;
745 CaretAdvancePolicy advpol; // caret advance policy
746
747public:
751 EditableCaretBoxIterator(LineIterator &lit, bool fromEnd = false,
752 CaretBoxIterator *it = 0)
753 : CaretBoxIterator(it ? *it : (fromEnd ? (*lit)->end() : (*lit)->preBegin())),
754 m_part(lit.lines->m_part), adjacent(false),
755 advpol(lit.lines->advancePolicy())
756 {
757 if (!it) {
758 if (fromEnd) --*this; else ++*this;
759 }
760 }
761
764 EditableCaretBoxIterator() {}
765
769 bool isAdjacent() const { return adjacent; }
770
773 EditableCaretBoxIterator &operator ++() { advance(false); return *this; }
774
777 EditableCaretBoxIterator &operator --() { advance(true); return *this; }
778
782 void advance(bool toBegin);
783
784protected:
790 bool isEditable(const CaretBoxIterator &boxit, bool fromEnd);
791};
792
807class EditableLineIterator : public LineIterator {
808public:
817 EditableLineIterator(const LineIterator &it, bool fromEnd = false)
818 : LineIterator(it)
819 {
820 if (!cbl) return;
821 if (!isEditable(*this)) advance(fromEnd);
822 }
823
828 EditableLineIterator() {}
829
834 EditableLineIterator &operator ++() { advance(false); return *this; }
835
840 EditableLineIterator &operator --() { advance(true); return *this; }
841
845 void advance(bool toBegin);
846
847protected:
853 bool isEditable(LineIterator &it)
854 {
855 EditableCaretBoxIterator fbit = it;
856 return fbit != (*it)->end();
857 }
858
859};
860
868class TableRowIterator {
869protected:
870 TableSectionIterator sec; // current section
871 int index; // index of row within section
872public:
879 TableRowIterator(RenderTable *table, bool fromEnd = false,
880 RenderTableSection::RowStruct *row = 0);
881
886 TableRowIterator(RenderTableSection *section, int index)
887 : sec(section), index(index)
888 {}
889
893 TableRowIterator() {}
894
898 RenderTableSection::RowStruct *operator *()
899 {
900 if (!*sec) return 0;
901 return &(*sec)->grid[index];
902 }
903
906 TableRowIterator &operator ++();
907
910 TableRowIterator &operator --();
911
912protected:
913};
914
929class ErgonomicEditableLineIterator : public EditableLineIterator {
930protected:
931 int xCoor; // x-coordinate to determine cell position
932public:
937 ErgonomicEditableLineIterator(const LineIterator &it, int x)
938 : EditableLineIterator(it), xCoor(x) {}
939
943 ErgonomicEditableLineIterator() {}
944
949 ErgonomicEditableLineIterator &operator ++();
950
955 ErgonomicEditableLineIterator &operator --();
956
957protected:
965 void determineTopologicalElement(RenderTableCell *oldCell,
966 RenderObject *newObject, bool toBegin);
967
973 void calcAndStoreNewLine(RenderBlock *newBlock, bool toBegin);
974
975};
976
984class EditableCharacterIterator {
985protected:
986 EditableLineIterator _it;
987 EditableCaretBoxIterator ebit;
988 long _offset; // offset within current caret box.
989 int _char;
990 bool _end:1; // true when end of document has been reached
991
992public:
993
999 EditableCharacterIterator() {}
1000
1005 EditableCharacterIterator(LinearDocument *ld)
1006 : _it(ld->current()),
1007 ebit(_it, false, &_it.currentCaretBox()),
1008 _offset(_it.currentModifiedOffset()), _char(-1), _end(false)
1009 {
1010 // ### temporary fix for illegal nodes
1011 if (_it == ld->end()) { _end = true; return; }
1012 initFirstChar();
1013 }
1014
1018 int chr() const { return _char; }
1019
1023 QChar operator *() const { return QChar(_char >= 0 ? _char : ' '); }
1024
1027 bool isEnd() const { return _end; }
1030 long offset() const { return _offset; }
1033 RenderObject *renderer() const { return (*ebit)->object(); }
1038 CaretBox *caretBox() const { return *ebit; }
1045 InlineBox *inlineBox() const { return (*ebit)->inlineBox(); }
1049// bool boxIsOutside() const { return _it.isOutside(); }
1050
1053 EditableCharacterIterator &operator ++();
1054
1057 EditableCharacterIterator &operator --();
1058
1059protected:
1063 void initFirstChar();
1066 void peekNext()
1067 {
1068 EditableCaretBoxIterator copy = ebit;
1069 ++copy;
1070 if (copy == (*_it)->end()) { _char = -1; return; }
1071
1072 CaretBox *box = *copy;
1073 InlineBox *b = box->inlineBox();
1074 if (b && !box->isOutside() && b->isInlineTextBox())
1075 _char = static_cast<RenderText *>(b->object())->str->s[b->minOffset()].unicode();
1076 else
1077 _char = -1;
1078 }
1081 void peekPrev()
1082 {
1083 --ebit;
1084 }
1085
1086};
1087
1088
1089}/*namespace khtml*/
1090
1091
1092#endif
KHTMLPart
This class is khtml's main class.
Definition: khtml_part.h:207
KHTMLPart::CaretDisplayPolicy
CaretDisplayPolicy
Enumeration for displaying the caret.
Definition: khtml_part.h:586
QVector
Definition: khtmlview.h:36
khtml::CaretBoxIterator
Iterates over the elements of a caret box line.
Definition: khtml_caret_p.h:221
khtml::CaretBoxIterator::operator++
CaretBoxIterator & operator++()
increments the iterator to point to the next caret box.
Definition: khtml_caret_p.h:255
khtml::CaretBoxIterator::data
CaretBox * data() const
returns the current caret box.
Definition: khtml_caret_p.h:477
khtml::CaretBoxIterator::CaretBoxIterator
CaretBoxIterator()
Definition: khtml_caret_p.h:229
khtml::CaretBoxIterator::operator*
CaretBox * operator*() const
shortcut for data
Definition: khtml_caret_p.h:251
khtml::CaretBoxIterator::operator--
CaretBoxIterator & operator--()
decrements the iterator to point to the previous caret box.
Definition: khtml_caret_p.h:258
khtml::CaretBoxIterator::operator==
bool operator==(const CaretBoxIterator &it) const
Definition: khtml_caret_p.h:234
khtml::CaretBoxIterator::index
int index
Definition: khtml_caret_p.h:224
khtml::CaretBoxIterator::operator!=
bool operator!=(const CaretBoxIterator &it) const
Definition: khtml_caret_p.h:239
khtml::CaretBoxIterator::cbl
CaretBoxLine * cbl
Definition: khtml_caret_p.h:223
khtml::CaretBoxLine
Resembles a line consisting of caret boxes.
Definition: khtml_caret_p.h:290
khtml::CaretBoxLine::end
CaretBoxIterator end()
Definition: khtml_caret_p.h:310
khtml::CaretBoxLine::CaretBoxLine
CaretBoxLine(InlineFlowBox *basefb)
Definition: khtml_caret_p.h:297
khtml::CaretBoxLine::addCreatedFlowBoxEdge
void addCreatedFlowBoxEdge(InlineFlowBox *flowBox, const QFontMetrics &fm, bool left, bool rtl)
creates and adds the edge of an inline flow box
Definition: khtml_caret.cpp:785
khtml::CaretBoxLine::enclosingObject
RenderBox * enclosingObject() const
returns the enclosing object
Definition: khtml_caret_p.h:343
khtml::CaretBoxLine::addCreatedInlineBoxEdge
void addCreatedInlineBoxEdge(InlineBox *box, const QFontMetrics &fm, bool left, bool rtl)
creates and adds the edge of a generic inline box
Definition: khtml_caret.cpp:798
khtml::CaretBoxLine::CaretBoxLine
CaretBoxLine()
Definition: khtml_caret_p.h:296
khtml::CaretBoxLine::preBegin
CaretBoxIterator preBegin()
Definition: khtml_caret_p.h:317
khtml::CaretBoxLine::isOutside
bool isOutside() const
returns whether this caret box line is outside.
Definition: khtml_caret_p.h:349
khtml::CaretBoxLine::addCreatedFlowBoxInside
void addCreatedFlowBoxInside(InlineFlowBox *flowBox, const QFontMetrics &fm)
creates and adds the inside of an inline flow box
Definition: khtml_caret.cpp:771
khtml::CaretBoxLine::basefb
InlineFlowBox * basefb
Definition: khtml_caret_p.h:294
khtml::CaretBoxLine::caret_boxes
CaretBoxDeleter caret_boxes
Definition: khtml_caret_p.h:292
khtml::CaretBoxLine::isOutsideEnd
bool isOutsideEnd() const
returns whether this caret box line is at the outside end.
Definition: khtml_caret_p.h:359
khtml::CaretBoxLine::constructCaretBoxLine
static CaretBoxLine * constructCaretBoxLine(MassDeleter< CaretBoxLine > *deleter, InlineFlowBox *baseFlowBox, InlineBox *seekBox, bool seekOutside, bool seekOutsideEnd, CaretBoxIterator &iter, RenderObject *seekObject=0)
constructs a new caret box line out of the given inline flow box
khtml::CaretBoxLine::baseFlowBox
InlineFlowBox * baseFlowBox() const
returns the base inline flow box which the caret boxes of this caret box line have been constructed f...
Definition: khtml_caret_p.h:338
khtml::CaretBoxLine::containingBlock
RenderBlock * containingBlock() const
returns the containing block
Definition: khtml_caret_p.h:341
khtml::CaretBoxLine::begin
CaretBoxIterator begin()
Definition: khtml_caret_p.h:303
khtml::CaretBoxLine::addConvertedInlineBox
void addConvertedInlineBox(InlineBox *, SeekBoxParams &)
recursively converts the given inline box into caret boxes and adds them to this caret box line.
Definition: khtml_caret.cpp:664
khtml::CaretBoxLine::constructCaretBoxLine
static CaretBoxLine * constructCaretBoxLine(MassDeleter< CaretBoxLine > *deleter, RenderBox *cb, bool outside, bool outsideEnd, CaretBoxIterator &iter)
constructs a new caret box line for the given render block.
khtml::CaretBoxLine::preEnd
CaretBoxIterator preEnd()
Definition: khtml_caret_p.h:324
khtml::CaretBox
Represents a rectangular box within which the caret is located.
Definition: khtml_caret_p.h:126
khtml::CaretBox::isInlineTextBox
bool isInlineTextBox() const
returns true if this caret box represents an inline text box.
Definition: khtml_caret_p.h:178
khtml::CaretBox::xPos
int xPos() const
Definition: khtml_caret_p.h:157
khtml::CaretBox::isInline
bool isInline() const
returns the replaced render object if this caret box represents one, 0 otherwise.
Definition: khtml_caret_p.h:175
khtml::CaretBox::minOffset
long minOffset() const
returns the minimum offset for this caret box.
Definition: khtml_caret_p.h:201
khtml::CaretBox::CaretBox
CaretBox(InlineBox *ibox, bool outside, bool outsideEnd)
initializes the caret box from the given inline box
Definition: khtml_caret_p.h:142
khtml::CaretBox::isLineBreak
bool isLineBreak() const
returns true if this caret box represents a line break
Definition: khtml_caret_p.h:181
khtml::CaretBox::_box
InlineBox * _box
Definition: khtml_caret_p.h:128
khtml::CaretBox::CaretBox
CaretBox(int x, int y, int w, int h, RenderBox *cb, bool outside, bool outsideEnd)
initializes the caret box from scratch
Definition: khtml_caret_p.h:150
khtml::CaretBox::yPos
int yPos() const
Definition: khtml_caret_p.h:158
khtml::CaretBox::containingBlock
RenderBlock * containingBlock() const
returns the containing block of this caret box.
Definition: khtml_caret_p.h:165
khtml::CaretBox::CaretBox
CaretBox()
empty constructor for later assignment
Definition: khtml_caret_p.h:140
khtml::CaretBox::_outside
bool _outside
Definition: khtml_caret_p.h:134
khtml::CaretBox::_y
int _y
Definition: khtml_caret_p.h:132
khtml::CaretBox::isOutside
bool isOutside() const
returns true when this caret box represents an ouside position of an element.
Definition: khtml_caret_p.h:188
khtml::CaretBox::_w
short _w
Definition: khtml_caret_p.h:129
khtml::CaretBox::width
int width() const
Definition: khtml_caret_p.h:155
khtml::CaretBox::outside_end
bool outside_end
Definition: khtml_caret_p.h:135
khtml::CaretBox::object
RenderObject * object() const
returns the associated render object.
Definition: khtml_caret_p.h:197
khtml::CaretBox::_x
int _x
Definition: khtml_caret_p.h:131
khtml::CaretBox::enclosingObject
RenderBox * enclosingObject() const
Definition: khtml_caret_p.h:159
khtml::CaretBox::cb
RenderBox * cb
Definition: khtml_caret_p.h:133
khtml::CaretBox::inlineBox
InlineBox * inlineBox() const
Definition: khtml_caret_p.h:160
khtml::CaretBox::isOutsideEnd
bool isOutsideEnd() const
returns the position at which the outside is targeted at.
Definition: khtml_caret_p.h:195
khtml::CaretBox::height
int height() const
Definition: khtml_caret_p.h:156
khtml::CaretBox::maxOffset
long maxOffset() const
returns the maximum offset for this caret box.
Definition: khtml_caret_p.h:204
khtml::CaretBox::_h
int _h
Definition: khtml_caret_p.h:130
khtml::EditableCaretBoxIterator
Iterates over the editable inner elements of a caret line box.
Definition: khtml_caret_p.h:742
khtml::EditableCaretBoxIterator::operator++
EditableCaretBoxIterator & operator++()
increments the iterator to point to the next editable caret box.
Definition: khtml_caret_p.h:773
khtml::EditableCaretBoxIterator::EditableCaretBoxIterator
EditableCaretBoxIterator(LineIterator &lit, bool fromEnd=false, CaretBoxIterator *it=0)
initializes a new iterator from the given line iterator, beginning with the given caret box iterator,...
Definition: khtml_caret_p.h:751
khtml::EditableCaretBoxIterator::operator--
EditableCaretBoxIterator & operator--()
decrements the iterator to point to the previous editable caret box.
Definition: khtml_caret_p.h:777
khtml::EditableCaretBoxIterator::advance
void advance(bool toBegin)
advances to the editable caret box to come
Definition: khtml_caret.cpp:1505
khtml::EditableCaretBoxIterator::isAdjacent
bool isAdjacent() const
returns true when the current caret box is adjacent to the previously iterated caret box,...
Definition: khtml_caret_p.h:769
khtml::EditableCaretBoxIterator::isEditable
bool isEditable(const CaretBoxIterator &boxit, bool fromEnd)
finds out if the given box is editable.
Definition: khtml_caret.cpp:1642
khtml::EditableCaretBoxIterator::EditableCaretBoxIterator
EditableCaretBoxIterator()
empty constructor.
Definition: khtml_caret_p.h:764
khtml::EditableCharacterIterator
Provides iterating through the document in terms of characters.
Definition: khtml_caret_p.h:984
khtml::EditableCharacterIterator::caretBox
CaretBox * caretBox() const
returns the current caret box.
Definition: khtml_caret_p.h:1038
khtml::EditableCharacterIterator::_char
int _char
Definition: khtml_caret_p.h:989
khtml::EditableCharacterIterator::operator++
EditableCharacterIterator & operator++()
returns whether the current line box represents the outside of its render object.
Definition: khtml_caret.cpp:1767
khtml::EditableCharacterIterator::_it
EditableLineIterator _it
Definition: khtml_caret_p.h:986
khtml::EditableCharacterIterator::peekNext
void peekNext()
reads ahead the next node and updates the data structures accordingly
Definition: khtml_caret_p.h:1066
khtml::EditableCharacterIterator::ebit
EditableCaretBoxIterator ebit
Definition: khtml_caret_p.h:987
khtml::EditableCharacterIterator::initFirstChar
void initFirstChar()
initializes the _char member by reading the character at the current offset, peeking ahead as necessa...
Definition: khtml_caret.cpp:1744
khtml::EditableCharacterIterator::EditableCharacterIterator
EditableCharacterIterator(LinearDocument *ld)
constructs a new iterator from the given linear document.
Definition: khtml_caret_p.h:1005
khtml::EditableCharacterIterator::operator--
EditableCharacterIterator & operator--()
moves to the previous editable character.
Definition: khtml_caret.cpp:1869
khtml::EditableCharacterIterator::isEnd
bool isEnd() const
returns true when the end of the document has been reached.
Definition: khtml_caret_p.h:1027
khtml::EditableCharacterIterator::inlineBox
InlineBox * inlineBox() const
returns the current inline box.
Definition: khtml_caret_p.h:1045
khtml::EditableCharacterIterator::EditableCharacterIterator
EditableCharacterIterator()
empty constructor.
Definition: khtml_caret_p.h:999
khtml::EditableCharacterIterator::offset
long offset() const
returns the current offset
Definition: khtml_caret_p.h:1030
khtml::EditableCharacterIterator::renderer
RenderObject * renderer() const
returns the current render object.
Definition: khtml_caret_p.h:1033
khtml::EditableCharacterIterator::_offset
long _offset
Definition: khtml_caret_p.h:988
khtml::EditableCharacterIterator::_end
bool _end
Definition: khtml_caret_p.h:990
khtml::EditableCharacterIterator::chr
int chr() const
returns the current character, or -1 if not on a text node, or beyond the end.
Definition: khtml_caret_p.h:1018
khtml::EditableCharacterIterator::peekPrev
void peekPrev()
reads ahead the previous node and updates the data structures accordingly
Definition: khtml_caret_p.h:1081
khtml::EditableCharacterIterator::operator*
QChar operator*() const
returns the current character as a unicode symbol, substituting a blank for a non-text node.
Definition: khtml_caret_p.h:1023
khtml::EditableLineIterator
Iterates through the editable lines of a document.
Definition: khtml_caret_p.h:807
khtml::EditableLineIterator::isEditable
bool isEditable(LineIterator &it)
finds out if the current line is editable.
Definition: khtml_caret_p.h:853
khtml::EditableLineIterator::EditableLineIterator
EditableLineIterator(const LineIterator &it, bool fromEnd=false)
Initializes a new iterator.
Definition: khtml_caret_p.h:817
khtml::EditableLineIterator::operator--
EditableLineIterator & operator--()
seek previous line.
Definition: khtml_caret_p.h:840
khtml::EditableLineIterator::advance
void advance(bool toBegin)
advances to the line to come.
Definition: khtml_caret.cpp:1688
khtml::EditableLineIterator::EditableLineIterator
EditableLineIterator()
empty constructor.
Definition: khtml_caret_p.h:828
khtml::EditableLineIterator::operator++
EditableLineIterator & operator++()
seek next line
Definition: khtml_caret_p.h:834
khtml::ErgonomicEditableLineIterator
Iterates through the editable lines of a document, in a topological order.
Definition: khtml_caret_p.h:929
khtml::ErgonomicEditableLineIterator::ErgonomicEditableLineIterator
ErgonomicEditableLineIterator()
Constructs an uninitialized iterator which must be assigned a line iterator before it can be used.
Definition: khtml_caret_p.h:943
khtml::ErgonomicEditableLineIterator::operator++
ErgonomicEditableLineIterator & operator++()
seek next line.
Definition: khtml_caret.cpp:2404
khtml::ErgonomicEditableLineIterator::xCoor
int xCoor
Definition: khtml_caret_p.h:931
khtml::ErgonomicEditableLineIterator::ErgonomicEditableLineIterator
ErgonomicEditableLineIterator(const LineIterator &it, int x)
Initializes a new ergonomic editable line iterator from the given one.
Definition: khtml_caret_p.h:937
khtml::ErgonomicEditableLineIterator::operator--
ErgonomicEditableLineIterator & operator--()
seek previous line.
Definition: khtml_caret.cpp:2420
khtml::ErgonomicEditableLineIterator::determineTopologicalElement
void determineTopologicalElement(RenderTableCell *oldCell, RenderObject *newObject, bool toBegin)
determines the topologically next render object.
Definition: khtml_caret.cpp:2282
khtml::ErgonomicEditableLineIterator::calcAndStoreNewLine
void calcAndStoreNewLine(RenderBlock *newBlock, bool toBegin)
initializes the iterator to point to the first previous/following editable line.
Definition: khtml_caret.cpp:2262
khtml::LineIterator
Iterates through the lines of a document.
Definition: khtml_caret_p.h:488
khtml::LineIterator::nextBlock
void nextBlock()
seeks next block.
Definition: khtml_caret.cpp:1345
khtml::LineIterator::cbl
CaretBoxLine * cbl
Definition: khtml_caret_p.h:491
khtml::LineIterator::LineIterator
LineIterator()
Default constructor, only for internal use.
Definition: khtml_caret_p.h:501
khtml::LineIterator::advance
void advance(bool toBegin)
advances to the line to come.
Definition: khtml_caret.cpp:1482
khtml::LineIterator::linearDocument
LinearDocument * linearDocument() const
returns the associated linear document
Definition: khtml_caret_p.h:520
khtml::LineIterator::lines
LinearDocument * lines
Definition: khtml_caret_p.h:490
khtml::LineIterator::operator!=
bool operator!=(const LineIterator &it) const
compares two iterators
Definition: khtml_caret_p.h:544
khtml::LineIterator::currentCaretBox
static CaretBoxIterator & currentCaretBox()
Whenever a new line iterator is created, it gets a caret box created.
Definition: khtml_caret_p.h:576
khtml::LineIterator::currentBox
static CaretBoxIterator currentBox
Definition: khtml_caret_p.h:493
khtml::LineIterator::operator*
CaretBoxLine * operator*() const
dereferences current caret box line.
Definition: khtml_caret_p.h:516
khtml::LineIterator::prevBlock
void prevBlock()
seeks previous block.
Definition: khtml_caret.cpp:1412
khtml::LineIterator::isOutside
bool isOutside() const
Tells whether the offset is meant to be outside or inside the containing block.
Definition: khtml_caret_p.h:559
khtml::LineIterator::operator++
LineIterator & operator++()
seek next line
Definition: khtml_caret_p.h:526
khtml::LineIterator::currentOffset
static long currentOffset
Definition: khtml_caret_p.h:494
khtml::LineIterator::operator==
bool operator==(const LineIterator &it) const
compares two iterators.
Definition: khtml_caret_p.h:537
khtml::LineIterator::currentModifiedOffset
static long currentModifiedOffset()
Whenever a new line iterator is created, it calculates a modified offset that is to be used with resp...
Definition: khtml_caret_p.h:586
khtml::LineIterator::operator--
LineIterator & operator--()
seek previous line.
Definition: khtml_caret_p.h:532
khtml::LineIterator::isOutsideEnd
bool isOutsideEnd()
Returns whether this line represents the outside end of the containing block.
Definition: khtml_caret_p.h:554
khtml::LinearDocument
Represents the whole document in terms of lines.
Definition: khtml_caret_p.h:622
khtml::LinearDocument::_end
Iterator _end
Definition: khtml_caret_p.h:718
khtml::LinearDocument::preEnd
Iterator preEnd()
Returns a line iterator pointing to the very last line of the document.
Definition: khtml_caret.cpp:1290
khtml::LinearDocument::m_part
KHTMLPart * m_part
Definition: khtml_caret_p.h:720
khtml::LinearDocument::node
DOM::NodeImpl * node
Definition: khtml_caret_p.h:714
khtml::LinearDocument::advPol
CaretAdvancePolicy advPol
Definition: khtml_caret_p.h:721
khtml::LinearDocument::begin
Iterator begin()
Returns a line iterator pointing to the very first line of the document.
Definition: khtml_caret.cpp:1276
khtml::LinearDocument::~LinearDocument
virtual ~LinearDocument()
Definition: khtml_caret.cpp:1261
khtml::LinearDocument::initEndIterator
void initEndIterator()
Definition: khtml_caret.cpp:1309
khtml::LinearDocument::base
RenderObject * base
Definition: khtml_caret_p.h:722
khtml::LinearDocument::current
Iterator current()
Returns a line iterator containing the current position as its starting value.
Definition: khtml_caret.cpp:1271
khtml::LinearDocument::isValid
bool isValid() const
Tells whether this list contains any lines.
Definition: khtml_caret_p.h:653
khtml::LinearDocument::advancePolicy
CaretAdvancePolicy advancePolicy() const
Returns the current caret advance policy.
Definition: khtml_caret_p.h:697
khtml::LinearDocument::count
int count() const
Returns the count of lines.
Definition: khtml_caret.cpp:1265
khtml::LinearDocument::cblDeleter
CaretBoxLineDeleter cblDeleter
Definition: khtml_caret_p.h:713
khtml::LinearDocument::baseObject
RenderObject * baseObject() const
Returns the base render object which the caret must not advance beyond.
Definition: khtml_caret_p.h:706
khtml::LinearDocument::Iterator
LineIterator Iterator
Definition: khtml_caret_p.h:624
khtml::LinearDocument::preBegin
const Iterator & preBegin() const
Returns a line iterator pointing just before the very first line of the document (this is somewhat an...
Definition: khtml_caret_p.h:692
khtml::LinearDocument::initPreBeginIterator
void initPreBeginIterator()
Definition: khtml_caret.cpp:1304
khtml::LinearDocument::_preBegin
Iterator _preBegin
Definition: khtml_caret_p.h:717
khtml::LinearDocument::end
const Iterator & end() const
Returns a line iterator pointing right after the end of the document.
Definition: khtml_caret_p.h:676
khtml::LinearDocument::offset
long offset
Definition: khtml_caret_p.h:715
khtml::MassDeleter
Stores objects of a certain type, and calls delete on each of them when this data structure is destro...
Definition: khtml_caret_p.h:102
khtml::MassDeleter::~MassDeleter
~MassDeleter()
Definition: khtml_caret_p.h:105
khtml::MassDeleter::MassDeleter
MassDeleter(size_t reserved=1)
Definition: khtml_caret_p.h:104
khtml::TableRowIterator
Represents a render table as a linear list of rows.
Definition: khtml_caret_p.h:868
khtml::TableRowIterator::operator++
TableRowIterator & operator++()
advances to the next row
Definition: khtml_caret.cpp:2027
khtml::TableRowIterator::operator*
RenderTableSection::RowStruct * operator*()
returns the current table row.
Definition: khtml_caret_p.h:898
khtml::TableRowIterator::sec
TableSectionIterator sec
Definition: khtml_caret_p.h:870
khtml::TableRowIterator::TableRowIterator
TableRowIterator(RenderTableSection *section, int index)
Constructs a new iterator.
Definition: khtml_caret_p.h:886
khtml::TableRowIterator::TableRowIterator
TableRowIterator()
empty constructor.
Definition: khtml_caret_p.h:893
khtml::TableRowIterator::operator--
TableRowIterator & operator--()
advances to the previous row
Definition: khtml_caret.cpp:2039
khtml::TableRowIterator::index
int index
Definition: khtml_caret_p.h:871
kDebug
#define kDebug
DOM
This library provides a full-featured HTML parser and widget.
Definition: design.h:55
copy
KAction * copy(const QObject *recvr, const char *slot, QObject *parent)
begin
const KShortcut & begin()
end
const KShortcut & end()
khtml
khtml::ind
static QDebug & ind(const QDebug &dbgIn, int ind)
Definition: khtml_childframe.cpp:60
khtml::CaretBoxDeleter
MassDeleter< CaretBox > CaretBoxDeleter
Definition: khtml_caret_p.h:213
khtml::CaretAdvancePolicy
CaretAdvancePolicy
caret advance policy.
Definition: khtml_caret_p.h:53
khtml::IndicatedFlows
@ IndicatedFlows
Definition: khtml_caret_p.h:54
khtml::VisibleFlows
@ VisibleFlows
Definition: khtml_caret_p.h:54
khtml::LeafsOnly
@ LeafsOnly
Definition: khtml_caret_p.h:54
khtml::CaretBoxLineDeleter
MassDeleter< CaretBoxLine > CaretBoxLineDeleter
Definition: khtml_caret_p.h:475
khtml::CaretBoxLine::SeekBoxParams
contains the seek parameters
Definition: khtml_caret_p.h:402
khtml::CaretBoxLine::SeekBoxParams::equalsBox
bool equalsBox(const InlineBox *box, bool outside, bool outsideEnd) const
compares whether this seek box matches the given specification
Definition: khtml_caret_p.h:415
khtml::CaretBoxLine::SeekBoxParams::outsideEnd
bool outsideEnd
Definition: khtml_caret_p.h:405
khtml::CaretBoxLine::SeekBoxParams::SeekBoxParams
SeekBoxParams(InlineBox *box, bool outside, bool outsideEnd, RenderObject *obj, CaretBoxIterator &it)
Definition: khtml_caret_p.h:410
khtml::CaretBoxLine::SeekBoxParams::it
CaretBoxIterator & it
Definition: khtml_caret_p.h:408
khtml::CaretBoxLine::SeekBoxParams::check
bool check(const CaretBoxIterator &chit)
checks whether this box matches the given iterator.
Definition: khtml_caret_p.h:432
khtml::CaretBoxLine::SeekBoxParams::operator==
bool operator==(const CaretBox *cbox) const
compares whether this seek box matches the given caret box
Definition: khtml_caret_p.h:423
khtml::CaretBoxLine::SeekBoxParams::outside
bool outside
Definition: khtml_caret_p.h:404
khtml::CaretBoxLine::SeekBoxParams::r
RenderObject * r
Definition: khtml_caret_p.h:407
khtml::CaretBoxLine::SeekBoxParams::found
bool found
Definition: khtml_caret_p.h:406
khtml::CaretBoxLine::SeekBoxParams::box
InlineBox * box
Definition: khtml_caret_p.h:403
khtml::CaretViewContext
contextual information about the caret which is related to the view.
Definition: khtml_caret_p.h:60
khtml::CaretViewContext::visible
bool visible
Definition: khtml_caret_p.h:66
khtml::CaretViewContext::displayNonFocused
KHTMLPart::CaretDisplayPolicy displayNonFocused
Definition: khtml_caret_p.h:70
khtml::CaretViewContext::CaretViewContext
CaretViewContext()
Definition: khtml_caret_p.h:83
khtml::CaretViewContext::freqTimerId
int freqTimerId
Definition: khtml_caret_p.h:61
khtml::CaretViewContext::height
int height
Definition: khtml_caret_p.h:65
khtml::CaretViewContext::y
int y
Definition: khtml_caret_p.h:62
khtml::CaretViewContext::x
int x
Definition: khtml_caret_p.h:62
khtml::CaretViewContext::caretMoved
bool caretMoved
Definition: khtml_caret_p.h:68
khtml::CaretViewContext::keyReleasePending
bool keyReleasePending
Definition: khtml_caret_p.h:81
khtml::CaretViewContext::width
int width
Definition: khtml_caret_p.h:64
khtml::CaretViewContext::origX
int origX
For natural traversal of lines, the original x position is saved, and the actual x is set to the firs...
Definition: khtml_caret_p.h:79
khtml::CaretViewContext::displayed
bool displayed
Definition: khtml_caret_p.h:67
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal