diff options
Diffstat (limited to 'src/mcd-account-manager-gvariant.h')
-rw-r--r-- | src/mcd-account-manager-gvariant.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/mcd-account-manager-gvariant.h b/src/mcd-account-manager-gvariant.h new file mode 100644 index 00000000..20537c02 --- /dev/null +++ b/src/mcd-account-manager-gvariant.h @@ -0,0 +1,83 @@ +/* + * The gvariant account manager keyfile storage pseudo-plugin + * + * Copyright © 2012 Collabora Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <mission-control-plugins/mission-control-plugins.h> + +#ifndef __MCD_ACCOUNT_MANAGER_GVARIANT_H__ +#define __MCD_ACCOUNT_MANAGER_GVARIANT_H__ + +G_BEGIN_DECLS + +#define MCD_TYPE_ACCOUNT_MANAGER_GVARIANT \ + (mcd_account_manager_gvariant_get_type ()) + +#define MCD_ACCOUNT_MANAGER_GVARIANT(o) \ + (G_TYPE_CHECK_INSTANCE_CAST ((o), MCD_TYPE_ACCOUNT_MANAGER_GVARIANT, \ + McdAccountManagerGVariant)) + +#define MCD_ACCOUNT_MANAGER_GVARIANT_CLASS(k) \ + (G_TYPE_CHECK_CLASS_CAST((k), MCD_TYPE_ACCOUNT_MANAGER_GVARIANT, \ + McdAccountManagerClass)) + +#define MCD_IS_ACCOUNT_MANAGER_GVARIANT(o) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCD_TYPE_ACCOUNT_MANAGER_GVARIANT)) + +#define MCD_IS_ACCOUNT_MANAGER_GVARIANT_CLASS(k) \ + (G_TYPE_CHECK_CLASS_TYPE ((k), MCD_TYPE_ACCOUNT_MANAGER_GVARIANT)) + +#define MCD_ACCOUNT_MANAGER_GVARIANT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), MCD_TYPE_ACCOUNT_MANAGER_GVARIANT, \ + McdAccountManagerGVariantClass)) + +typedef struct { + GObject parent; + + gboolean loaded; + gchar *directory; + + /* owned (gchar *) of account => owned GHashTable<owned gchar*, + * slice allocated GValue> of properties */ + GHashTable *accounts; + + /* owned (gchar *) of account => owned (gchar *) of full path to + * account file */ + GHashTable *accounts_to_paths; + + /* owned (gchar *) of account => (gpointer) boolean whether account + * has changed and so needs to be written to disk. in reality the + * value is always GUINT_TO_POINTER(TRUE) or the account is simply + * absent. */ + GHashTable *accounts_modified; +} _McdAccountManagerGVariant; + +typedef struct { + GObjectClass parent_class; +} _McdAccountManagerGVariantClass; + +typedef _McdAccountManagerGVariant McdAccountManagerGVariant; +typedef _McdAccountManagerGVariantClass McdAccountManagerGVariantClass; + +GType mcd_account_manager_gvariant_get_type (void) G_GNUC_CONST; + +McdAccountManagerGVariant *mcd_account_manager_gvariant_new (void); + +G_END_DECLS + +#endif |