Move enumerations to matrix-api-types.[ch]

This commit is contained in:
Gergely Polonkai 2016-01-11 14:07:27 +01:00
parent 4aa99ea19b
commit 4847f73668
5 changed files with 213 additions and 212 deletions

View File

@ -25,6 +25,14 @@ MATRIX_API_ERROR
<SUBSECTION> <SUBSECTION>
MatrixAPIEventFormat MatrixAPIEventFormat
MatrixAPIRoomPreset
MatrixAPIRoomVisibility
MatrixAPIResizeMethod
MatrixAPIPresence
MatrixAPIPusherKind
MatrixAPIPusherConditionKind
MatrixAPIEventDirection
MatrixAPIReceiptType
<SUBSECTION> <SUBSECTION>
MatrixAPIFilterRules MatrixAPIFilterRules
@ -148,6 +156,22 @@ matrix_api_state_event_get_json_data
<SUBSECTION Standard> <SUBSECTION Standard>
MATRIX_TYPE_API_EVENT_FORMAT MATRIX_TYPE_API_EVENT_FORMAT
matrix_api_event_format_get_type matrix_api_event_format_get_type
MATRIX_TYPE_API_ROOM_PRESET
matrix_api_room_preset_get_type
MATRIX_TYPE_API_ROOM_VISIBILITY
matrix_api_room_visibility_get_type
MATRIX_TYPE_API_RESIZE_METHOD
matrix_api_resize_method_get_type
MATRIX_TYPE_API_PRESENCE
matrix_api_presence_get_type
MATRIX_TYPE_API_PUSHER_KIND
matrix_api_pusher_kind_get_type
MATRIX_TYPE_API_PUSHER_CONDITION_KIND
matrix_api_pusher_condition_kind_get_type
MATRIX_TYPE_API_EVENT_DIRECTION
matrix_api_event_direction_get_type
MATRIX_TYPE_API_RECEIPT_TYPE
matrix_api_receipt_type_get_type
MATRIX_TYPE_API_FILTER_RULES MATRIX_TYPE_API_FILTER_RULES
matrix_api_filter_rules_get_type matrix_api_filter_rules_get_type
MATRIX_TYPE_API_ROOM_FILTER MATRIX_TYPE_API_ROOM_FILTER
@ -166,14 +190,6 @@ matrix_api_state_event_get_type
<FILE>matrix-api</FILE> <FILE>matrix-api</FILE>
<TITLE>MatrixAPI</TITLE> <TITLE>MatrixAPI</TITLE>
MatrixAPICallback MatrixAPICallback
MatrixAPIRoomPreset
MatrixAPIRoomVisibility
MatrixAPIResizeMethod
MatrixAPIPresence
MatrixAPIPusherKind
MatrixAPIPusherConditionKind
MatrixAPIEventDirection
MatrixAPIReceiptType
<SUBSECTION> <SUBSECTION>
matrix_api_set_token matrix_api_set_token
@ -275,22 +291,7 @@ MATRIX_IS_API
MATRIX_API_GET_IFACE MATRIX_API_GET_IFACE
MatrixApiPrivate MatrixApiPrivate
matrix_api_get_type matrix_api_get_type
MATRIX_TYPE_API_EVENT_DIRECTION
matrix_api_event_direction_get_type
MATRIX_TYPE_API_PRESENCE
matrix_api_presence_get_type
MATRIX_TYPE_API_PUSHER_CONDITION_KIND
matrix_api_pusher_condition_kind_get_type
MATRIX_TYPE_API_PUSHER_KIND
matrix_api_pusher_kind_get_type
MATRIX_TYPE_API_RECEIPT_TYPE
matrix_api_receipt_type_get_type
MATRIX_TYPE_API_RESIZE_METHOD
matrix_api_resize_method_get_type
MATRIX_TYPE_API_ROOM_PRESET
matrix_api_room_preset_get_type
MATRIX_TYPE_API_ROOM_VISIBILITY
matrix_api_room_visibility_get_type
<SUBSECTION Private> <SUBSECTION Private>
matrix_api_error_quark matrix_api_error_quark
</SECTION> </SECTION>

View File

@ -74,6 +74,145 @@ G_DEFINE_QUARK(matrix-api-error-quark, matrix_api_error);
* Event format received when synchronizing. * Event format received when synchronizing.
*/ */
/**
* MatrixAPIRoomPreset:
* @MATRIX_API_ROOM_PRESET_NONE: no preset
* @MATRIX_API_ROOM_PRESET_PRIVATE: preset for private rooms
* @MATRIX_API_ROOM_PRESET_TRUSTED_PRIVATE: same as private rooms, but
* all users get the same
* power level as the room
* creator
* @MATRIX_API_ROOM_PRESET_PUBLIC: preset for public rooms
*
* Preset values for matrix_api_create_room() calls.
*/
/**
* MatrixAPIRoomVisibility:
* @MATRIX_API_ROOM_VISIBILITY_DEFAULT: use a server-assigned value
* (usually <code>private</code>
* @MATRIX_API_ROOM_VISIBILITY_PUBLIC: make the room visible in the
* public room list
* @MATRIX_API_ROOM_VISIBILITY_PRIVATE: hide the room from the public
* room list
*
* Visibility values for room creation. Not to be confused with join
* rules.
*/
/**
* MatrixAPIResizeMethod:
* @MATRIX_API_RESIZE_METHOD_CROP: crop thumbnail to the requested
* size
* @MATRIX_API_RESIZE_METHOD_SCALE: scale thumbnail to the requested
* size
*
* Resizing methods for matrix_api_media_thumbnail().
*/
/**
* MatrixAPIPresence:
* @MATRIX_API_PRESENCE_ONLINE: user is online
* @MATRIX_API_PRESENCE_OFFLINE: user is offline
* @MATRIX_API_PRESENCE_UNAVAILABLE: user is unavailable (i.e. busy)
* @MATRIX_API_PRESENCE_FREE_FOR_CHAT: user is free for chat
*
* Presence values for matrix_api_set_user_presence() and other
* presence related queries.
*/
/**
* MatrixAPIPusherKind:
* @MATRIX_API_PUSHER_KIND_OVERRIDE: highest priority rules
* @MATRIX_API_PUSHER_KIND_SENDER: for (unencrypted) messages that
* match certain patterns
* @MATRIX_API_PUSHER_KIND_ROOM: for all messages for a given
* room. The rule ID of a room rule is
* always the ID of the room that it
* affects
* @MATRIX_API_PUSHER_KIND_CONTENT: for messages from a specific
* Matrix user ID. The rule ID of
* such rules is always the Matrix ID
* of the user whose messages they'd
* apply to
* @MATRIX_API_PUSHER_KIND_UNDERRIDE: lowest priority rules
*
* Pusher types.
*/
/**
* MatrixAPIPusherConditionKind:
* @MATRIX_API_PUSHER_CONDITION_KIND_EVENT_MATCH: glob pattern match
* on a field of the
* event. Requires a
* <code>key</code> and
* a
* <code>pattern</code>
* parameter
* @MATRIX_API_PUSHER_CONDITION_KIND_PROFILE_TAG: matches the profile
* tag of the device
* that the
* notification would
* be delivered
* to. Requires a
* <code>profile_tag</code>
* parameter
* @MATRIX_API_PUSHER_CONDITION_KIND_CONTAINS_DISPLAY_NAME: matches
* unencrypted
* messages
* where the
* content's
* body
* contains
* the
* owner's
* display
* name in
* that room.
* @MATRIX_API_PUSHER_CONDITION_KIND_ROOM_MEMBER_COUNT: matches the
* current number
* of members in
* the
* room. Requires
* an
* <code>is</code>
* parameter,
* which must be
* an integer,
* optionally
* prefixed by
* <code>==</code>,
* <code>&lt;</code>,
* <code>&gt;</code>,
* <code>&lt;=</code>
* or
* <code>&gt;=</code>. If
* the prefix is
* omitted, it
* defaults to
* <code>==</code>
*
* Condition types for pushers.
*/
/**
* MatrixAPIEventDirection:
* @MATRIX_API_EVENT_DIRECTION_FORWARD: List events after the
* specified one
* @MATRIX_API_EVENT_DIRECTION_BACKWARD: List events before the
* specified one
*
* Direction of events when requesting an event context.
*/
/**
* MatrixAPIReceiptType:
* @MATRIX_API_RECEIPT_TYPE_READ: indicate that the message has been
* read
*
* Receipt types of acknowledgment.
*/
/** /**
* MatrixAPIFilterRules: (ref-func matrix_api_filter_rules_ref) (unref-func matrix_api_filter_rules_unref) * MatrixAPIFilterRules: (ref-func matrix_api_filter_rules_ref) (unref-func matrix_api_filter_rules_unref)
* *

View File

@ -44,6 +44,55 @@ typedef enum {
MATRIX_API_EVENT_FORMAT_FEDERATION MATRIX_API_EVENT_FORMAT_FEDERATION
} MatrixAPIEventFormat; } MatrixAPIEventFormat;
typedef enum {
MATRIX_API_RESIZE_METHOD_CROP,
MATRIX_API_RESIZE_METHOD_SCALE
} MatrixAPIResizeMethod;
typedef enum {
MATRIX_API_PRESENCE_ONLINE,
MATRIX_API_PRESENCE_OFFLINE,
MATRIX_API_PRESENCE_UNAVAILABLE,
MATRIX_API_PRESENCE_FREE_FOR_CHAT
} MatrixAPIPresence;
typedef enum {
MATRIX_API_ROOM_PRESET_NONE,
MATRIX_API_ROOM_PRESET_PRIVATE,
MATRIX_API_ROOM_PRESET_TRUSTED_PRIVATE,
MATRIX_API_ROOM_PRESET_PUBLIC
} MatrixAPIRoomPreset;
typedef enum {
MATRIX_API_ROOM_VISIBILITY_DEFAULT,
MATRIX_API_ROOM_VISIBILITY_PUBLIC,
MATRIX_API_ROOM_VISIBILITY_PRIVATE
} MatrixAPIRoomVisibility;
typedef enum {
MATRIX_API_EVENT_DIRECTION_FORWARD,
MATRIX_API_EVENT_DIRECTION_BACKWARD
} MatrixAPIEventDirection;
typedef enum {
MATRIX_API_RECEIPT_TYPE_READ
} MatrixAPIReceiptType;
typedef enum {
MATRIX_API_PUSHER_KIND_OVERRIDE,
MATRIX_API_PUSHER_KIND_SENDER,
MATRIX_API_PUSHER_KIND_ROOM,
MATRIX_API_PUSHER_KIND_CONTENT,
MATRIX_API_PUSHER_KIND_UNDERRIDE
} MatrixAPIPusherKind;
typedef enum {
MATRIX_API_PUSHER_CONDITION_KIND_EVENT_MATCH,
MATRIX_API_PUSHER_CONDITION_KIND_PROFILE_TAG,
MATRIX_API_PUSHER_CONDITION_KIND_CONTAINS_DISPLAY_NAME,
MATRIX_API_PUSHER_CONDITION_KIND_ROOM_MEMBER_COUNT
} MatrixAPIPusherConditionKind;
typedef struct _MatrixAPIFilterRules MatrixAPIFilterRules; typedef struct _MatrixAPIFilterRules MatrixAPIFilterRules;
GType matrix_api_filter_rules_get_type(void); GType matrix_api_filter_rules_get_type(void);

View File

@ -75,145 +75,6 @@
* A callback function to use with API calls. * A callback function to use with API calls.
*/ */
/**
* MatrixAPIRoomPreset:
* @MATRIX_API_ROOM_PRESET_NONE: no preset
* @MATRIX_API_ROOM_PRESET_PRIVATE: preset for private rooms
* @MATRIX_API_ROOM_PRESET_TRUSTED_PRIVATE: same as private rooms, but
* all users get the same
* power level as the room
* creator
* @MATRIX_API_ROOM_PRESET_PUBLIC: preset for public rooms
*
* Preset values for matrix_api_create_room() calls.
*/
/**
* MatrixAPIRoomVisibility:
* @MATRIX_API_ROOM_VISIBILITY_DEFAULT: use a server-assigned value
* (usually <code>private</code>
* @MATRIX_API_ROOM_VISIBILITY_PUBLIC: make the room visible in the
* public room list
* @MATRIX_API_ROOM_VISIBILITY_PRIVATE: hide the room from the public
* room list
*
* Visibility values for room creation. Not to be confused with join
* rules.
*/
/**
* MatrixAPIResizeMethod:
* @MATRIX_API_RESIZE_METHOD_CROP: crop thumbnail to the requested
* size
* @MATRIX_API_RESIZE_METHOD_SCALE: scale thumbnail to the requested
* size
*
* Resizing methods for matrix_api_media_thumbnail().
*/
/**
* MatrixAPIPresence:
* @MATRIX_API_PRESENCE_ONLINE: user is online
* @MATRIX_API_PRESENCE_OFFLINE: user is offline
* @MATRIX_API_PRESENCE_UNAVAILABLE: user is unavailable (i.e. busy)
* @MATRIX_API_PRESENCE_FREE_FOR_CHAT: user is free for chat
*
* Presence values for matrix_api_set_user_presence() and other
* presence related queries.
*/
/**
* MatrixAPIPusherKind:
* @MATRIX_API_PUSHER_KIND_OVERRIDE: highest priority rules
* @MATRIX_API_PUSHER_KIND_SENDER: for (unencrypted) messages that
* match certain patterns
* @MATRIX_API_PUSHER_KIND_ROOM: for all messages for a given
* room. The rule ID of a room rule is
* always the ID of the room that it
* affects
* @MATRIX_API_PUSHER_KIND_CONTENT: for messages from a specific
* Matrix user ID. The rule ID of
* such rules is always the Matrix ID
* of the user whose messages they'd
* apply to
* @MATRIX_API_PUSHER_KIND_UNDERRIDE: lowest priority rules
*
* Pusher types.
*/
/**
* MatrixAPIPusherConditionKind:
* @MATRIX_API_PUSHER_CONDITION_KIND_EVENT_MATCH: glob pattern match
* on a field of the
* event. Requires a
* <code>key</code> and
* a
* <code>pattern</code>
* parameter
* @MATRIX_API_PUSHER_CONDITION_KIND_PROFILE_TAG: matches the profile
* tag of the device
* that the
* notification would
* be delivered
* to. Requires a
* <code>profile_tag</code>
* parameter
* @MATRIX_API_PUSHER_CONDITION_KIND_CONTAINS_DISPLAY_NAME: matches
* unencrypted
* messages
* where the
* content's
* body
* contains
* the
* owner's
* display
* name in
* that room.
* @MATRIX_API_PUSHER_CONDITION_KIND_ROOM_MEMBER_COUNT: matches the
* current number
* of members in
* the
* room. Requires
* an
* <code>is</code>
* parameter,
* which must be
* an integer,
* optionally
* prefixed by
* <code>==</code>,
* <code>&lt;</code>,
* <code>&gt;</code>,
* <code>&lt;=</code>
* or
* <code>&gt;=</code>. If
* the prefix is
* omitted, it
* defaults to
* <code>==</code>
*
* Condition types for pushers.
*/
/**
* MatrixAPIEventDirection:
* @MATRIX_API_EVENT_DIRECTION_FORWARD: List events after the
* specified one
* @MATRIX_API_EVENT_DIRECTION_BACKWARD: List events before the
* specified one
*
* Direction of events when requesting an event context.
*/
/**
* MatrixAPIReceiptType:
* @MATRIX_API_RECEIPT_TYPE_READ: indicate that the message has been
* read
*
* Receipt types of acknowledgment.
*/
G_DEFINE_INTERFACE(MatrixAPI, matrix_api, G_TYPE_OBJECT); G_DEFINE_INTERFACE(MatrixAPI, matrix_api, G_TYPE_OBJECT);
static void static void

View File

@ -39,55 +39,6 @@ typedef void (*MatrixAPICallback)(MatrixAPI *api,
gpointer data, gpointer data,
GError *err); GError *err);
typedef enum {
MATRIX_API_RESIZE_METHOD_CROP,
MATRIX_API_RESIZE_METHOD_SCALE
} MatrixAPIResizeMethod;
typedef enum {
MATRIX_API_PRESENCE_ONLINE,
MATRIX_API_PRESENCE_OFFLINE,
MATRIX_API_PRESENCE_UNAVAILABLE,
MATRIX_API_PRESENCE_FREE_FOR_CHAT
} MatrixAPIPresence;
typedef enum {
MATRIX_API_ROOM_PRESET_NONE,
MATRIX_API_ROOM_PRESET_PRIVATE,
MATRIX_API_ROOM_PRESET_TRUSTED_PRIVATE,
MATRIX_API_ROOM_PRESET_PUBLIC
} MatrixAPIRoomPreset;
typedef enum {
MATRIX_API_ROOM_VISIBILITY_DEFAULT,
MATRIX_API_ROOM_VISIBILITY_PUBLIC,
MATRIX_API_ROOM_VISIBILITY_PRIVATE
} MatrixAPIRoomVisibility;
typedef enum {
MATRIX_API_EVENT_DIRECTION_FORWARD,
MATRIX_API_EVENT_DIRECTION_BACKWARD
} MatrixAPIEventDirection;
typedef enum {
MATRIX_API_RECEIPT_TYPE_READ
} MatrixAPIReceiptType;
typedef enum {
MATRIX_API_PUSHER_KIND_OVERRIDE,
MATRIX_API_PUSHER_KIND_SENDER,
MATRIX_API_PUSHER_KIND_ROOM,
MATRIX_API_PUSHER_KIND_CONTENT,
MATRIX_API_PUSHER_KIND_UNDERRIDE
} MatrixAPIPusherKind;
typedef enum {
MATRIX_API_PUSHER_CONDITION_KIND_EVENT_MATCH,
MATRIX_API_PUSHER_CONDITION_KIND_PROFILE_TAG,
MATRIX_API_PUSHER_CONDITION_KIND_CONTAINS_DISPLAY_NAME,
MATRIX_API_PUSHER_CONDITION_KIND_ROOM_MEMBER_COUNT
} MatrixAPIPusherConditionKind;
struct _MatrixAPIInterface { struct _MatrixAPIInterface {
/*< private >*/ /*< private >*/
GTypeInterface g_iface; GTypeInterface g_iface;