| 1 |
/* |
| 2 |
* SPDX-FileCopyrightText: (C) 1999-2008 Novell, Inc. (www.novell.com) |
| 3 |
* SPDX-License-Identifier: LGPL-2.1-or-later |
| 4 |
*/ |
| 5 |
|
| 6 |
#ifndef E_EWS_FOLDER_H |
| 7 |
#define E_EWS_FOLDER_H |
| 8 |
|
| 9 |
#include <libedataserver/libedataserver.h> |
| 10 |
|
| 11 |
#include "e-ews-enums.h" |
| 12 |
#include "e-soap-request.h" |
| 13 |
|
| 14 |
G_BEGIN_DECLS |
| 15 |
|
| 16 |
#define E_TYPE_EWS_FOLDER (e_ews_folder_get_type ()) |
| 17 |
#define E_EWS_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_EWS_FOLDER, EEwsFolder)) |
| 18 |
#define E_EWS_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_EWS_FOLDER, EEwsFolderClass)) |
| 19 |
#define E_IS_EWS_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_EWS_FOLDER)) |
| 20 |
#define E_IS_EWS_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_EWS_FOLDER)) |
| 21 |
|
| 22 |
typedef struct _EEwsFolder EEwsFolder; |
| 23 |
typedef struct _EEwsFolderClass EEwsFolderClass; |
| 24 |
typedef struct _EEwsFolderPrivate EEwsFolderPrivate; |
| 25 |
|
| 26 |
struct _EEwsFolder { |
| 27 |
GObject parent; |
| 28 |
EEwsFolderPrivate *priv; |
| 29 |
}; |
| 30 |
|
| 31 |
struct _EEwsFolderClass { |
| 32 |
GObjectClass parent_class; |
| 33 |
}; |
| 34 |
|
| 35 |
typedef struct { |
| 36 |
gchar *id; |
| 37 |
gchar *change_key; |
| 38 |
gboolean is_distinguished_id; |
| 39 |
} EwsFolderId; |
| 40 |
|
| 41 |
GType e_ews_folder_get_type (void); |
| 42 |
const gchar * e_ews_folder_type_to_nick (EEwsFolderType folder_type); |
| 43 |
EEwsFolderType e_ews_folder_type_from_nick (const gchar *folder_type_nick); |
| 44 |
EEwsFolder * e_ews_folder_new_from_soap_parameter (ESoapParameter *param); |
| 45 |
EEwsFolder * e_ews_folder_new_from_error (const GError *error); |
| 46 |
gboolean e_ews_folder_is_error (const EEwsFolder *folder); |
| 47 |
const GError * e_ews_folder_get_error (const EEwsFolder *folder); |
| 48 |
const gchar * e_ews_folder_get_name (const EEwsFolder *folder); |
| 49 |
void e_ews_folder_set_name (EEwsFolder *folder, const gchar *new_name); |
| 50 |
const gchar * e_ews_folder_get_escaped_name (const EEwsFolder *folder); |
| 51 |
void e_ews_folder_set_parent_id (EEwsFolder *folder, EwsFolderId *fid); |
| 52 |
const EwsFolderId * |
| 53 |
e_ews_folder_get_parent_id (const EEwsFolder *folder); |
| 54 |
const EwsFolderId * |
| 55 |
e_ews_folder_get_id (const EEwsFolder *folder); |
| 56 |
void e_ews_folder_set_id (EEwsFolder *folder, EwsFolderId *fid); |
| 57 |
guint32 e_ews_folder_get_total_count (const EEwsFolder *folder); |
| 58 |
guint32 e_ews_folder_get_unread_count (const EEwsFolder *folder); |
| 59 |
guint32 e_ews_folder_get_child_count (const EEwsFolder *folder); |
| 60 |
guint64 e_ews_folder_get_size (const EEwsFolder *folder); |
| 61 |
gboolean e_ews_folder_get_is_hidden (EEwsFolder *folder); |
| 62 |
EEwsFolderType e_ews_folder_get_folder_type (const EEwsFolder *folder); |
| 63 |
void e_ews_folder_set_folder_type (EEwsFolder *folder, EEwsFolderType folder_type); |
| 64 |
gboolean e_ews_folder_get_foreign (const EEwsFolder *folder); |
| 65 |
void e_ews_folder_set_foreign (EEwsFolder *folder, gboolean is_foreign); |
| 66 |
const gchar * e_ews_folder_get_foreign_mail (const EEwsFolder *folder); |
| 67 |
void e_ews_folder_set_foreign_mail (EEwsFolder *folder, const gchar *foreign_mail); |
| 68 |
gboolean e_ews_folder_get_public (const EEwsFolder *folder); |
| 69 |
void e_ews_folder_set_public (EEwsFolder *folder, gboolean is_public); |
| 70 |
|
| 71 |
EwsFolderId * e_ews_folder_id_new (const gchar *id, |
| 72 |
const gchar *change_key, |
| 73 |
gboolean is_distinguished_id); |
| 74 |
void e_ews_folder_id_free (EwsFolderId *fid); |
| 75 |
gboolean e_ews_folder_id_is_equal (const EwsFolderId *a, |
| 76 |
const EwsFolderId *b, |
| 77 |
gboolean check_change_key); |
| 78 |
void e_ews_folder_id_append_to_request (ESoapRequest *request, |
| 79 |
const gchar *email, |
| 80 |
const EwsFolderId *fid); |
| 81 |
gchar * e_ews_folder_utils_escape_name (const gchar *folder_name); |
| 82 |
gchar * e_ews_folder_utils_unescape_name (const gchar *escaped_folder_name); |
| 83 |
|
| 84 |
typedef enum { |
| 85 |
E_EWS_ESOURCE_FLAG_NONE = 0, |
| 86 |
E_EWS_ESOURCE_FLAG_INCLUDE_SUBFOLDERS = 1 << 0, |
| 87 |
E_EWS_ESOURCE_FLAG_OFFLINE_SYNC = 1 << 1, |
| 88 |
E_EWS_ESOURCE_FLAG_PUBLIC_FOLDER = 1 << 2 |
| 89 |
} EEwsESourceFlags; |
| 90 |
|
| 91 |
gchar * e_ews_folder_utils_pick_color_spec (gint move_by, |
| 92 |
gboolean around_middle); |
| 93 |
gboolean e_ews_folder_utils_populate_esource (ESource *source, |
| 94 |
const GList *sources, |
| 95 |
const gchar *master_hosturl, |
| 96 |
const gchar *master_username, |
| 97 |
EEwsFolder *folder, |
| 98 |
EEwsESourceFlags flags, |
| 99 |
gint color_seed, |
| 100 |
GCancellable *cancellable, |
| 101 |
GError **perror); |
| 102 |
gboolean e_ews_folder_utils_add_as_esource (ESourceRegistry *pregistry, |
| 103 |
const gchar *master_hosturl, |
| 104 |
const gchar *master_username, |
| 105 |
EEwsFolder *folder, |
| 106 |
EEwsESourceFlags flags, |
| 107 |
gint color_seed, |
| 108 |
GCancellable *cancellable, |
| 109 |
GError **perror); |
| 110 |
gboolean e_ews_folder_utils_remove_as_esource (const gchar *master_hosturl, |
| 111 |
const gchar *master_username, |
| 112 |
const gchar *folder_id, |
| 113 |
GCancellable *cancellable, |
| 114 |
GError **perror); |
| 115 |
GList * e_ews_folder_utils_get_esources (const gchar *master_hosturl, |
| 116 |
const gchar *master_username, |
| 117 |
GCancellable *cancellable, |
| 118 |
GError **perror); |
| 119 |
gboolean e_ews_folder_utils_is_subscribed_as_esource (const GList *esources, |
| 120 |
const gchar *master_hosturl, |
| 121 |
const gchar *master_username, |
| 122 |
const gchar *folder_id); |
| 123 |
GList * e_ews_folder_utils_filter_sources_for_account (const GList *esources, |
| 124 |
const gchar *master_hosturl, |
| 125 |
const gchar *master_username); |
| 126 |
ESource * e_ews_folder_utils_get_source_for_folder (const GList *esources, |
| 127 |
const gchar *master_hosturl, |
| 128 |
const gchar *master_username, |
| 129 |
const gchar *folder_id); |
| 130 |
ESource * e_ews_folder_utils_get_master_source (const GList *esources, |
| 131 |
const gchar *master_hosturl, |
| 132 |
const gchar *master_username); |
| 133 |
|
| 134 |
G_END_DECLS |
| 135 |
|
| 136 |
#endif |