Refresh upstream 2.1.0 release
[profile/ivi/libgsignon-glib.git] / libgsignon-glib / signon-errors.h
1 /* vi: set et sw=4 ts=4 cino=t0,(0: */
2 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 /*
4  * This file is part of libgsignon-glib
5  *
6  * Copyright (C) 2009-2010 Nokia Corporation.
7  *
8  * Contact: Alberto Mardegan <alberto.mardegan@nokia.com>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public License
12  * version 2.1 as published by the Free Software Foundation.
13  *
14  * This library is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22  * 02110-1301 USA
23  */
24
25 #ifndef __LIBSIGNON_ERRORS_H__
26 #define __LIBSIGNON_ERRORS_H__
27
28 #include <glib.h>
29 #include <glib-object.h>
30 #include "signon-enum-types.h"
31
32 /**
33  * SIGNON_ERROR:
34  *
35  * This macro is used when creating a #GError in libgsignond-glib library
36  */
37 #define SIGNON_ERROR (signon_error_quark())
38
39 //FIXME: reuse error definitions from libgsignond-common
40 /**
41  * SignonError:
42  * @SIGNON_ERROR_UNKNOWN: Catch-all for errors not distinguished by another code.
43  * @SIGNON_ERROR_INTERNAL_SERVER: Signon daemon internal error.
44  * @SIGNON_ERROR_INTERNAL_COMMUNICATION: Error communicating with Signon daemon.
45  * @SIGNON_ERROR_PERMISSION_DENIED: The operation cannot be performed due to
46  * insufficient client permissions.
47  * @SIGNON_ERROR_METHOD_NOT_KNOWN: The method with this name was not found.
48  * @SIGNON_ERROR_SERVICE_NOT_AVAILABLE: The service is temporarily unavailable.
49  * @SIGNON_ERROR_INVALID_QUERY: Parameters for the query are invalid.
50  * @SIGNON_ERROR_METHOD_NOT_AVAILABLE: The requested method is not available.
51  * @SIGNON_ERROR_IDENTITY_NOT_FOUND: The identity mathching the #SignonIdentity
52  * was not found on the service.
53  * @SIGNON_ERROR_STORE_FAILED: Storing credentials failed.
54  * @SIGNON_ERROR_REMOVE_FAILED: Removing credentials failed.
55  * @SIGNON_ERROR_SIGNOUT_FAILED: Signing out failed.
56  * @SIGNON_ERROR_IDENTITY_OPERATION_CANCELED: Identity operation was canceled
57  * by the user.
58  * @SIGNON_ERROR_CREDENTIALS_NOT_AVAILABLE: Query failed.
59  * @SIGNON_ERROR_REFERENCE_NOT_FOUND: Trying to remove non-existent reference.
60  * @SIGNON_ERROR_MECHANISM_NOT_AVAILABLE: The requested mechanism in not
61  * available.
62  * @SIGNON_ERROR_MISSING_DATA: The SessionData does not contain the necessary
63  * information.
64  * @SIGNON_ERROR_INVALID_CREDENTIALS: The supplied credentials are invalid for
65  * the mechanism implementation.
66  * @SIGNON_ERROR_NOT_AUTHORIZED: Authorization failed.
67  * @SIGNON_ERROR_WRONG_STATE: An operation method has been called in an
68  * incorrect state.
69  * @SIGNON_ERROR_OPERATION_NOT_SUPPORTED: The operation is not supported by the
70  * mechanism implementation.
71  * @SIGNON_ERROR_NO_CONNECTION: No network connection.
72  * @SIGNON_ERROR_NETWORK: Network connection failed.
73  * @SIGNON_ERROR_SSL: SSL connection failed.
74  * @SIGNON_ERROR_RUNTIME: Casting SessionData into subclass failed.
75  * @SIGNON_ERROR_SESSION_CANCELED: Challenge was canceled.
76  * @SIGNON_ERROR_TIMED_OUT: Challenge timed out.
77  * @SIGNON_ERROR_USER_INTERACTION: User interaction dialog failed.
78  * @SIGNON_ERROR_OPERATION_FAILED: Temporary failure in authentication.
79  * @SIGNON_ERROR_ENCRYPTION_FAILED: @deprecated: Failure during data
80  * encryption/decryption.
81  * @SIGNON_ERROR_TOS_NOT_ACCEPTED: User declined Terms of Service.
82  * @SIGNON_ERROR_FORGOT_PASSWORD: User requested password reset sequence.
83  * @SIGNON_ERROR_METHOD_OR_MECHANISM_NOT_ALLOWED: Method or mechanism not
84  * allowed for this identity.
85  * @SIGNON_ERROR_INCORRECT_DATE: Date/time incorrect on device.
86  * @SIGNON_ERROR_USER_ERROR: Placeholder to rearrange enumeration - userspace
87  * specific.
88  *
89  * Possible Signon errors.
90  */
91 typedef enum {
92     SIGNON_ERROR_UNKNOWN = 1,
93     SIGNON_ERROR_INTERNAL_SERVER = 2,
94     SIGNON_ERROR_INTERNAL_COMMUNICATION = 3,
95     SIGNON_ERROR_PERMISSION_DENIED = 4,
96
97     SIGNON_ERROR_METHOD_NOT_KNOWN = 101,
98     SIGNON_ERROR_SERVICE_NOT_AVAILABLE,
99     SIGNON_ERROR_INVALID_QUERY,
100
101     SIGNON_ERROR_METHOD_NOT_AVAILABLE = 201,
102     SIGNON_ERROR_IDENTITY_NOT_FOUND,
103     SIGNON_ERROR_STORE_FAILED,
104     SIGNON_ERROR_REMOVE_FAILED,
105     SIGNON_ERROR_SIGNOUT_FAILED,
106     SIGNON_ERROR_IDENTITY_OPERATION_CANCELED,
107     SIGNON_ERROR_CREDENTIALS_NOT_AVAILABLE,
108     SIGNON_ERROR_REFERENCE_NOT_FOUND,
109
110     SIGNON_ERROR_MECHANISM_NOT_AVAILABLE = 301,
111     SIGNON_ERROR_MISSING_DATA,
112     SIGNON_ERROR_INVALID_CREDENTIALS,
113     SIGNON_ERROR_NOT_AUTHORIZED,
114     SIGNON_ERROR_WRONG_STATE,
115     SIGNON_ERROR_OPERATION_NOT_SUPPORTED,
116     SIGNON_ERROR_NO_CONNECTION,
117     SIGNON_ERROR_NETWORK,
118     SIGNON_ERROR_SSL,
119     SIGNON_ERROR_RUNTIME,
120     SIGNON_ERROR_SESSION_CANCELED,
121     SIGNON_ERROR_TIMED_OUT,
122     SIGNON_ERROR_USER_INTERACTION,
123     SIGNON_ERROR_OPERATION_FAILED,
124     SIGNON_ERROR_ENCRYPTION_FAILED,
125     SIGNON_ERROR_TOS_NOT_ACCEPTED,
126     SIGNON_ERROR_FORGOT_PASSWORD,
127     SIGNON_ERROR_METHOD_OR_MECHANISM_NOT_ALLOWED,
128     SIGNON_ERROR_INCORRECT_DATE,
129     SIGNON_ERROR_USER_ERROR = 400
130 } SignonError;
131
132 GQuark signon_error_quark (void);
133
134
135 #endif