1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 """Conversation event interfaces
22
23 The interfaces defined in this module allow receiving notification events
24 from a L{Conversation<papyon.conversation.ConversationInterface>} object."""
25
26 from papyon.event import BaseEventInterface
27
28 __all__ = ["ConversationEventInterface", "ConversationErrorType",
29 "ContactInviteError", "MessageError"]
30
31
33 """L{Client<papyon.Client>} error types
34 @see: L{ClientEventInterface.on_client_error}"""
35
36 NETWORK = 0
37 "Network related errors"
38 AUTHENTICATION = 1
39 "Authentication related errors"
40 PROTOCOL = 2
41 "Protocol related errors"
42 CONTACT_INVITE = 3
43 "Contact invitation related errors"
44 MESSAGE = 4
45 "Message sending related errors"
46
47
53
54
60
61
63 """Interfaces allowing the user to get notified about events
64 from a L{Conversation<papyon.conversation.ConversationInterface>} object."""
65
67 """Initializer
68 @param conversation: the conversation we want to be notified for its events
69 @type conversation: L{Conversation<papyon.conversation.ConversationInterface>}"""
70 BaseEventInterface.__init__(self, conversation)
71
73 """@attention: not implemented"""
74 pass
75
77 """Called when an error occurs in the L{Client<papyon.conversation>}.
78
79 @param type: the error type
80 @type type: L{ClientErrorType}
81
82 @param error: the error code
83 @type error: L{NetworkError} or L{AuthenticationError} or
84 L{ProtocolError} or L{ContactInviteError} or
85 L{MessageError}"""
86 pass
87
89 """Called when an user joins the conversation.
90 @param contact: the contact whose presence changed
91 @type contact: L{Contact<papyon.profile.Contact>}"""
92 pass
93
95 """Called when an user leaved the conversation.
96 @param contact: the contact whose presence changed
97 @type contact: L{Contact<papyon.profile.Contact>}"""
98 pass
99
101 """Called when an user is typing.
102 @param contact: the contact whose presence changed
103 @type contact: L{Contact<papyon.profile.Contact>}"""
104 pass
105
107 """Called when an user sends a message.
108 @param sender: the contact who sent the message
109 @type sender: L{Contact<papyon.profile.Contact>}
110
111 @param message: the message
112 @type message: L{ConversationMessage<papyon.conversation.ConversationMessage>}"""
113 pass
114
116 """Called when an user sends a nudge.
117 @param sender: the contact who sent the nudge
118 @type sender: L{Contact<papyon.profile.Contact>}"""
119 pass
120