chenqiyang
2022-09-02 6a99d9bf65aa5878cb409945ed2bdbdcb916d047
HDLLinPhoneSDK(OC)/HDLLinPhoneSDK/linphone-sdk/apple-darwin/Frameworks/linphone.framework/Headers/event.h
old mode 100644 new mode 100755
@@ -34,246 +34,296 @@
/**
 * Send a subscription previously created by linphone_core_create_subscribe().
 * @param ev the #LinphoneEvent
 * @param body optional content to attach with the subscription.
 * @param linphone_event the #LinphoneEvent @notnil
 * @param body optional content to attach with the subscription. @maybenil
 * @return 0 if successful, -1 otherwise.
**/
LINPHONE_PUBLIC LinphoneStatus linphone_event_send_subscribe(LinphoneEvent *ev, const LinphoneContent *body);
LINPHONE_PUBLIC LinphoneStatus linphone_event_send_subscribe(LinphoneEvent *linphone_event, const LinphoneContent *body);
/**
 * Update (refresh) an outgoing subscription, changing the body.
 * @param lev a #LinphoneEvent
 * @param body an optional body to include in the subscription update, may be NULL.
 * @param linphone_event a #LinphoneEvent @notnil
 * @param body an optional body to include in the subscription update, may be NULL. @maybenil
 * @return 0 if successful, error code otherwise
 * @maybenil
**/
LINPHONE_PUBLIC LinphoneStatus linphone_event_update_subscribe(LinphoneEvent *lev, const LinphoneContent *body);
LINPHONE_PUBLIC LinphoneStatus linphone_event_update_subscribe(LinphoneEvent *linphone_event, const LinphoneContent *body);
/**
 * Refresh an outgoing subscription keeping the same body.
 * @param lev #LinphoneEvent object.
 * @param linphone_event #LinphoneEvent object. @notnil
 * @return 0 if successful, -1 otherwise.
 */
LINPHONE_PUBLIC LinphoneStatus linphone_event_refresh_subscribe(LinphoneEvent *lev);
LINPHONE_PUBLIC LinphoneStatus linphone_event_refresh_subscribe(LinphoneEvent *linphone_event);
/**
 * Accept an incoming subcription.
 * @param linphone_event #LinphoneEvent object. @notnil
 * @return 0 if successful, error code otherwise
**/
LINPHONE_PUBLIC LinphoneStatus linphone_event_accept_subscription(LinphoneEvent *lev);
LINPHONE_PUBLIC LinphoneStatus linphone_event_accept_subscription(LinphoneEvent *linphone_event);
/**
 * Deny an incoming subscription with given reason.
 * @param linphone_event #LinphoneEvent object. @notnil
 * @return 0 if successful, error code otherwise
**/
LINPHONE_PUBLIC LinphoneStatus linphone_event_deny_subscription(LinphoneEvent *lev, LinphoneReason reason);
LINPHONE_PUBLIC LinphoneStatus linphone_event_deny_subscription(LinphoneEvent *linphone_event, LinphoneReason reason);
/**
 * Send a notification.
 * @param lev a #LinphoneEvent corresponding to an incoming subscription previously received and accepted.
 * @param body an optional body containing the actual notification data.
 * @param linphone_event a #LinphoneEvent corresponding to an incoming subscription previously received and accepted. @notnil
 * @param body an optional body containing the actual notification data.@maybenil
 * @return 0 if successful, -1 otherwise.
 **/
LINPHONE_PUBLIC LinphoneStatus linphone_event_notify(LinphoneEvent *lev, const LinphoneContent *body);
LINPHONE_PUBLIC LinphoneStatus linphone_event_notify(LinphoneEvent *linphone_event, const LinphoneContent *body);
/**
 * Send a publish created by linphone_core_create_publish().
 * @param lev the #LinphoneEvent
 * @param body the new data to be published
 * @param linphone_event the #LinphoneEvent @notnil
 * @param body the new data to be published @notnil
 * @return 0 if successful, -1 otherwise.
**/
LINPHONE_PUBLIC LinphoneStatus linphone_event_send_publish(LinphoneEvent *lev, const LinphoneContent *body);
LINPHONE_PUBLIC LinphoneStatus linphone_event_send_publish(LinphoneEvent *linphone_event, const LinphoneContent *body);
/**
 * Update (refresh) a publish.
 * @param lev the #LinphoneEvent
 * @param body the new data to be published
 * @param linphone_event the #LinphoneEvent @notnil
 * @param body the new data to be published @notnil
 * @return 0 if successful, error code otherwise
**/
LINPHONE_PUBLIC LinphoneStatus linphone_event_update_publish(LinphoneEvent *lev, const LinphoneContent *body);
LINPHONE_PUBLIC LinphoneStatus linphone_event_update_publish(LinphoneEvent *linphone_event, const LinphoneContent *body);
/**
 * Refresh an outgoing publish keeping the same body.
 * @param lev #LinphoneEvent object.
 * @param linphone_event #LinphoneEvent object. @notnil
 * @return 0 if successful, -1 otherwise.
 */
LINPHONE_PUBLIC LinphoneStatus linphone_event_refresh_publish(LinphoneEvent *lev);
LINPHONE_PUBLIC LinphoneStatus linphone_event_refresh_publish(LinphoneEvent *linphone_event);
/**
 * Prevent an event from refreshing its publish.
 * This is useful to let registrations to expire naturally (or) when the application wants to keep control on when
 * refreshes are sent.
 * The refreshing operations can be resumed with linphone_proxy_config_refresh_register().
 * @param[in] lev #LinphoneEvent object.
 * @param linphone_event #LinphoneEvent object. @notnil
 **/
LINPHONE_PUBLIC void linphone_event_pause_publish(LinphoneEvent *lev);
LINPHONE_PUBLIC void linphone_event_pause_publish(LinphoneEvent *linphone_event);
/**
 * Return reason code (in case of error state reached).
 * @param linphone_event #LinphoneEvent object. @notnil
 * @return a #LinphoneReason enum
**/
LINPHONE_PUBLIC LinphoneReason linphone_event_get_reason(const LinphoneEvent *lev);
LINPHONE_PUBLIC LinphoneReason linphone_event_get_reason(const LinphoneEvent *linphone_event);
/**
 * Get full details about an error occured.
 * @param linphone_event #LinphoneEvent object. @notnil
 * @return a #LinphoneErrorInfo object. @notnil
**/
LINPHONE_PUBLIC const LinphoneErrorInfo *linphone_event_get_error_info(const LinphoneEvent *lev);
LINPHONE_PUBLIC const LinphoneErrorInfo *linphone_event_get_error_info(const LinphoneEvent *linphone_event);
/**
 * Get subscription state. If the event object was not created by a subscription mechanism, #LinphoneSubscriptionNone is returned.
 * @param linphone_event #LinphoneEvent object. @notnil
 * @return the current #LinphoneSubscriptionState
**/
LINPHONE_PUBLIC LinphoneSubscriptionState linphone_event_get_subscription_state(const LinphoneEvent *lev);
LINPHONE_PUBLIC LinphoneSubscriptionState linphone_event_get_subscription_state(const LinphoneEvent *linphone_event);
/**
 * Get publish state. If the event object was not created by a publish mechanism, #LinphonePublishNone is returned.
 * @param linphone_event #LinphoneEvent object. @notnil
 * @return the current #LinphonePublishState
**/
LINPHONE_PUBLIC LinphonePublishState linphone_event_get_publish_state(const LinphoneEvent *lev);
LINPHONE_PUBLIC LinphonePublishState linphone_event_get_publish_state(const LinphoneEvent *linphone_event);
/**
 * Get subscription direction.
 * If the object wasn't created by a subscription mechanism, #LinphoneSubscriptionInvalidDir is returned.
 * @param linphone_event #LinphoneEvent object. @notnil
 * @return the #LinphoneSubscriptionDir
**/
LINPHONE_PUBLIC LinphoneSubscriptionDir linphone_event_get_subscription_dir(LinphoneEvent *lev);
LINPHONE_PUBLIC LinphoneSubscriptionDir linphone_event_get_subscription_dir(LinphoneEvent *linphone_event);
/**
 * Set a user (application) pointer.
 * @param linphone_event #LinphoneEvent object. @notnil
 * @param user_data The user data to set. @maybenil
**/
LINPHONE_PUBLIC void linphone_event_set_user_data(LinphoneEvent *ev, void *up);
LINPHONE_PUBLIC void linphone_event_set_user_data(LinphoneEvent *linphone_event, void *user_data);
/**
 * Retrieve user pointer.
 * @param linphone_event #LinphoneEvent object. @notnil
 * @return the user_data pointer or NULL. @maybenil
**/
LINPHONE_PUBLIC void *linphone_event_get_user_data(const LinphoneEvent *ev);
LINPHONE_PUBLIC void *linphone_event_get_user_data(const LinphoneEvent *linphone_event);
/**
 * Add a custom header to an outgoing susbscription or publish.
 * @param ev the #LinphoneEvent
 * @param name header's name
 * @param value the header's value.
 * @param linphone_event the #LinphoneEvent @notnil
 * @param name header's name @notnil
 * @param value the header's value. @maybenil
**/
LINPHONE_PUBLIC void linphone_event_add_custom_header(LinphoneEvent *ev, const char *name, const char *value);
LINPHONE_PUBLIC void linphone_event_add_custom_header(LinphoneEvent *linphone_event, const char *name, const char *value);
/**
 * Remove custom header to an outgoing susbscription or publish.
 * @param ev the #LinphoneEvent @notnil
 * @param name header's name @notnil
**/
LINPHONE_PUBLIC void linphone_event_remove_custom_header(LinphoneEvent *ev, const char *name);
/**
 * Obtain the value of a given header for an incoming subscription.
 * @param ev the #LinphoneEvent
 * @param name header's name
 * @return the header's value or NULL if such header doesn't exist.
 * @param linphone_event the #LinphoneEvent @notnil
 * @param name header's name @notnil
 * @return the header's value or NULL if such header doesn't exist. @maybenil
**/
LINPHONE_PUBLIC const char *linphone_event_get_custom_header(LinphoneEvent *ev, const char *name);
LINPHONE_PUBLIC const char *linphone_event_get_custom_header(LinphoneEvent *linphone_event, const char *name);
/**
 * Terminate an incoming or outgoing subscription that was previously acccepted, or a previous publication.
 * The #LinphoneEvent shall not be used anymore after this operation, unless the application explicitely took a reference on the object with
 * linphone_event_ref().
 * The #LinphoneEvent shall not be used anymore after this operation.
 * @param linphone_event #LinphoneEvent object @notnil
**/
LINPHONE_PUBLIC void linphone_event_terminate(LinphoneEvent *lev);
LINPHONE_PUBLIC void linphone_event_terminate(LinphoneEvent *linphone_event);
/**
 * Increase reference count of LinphoneEvent.
 * By default #LinphoneEvents created by the core are owned by the core only.
 * A #LinphoneEvent created by the core when receiving an incoming SUBSCRIBE or PUBLISH are owned by the core only.
 * An application that wishes to retain a reference to it must call linphone_event_ref().
 * When this reference is no longer needed, linphone_event_unref() must be called.
 * @param linphone_event #LinphoneEvent object @notnil
 * @return the same #LinphoneEvent object. @notnil
 *
**/
LINPHONE_PUBLIC LinphoneEvent *linphone_event_ref(LinphoneEvent *lev);
LINPHONE_PUBLIC LinphoneEvent *linphone_event_ref(LinphoneEvent *linphone_event);
/**
 * Decrease reference count.
 * @param linphone_event #LinphoneEvent object @notnil
 * @see linphone_event_ref()
**/
LINPHONE_PUBLIC void linphone_event_unref(LinphoneEvent *lev);
LINPHONE_PUBLIC void linphone_event_unref(LinphoneEvent *linphone_event);
/**
 * Get the name of the event as specified in the event package RFC.
 * @param linphone_event #LinphoneEvent object @notnil
 * @return the event name. @notnil
**/
LINPHONE_PUBLIC const char *linphone_event_get_name(const LinphoneEvent *lev);
LINPHONE_PUBLIC const char *linphone_event_get_name(const LinphoneEvent *linphone_event);
/**
 * Get the "from" address of the subscription.
 * @param linphone_event #LinphoneEvent object @notnil
 * @return the from #LinphoneAddress. @notnil
**/
LINPHONE_PUBLIC const LinphoneAddress *linphone_event_get_from(const LinphoneEvent *lev);
LINPHONE_PUBLIC const LinphoneAddress *linphone_event_get_from(const LinphoneEvent *linphone_event);
/**
 * Get the "to" address of the subscription.
 * @param linphone_event #LinphoneEvent object @notnil
 * @return the "to" #LinphoneAddress. @notnil
**/
LINPHONE_PUBLIC const LinphoneAddress *linphone_event_get_to(const LinphoneEvent *lev);
/**
 * Get the resource address of the subscription or publish.
 * @param linphone_event #LinphoneEvent object @notnil
 * @return the resource #LinphoneAddress. @notnil
**/
LINPHONE_PUBLIC const LinphoneAddress *linphone_event_get_resource(const LinphoneEvent *lev);
LINPHONE_PUBLIC const LinphoneAddress *linphone_event_get_resource(const LinphoneEvent *linphone_event);
/**
 * Get the "contact" address of the subscription.
 * @param[in] lev #LinphoneEvent object
 * @return The "contact" address of the subscription
 * @param linphone_event #LinphoneEvent object @notnil
 * @return The "contact" address of the subscription @notnil
 */
LINPHONE_PUBLIC const LinphoneAddress *linphone_event_get_remote_contact (const LinphoneEvent *lev);
LINPHONE_PUBLIC const LinphoneAddress *linphone_event_get_remote_contact (const LinphoneEvent *linphone_event);
/**
 * Returns back pointer to the #LinphoneCore that created this #LinphoneEvent
 * @param linphone_event #LinphoneEvent object @notnil
 * @return the #LinphoneCore object associated. @notnil
**/
LINPHONE_PUBLIC LinphoneCore *linphone_event_get_core(const LinphoneEvent *lev);
/**
 * Get the LinphoneEventCbs object associated with a LinphoneEvent.
 * @param[in] ev LinphoneEvent object
 * @return The LinphoneEventCbs object associated with the LinphoneEvent.
 * @deprecated use add_callbacks / remove_callbacks instead
**/
LINPHONE_PUBLIC LinphoneEventCbs *linphone_event_get_callbacks(const LinphoneEvent *ev);
LINPHONE_PUBLIC LinphoneCore *linphone_event_get_core(const LinphoneEvent *linphone_event);
/**
 * Adds a LinphoneEventCbs object to be associated with a LinphoneEvent.
 * @param[in] ev LinphoneEvent object
 * @param[in] cbs The LinphoneEventCbs object to add
 * @param linphone_event #LinphoneEvent object @notnil
 * @param cbs The LinphoneEventCbs object to add @notnil
**/
LINPHONE_PUBLIC void linphone_event_add_callbacks(LinphoneEvent *ev, LinphoneEventCbs *cbs);
LINPHONE_PUBLIC void linphone_event_add_callbacks(LinphoneEvent *linphone_event, LinphoneEventCbs *cbs);
/**
 * Removes a LinphoneEventCbs object associated with a LinphoneEvent.
 * @param[in] ev LinphoneEvent object
 * @param[in] cbs The LinphoneEventCbs object to remove
 * @param linphone_event #LinphoneEvent object @notnil
 * @param cbs The LinphoneEventCbs object to remove @notnil
**/
LINPHONE_PUBLIC void linphone_event_remove_callbacks(LinphoneEvent *ev, LinphoneEventCbs *cbs);
LINPHONE_PUBLIC void linphone_event_remove_callbacks(LinphoneEvent *linphone_event, LinphoneEventCbs *cbs);
/**
 * Get the current LinphoneEventCbs object associated with a LinphoneEvent.
 * @param[in] ev LinphoneEvent object
 * @return The current LinphoneEventCbs object associated with the LinphoneEvent.
 * @param linphone_event #LinphoneEvent object @notnil
 * @return The current LinphoneEventCbs object associated with the LinphoneEvent. @maybenil
**/
LINPHONE_PUBLIC LinphoneEventCbs *linphone_event_get_current_callbacks(const LinphoneEvent *ev);
LINPHONE_PUBLIC LinphoneEventCbs *linphone_event_get_current_callbacks(const LinphoneEvent *linphone_event);
/**
 * Acquire a reference to a LinphoneEventCbs object.
 * @param[in] cbs LinphoneEventCbs object.
 * @return The same LinphoneEventCbs object.
 * @return The same LinphoneEventCbs object. @notnil
**/
LINPHONE_PUBLIC LinphoneEventCbs *linphone_event_cbs_ref(LinphoneEventCbs *cbs);
/**
 * Release a reference to a LinphoneEventCbs object.
 * @param[in] cbs LinphoneEventCbs object.
 * @param cbs LinphoneEventCbs object. @notnil
**/
LINPHONE_PUBLIC void linphone_event_cbs_unref(LinphoneEventCbs *cbs);
/**
 * Retrieve the user pointer associated with a LinphoneEventCbs object.
 * @param[in] cbs LinphoneEventCbs object.
 * @return The user pointer associated with the LinphoneEventCbs object.
 * @param cbs LinphoneEventCbs object. @notnil
 * @return The user pointer associated with the LinphoneEventCbs object. @maybenil
**/
LINPHONE_PUBLIC void *linphone_event_cbs_get_user_data(const LinphoneEventCbs *cbs);
/**
 * Assign a user pointer to a LinphoneEventCbs object.
 * @param[in] cbs LinphoneEventCbs object.
 * @param[in] ud The user pointer to associate with the LinphoneEventCbs object.
 * @param cbs LinphoneEventCbs object. @notnil
 * @param user_data The user pointer to associate with the LinphoneEventCbs object. @maybenil
**/
LINPHONE_PUBLIC void linphone_event_cbs_set_user_data(LinphoneEventCbs *cbs, void *ud);
LINPHONE_PUBLIC void linphone_event_cbs_set_user_data(LinphoneEventCbs *cbs, void *user_data);
/**
 * Get the notify response callback.
 * @param[in] cbs LinphoneEventCbs object.
 * @param cbs LinphoneEventCbs object. @notnil
 * @return The current notify response callback.
**/
LINPHONE_PUBLIC LinphoneEventCbsNotifyResponseCb linphone_event_cbs_get_notify_response(const LinphoneEventCbs *cbs);
/**
 * Set the notify response callback.
 * @param[in] cbs LinphoneEventCbs object.
 * @param[in] cb The notify response callback to be used.
 * @param cbs LinphoneEventCbs object. @notnil
 * @param cb The notify response callback to be used.
**/
LINPHONE_PUBLIC void linphone_event_cbs_set_notify_response(LinphoneEventCbs *cbs, LinphoneEventCbsNotifyResponseCb cb);
/************ */
/* DEPRECATED */
/* ********** */
/**
 * Get the LinphoneEventCbs object associated with a LinphoneEvent.
 * @param linphone_event #LinphoneEvent object @notnil
 * @return The LinphoneEventCbs object associated with the LinphoneEvent. @notnil
 * @deprecated 19/02/2019 use add_callbacks / remove_callbacks instead
**/
LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneEventCbs *linphone_event_get_callbacks(const LinphoneEvent *linphone_event);
/**
 * @}
**/