• 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.14
  • kdenetwork
  • kopete
  • kopete
  • chatwindow
chattexteditpart.h
Go to the documentation of this file.
1 /*
2  chattexteditpart.h - Chat Text Edit Part
3 
4  Copyright (c) 2004 by Richard Smith <kde@metafoo.co.uk>
5 
6  Kopete (c) 2002-2004 by the Kopete developers <kopete-devel@kde.org>
7 
8  *************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  *************************************************************************
16 */
17 
18 #ifndef CHATTEXTEDITPART_H
19 #define CHATTEXTEDITPART_H
20 #include <kparts/part.h>
21 #include <krichtextedit.h>
22 #include "kopeterichtextwidget.h"
23 
24 #include <QtGui/QFont>
25 #include <QtGui/QColor>
26 #include <QtCore/QFlags>
27 #include <QtCore/QStringList>
28 
29 // TODO: Use kdelibs export
30 #include <kopete_export.h>
31 
32 class KAboutData;
33 class KTextEdit;
34 class KConfigGroup;
35 class KCompletion;
36 class QTimer;
37 
38 namespace Sonnet {
39  class Highlighter;
40 }
41 
42 namespace Kopete
43 {
44 class Message;
45 class Contact;
46 class OnlineStatus;
47 class ChatSession;
48 class Protocol;
49 class PropertyContainer;
50 }
51 
61 class CHATTEXTEDITPART_EXPORT ChatTextEditPart : public KParts::ReadOnlyPart
62 {
63  Q_OBJECT
64 public:
65  ChatTextEditPart( Kopete::ChatSession *session, QWidget *parent);
66  ChatTextEditPart(QWidget *parent, QObject*, const QStringList&);
67  ~ChatTextEditPart();
68 
77  QString text( Qt::TextFormat format = Qt::AutoText ) const;
78 
83  void setCheckSpellingEnabled( bool enabled );
84 
89  bool checkSpellingEnabled() const;
90 
91  static KAboutData *createAboutData();
92 
96  virtual bool openFile() {
97  return false;
98  }
99 
104  KopeteRichTextWidget *textEdit();
105 
109  bool isRichTextEnabled() const;
110 
111 
116  Kopete::Message contents();
117 
122  void setContents( const Kopete::Message &message );
123 
128  void addText( const QString &text );
129 
133  bool canSend();
134 
138  bool isTyping();
139 
140  void readConfig( KConfigGroup& config );
141  void resetConfig( KConfigGroup& config );
142  void writeConfig( KConfigGroup& config );
143 
144 public slots:
148  void historyUp();
149 
153  void historyDown();
154 
158  void complete();
159 
163  void sendMessage();
164 
165  void checkToolbarEnabled();
166 
167 signals:
172  void messageSent( Kopete::Message &message );
173 
178  void typing( bool typing );
179 
184  void canSendChanged( bool canSend );
185 
186  void toolbarToggled(bool enabled);
187  void richTextChanged();
188 
189 private slots:
195  void slotContactAdded( const Kopete::Contact *c );
196 
202  void slotContactRemoved( const Kopete::Contact *c );
203 
209  void slotContactStatusChanged( Kopete::Contact *contact, const Kopete::OnlineStatus &status, const Kopete::OnlineStatus &oldstatus );
210 
214  void slotTextChanged();
215 
220  void slotRepeatTypingTimer();
221 
225  void slotStoppedTypingTimer();
226 
230  void slotDisplayNameChanged( const QString &oldName, const QString &newName );
231 
235  void slotAppearanceChanged();
236 
237  void slotRichTextSupportChanged();
238 
239 private:
240  void init( Kopete::ChatSession *session, QWidget *parent);
241 
242  Kopete::ChatSession *m_session;
243 
252  QStringList historyList;
253  int historyPos;
254 
255  KCompletion *mComplete;
256  QString m_lastMatch;
257 
258  QTimer *m_typingRepeatTimer;
259  QTimer *m_typingStopTimer;
260 
261  KopeteRichTextWidget *editor;
262 };
263 
264 #endif
265 
266 // vim: set noet ts=4 sts=4 sw=4:
QWidget
ChatTextEditPart::openFile
virtual bool openFile()
Disable file open, because it's not used by this part.
Definition: chattexteditpart.h:96
kopeterichtextwidget.h
QTimer
QObject
KopeteRichTextWidget
A KopeteRichTextWidget with overridden behaviors.
Definition: kopeterichtextwidget.h:44
ChatTextEditPart
An instant message composition part.
Definition: chattexteditpart.h:61
QString
QStringList
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:08 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