• 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
kopetemessagehandler.h
Go to the documentation of this file.
1 /*
2  kopetemessagehandler.h - Kopete Message Filtering
3 
4  Copyright (c) 2004 by Richard Smith <kde@metafoo.co.uk>
5  Kopete (c) 2002-2004 by the Kopete developers <kopete-devel@kde.org>
6 
7  *************************************************************************
8  * *
9  * This library is free software; you can redistribute it and/or *
10  * modify it under the terms of the GNU Lesser General Public *
11  * License as published by the Free Software Foundation; either *
12  * version 2 of the License, or (at your option) any later version. *
13  * *
14  *************************************************************************
15 */
16 
17 #ifndef KOPETEMESSAGEHANDLER_H
18 #define KOPETEMESSAGEHANDLER_H
19 
20 #include <QtCore/QObject>
21 #include <QtCore/QLinkedList>
22 
23 #include "kopete_export.h"
24 
25 //FIXME: Message::MessageDirection could be moved into namespace Kopete
26 // to avoid this being included everywhere
27 #include "kopetemessage.h"
28 
29 namespace Kopete
30 {
31 
32 class MessageEvent;
33 class ChatSession;
34 
44 class KOPETE_EXPORT MessageHandler : public QObject
45 {
46  Q_OBJECT
47 public:
48  MessageHandler();
49  virtual ~MessageHandler() = 0;
50 
54  MessageHandler *next();
55  // FIXME: remove?
56  void setNext( MessageHandler *next );
57 
63  virtual int capabilities();
64 
82  virtual void handleMessage( MessageEvent *event );
83 
85  void handleMessageInternal( MessageEvent *event );
86 private slots:
90  void messageAccepted( Kopete::MessageEvent *event );
91 
92 private:
93  class Private;
94  Private * const d;
95 };
96 
109 class KOPETE_EXPORT MessageHandlerFactory
110 {
111 public:
120  MessageHandlerFactory();
124  virtual ~MessageHandlerFactory();
125 
126  typedef QLinkedList<MessageHandlerFactory*> FactoryList;
130  static FactoryList messageHandlerFactories();
131 
138  virtual MessageHandler *create( ChatSession *manager, Message::MessageDirection direction ) = 0;
139 
143  enum SpecialStage
144  {
145  StageDoNotCreate = -10000,
146  StageStart = 0,
147  StageEnd = 10000
148  };
149 
153  enum InboundStage
154  {
155  InStageStart = 0,
156  InStageToSent = 2000,
157  InStageToDesired = 5000,
158  InStageFormat = 7000,
159  InStageEnd = 10000
160  };
161 
165  enum OutboundStage
166  {
167  OutStageStart = 0,
168  OutStageParse = 2000,
169  OutStageToDesired = 4000,
170  OutStageFormat = 6000,
171  OutStageToSent = 8000,
172  OutStageEnd = 10000
173  };
174 
178  enum InternalStage
179  {
180  IntStageStart = 0,
181  IntStageEnd = 10000
182  };
183 
190  enum Offset
191  {
192  OffsetBefore = -90,
193  OffsetVeryEarly = -60,
194  OffsetEarly = -30,
195  OffsetNormal = 0,
196  OffsetLate = 30,
197  OffsetVeryLate = 60,
198  OffsetAfter = 90
199  };
200 
209  virtual int filterPosition( ChatSession *manager, Message::MessageDirection direction ) = 0;
210 
211 private:
212  // noncopyable
213  MessageHandlerFactory(const MessageHandlerFactory &);
214  void operator=(const MessageHandlerFactory &);
215 
216  class Private;
217  Private * const d;
218 };
219 
220 }
221 
222 #endif
223 
224 // vim: set noet ts=4 sts=4 sw=4:
KOPETE_EXPORT
#define KOPETE_EXPORT
Definition: kopete_export.h:27
Kopete::MessageEvent
Definition: kopetemessageevent.h:41
Kopete::MessageHandlerFactory::InboundStage
InboundStage
Processing stages for handlers in inbound message handler chains.
Definition: kopetemessagehandler.h:153
Kopete::MessageHandlerFactory::FactoryList
QLinkedList< MessageHandlerFactory * > FactoryList
Definition: kopetemessagehandler.h:126
Kopete::MessageHandlerFactory::InternalStage
InternalStage
Processing stages for handlers in internal message handler chains.
Definition: kopetemessagehandler.h:178
Kopete::MessageHandlerFactory
Definition: kopetemessagehandler.h:109
Kopete::ChatSession
Definition: kopetechatsession.h:74
Kopete::MessageHandlerFactory::OutboundStage
OutboundStage
Processing stages for handlers in outbound message handler chains.
Definition: kopetemessagehandler.h:165
QLinkedList
QObject
Kopete::Message::MessageDirection
MessageDirection
Direction of a message.
Definition: kopetemessage.h:88
kopete_export.h
Kopete::MessageHandlerFactory::Offset
Offset
Offsets within a processing stage.
Definition: kopetemessagehandler.h:190
Kopete::MessageHandler
Definition: kopetemessagehandler.h:44
Kopete::MessageHandlerFactory::SpecialStage
SpecialStage
Special stages usable with any message direction.
Definition: kopetemessagehandler.h:143
kopetemessage.h
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