1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 * 3 * Copyright (C) 2009-2013 Richard Hughes <richard@hughsie.com> 4 * 5 * Licensed under the GNU Lesser General Public License Version 2.1 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public 9 * License as published by the Free Software Foundation; either 10 * version 2.1 of the License, or (at your option) any later version. 11 * 12 * This library is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * Lesser General Public License for more details. 16 * 17 * You should have received a copy of the GNU Lesser General Public 18 * License along with this library; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 */ 21 22 #if !defined (__COLORD_H_INSIDE__) && !defined (CD_COMPILATION) 23 #error "Only <colord.h> can be included directly." 24 #endif 25 26 #ifndef __CD_ICC_STORE_H 27 #define __CD_ICC_STORE_H 28 29 #include <glib-object.h> 30 31 #include "cd-icc.h" 32 33 G_BEGIN_DECLS 34 35 #define CD_TYPE_ICC_STORE (cd_icc_store_get_type ()) 36 G_DECLARE_DERIVABLE_TYPE (CdIccStore, cd_icc_store, CD, ICC_STORE, GObject) 37 38 struct _CdIccStoreClass 39 { 40 GObjectClass parent_class; 41 void (* added) (CdIcc *icc); 42 void (* removed) (CdIcc *icc); 43 }; 44 45 /** 46 * CdIccStoreSearchFlags: 47 * @CD_ICC_STORE_SEARCH_FLAGS_NONE: No flags set. 48 * @CD_ICC_STORE_SEARCH_FLAGS_CREATE_LOCATION: Create the location if it does not exist 49 * 50 * Flags used when adding scan locations. 51 * 52 * Since: 1.1.1 53 **/ 54 typedef enum { 55 CD_ICC_STORE_SEARCH_FLAGS_NONE = 0, /* Since: 1.0.2 */ 56 CD_ICC_STORE_SEARCH_FLAGS_CREATE_LOCATION = 1, /* Since: 1.0.2 */ 57 /*< private >*/ 58 CD_ICC_STORE_SEARCH_FLAGS_LAST 59 } CdIccStoreSearchFlags; 60 61 /** 62 * CdIccStoreSearchKind: 63 * @CD_ICC_STORE_SEARCH_KIND_SYSTEM: Per-system locations 64 * @CD_ICC_STORE_SEARCH_KIND_MACHINE: Per-machine locations 65 * @CD_ICC_STORE_SEARCH_KIND_USER: Per-user locations 66 * 67 * The kind of profiles locations to search. 68 * 69 * Since: 1.1.1 70 **/ 71 typedef enum { 72 CD_ICC_STORE_SEARCH_KIND_SYSTEM, /* Since: 1.0.2 */ 73 CD_ICC_STORE_SEARCH_KIND_MACHINE, /* Since: 1.0.2 */ 74 CD_ICC_STORE_SEARCH_KIND_USER, /* Since: 1.0.2 */ 75 /*< private >*/ 76 CD_ICC_STORE_SEARCH_KIND_LAST 77 } CdIccStoreSearchKind; 78 79 CdIccStore *cd_icc_store_new (void); 80 gboolean cd_icc_store_search_location (CdIccStore *store, 81 const gchar *location, 82 CdIccStoreSearchFlags search_flags, 83 GCancellable *cancellable, 84 GError **error); 85 gboolean cd_icc_store_search_kind (CdIccStore *store, 86 CdIccStoreSearchKind search_kind, 87 CdIccStoreSearchFlags search_flags, 88 GCancellable *cancellable, 89 GError **error); 90 void cd_icc_store_set_load_flags (CdIccStore *store, 91 CdIccLoadFlags load_flags); 92 CdIccLoadFlags cd_icc_store_get_load_flags (CdIccStore *store); 93 void cd_icc_store_set_cache (CdIccStore *store, 94 GResource *cache); 95 GPtrArray *cd_icc_store_get_all (CdIccStore *store); 96 CdIcc *cd_icc_store_find_by_filename (CdIccStore *store, 97 const gchar *filename); 98 CdIcc *cd_icc_store_find_by_checksum (CdIccStore *store, 99 const gchar *checksum); 100 101 G_END_DECLS 102 103 #endif /* __CD_ICC_STORE_H */ 104