diff --git a/deltachat-ffi/deltachat.h b/deltachat-ffi/deltachat.h index 3695fa44b..7b9ff845c 100644 --- a/deltachat-ffi/deltachat.h +++ b/deltachat-ffi/deltachat.h @@ -11,6 +11,16 @@ extern "C" { #endif +typedef struct _dc_context dc_context_t; +typedef struct _dc_array dc_array_t; +typedef struct _dc_chatlist dc_chatlist_t; +typedef struct _dc_chat dc_chat_t; +typedef struct _dc_msg dc_msg_t; +typedef struct _dc_contact dc_contact_t; +typedef struct _dc_lot dc_lot_t; +typedef struct _dc_provider dc_provider_t; + + /** * @mainpage Getting started * @@ -189,13 +199,6 @@ extern "C" { * SQLite database for offline functionality and for account-related * settings. */ -typedef struct _dc_context dc_context_t; -typedef struct _dc_array dc_array_t; -typedef struct _dc_chatlist dc_chatlist_t; -typedef struct _dc_chat dc_chat_t; -typedef struct _dc_msg dc_msg_t; -typedef struct _dc_contact dc_contact_t; -typedef struct _dc_lot dc_lot_t; /** @@ -442,137 +445,6 @@ char* dc_get_info (dc_context_t* context); */ char* dc_get_oauth2_url (dc_context_t* context, const char* addr, const char* redirect_uri); -/** - * @class dc_provider_t - * - * Opaque object containing information about one single email provider. - */ -typedef struct _dc_provider dc_provider_t; - -/** - * Create a provider struct for the given domain. - * - * @memberof dc_provider_t - * @param domain The domain to get provider info for. - * @return a dc_provider_t struct which can be used with the dc_provider_get_* - * accessor functions. If no provider info is found, NULL will be - * returned. - */ -dc_provider_t* dc_provider_new_from_domain (char* domain); - -/** - * Create a provider struct for the given email address. - * - * The provider is extracted from the email address and it's information is returned. - * - * @memberof dc_provider_t - * @param email The user's email address to extract the provider info form. - * @return a dc_provider_t struct which can be used with the dc_provider_get_* - * accessor functions. If no provider info is found, NULL will be - * returned. - */ -dc_provider_t* dc_provider_new_from_email (char* email); - -/** - * URL of the overview page. - * - * This URL allows linking to the providers page on providers.delta.chat. - * - * @memberof dc_provider_t - * @param provider The dc_provider_t struct. - * @return A string which must be free()d. - */ -char* dc_provider_get_overview_page (const dc_provider_t* provider); - -/** - * The provider's name. - * - * The name of the provider, e.g. "POSTEO". - * - * @memberof dc_provider_t - * @param provider The dc_provider_t struct. - * @return A string which must be free()d. - */ -char* dc_provider_get_name (const dc_provider_t* provider); - -/** - * The markdown content of the providers page. - * - * This contains the preparation steps or additional information if the status - * is @ref DC_PROVIDER_STATUS_BROKEN. - * - * @memberof dc_provider_t - * @param provider The dc_provider_t struct. - * @return A string which must be free()d. - */ -char* dc_provider_get_markdown (const dc_provider_t* provider); - -/** - * Date of when the state was last checked/updated. - * - * This is returned as a string. - * - * @memberof dc_provider_t - * @param provider The dc_provider_t struct. - * @return A string which must be free()d. - */ -char* dc_provider_get_status_date (const dc_provider_t* provider); - -/** - * Whether DC works with this provider. - * - * Can be one of @ref DC_PROVIDER_STATUS_OK, @ref - * DC_PROVIDER_STATUS_PREPARATION and @ref DC_PROVIDER_STATUS_BROKEN. - * - * @memberof dc_provider_t - * @param provider The dc_provider_t struct. - * @return The status as a constant number. - */ -int dc_provider_get_status (const dc_provider_t* provider); - -/** - * Free the provider info struct. - * - * @memberof dc_provider_t - * @param provider The dc_provider_t struct. - */ -void dc_provider_unref (const dc_provider_t* provider); - - -/** - * @defgroup DC_PROVIDER_STATUS DC_PROVIDER_STATUS - * - * These constants are used as return values for dc_provider_get_status(). - * - * @addtogroup DC_PROVIDER_STATUS - * @{ - */ - -/** - * Provider status returned by dc_provider_get_status(). - * - * Works right out of the box without any preperation steps needed - */ -#define DC_PROVIDER_STATUS_OK 1 - -/** - * Provider status returned by dc_provider_get_status(). - * - * Works, but preparation steps are needed - */ -#define DC_PROVIDER_STATUS_PREPARATION 2 - -/** - * Provider status returned by dc_provider_get_status(). - * - * Doesn't work (too unstable to use falls also in this category) - */ -#define DC_PROVIDER_STATUS_BROKEN 3 - -/** - * @} - */ - // connect @@ -3549,6 +3421,110 @@ int dc_contact_is_blocked (const dc_contact_t* contact); int dc_contact_is_verified (dc_contact_t* contact); +/** + * @class dc_provider_t + * + * Opaque object containing information about one single email provider. + */ + + +/** + * Create a provider struct for the given domain. + * + * @memberof dc_provider_t + * @param domain The domain to get provider info for. + * @return a dc_provider_t struct which can be used with the dc_provider_get_* + * accessor functions. If no provider info is found, NULL will be + * returned. + */ +dc_provider_t* dc_provider_new_from_domain (char* domain); + + +/** + * Create a provider struct for the given email address. + * + * The provider is extracted from the email address and it's information is returned. + * + * @memberof dc_provider_t + * @param email The user's email address to extract the provider info form. + * @return a dc_provider_t struct which can be used with the dc_provider_get_* + * accessor functions. If no provider info is found, NULL will be + * returned. + */ +dc_provider_t* dc_provider_new_from_email (char* email); + + +/** + * URL of the overview page. + * + * This URL allows linking to the providers page on providers.delta.chat. + * + * @memberof dc_provider_t + * @param provider The dc_provider_t struct. + * @return A string which must be free()d. + */ +char* dc_provider_get_overview_page (const dc_provider_t* provider); + + +/** + * The provider's name. + * + * The name of the provider, e.g. "POSTEO". + * + * @memberof dc_provider_t + * @param provider The dc_provider_t struct. + * @return A string which must be free()d. + */ +char* dc_provider_get_name (const dc_provider_t* provider); + + +/** + * The markdown content of the providers page. + * + * This contains the preparation steps or additional information if the status + * is @ref DC_PROVIDER_STATUS_BROKEN. + * + * @memberof dc_provider_t + * @param provider The dc_provider_t struct. + * @return A string which must be free()d. + */ +char* dc_provider_get_markdown (const dc_provider_t* provider); + + +/** + * Date of when the state was last checked/updated. + * + * This is returned as a string. + * + * @memberof dc_provider_t + * @param provider The dc_provider_t struct. + * @return A string which must be free()d. + */ +char* dc_provider_get_status_date (const dc_provider_t* provider); + + +/** + * Whether DC works with this provider. + * + * Can be one of @ref DC_PROVIDER_STATUS_OK, @ref + * DC_PROVIDER_STATUS_PREPARATION and @ref DC_PROVIDER_STATUS_BROKEN. + * + * @memberof dc_provider_t + * @param provider The dc_provider_t struct. + * @return The status as a constant number. + */ +int dc_provider_get_status (const dc_provider_t* provider); + + +/** + * Free the provider info struct. + * + * @memberof dc_provider_t + * @param provider The dc_provider_t struct. + */ +void dc_provider_unref (const dc_provider_t* provider); + + /** * @class dc_lot_t * @@ -4156,6 +4132,41 @@ void dc_array_add_id (dc_array_t*, uint32_t); // depreca #define DC_SHOW_EMAILS_ALL 2 +/** + * @defgroup DC_PROVIDER_STATUS DC_PROVIDER_STATUS + * + * These constants are used as return values for dc_provider_get_status(). + * + * @addtogroup DC_PROVIDER_STATUS + * @{ + */ + +/** + * Provider status returned by dc_provider_get_status(). + * + * Works right out of the box without any preperation steps needed + */ +#define DC_PROVIDER_STATUS_OK 1 + +/** + * Provider status returned by dc_provider_get_status(). + * + * Works, but preparation steps are needed + */ +#define DC_PROVIDER_STATUS_PREPARATION 2 + +/** + * Provider status returned by dc_provider_get_status(). + * + * Doesn't work (too unstable to use falls also in this category) + */ +#define DC_PROVIDER_STATUS_BROKEN 3 + +/** + * @} + */ + + /* * TODO: Strings need some doumentation about used placeholders. *