00001 #ifndef GTASK_ROLE_PACKET_H
00002 #define GTASK_ROLE_PACKET_H
00003
00004 #include <gtask/gtask-packet.h>
00005
00008
00009
00010 typedef struct _GTaskRolePacket GTaskRolePacket;
00011 typedef struct _GTaskRolePacketPrivate GTaskRolePacketPrivate;
00012 typedef struct _GTaskRolePacketClass GTaskRolePacketClass;
00013
00014
00016 #define GTASK_ROLE_PACKET_TYPE (gtask_role_packet_get_type())
00017
00019 #define GTASK_ROLE_PACKET(obj) (G_TYPE_CHECK_INSTANCE_CAST( (obj), \
00020 GTASK_ROLE_PACKET_TYPE, \
00021 GTaskRolePacket ))
00022
00024 #define GTASK_ROLE_PACKET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST( (klass), \
00025 GTASK_ROLE_PACKET_TYPE, \
00026 GTaskRolePacketClass ))
00027
00032 #define GTASK_IS_ROLE_PACKET(obj) (G_TYPE_CHECK_INSTANCE_TYPE( (obj), \
00033 GTASK_ROLE_PACKET_TYPE ))
00034
00039 #define GTASK_IS_ROLE_PACKET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE( (klass), \
00040 GTASK_ROLE_PACKET_TYPE ))
00041
00042 #define GTASK_ROLE_PACKET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS( (obj), \
00043 GTASK_ROLE_PACKET_TYPE, \
00044 GTaskRolePacketClass ))
00045
00046 typedef enum {
00047 GTASK_ROLE_NONE,
00048 GTASK_ROLE_PROXY,
00049 GTASK_ROLE_REPORTER,
00050 GTASK_ROLE_PROVIDER
00051 } GTaskRole;
00052
00053 #define GTASK_ROLE_TYPE (gtask_role_get_type())
00054
00055
00056 struct _GTaskRolePacket {
00057 GTaskPacket parent;
00058 GTaskRolePacketPrivate *private;
00059 };
00060
00061 struct _GTaskRolePacketPrivate {
00062 GTaskRole role;
00063 };
00064
00065 struct _GTaskRolePacketClass {
00066 GTaskPacketClass parent;
00067 };
00068
00069 GType gtask_role_get_type( void );
00070
00071 GType gtask_role_packet_get_type( void );
00072
00073 GTaskRolePacket *
00074 gtask_role_packet_new( void );
00075
00076 GTaskRolePacket *
00077 gtask_role_packet_new_with_role( GTaskRole role );
00078
00079 GTaskRole
00080 gtask_role_packet_get_role( GTaskRolePacket *packet );
00081
00082 void
00083 gtask_role_packet_set_role( GTaskRolePacket *packet, GTaskRole role );
00084
00085 void
00086 gtask_role_packet_set_role_from_name( GTaskRolePacket *packet,
00087 const char *name );
00088
00089 const char *
00090 gtask_role_packet_get_role_name( GTaskRolePacket *packet );
00091
00092 GTaskRole
00093 gtask_role_from_name( const char *name );
00094
00095 const char *
00096 gtask_role_name( GTaskRole role );
00097
00098
00099
00100 #endif