KDEUI
nestedlisthelper.h
Go to the documentation of this file.00001
00022 #ifndef NESTEDLISTHELPER_H
00023 #define NESTEDLISTHELPER_H
00024
00025
00026
00027 class QTextEdit;
00028
00029 class QKeyEvent;
00030 class QDropEvent;
00031 class QTextCursor;
00032 class QTextList;
00033 class QTextBlock;
00034
00044 class NestedListHelper
00045 {
00046 public:
00047
00053 NestedListHelper(QTextEdit *te);
00054
00058 ~NestedListHelper();
00059
00070 bool handleBeforeKeyPressEvent(QKeyEvent *event);
00071
00083 bool handleAfterKeyPressEvent(QKeyEvent *event);
00084
00085 bool handleAfterDropEvent(QDropEvent *event);
00086
00090 void handleOnIndentMore();
00091
00095 void handleOnIndentLess();
00096
00103 void handleOnBulletType(int styleIndex);
00104
00117 bool canIndent() const;
00118
00128 bool canDedent() const;
00129
00130 private:
00131 void reformatBoundingItemSpacing(QTextBlock block);
00132 void reformatBoundingItemSpacing();
00133 QTextCursor topOfSelection();
00134 QTextCursor bottomOfSelection();
00135 void processList(QTextList* list);
00136 void reformatList(QTextBlock block);
00137 void reformatList();
00138
00139 QTextEdit *textEdit;
00140
00141 int listBottomMargin;
00142 int listTopMargin;
00143 int listNoMargin;
00144
00145 };
00146
00147
00148
00149 #endif