libpurple/protocol.h

changeset 40507
77d7bc9e5151
parent 40474
1341be8e3402
child 40521
c4269b37a13a
equal deleted inserted replaced
40506:cb26b9c6d4d0 40507:77d7bc9e5151
373 373
374 #define PURPLE_IS_PROTOCOL_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_PROTOCOL_SERVER)) 374 #define PURPLE_IS_PROTOCOL_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_PROTOCOL_SERVER))
375 #define PURPLE_PROTOCOL_SERVER_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE((obj), PURPLE_TYPE_PROTOCOL_SERVER, \ 375 #define PURPLE_PROTOCOL_SERVER_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE((obj), PURPLE_TYPE_PROTOCOL_SERVER, \
376 PurpleProtocolServerInterface)) 376 PurpleProtocolServerInterface))
377 377
378 #define PURPLE_TYPE_PROTOCOL_IM (purple_protocol_im_iface_get_type())
379
380 typedef struct _PurpleProtocolIMInterface PurpleProtocolIMInterface;
381
382 /**
383 * PurpleProtocolIMInterface:
384 * @send: This protocol function should return a positive value on
385 * success. If the message is too big to be sent, return
386 * <literal>-E2BIG</literal>. If the account is not connected,
387 * return <literal>-ENOTCONN</literal>. If the protocol is unable
388 * to send the message for another reason, return some other
389 * negative value. You can use one of the valid #errno values, or
390 * just big something. If the message should not be echoed to the
391 * conversation window, return 0.
392 * @send_typing: If this protocol requires the #PURPLE_IM_TYPING message to be
393 * sent repeatedly to signify that the user is still typing, then
394 * the protocol should return the number of seconds to wait before
395 * sending a subsequent notification. Otherwise the protocol
396 * should return 0.
397 *
398 * The protocol IM interface.
399 *
400 * This interface provides callbacks needed by protocols that implement IMs.
401 */
402 struct _PurpleProtocolIMInterface
403 {
404 /*< private >*/
405 GTypeInterface parent_iface;
406
407 /*< public >*/
408 int (*send)(PurpleConnection *connection, PurpleMessage *msg);
409
410 unsigned int (*send_typing)(PurpleConnection *connection, const char *name,
411 PurpleIMTypingState state);
412 };
413
414 #define PURPLE_IS_PROTOCOL_IM(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_PROTOCOL_IM))
415 #define PURPLE_PROTOCOL_IM_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE((obj), PURPLE_TYPE_PROTOCOL_IM, \
416 PurpleProtocolIMInterface))
417
418 #define PURPLE_TYPE_PROTOCOL_CHAT (purple_protocol_chat_iface_get_type()) 378 #define PURPLE_TYPE_PROTOCOL_CHAT (purple_protocol_chat_iface_get_type())
419 379
420 typedef struct _PurpleProtocolChatInterface PurpleProtocolChatInterface; 380 typedef struct _PurpleProtocolChatInterface PurpleProtocolChatInterface;
421 381
422 /** 382 /**
899 void purple_protocol_server_iface_get_public_alias(PurpleProtocol *protocol, 859 void purple_protocol_server_iface_get_public_alias(PurpleProtocol *protocol,
900 PurpleConnection *gc, PurpleGetPublicAliasSuccessCallback success_cb, 860 PurpleConnection *gc, PurpleGetPublicAliasSuccessCallback success_cb,
901 PurpleGetPublicAliasFailureCallback failure_cb); 861 PurpleGetPublicAliasFailureCallback failure_cb);
902 862
903 /**************************************************************************/ 863 /**************************************************************************/
904 /* Protocol IM Interface API */
905 /**************************************************************************/
906
907 /**
908 * purple_protocol_im_iface_get_type:
909 *
910 * Returns: The #GType for the protocol IM interface.
911 */
912 GType purple_protocol_im_iface_get_type(void);
913
914 int purple_protocol_im_iface_send(PurpleProtocol *protocol, PurpleConnection *connection,
915 PurpleMessage *msg);
916
917 unsigned int purple_protocol_im_iface_send_typing(PurpleProtocol *protocol,
918 PurpleConnection *connection, const char *name, PurpleIMTypingState state);
919
920 /**************************************************************************/
921 /* Protocol Chat Interface API */ 864 /* Protocol Chat Interface API */
922 /**************************************************************************/ 865 /**************************************************************************/
923 866
924 /** 867 /**
925 * purple_protocol_chat_iface_get_type: 868 * purple_protocol_chat_iface_get_type:

mercurial