1 /* modest-tny-store-actions.c */
3 /* insert (c)/licensing information) */
6 #include <tny-msg-iface.h>
7 #include <tny-msg-header.h>
8 #include <tny-msg-header-iface.h>
9 #include <tny-account-iface.h>
10 #include <tny-account-store-iface.h>
11 #include <tny-store-account-iface.h>
12 #include <tny-store-account.h>
13 #include <tny-stream-camel.h>
15 #include <camel/camel-folder.h>
16 #include <camel/camel.h>
17 #include <camel/camel-folder-summary.h>
21 #include "modest-tny-store-actions.h"
24 /* 'private'/'protected' functions */
25 static void modest_tny_store_actions_class_init (ModestTnyStoreActionsClass *klass);
26 static void modest_tny_store_actions_init (ModestTnyStoreActions *obj);
27 static void modest_tny_store_actions_finalize (GObject *obj);
36 typedef struct _ModestTnyStoreActionsPrivate ModestTnyStoreActionsPrivate;
38 struct _ModestTnyStoreActionsPrivate {
42 #define MODEST_TNY_STORE_ACTIONS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \
43 MODEST_TYPE_TNY_STORE_ACTIONS, \
44 ModestTnyStoreActionsPrivate))
46 static GObjectClass *parent_class = NULL;
48 /* uncomment the following if you have defined any signals */
49 /* static guint signals[LAST_SIGNAL] = {0}; */
52 modest_tny_store_actions_update_folders (ModestTnyStoreActions *self,
53 TnyStoreAccountIface *storage_account)
55 const TnyListIface* folders;
56 TnyIteratorIface* ifolders;
59 folders = tny_store_account_iface_get_folders (storage_account,
60 TNY_STORE_ACCOUNT_FOLDER_TYPE_SUBSCRIBED);
62 ifolders = tny_list_iface_create_iterator (folders);
64 for (cur_folder = tny_iterator_iface_first (ifolders);
65 tny_iterator_iface_has_next (ifolders);
66 tny_iterator_iface_next (ifolders))
68 cur_folder = tny_iterator_iface_current (ifolders);
69 // tny_msg_folder_iface_refresh (cur_folder);
76 modest_tny_store_actions_get_type (void)
78 static GType my_type = 0;
80 static const GTypeInfo my_info = {
81 sizeof(ModestTnyStoreActionsClass),
83 NULL, /* base finalize */
84 (GClassInitFunc) modest_tny_store_actions_class_init,
85 NULL, /* class finalize */
86 NULL, /* class data */
87 sizeof(ModestTnyStoreActions),
89 (GInstanceInitFunc) modest_tny_store_actions_init,
91 my_type = g_type_register_static (G_TYPE_OBJECT,
92 "ModestTnyStoreActions",
99 modest_tny_store_actions_class_init (ModestTnyStoreActionsClass *klass)
101 GObjectClass *gobject_class;
102 gobject_class = (GObjectClass*) klass;
104 parent_class = g_type_class_peek_parent (klass);
105 gobject_class->finalize = modest_tny_store_actions_finalize;
107 g_type_class_add_private (gobject_class, sizeof(ModestTnyStoreActionsPrivate));
109 klass->update_folders = modest_tny_store_actions_update_folders;
110 /* signal definitions go here, e.g.: */
111 /* signals[MY_SIGNAL_1] = */
112 /* g_signal_new ("my_signal_1",....); */
113 /* signals[MY_SIGNAL_2] = */
114 /* g_signal_new ("my_signal_2",....); */
119 modest_tny_store_actions_init (ModestTnyStoreActions *obj)
121 /* uncomment the following if you init any of the private data */
122 /* ModestTnyStoreActionsPrivate *priv = MODEST_TNY_STORE_ACTIONS_GET_PRIVATE(obj); */
124 /* initialize this object, eg.: */
125 /* priv->frobnicate_mode = FALSE; */
129 modest_tny_store_actions_finalize (GObject *obj)
131 /* free/unref instance resources here */
135 modest_tny_store_actions_new (void)
137 return G_OBJECT(g_object_new(MODEST_TYPE_TNY_STORE_ACTIONS, NULL));