1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ 2 /* 3 * Copyright (C) 2018 Red Hat, Inc. (www.redhat.com) 4 * 5 * This library is free software: you can redistribute it and/or modify it 6 * under the terms of the GNU Lesser General Public License as published by 7 * the Free Software Foundation. 8 * 9 * This library is distributed in the hope that it will be useful, but 10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License 12 * for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public License 15 * along with this library. If not, see <http://www.gnu.org/licenses/>. 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_OAUTH2_SERVICES_H 23 #define E_OAUTH2_SERVICES_H 24 25 #include <glib-object.h> 26 27 #include <libedataserver/e-oauth2-service.h> 28 29 /* Standard GObject macros */ 30 #define E_TYPE_OAUTH2_SERVICES \ 31 (e_oauth2_services_get_type ()) 32 #define E_OAUTH2_SERVICES(obj) \ 33 (G_TYPE_CHECK_INSTANCE_CAST \ 34 ((obj), E_TYPE_OAUTH2_SERVICES, EOAuth2Services)) 35 #define E_OAUTH2_SERVICES_CLASS(cls) \ 36 (G_TYPE_CHECK_CLASS_CAST \ 37 ((cls), E_TYPE_OAUTH2_SERVICES, EOAuth2ServicesClass)) 38 #define E_IS_OAUTH2_SERVICES(obj) \ 39 (G_TYPE_CHECK_INSTANCE_TYPE \ 40 ((obj), E_TYPE_OAUTH2_SERVICES)) 41 #define E_IS_OAUTH2_SERVICES_CLASS(cls) \ 42 (G_TYPE_CHECK_CLASS_TYPE \ 43 ((cls), E_TYPE_OAUTH2_SERVICES)) 44 #define E_OAUTH2_SERVICES_GET_CLASS(obj) \ 45 (G_TYPE_INSTANCE_GET_CLASS \ 46 ((obj), E_TYPE_OAUTH2_SERVICES, EOAuth2ServicesClass)) 47 48 G_BEGIN_DECLS 49 50 typedef struct _EOAuth2Services EOAuth2Services; 51 typedef struct _EOAuth2ServicesClass EOAuth2ServicesClass; 52 typedef struct _EOAuth2ServicesPrivate EOAuth2ServicesPrivate; 53 54 /** 55 * EOAuth2Services: 56 * 57 * Contains only private data that should be read and manipulated using the 58 * functions below. 59 * 60 * Since: 3.28 61 **/ 62 struct _EOAuth2Services { 63 /*< private >*/ 64 GObject parent; 65 EOAuth2ServicesPrivate *priv; 66 }; 67 68 struct _EOAuth2ServicesClass { 69 GObjectClass parent_class; 70 71 /* Padding for future expansion */ 72 gpointer reserved[10]; 73 }; 74 75 gboolean e_oauth2_services_is_supported (void); 76 77 GType e_oauth2_services_get_type (void) G_GNUC_CONST; 78 79 EOAuth2Services * 80 e_oauth2_services_new (void); 81 void e_oauth2_services_add (EOAuth2Services *services, 82 EOAuth2Service *service); 83 void e_oauth2_services_remove (EOAuth2Services *services, 84 EOAuth2Service *service); 85 GSList * e_oauth2_services_list (EOAuth2Services *services); 86 EOAuth2Service * 87 e_oauth2_services_find (EOAuth2Services *services, 88 ESource *source); 89 EOAuth2Service * 90 e_oauth2_services_guess (EOAuth2Services *services, 91 const gchar *protocol, 92 const gchar *hostname); 93 gboolean e_oauth2_services_is_oauth2_alias (EOAuth2Services *services, 94 const gchar *auth_method); 95 gboolean e_oauth2_services_is_oauth2_alias_static 96 (const gchar *auth_method); 97 98 G_END_DECLS 99 100 #endif /* E_OAUTH2_SERVICES_H */ 101