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

KDEUI

  • kdeui
  • widgets
krichtextwidget.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2
3 Copyright 2008 Stephen Kelly <steveire@gmail.com>
4 Copyright 2008 Thomas McGuire <thomas.mcguire@gmx.net>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2 as published by the Free Software Foundation.
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#ifndef KRICHTEXTWIDGET_H
21#define KRICHTEXTWIDGET_H
22
23#include "krichtextedit.h"
24
25class KActionCollection;
26
45class KDEUI_EXPORT KRichTextWidget : public KRichTextEdit
46{
47 Q_OBJECT
48 Q_FLAGS(RichTextSupport)
49 Q_PROPERTY(RichTextSupport richTextSupport READ richTextSupport WRITE setRichTextSupport)
50public:
51
56 enum RichTextSupportValues {
61 DisableRichText = 0x00,
62
69 SupportBold = 0x01,
70
77 SupportItalic = 0x02,
78
85 SupportUnderline = 0x04,
86
93 SupportStrikeOut = 0x08,
94
103 SupportFontFamily = 0x10,
104
112 SupportFontSize = 0x20,
113
120 SupportTextForegroundColor = 0x40,
121
128 SupportTextBackgroundColor = 0x80,
129
134 FullTextFormattingSupport = 0xff,
135
143 SupportChangeListStyle = 0x100,
144
149 SupportIndentLists = 0x200,
150
154 SupportDedentLists = 0x400,
155
160 FullListSupport = 0xf00,
161
162// Not implemented yet.
163// SupportCreateTables = 0x1000,
164// SupportChangeCellMargin = 0x2000,
165// SupportChangeCellPadding = 0x4000,
166// SupportChangeTableBorderWidth = 0x8000,
167// SupportChangeTableBorderColor = 0x10000,
168// SupportChangeTableBorderStyle = 0x20000,
169// SupportChangeCellBackground = 0x40000,
170// SupportCellFillPatterns = 0x80000,
171//
172// FullTableSupport = 0xff000,
173
179 SupportAlignment = 0x100000,
180
181 // Not yet implemented SupportImages = 0x200000,
182
186 SupportRuleLine = 0x400000,
187
193 SupportHyperlinks = 0x800000,
194
200 SupportFormatPainting = 0x1000000,
201
206 SupportToPlainText = 0x2000000,
207
214 SupportSuperScriptAndSubScript = 0x4000000,
215
216// SupportChangeParagraphSpacing = 0x200000,
217
221 SupportDirection = 0x8000000,
222
226 FullSupport = 0xffffffff
227 };
228 Q_DECLARE_FLAGS(RichTextSupport, RichTextSupportValues)
229
230
234 explicit KRichTextWidget(QWidget *parent);
235
243 explicit KRichTextWidget(const QString& text, QWidget *parent = 0);
244
248 ~KRichTextWidget();
249
294 virtual void createActions(KActionCollection *actionCollection);
295
306 void setRichTextSupport(const KRichTextWidget::RichTextSupport &support);
307
312 RichTextSupport richTextSupport() const;
313
322 void updateActionStates();
323
324public Q_SLOTS:
325
333 void setActionsEnabled(bool enabled);
334
335protected:
340 virtual void mouseReleaseEvent(QMouseEvent *event);
341
342
343private:
344 //@cond PRIVATE
345 class Private;
346 friend class Private;
347 Private *const d;
348 Q_PRIVATE_SLOT(d, void _k_setTextForegroundColor())
349 Q_PRIVATE_SLOT(d, void _k_setTextBackgroundColor())
350 Q_PRIVATE_SLOT(d, void _k_manageLink())
351 Q_PRIVATE_SLOT(d, void _k_formatPainter(bool))
352 Q_PRIVATE_SLOT(d, void _k_updateCharFormatActions(const QTextCharFormat &))
353 Q_PRIVATE_SLOT(d, void _k_updateMiscActions())
354 Q_PRIVATE_SLOT(d, void _k_setListStyle(int))
355 //@endcond
356};
357
358Q_DECLARE_OPERATORS_FOR_FLAGS(KRichTextWidget::RichTextSupport)
359
360#endif
361
362// kate: space-indent on; indent-width 4; encoding utf-8; replace-tabs on;
KActionCollection
A container for a set of QAction objects.
Definition kactioncollection.h:57
KRichTextEdit::KRichTextEdit
KRichTextEdit(const QString &text, QWidget *parent=0)
Constructs a KRichTextEdit object.
Definition krichtextedit.cpp:118
KRichTextWidget::KRichTextWidget
KRichTextWidget(QWidget *parent)
Constructor.
KRichTextWidget::setActionsEnabled
void setActionsEnabled(bool enabled)
Disables or enables all of the actions created by createActions().
KRichTextWidget::createActions
virtual void createActions(KActionCollection *actionCollection)
Creates the actions and adds them to the given action collection.
KRichTextWidget::richTextSupport
RichTextSupport richTextSupport
Definition krichtextwidget.h:49
KRichTextWidget::updateActionStates
void updateActionStates()
Tells KRichTextWidget to update the state of the actions created by createActions().
KRichTextWidget::mouseReleaseEvent
virtual void mouseReleaseEvent(QMouseEvent *event)
Reimplemented.
KRichTextWidget::setRichTextSupport
void setRichTextSupport(const KRichTextWidget::RichTextSupport &support)
Sets the supported rich text subset available.
KRichTextWidget::RichTextSupportValues
RichTextSupportValues
These flags describe what actions will be created by createActions() after passing a combination of t...
Definition krichtextwidget.h:56
KRichTextWidget::SupportTextBackgroundColor
@ SupportTextBackgroundColor
Action to change the background color of the currently selected text.
Definition krichtextwidget.h:128
KRichTextWidget::SupportFontFamily
@ SupportFontFamily
Action to change the font family of the currently selected text.
Definition krichtextwidget.h:103
KRichTextWidget::SupportDirection
@ SupportDirection
Action to change direction of text to Right-To-Left or Left-To-Right.
Definition krichtextwidget.h:221
KRichTextWidget::SupportItalic
@ SupportItalic
Action to format the selected text as italic.
Definition krichtextwidget.h:77
KRichTextWidget::SupportUnderline
@ SupportUnderline
Action to underline the selected text.
Definition krichtextwidget.h:85
KRichTextWidget::SupportBold
@ SupportBold
Action to format the selected text as bold.
Definition krichtextwidget.h:69
KRichTextWidget::SupportStrikeOut
@ SupportStrikeOut
Action to strike out the selected text.
Definition krichtextwidget.h:93
KRichTextWidget::FullTextFormattingSupport
@ FullTextFormattingSupport
A combination of all the flags above.
Definition krichtextwidget.h:134
KRichTextWidget::SupportDedentLists
@ SupportDedentLists
Action to decrease the current list nesting level.
Definition krichtextwidget.h:154
KRichTextWidget::SupportHyperlinks
@ SupportHyperlinks
Action to convert the current text to a hyperlink.
Definition krichtextwidget.h:193
KRichTextWidget::SupportChangeListStyle
@ SupportChangeListStyle
Action to make the current line a list element, change the list style or remove list formatting.
Definition krichtextwidget.h:143
KRichTextWidget::SupportRuleLine
@ SupportRuleLine
Action to insert a horizontal line.
Definition krichtextwidget.h:186
KRichTextWidget::DisableRichText
@ DisableRichText
No rich text support at all, no actions will be created.
Definition krichtextwidget.h:61
KRichTextWidget::FullSupport
@ FullSupport
Includes all above actions for full rich text support.
Definition krichtextwidget.h:226
KRichTextWidget::SupportToPlainText
@ SupportToPlainText
Action to change the text of the whole text edit to plain text.
Definition krichtextwidget.h:206
KRichTextWidget::SupportFontSize
@ SupportFontSize
Action to change the font size of the currently selected text.
Definition krichtextwidget.h:112
KRichTextWidget::SupportTextForegroundColor
@ SupportTextForegroundColor
Action to change the text color of the currently selected text.
Definition krichtextwidget.h:120
KRichTextWidget::SupportFormatPainting
@ SupportFormatPainting
Action to make the mouse cursor a format painter.
Definition krichtextwidget.h:200
KRichTextWidget::SupportAlignment
@ SupportAlignment
Actions to align the current paragraph left, righ, center or justify.
Definition krichtextwidget.h:179
KRichTextWidget::FullListSupport
@ FullListSupport
All of the three list actions above.
Definition krichtextwidget.h:160
KRichTextWidget::SupportSuperScriptAndSubScript
@ SupportSuperScriptAndSubScript
Actions to format text as superscript or subscript.
Definition krichtextwidget.h:214
KRichTextWidget::SupportIndentLists
@ SupportIndentLists
Action to increase the current list nesting level.
Definition krichtextwidget.h:149
KTextEdit::event
virtual bool event(QEvent *)
Reimplemented to catch "delete word" shortcut events.
Definition ktextedit.cpp:371
QWidget
krichtextedit.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • 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