1 /* 2 * e-gdata-oauth2-authorizer.h 3 * 4 * This library is free software: you can redistribute it and/or modify it 5 * under the terms of the GNU Lesser General Public License as published by 6 * the Free Software Foundation. 7 * 8 * This library is distributed in the hope that it will be useful, but 9 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 10 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License 11 * for more details. 12 * 13 * You should have received a copy of the GNU Lesser General Public License 14 * along with this library. If not, see <http://www.gnu.org/licenses/>. 15 * 16 */ 17 18 #if !defined (__LIBEDATASERVER_H_INSIDE__) && !defined (LIBEDATASERVER_COMPILATION) 19 #error "Only <libedataserver/libedataserver.h> should be included directly." 20 #endif 21 22 #ifndef E_GDATA_OAUTH2_AUTHORIZER_H 23 #define E_GDATA_OAUTH2_AUTHORIZER_H 24 25 #include <libedataserver/e-source.h> 26 #include <libedataserver/e-data-server-util.h> 27 28 /* Standard GObject macros */ 29 #define E_TYPE_GDATA_OAUTH2_AUTHORIZER \ 30 (e_gdata_oauth2_authorizer_get_type ()) 31 #define E_GDATA_OAUTH2_AUTHORIZER(obj) \ 32 (G_TYPE_CHECK_INSTANCE_CAST \ 33 ((obj), E_TYPE_GDATA_OAUTH2_AUTHORIZER, EGDataOAuth2Authorizer)) 34 #define E_GDATA_OAUTH2_AUTHORIZER_CLASS(cls) \ 35 (G_TYPE_CHECK_CLASS_CAST \ 36 ((cls), E_TYPE_GDATA_OAUTH2_AUTHORIZER, EGDataOAuth2AuthorizerClass)) 37 #define E_IS_GDATA_OAUTH2_AUTHORIZER(obj) \ 38 (G_TYPE_CHECK_INSTANCE_TYPE \ 39 ((obj), E_TYPE_GDATA_OAUTH2_AUTHORIZER)) 40 #define E_IS_GDATA_OAUTH2_AUTHORIZER_CLASS(cls) \ 41 (G_TYPE_CHECK_CLASS_TYPE \ 42 ((cls), E_TYPE_GDATA_OAUTH2_AUTHORIZER)) 43 #define E_GDATA_OAUTH2_AUTHORIZER_GET_CLASS(obj) \ 44 (G_TYPE_INSTANCE_GET_CLASS \ 45 ((obj), E_TYPE_GDATA_OAUTH2_AUTHORIZER, EGDataOAuth2AuthorizerClass)) 46 47 G_BEGIN_DECLS 48 49 typedef struct _EGDataOAuth2Authorizer EGDataOAuth2Authorizer; 50 typedef struct _EGDataOAuth2AuthorizerClass EGDataOAuth2AuthorizerClass; 51 typedef struct _EGDataOAuth2AuthorizerPrivate EGDataOAuth2AuthorizerPrivate; 52 53 struct _EGDataOAuth2Authorizer { 54 GObject parent; 55 EGDataOAuth2AuthorizerPrivate *priv; 56 }; 57 58 struct _EGDataOAuth2AuthorizerClass { 59 GObjectClass parent_class; 60 }; 61 62 gboolean e_gdata_oauth2_authorizer_supported (void); 63 GType e_gdata_oauth2_authorizer_get_type (void) G_GNUC_CONST; 64 EGDataOAuth2Authorizer * 65 e_gdata_oauth2_authorizer_new (ESource *source, 66 GType service_type); 67 ESource * e_gdata_oauth2_authorizer_ref_source (EGDataOAuth2Authorizer *oauth2_authorizer); 68 GType e_gdata_oauth2_authorizer_get_service_type 69 (EGDataOAuth2Authorizer *oauth2_authorizer); 70 void e_gdata_oauth2_authorizer_set_credentials 71 (EGDataOAuth2Authorizer *oauth2_authorizer, 72 const ENamedParameters *credentials); 73 ENamedParameters * 74 e_gdata_oauth2_authorizer_clone_credentials 75 (EGDataOAuth2Authorizer *oauth2_authorizer); 76 gboolean e_gdata_oauth2_authorizer_is_expired (EGDataOAuth2Authorizer *oauth2_authorizer); 77 78 G_END_DECLS 79 80 #endif /* E_GDATA_OAUTH2_AUTHORIZER_H */ 81