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

KDEUI

  • sources
  • kde-4.12
  • kdelibs
  • 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 
25 class KActionCollection;
26 
45 class KDEUI_EXPORT KRichTextWidget : public KRichTextEdit
46 {
47  Q_OBJECT
48  Q_FLAGS(RichTextSupport)
49  Q_PROPERTY(RichTextSupport richTextSupport READ richTextSupport WRITE setRichTextSupport)
50 public:
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 
324 public Q_SLOTS:
325 
333  void setActionsEnabled(bool enabled);
334 
335 protected:
340  virtual void mouseReleaseEvent(QMouseEvent *event);
341 
342 
343 private:
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 
358 Q_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:56
krichtextedit.h
QWidget
QString
KRichTextWidget
A KRichTextEdit with common actions.
Definition: krichtextwidget.h:45
KRichTextWidget::RichTextSupportValues
RichTextSupportValues
These flags describe what actions will be created by createActions() after passing a combination of t...
Definition: krichtextwidget.h:56
KRichTextEdit
The KRichTextEdit class provides a widget to edit and display rich text.
Definition: krichtextedit.h:65
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:15 by doxygen 1.8.7 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
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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