m ;YCc@sdklZlZlZdefdYZdefdYZdefdYZdefdYZd efd YZd dddd gZ d S( (s Interfaces Attributes implementstIProtocolPlugincBs#tZdZedZdZRS(sDInterface for plugins providing an interface to a Words service sHA single word describing what kind of interface this is (eg, irc or web)cCsdS(sbRetrieve a C{twisted.internet.interfaces.IServerFactory} provider @param realm: An object providing C{twisted.cred.portal.IRealm} and C{IChatService}, with which service information should be looked up. @param portal: An object providing C{twisted.cred.portal.IPortal}, through which logins should be performed. N((trealmtportal((tl/home/radix/Projects/Twisted/branches/releases/twisted-core-2.5.x-2329-2/Twisted.exp/twisted/words/iwords.pyt getFactory s(t__name__t __module__t__doc__t AttributetnameR(((RRs  tIGroupcBsMtZedZdZddZdZdZdZ dZ RS(Ns$A short string, unique among groups.cCsdS(sLInclude the given user in this group. @type user: L{IUser} N((tuser((RtaddscCsdS(snRemove the given user from this group. @type user: L{IUser} @type reason: C{unicode} N((R treason((Rtremove!scCsdS(sReturn the number of participants in this group. @rtype: L{twisted.internet.defer.Deferred} @return: A Deferred which fires with an C{int} representing the the number of participants in this group. N((((Rtsize(scCsdS(sY Broadcast the given message from the given sender to other users in group. The message is not re-transmitted to the sender. @param sender: L{IUser} @type recipient: L{IGroup} @param recipient: This is probably a wart. Maybe it will be removed in the future. For now, it should be the group object the message is being delivered to. @param message: C{dict} @rtype: L{twisted.internet.defer.Deferred} @return: A Deferred which fires with None when delivery has been attempted for all users. N((tsendert recipienttmessage((Rtreceive0scCsdS(sUChange the metadata associated with this group. @type meta: C{dict} N((tmeta((Rt setMetadataEscCsdS(s7Return an iterator of all users in this group. N((((Rt iterusersKs( RRRR R tNoneRRRRR(((RR s      t IChatClientcBsAtZdZedZdZdZdZedZ RS(sAInterface through which IChatService interacts with clients. s[A short string, unique among users. This will be set by the L{IChatService} at login time.cCsdS(s^ Callback notifying this user of the given message sent by the given user. This will be invoked whenever another user sends a message to a group this user is participating in, or whenever another user sends a message directly to this user. In the former case, C{recipient} will be the group to which the message was sent; in the latter, it will be the same object as the user who is receiving the message. @type sender: L{IUser} @type recipient: L{IUser} or L{IGroup} @type message: C{dict} @rtype: L{twisted.internet.defer.Deferred} @return: A Deferred which fires when the message has been delivered, or which fails in some way. If the Deferred fails and the message was directed at a group, this user will be removed from that group. N((RRR((RRVscCsdS(s Callback notifying this user that the metadata for the given group has changed. @type group: L{IGroup} @type meta: C{dict} @rtype: L{twisted.internet.defer.Deferred} N((tgroupR((RtgroupMetaUpdateks cCsdS(s Callback notifying this user that the given user has joined the given group. @type group: L{IGroup} @type user: L{IUser} @rtype: L{twisted.internet.defer.Deferred} N((RR ((Rt userJoinedvs cCsdS(s  Callback notifying this user that the given user has left the given group for the given reason. @type group: L{IGroup} @type user: L{IUser} @type reason: C{unicode} @rtype: L{twisted.internet.defer.Deferred} N((RR R ((RtuserLefts ( RRRRR RRRRR(((RRPs    tIUsercBswtZdZedZedZedZedZedZdZ dZ dZ d Z d Z RS( s@Interface through which clients interact with IChatService. s_A reference to the Realm to which this user belongs. Set if and only if the user is logged in.s`A reference to the mind which logged in to this user. Set if and only if the user is logged in.s#A short string, unique among users.sRA POSIX timestamp indicating the time of the last message received from this user.sBA POSIX timestamp indicating this user's most recent sign on time.cCsdS(sInvoked by the associated L{IChatService} when login occurs. @param realm: The L{IChatService} through which login is occurring. @param mind: The mind object used for cred login. N((Rtmind((RtloggedInscCsdS(sSend the given message to the given user or group. @type recipient: Either L{IUser} or L{IGroup} @type message: C{dict} N((RR((RtsendscCsdS(s|Attempt to join the given group. @type group: L{IGroup} @rtype: L{twisted.internet.defer.Deferred} N((R((RtjoinscCsdS(sDiscontinue participation in the given group. @type group: L{IGroup} @rtype: L{twisted.internet.defer.Deferred} N((R((RtleavescCsdS(sZ Return an iterator of all groups of which this user is a member. N((((Rt itergroupss(RRRRRRR t lastMessagetsignOnRR R!R"R#(((RRs          t IChatServicecBsbtZedZedZedZdZdZdZdZ dZ d Z RS( Ns=A short string identifying this chat service (eg, a hostname)sxA boolean indicating whether L{getGroup} should implicitly create groups which are requested but which do not yet exist.svA boolean indicating whether L{getUser} should implicitly create users which are requested but which do not yet exist.cCsdS(sReturn all groups available on this service. @rtype: C{twisted.internet.defer.Deferred} @return: A Deferred which fires with a list of C{IGroup} providers. N((((RR#scCsdS(sRetrieve the group by the given name. @type name: C{str} @rtype: L{twisted.internet.defer.Deferred} @return: A Deferred which fires with the group with the given name if one exists (or if one is created due to the setting of L{createGroupOnRequest}, or which fails with L{twisted.words.ewords.NoSuchGroup} if no such group exists. N((R ((RtgetGroups cCsdS(s2Create a new group with the given name. @type name: C{str} @rtype: L{twisted.internet.defer.Deferred} @return: A Deferred which fires with the created group, or with fails with L{twisted.words.ewords.DuplicateGroup} if a group by that name exists already. N((R ((Rt createGroups cCsdS(sERetrieve a group by name. Unlike C{getGroup}, this will never implicitly create a group. @type name: C{str} @rtype: L{twisted.internet.defer.Deferred} @return: A Deferred which fires with the group by the given name, or which fails with L{twisted.words.ewords.NoSuchGroup}. N((R ((Rt lookupGroups cCsdS(sRetrieve the user by the given name. @type name: C{str} @rtype: L{twisted.internet.defer.Deferred} @return: A Deferred which fires with the user with the given name if one exists (or if one is created due to the setting of L{createUserOnRequest}, or which fails with L{twisted.words.ewords.NoSuchUser} if no such user exists. N((R ((RtgetUsers cCsdS(s.Create a new user with the given name. @type name: C{str} @rtype: L{twisted.internet.defer.Deferred} @return: A Deferred which fires with the created user, or with fails with L{twisted.words.ewords.DuplicateUser} if a user by that name exists already. N((R ((Rt createUsers ( RRRR tcreateGroupOnRequesttcreateUserOnRequestR#R'R(R)R*R+(((RR&s     tIChatInterfaceN( tzope.interfacet InterfaceRt implementsRR RRR&t__all__( R1R&RR2RR RR0R((Rt?s 8>.L