kopete/kopete
chattexteditpart.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef CHATTEXTEDITPART_H
00019 #define CHATTEXTEDITPART_H
00020
00021 #include "krichtexteditpart.h"
00022 #include <QtCore/QStringList>
00023
00024 #include <kopete_export.h>
00025
00026 class QTimer;
00027
00028 class KCompletion;
00029
00030 namespace Sonnet {
00031 class Highlighter;
00032 }
00033
00034 namespace Kopete
00035 {
00036 class Message;
00037 class Contact;
00038 class OnlineStatus;
00039 class ChatSession;
00040 class Protocol;
00041 class PropertyContainer;
00042 }
00043
00053 class KOPETECHATWINDOW_SHARED_EXPORT ChatTextEditPart : public KRichTextEditPart
00054 {
00055 Q_OBJECT
00056 public:
00057 ChatTextEditPart( Kopete::ChatSession *session, QWidget *parent);
00058 ~ChatTextEditPart();
00059
00064 Kopete::Message contents();
00065
00070 void setContents( const Kopete::Message &message );
00071
00076 void addText( const QString &text );
00077
00081 bool canSend();
00082
00086 bool isTyping();
00087
00088 public slots:
00092 void historyUp();
00093
00097 void historyDown();
00098
00102 void complete();
00103
00107 void sendMessage();
00108
00109 signals:
00114 void messageSent( Kopete::Message &message );
00115
00120 void typing( bool typing );
00121
00126 void canSendChanged( bool canSend );
00127
00128 private slots:
00134 void slotContactAdded( const Kopete::Contact *c );
00135
00141 void slotContactRemoved( const Kopete::Contact *c );
00142
00148 void slotContactStatusChanged( Kopete::Contact *contact, const Kopete::OnlineStatus &status, const Kopete::OnlineStatus &oldstatus );
00149
00153 void slotTextChanged();
00154
00159 void slotRepeatTypingTimer();
00160
00164 void slotStoppedTypingTimer();
00165
00169 void slotPropertyChanged( Kopete::PropertyContainer *, const QString &key, const QVariant &oldValue, const QVariant &newValue );
00170
00174 void slotAppearanceChanged();
00175
00176 private:
00177 void setProtocolRichTextSupport();
00178
00179 private:
00180 Kopete::ChatSession *m_session;
00181
00190 QStringList historyList;
00191 int historyPos;
00192
00193 KCompletion *mComplete;
00194 QString m_lastMatch;
00195
00196 QTimer *m_typingRepeatTimer;
00197 QTimer *m_typingStopTimer;
00198 };
00199
00200 #endif
00201
00202