kotextiterator.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KOTEXTITERATOR_H
00020 #define KOTEXTITERATOR_H
00021
00022 #include <qvaluelist.h>
00023 #include <qstring.h>
00024 #include <qpair.h>
00025 #include <qobject.h>
00026 #include <koffice_export.h>
00027 class KoTextParag;
00028 class KoTextObject;
00029 class KoTextView;
00030
00036 class KOTEXT_EXPORT KoTextIterator : public QObject
00037 {
00038 Q_OBJECT
00039 public:
00043 KoTextIterator( const QValueList<KoTextObject *> & lstObjects, KoTextView* textView, int options ) {
00044 init( lstObjects, textView, options );
00045 }
00046 void init( const QValueList<KoTextObject *> & lstObjects, KoTextView* textView, int options );
00047
00051 void restart();
00052
00058 void setOptions( int options );
00059
00063 int options() const { return m_options; }
00064
00068 void operator++();
00069
00073 bool atEnd() const;
00074
00079 bool hasText() const;
00080
00084 QString currentText() const;
00085
00089 KoTextParag* currentParag() const { return m_currentParag; }
00090
00094 KoTextObject* currentTextObject() const { return *m_currentTextObj; }
00095
00099 int currentStartIndex() const;
00100
00107 QPair<int, QString> currentTextAndIndex() const;
00108
00109 signals:
00114 void currentParagraphModified( int modifyType, int pos, int length );
00115
00120 void currentParagraphDeleted();
00121
00122 protected:
00123 void connectTextObjects();
00124 void nextTextObject();
00125
00126 protected slots:
00127 void slotParagraphDeleted( KoTextParag* parag );
00128 void slotParagraphModified( KoTextParag* parag, int , int pos, int length );
00129
00130 private:
00131
00132
00133
00134 QValueList<KoTextObject *> m_lstObjects;
00135 int m_options;
00136
00137
00138
00139 KoTextParag* m_firstParag;
00140 int m_firstIndex;
00141
00142
00143
00144 KoTextParag* m_lastParag;
00145 int m_lastIndex;
00146
00147
00148 QValueList<KoTextObject *>::Iterator m_currentTextObj;
00149 KoTextParag* m_currentParag;
00150 };
00151
00152 #endif
This file is part of the documentation for lib Library Version 1.4.2.