/*
 * e-source-enums.h
 *
 * This library is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library. If not, see <http://www.gnu.org/licenses/>.
 *
 */

#if !defined (__LIBEDATASERVER_H_INSIDE__) && !defined (LIBEDATASERVER_COMPILATION)
#error "Only <libedataserver/libedataserver.h> should be included directly."
#endif

#ifndef E_SOURCE_ENUMS_H
#define E_SOURCE_ENUMS_H

/**
 * EMdnResponsePolicy:
 * @E_MDN_RESPONSE_POLICY_NEVER:
 *   Never respond to an MDN request.
 * @E_MDN_RESPONSE_POLICY_ALWAYS:
 *   Always respond to an MDN request.
 * @E_MDN_RESPONSE_POLICY_ASK:
 *   Ask the user before responding to an MDN request.
 *
 * Policy for responding to Message Disposition Notification requests
 * (i.e. a Disposition-Notification-To header) when receiving messages.
 * See RFC 2298 for more information about MDN requests.
 *
 * Since: 3.6
 **/
typedef enum {
	E_MDN_RESPONSE_POLICY_NEVER,
	E_MDN_RESPONSE_POLICY_ALWAYS,
	E_MDN_RESPONSE_POLICY_ASK
} EMdnResponsePolicy;

/**
 * EProxyMethod:
 * @E_PROXY_METHOD_DEFAULT:
 *   Use the default #GProxyResolver (see g_proxy_resolver_get_default()).
 * @E_PROXY_METHOD_MANUAL:
 *   Use the FTP/HTTP/HTTPS/SOCKS settings defined in #ESourceProxy.
 * @E_PROXY_METHOD_AUTO:
 *   Use the autoconfiguration URL defined in #ESourceProxy.
 * @E_PROXY_METHOD_NONE:
 *   Direct connection; do not use a network proxy.
 *
 * Network proxy configuration methods.
 *
 * Since: 3.12
 **/
typedef enum {
	E_PROXY_METHOD_DEFAULT,
	E_PROXY_METHOD_MANUAL,
	E_PROXY_METHOD_AUTO,
	E_PROXY_METHOD_NONE
} EProxyMethod;

/**
 * ESourceAuthenticationResult:
 * @E_SOURCE_AUTHENTICATION_ERROR:
 *   An error occurred while authenticating.
 * @E_SOURCE_AUTHENTICATION_ERROR_SSL_FAILED:
 *   An SSL certificate check failed. Since: 3.16.
 * @E_SOURCE_AUTHENTICATION_ACCEPTED:
 *   Server requesting authentication accepted password.
 * @E_SOURCE_AUTHENTICATION_REJECTED:
 *   Server requesting authentication rejected password.
 * @E_SOURCE_AUTHENTICATION_REQUIRED:
 *   Server requesting authentication, but none was given.
 *
 * Status codes used by the #EBackend authentication wrapper.
 *
 * Since: 3.6
 **/
typedef enum {
	E_SOURCE_AUTHENTICATION_ERROR,
	E_SOURCE_AUTHENTICATION_ERROR_SSL_FAILED,
	E_SOURCE_AUTHENTICATION_ACCEPTED,
	E_SOURCE_AUTHENTICATION_REJECTED,
	E_SOURCE_AUTHENTICATION_REQUIRED
} ESourceAuthenticationResult;

/**
 * ETrustPromptResponse:
 *
 * XXX Document me!
 *
 * Since: 3.8
 **/
typedef enum {
	E_TRUST_PROMPT_RESPONSE_UNKNOWN = -1,
	E_TRUST_PROMPT_RESPONSE_REJECT = 0,
	E_TRUST_PROMPT_RESPONSE_ACCEPT = 1,
	E_TRUST_PROMPT_RESPONSE_ACCEPT_TEMPORARILY = 2,
	E_TRUST_PROMPT_RESPONSE_REJECT_TEMPORARILY = 3
} ETrustPromptResponse;

/**
 * ESourceConnectionStatus:
 * @E_SOURCE_CONNECTION_STATUS_DISCONNECTED:
 *   The source is currently disconnected from its (possibly remote) data store.
 * @E_SOURCE_CONNECTION_STATUS_AWAITING_CREDENTIALS:
 *   The source asked for credentials with a 'credentials-required' signal and
 *   is currently awaiting for them.
 * @E_SOURCE_CONNECTION_STATUS_SSL_FAILED:
 *   A user rejected SSL certificate trust for the connection.
 * @E_SOURCE_CONNECTION_STATUS_CONNECTING:
 *   The source is currently connecting to its (possibly remote) data store.
 * @E_SOURCE_CONNECTION_STATUS_CONNECTED:
 *   The source is currently connected to its (possibly remote) data store.
 *
 * Connection status codes used by the #ESource to indicate its connection state.
 * This is used in combination with authentication of the ESource. For example,
 * if there are multiple clients asking for a password and a user enters the password
 * in one of them, then the status will change into 'connecting', which is a signal
 * do close the password prompt in the other client, because the credentials had
 * been already provided.
 *
 * Since: 3.16
 **/
typedef enum {
	E_SOURCE_CONNECTION_STATUS_DISCONNECTED,
	E_SOURCE_CONNECTION_STATUS_AWAITING_CREDENTIALS,
	E_SOURCE_CONNECTION_STATUS_SSL_FAILED,
	E_SOURCE_CONNECTION_STATUS_CONNECTING,
	E_SOURCE_CONNECTION_STATUS_CONNECTED
} ESourceConnectionStatus;

/**
 * ESourceCredentialsReason:
 * @E_SOURCE_CREDENTIALS_REASON_UNKNOWN:
 *   A return value when there was no 'credentials-required' signal emitted yet,
 *   or a pair 'authenticate' signal had been received. This value should not
 *   be used in the call of 'credentials-required'.
 * @E_SOURCE_CREDENTIALS_REASON_REQUIRED:
 *   This is the first attempt to get credentials for the source. It's usually
 *   used right after the source is opened and the authentication continues with
 *   a stored credentials, if any.
 * @E_SOURCE_CREDENTIALS_REASON_REJECTED:
 *   The previously used credentials had been rejected by the server. That
 *   usually means that the user should be asked to provide/correct the credentials.
 * @E_SOURCE_CREDENTIALS_REASON_SSL_FAILED:
 *   A secured connection failed due to some server-side certificate issues.
 * @E_SOURCE_CREDENTIALS_REASON_ERROR:
 *   The server returned an error. It is not possible to connect to it
 *   at the moment usually.
 *
 * An ESource's authentication reason, used by an ESource::CredentialsRequired method.
 *
 * Since: 3.16
 **/
typedef enum {
	E_SOURCE_CREDENTIALS_REASON_UNKNOWN,
	E_SOURCE_CREDENTIALS_REASON_REQUIRED,
	E_SOURCE_CREDENTIALS_REASON_REJECTED,
	E_SOURCE_CREDENTIALS_REASON_SSL_FAILED,
	E_SOURCE_CREDENTIALS_REASON_ERROR
} ESourceCredentialsReason;

#endif /* E_SOURCE_ENUMS_H */
