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

kopete/kopete

  • sources
  • kde-4.12
  • kdenetwork
  • kopete
  • kopete
  • chatwindow
kopeterichtextwidget.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 Roman Jarosz <kedgedev@gmail.com>
3  Copyright 2009 Benson Tsai <btsai@vrwarp.com>
4  Copyright (C) 2006 MichaĆ«l Larouche <larouche@kde.org>
5  Copyright (C) 2003 Richard Moore <rich@kde.org>
6  Copyright (c) 2003-2005 Jason Keirstead <jason@keirstead.org>
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public
10  License version 2 as published by the Free Software Foundation.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 #ifndef KOPETERICHTEXTWIDGET_H
23 #define KOPETERICHTEXTWIDGET_H
24 
25 #include "kopeteprotocol.h"
26 
27 #include <krichtextwidget.h>
28 #include <kopete_export.h>
29 
44 class KOPETECHATWINDOW_SHARED_EXPORT KopeteRichTextWidget : public KRichTextWidget
45 {
46  Q_OBJECT
47 public:
48  explicit KopeteRichTextWidget(QWidget *parent, Kopete::Protocol::Capabilities protocolCaps, KActionCollection *actionCollection);
49  ~KopeteRichTextWidget();
50 
51  void setTextOrHtml(const QString &text);
52 
53 public:
54  virtual void createActions(KActionCollection *actionCollection);
55 
56  void setDefaultPlainCharFormat(const QTextCharFormat& format);
57  void setDefaultRichCharFormat(const QTextCharFormat& format);
58  void setCurrentRichCharFormat(const QTextCharFormat & format);
59 
60  QTextCharFormat defaultPlainFormat() const;
61  QTextCharFormat defaultRichFormat() const;
62  QTextCharFormat currentRichFormat() const;
63 
64  bool isRichTextEnabled() const;
65 
66 public Q_SLOTS:
71  void setRichTextEnabled(bool enable);
72 
73  void setFontFamily(QString family);
74  void setFontSize(int size);
75  void setTextBold(bool bold);
76  void setTextItalic(bool italic);
77  void setTextUnderline(bool underline);
78  void setTextStrikeOut(bool strikeout);
79  void setSendKeySequenceList(const QList<QKeySequence>& keySequenceList);
80 
81  void slotResetFontAndColor();
82  void slotCheckSpellingChanged(bool b);
83  void slotDocumentSizeUpdated();
84  void slotEnableAutoResize(bool enable);
85 signals:
86  void richTextSupportChanged();
87  void documentSizeUpdated(int difference);
88 
89 protected:
90  virtual void insertFromMimeData(const QMimeData * source);
91  virtual bool event(QEvent *event);
92 
93 protected slots:
94  void updateTextFormat();
95  void updateCharFormat(const QTextCharFormat &);
96  void slotTextModeChanged(KRichTextEdit::Mode mode);
97 
98 private:
99  void setCurrentPlainCharFormat(const QTextCharFormat & format);
100 
101  // Leave it in private secion, you should call setCurrentRichCharFormat or setDefaultPlainCharFormat.
102  void setCurrentCharFormat(const QTextCharFormat & format);
103 
104  KopeteRichTextWidget::RichTextSupport getProtocolRichTextSupport() const;
105 
106 private:
107  //@cond PRIVATE
108  class Private;
109  friend class Private;
110  Private *const d;
111  //@endcond
112 };
113 
114 #endif
115 
116 // kate: space-indent on; indent-width 4; encoding utf-8; replace-tabs on;
QWidget
KRichTextWidget
KopeteRichTextWidget
A KopeteRichTextWidget with overridden behaviors.
Definition: kopeterichtextwidget.h:44
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/kopete

Skip menu "kopete/kopete"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

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