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

kopete/libkopete

  • sources
  • kde-4.14
  • kdenetwork
  • kopete
  • libkopete
kopetechatsession.h
Go to the documentation of this file.
1 /*
2  kopetechatsession.h - Manages all chats
3 
4  Copyright (c) 2002 by Duncan Mac-Vicar Prett <duncan@kde.org>
5  Copyright (c) 2002 by Daniel Stone <dstone@kde.org>
6  Copyright (c) 2002-2003 by Martijn Klingens <klingens@kde.org>
7  Copyright (c) 2002-2004 by Olivier Goffart <ogoffart@kde.org>
8  Copyright (c) 2003 by Jason Keirstead <jason@keirstead.org>
9  Copyright (c) 2005 by MichaĆ«l Larouche <larouche@kde.org>
10  Copyright (c) 2009 by Fabian Rami <fabian.rami@wowcompany.com>
11 
12  Kopete (c) 2002-2003 by the Kopete developers <kopete-devel@kde.org>
13 
14  *************************************************************************
15  * *
16  * This library is free software; you can redistribute it and/or *
17  * modify it under the terms of the GNU Lesser General Public *
18  * License as published by the Free Software Foundation; either *
19  * version 2 of the License, or (at your option) any later version. *
20  * *
21  *************************************************************************
22 */
23 
24 #ifndef KOPETECHATSESSION_H
25 #define KOPETECHATSESSION_H
26 
27 #include <QtCore/QObject>
28 
29 #include <kxmlguiclient.h>
30 
31 #include "kopete_export.h"
32 
33 // FIXME: get rid of these includes
34 #include "kopetemessage.h"
35 #include "kopetemessagehandlerchain.h"
36 
37 class KMMPrivate;
38 
39 class KopeteView;
40 
41 namespace Kopete
42 {
43 
44 class Contact;
45 class Message;
46 class Protocol;
47 class OnlineStatus;
48 class Account;
49 class ChatSessionManager;
50 class PropertyContainer;
51 class MessageHandlerChain;
52 class TemporaryKMMCallbackAppendMessageHandler;
53 
54 typedef QList<Contact*> ContactPtrList;
55 typedef QList<Message> MessageList;
56 
57 
74 class KOPETE_EXPORT ChatSession : public QObject , public KXMLGUIClient
75 {
76  // friend class so the object factory can access the protected constructor
77  friend class ChatSessionManager;
78 
79  Q_OBJECT
80 
81 public:
85  enum Form { Small,
86  Chatroom };
92  ~ChatSession();
93 
97  const ContactPtrList& members() const;
98 
104  const Contact* myself() const;
105 
110  Protocol* protocol() const;
111 
117  Account *account() const ;
118 
124  const QString displayName();
125 
129  void setLastUrl( const QString &verylastUrl );
130 
135  const QString lastUrl();
136 
142  void setDisplayName( const QString &displayName );
143 
150  void setContactOnlineStatus( const Contact *contact, const OnlineStatus &newStatus );
151 
157  const OnlineStatus contactOnlineStatus( const Contact *contact ) const;
158 
168  // FIXME: canCreate should definitely be an enum and not a bool - Martijn
169  KopeteView* view( bool canCreate = false, const QString &requestedPlugin = QString() );
170 
176  bool mayInvite() const ;
177 
187  virtual void inviteContact(const QString &contactId);
188 
192  MessageHandlerChain::Ptr chainForDirection( Message::MessageDirection dir );
193 
198  Form form() const;
199 
205  bool warnGroupChat() const;
206 
213  QString initLastUrl( const Kopete::Contact* c );
214 
218  static QString getUrlsFileName(const Kopete::Contact*);
219 
224  void urlSearch( const Kopete::Message &msg );
225 
230  QStringList findUrls(const Kopete::Message &msg );
231 
232 signals:
237  void closing( Kopete::ChatSession *kmm );
238 
243  void messageAppended( Kopete::Message &msg, Kopete::ChatSession *kmm = 0L );
244 
249  void messageReceived( Kopete::Message &msg, Kopete::ChatSession *kmm = 0L );
250 
259  void messageSent( Kopete::Message &msg, Kopete::ChatSession *kmm = 0L );
260 
264  void messageSuccess();
265 
269  // FIXME: What's 'suppress'? Shouldn't this be an enum? - Martijn
270  void contactAdded( const Kopete::Contact *contact, bool suppress );
271 
275  void contactRemoved( const Kopete::Contact *contact, const QString &reason, Qt::TextFormat format = Qt::PlainText, bool suppressNotification = false );
276 
280  void onlineStatusChanged( Kopete::Contact *, const Kopete::OnlineStatus &, const Kopete::OnlineStatus & );
281 
285  void statusMessageChanged( Kopete::Contact* );
286 
290  void nickNameChanged( Kopete::Contact *, const QString & );
291 
295  void displayNameChanged();
296 
305  void myselfTyping( bool isTyping );
306 
311  void remoteTyping( const Kopete::Contact *contact, bool isTyping );
312 
317  void eventNotification( const QString& notificationText);
318 
322  void viewActivated( KopeteView* view );
323 
328  void messageStateChanged( uint messageId, Kopete::Message::MessageState state );
329 
334  void photoChanged();
335 
339  void toggleGraphicOverride(bool enable);
340 
341 public slots:
345  void receivedTypingMsg( const Kopete::Contact *contact , bool isTyping = true );
346 
352  void receivedTypingMsg( const QString &contactId, bool isTyping = true );
353 
359  void receivedEventNotification( const QString& notificationText );
360 
366  void receivedMessageState( uint messageId, Kopete::Message::MessageState state );
367 
373  void appendMessage( Kopete::Message &msg );
374 
382  void addContact( const Kopete::Contact *c, bool suppress = false );
383 
393  void addContact( const Kopete::Contact *c, const Kopete::OnlineStatus &initialStatus, bool suppress = false );
394 
402  void removeContact( const Kopete::Contact *contact, const QString& reason = QString(), Qt::TextFormat format = Qt::PlainText, bool suppressNotification = false );
403 
415  void setCanBeDeleted ( bool canBeDeleted );
416 
423  void ref();
428  void deref();
429 
430 
434  void sendMessage( Kopete::Message &message );
435 
440  void typing( bool t );
441 
446  void messageSucceeded();
447 
451  void emitNudgeNotification();
452 
457  void raiseView();
458 
459 private slots:
460  void clearChains();
461  void slotUpdateDisplayName();
462  void slotViewDestroyed();
463  void slotOnlineStatusChanged( Kopete::Contact *c, const Kopete::OnlineStatus &status, const Kopete::OnlineStatus &oldStatus );
464  void slotContactDestroyed( Kopete::Contact *contact );
465  void slotMyselfDestroyed( Kopete::Contact *contact );
466  void slotDisplayNameChanged( const QString &oldName, const QString &newName );
467 
468 protected:
474  ChatSession( const Contact *user, ContactPtrList others, Protocol *protocol, Form form = Small );
475 
482  void setMayInvite(bool);
483 
489  void setWarnGroupChat(bool);
490 
491 private:
492  KMMPrivate *d;
493 
494  // FIXME: remove
495  friend class TemporaryKMMCallbackAppendMessageHandler;
496 };
497 
498 }
499 
500 #endif
501 
502 // vim: set noet ts=4 sts=4 sw=4:
503 
KOPETE_EXPORT
#define KOPETE_EXPORT
Definition: kopete_export.h:27
Kopete::OnlineStatus
Definition: kopeteonlinestatus.h:68
Kopete::ContactPtrList
QList< Contact * > ContactPtrList
Definition: kopetechatsession.h:52
status
OnlineStatus::StatusType status
Definition: kopeteonlinestatus.cpp:103
Kopete::Protocol
base class of every protocol.
Definition: kopeteprotocol.h:62
Kopete::ChatSessionManager
Definition: kopetechatsessionmanager.h:47
Kopete::Message::MessageState
MessageState
Definition: kopetemessage.h:116
Kopete::ChatSession
Definition: kopetechatsession.h:74
QObject
Kopete::Message::MessageDirection
MessageDirection
Direction of a message.
Definition: kopetemessage.h:88
kopete_export.h
QString
QList< Contact * >
Kopete::Contact
Definition: kopetecontact.h:58
QStringList
kopetemessagehandlerchain.h
Kopete::MessageHandlerChain::Ptr
KSharedPtr< MessageHandlerChain > Ptr
Definition: kopetemessagehandlerchain.h:50
Kopete::MessageList
QList< Message > MessageList
Definition: kopetechatsession.h:55
Kopete::ChatSession::Small
The chat is a small group or 1:1 chat.
Definition: kopetechatsession.h:85
Kopete::ChatSession::Form
Form
Describes the form of this chat session.
Definition: kopetechatsession.h:85
kopetemessage.h
KopeteView
Definition: kopeteview.h:40
Kopete::Account
The Kopete::Account class handles one account.
Definition: kopeteaccount.h:72
Kopete::Message
Representation of a message in Kopete.
Definition: kopetemessage.h:82
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/libkopete

Skip menu "kopete/libkopete"
  • 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