51 #ifndef QT_NO_TEXTEDIT
67 class QTextEditPrivate;
76 Q_PROPERTY(AutoFormatting autoFormatting READ autoFormatting WRITE setAutoFormatting)
77 Q_PROPERTY(
bool tabChangesFocus READ tabChangesFocus WRITE setTabChangesFocus)
79 Q_PROPERTY(
bool undoRedoEnabled READ isUndoRedoEnabled WRITE setUndoRedoEnabled)
81 QDOC_PROPERTY(
QTextOption::WrapMode wordWrapMode READ wordWrapMode WRITE setWordWrapMode)
82 Q_PROPERTY(
int lineWrapColumnOrWidth READ lineWrapColumnOrWidth WRITE setLineWrapColumnOrWidth)
83 Q_PROPERTY(
bool readOnly READ isReadOnly WRITE setReadOnly)
84 #ifndef QT_NO_TEXTHTMLPARSER
88 Q_PROPERTY(
bool overwriteMode READ overwriteMode WRITE setOverwriteMode)
89 Q_PROPERTY(
int tabStopWidth READ tabStopWidth WRITE setTabStopWidth)
90 Q_PROPERTY(
bool acceptRichText READ acceptRichText WRITE setAcceptRichText)
91 Q_PROPERTY(
int cursorWidth READ cursorWidth WRITE setCursorWidth)
92 Q_PROPERTY(
Qt::TextInteractionFlags textInteractionFlags READ textInteractionFlags WRITE setTextInteractionFlags)
103 AutoBulletList = 0x00000001,
107 Q_DECLARE_FLAGS(AutoFormatting, AutoFormattingFlag)
109 #if defined(QT3_SUPPORT)
123 #if !defined(Q_MOC_RUN)
125 MovePgUp = MovePageUp,
126 MovePgDown = MovePageDown
135 void setDocument(QTextDocument *document);
136 QTextDocument *document()
const;
141 bool isReadOnly()
const;
142 void setReadOnly(
bool ro);
144 void setTextInteractionFlags(Qt::TextInteractionFlags flags);
145 Qt::TextInteractionFlags textInteractionFlags()
const;
147 qreal fontPointSize()
const;
149 int fontWeight()
const;
150 bool fontUnderline()
const;
151 bool fontItalic()
const;
153 QColor textBackgroundColor()
const;
154 QFont currentFont()
const;
155 Qt::Alignment alignment()
const;
162 AutoFormatting autoFormatting()
const;
163 void setAutoFormatting(AutoFormatting features);
165 bool tabChangesFocus()
const;
166 void setTabChangesFocus(
bool b);
174 {
return document()->isUndoRedoEnabled(); }
176 { document()->setUndoRedoEnabled(enable); }
178 LineWrapMode lineWrapMode()
const;
179 void setLineWrapMode(LineWrapMode
mode);
181 int lineWrapColumnOrWidth()
const;
182 void setLineWrapColumnOrWidth(
int w);
187 bool find(
const QString &exp, QTextDocument::FindFlags options = 0);
190 {
return document()->toPlainText(); }
191 #ifndef QT_NO_TEXTHTMLPARSER
193 {
return document()->toHtml(); }
196 void ensureCursorVisible();
199 #ifndef QT_NO_CONTEXTMENU
200 QMenu *createStandardContextMenu();
201 QMenu *createStandardContextMenu(
const QPoint &position);
206 QRect cursorRect()
const;
210 bool overwriteMode()
const;
211 void setOverwriteMode(
bool overwrite);
213 int tabStopWidth()
const;
214 void setTabStopWidth(
int width);
216 int cursorWidth()
const;
217 void setCursorWidth(
int width);
219 bool acceptRichText()
const;
220 void setAcceptRichText(
bool accept);
232 bool canPaste()
const;
234 #ifndef QT_NO_PRINTER
235 void print(
QPrinter *printer)
const;
239 void setFontPointSize(qreal
s);
240 void setFontFamily(
const QString &fontFamily);
241 void setFontWeight(
int w);
242 void setFontUnderline(
bool b);
243 void setFontItalic(
bool b);
244 void setTextColor(
const QColor &
c);
245 void setTextBackgroundColor(
const QColor &
c);
246 void setCurrentFont(
const QFont &
f);
247 void setAlignment(Qt::Alignment
a);
249 void setPlainText(
const QString &text);
250 #ifndef QT_NO_TEXTHTMLPARSER
251 void setHtml(
const QString &text);
253 void setText(
const QString &text);
255 #ifndef QT_NO_CLIPBOARD
267 void insertPlainText(
const QString &text);
268 #ifndef QT_NO_TEXTHTMLPARSER
269 void insertHtml(
const QString &text);
270 #endif // QT_NO_TEXTHTMLPARSER
272 void append(
const QString &text);
276 void zoomIn(
int range = 1);
277 void zoomOut(
int range = 1);
281 void undoAvailable(
bool b);
282 void redoAvailable(
bool b);
284 void copyAvailable(
bool b);
285 void selectionChanged();
286 void cursorPositionChanged();
289 virtual bool event(
QEvent *e);
291 virtual void keyPressEvent(
QKeyEvent *e);
292 virtual void keyReleaseEvent(
QKeyEvent *e);
298 virtual void mouseDoubleClickEvent(
QMouseEvent *e);
299 virtual bool focusNextPrevChild(
bool next);
300 #ifndef QT_NO_CONTEXTMENU
303 #ifndef QT_NO_DRAGANDDROP
312 virtual void changeEvent(
QEvent *e);
313 #ifndef QT_NO_WHEELEVENT
317 virtual QMimeData *createMimeDataFromSelection()
const;
318 virtual bool canInsertFromMimeData(
const QMimeData *
source)
const;
319 virtual void insertFromMimeData(
const QMimeData *
source);
326 virtual void scrollContentsBy(
int dx,
int dy);
330 QT_MOC_COMPAT
void currentFontChanged(
const QFont &
f);
331 QT_MOC_COMPAT
void currentColorChanged(
const QColor &
c);
335 inline QT3_SUPPORT
bool find(
const QString &exp,
bool cs,
bool wo)
337 QTextDocument::FindFlags flags = 0;
342 return find(exp, flags);
345 inline QT3_SUPPORT
void sync() {}
348 QT3_SUPPORT
void moveCursor(CursorAction action,
bool select);
350 enum KeyboardAction {
359 QT3_SUPPORT
void doKeyboardAction(KeyboardAction action);
361 QT3_SUPPORT
QString text()
const;
366 inline QT3_SUPPORT
void setUnderline(
bool b) { setFontUnderline(b); }
367 inline QT3_SUPPORT
void setItalic(
bool i) { setFontItalic(i); }
368 inline QT3_SUPPORT
void setFamily(
const QString &family) { setFontFamily(family); }
369 inline QT3_SUPPORT
void setPointSize(
int size) { setFontPointSize(size); }
371 inline QT3_SUPPORT
bool italic()
const {
return fontItalic(); }
372 inline QT3_SUPPORT
bool bold()
const {
return fontWeight() >=
QFont::Bold; }
373 inline QT3_SUPPORT
bool underline()
const {
return fontUnderline(); }
374 inline QT3_SUPPORT
QString family()
const {
return fontFamily(); }
375 inline QT3_SUPPORT
int pointSize()
const {
return (
int)(fontPointSize()+0.5); }
377 inline QT3_SUPPORT
bool hasSelectedText()
const
378 {
return textCursor().hasSelection(); }
379 inline QT3_SUPPORT
QString selectedText()
const
380 {
return textCursor().selectedText(); }
382 inline QT3_SUPPORT
bool isUndoAvailable()
const
383 {
return document()->isUndoAvailable(); }
384 inline QT3_SUPPORT
bool isRedoAvailable()
const
385 {
return document()->isRedoAvailable(); }
387 inline QT3_SUPPORT
void insert(
const QString &text)
388 { insertPlainText(text); }
390 inline QT3_SUPPORT
bool isModified()
const
391 {
return document()->isModified(); }
394 {
return textColor(); }
397 inline QT_MOC_COMPAT
void setModified(
bool m =
true)
398 { document()->setModified(m); }
400 inline QT3_SUPPORT
void undo()
const
401 { document()->undo(); }
402 inline QT3_SUPPORT
void redo()
const
403 { document()->redo(); }
406 inline QT_MOC_COMPAT
void setColor(
const QColor &
c)
417 friend class QTextEditControl;
418 friend class QTextDocument;
419 friend class QTextControl;
422 Q_DECLARE_OPERATORS_FOR_FLAGS(
QTextEdit::AutoFormatting)
428 #endif // QT_NO_TEXTEDIT
430 #endif // QTEXTEDIT_H
GLuint GLuint GLsizei GLenum type
GLdouble GLdouble GLdouble r
GLsizei GLsizei GLchar * source
QString documentTitle() const
#define Q_PRIVATE_SLOT(d, signature)
QString toPlainText() const
bool isUndoRedoEnabled() const
#define QT_BEGIN_NAMESPACE
GLenum GLsizei GLenum format
GLuint const GLchar * name
void setUndoRedoEnabled(bool enable)
GLubyte GLubyte GLubyte a
GLubyte GLubyte GLubyte GLubyte w
void setDocumentTitle(const QString &title)