~ubuntu-branches/ubuntu/precise/tumbler/precise

« back to all changes in this revision

Viewing changes to tumbler/tumbler-cache.h

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc
  • Date: 2010-11-07 16:34:58 UTC
  • Revision ID: james.westby@ubuntu.com-20101107163458-skwfq34vnuavipne
Tags: upstream-0.1.4
ImportĀ upstreamĀ versionĀ 0.1.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* vi:set et ai sw=2 sts=2 ts=2: */
 
2
/*-
 
3
 * Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.org>
 
4
 *
 
5
 * This library is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU Library General Public
 
7
 * License as published by the Free Software Foundation; either
 
8
 * version 2 of the License, or (at your option) any later version.
 
9
 *
 
10
 * This library is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 
13
 * GNU Library General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU Library General 
 
16
 * Public License along with this library; if not, write to the 
 
17
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
18
 * Boston, MA 02110-1301, USA.
 
19
 */
 
20
 
 
21
#if !defined (TUMBLER_INSIDE_TUMBLER_H) && !defined (TUMBLER_COMPILATION)
 
22
#error "Only <tumbler/tumbler.h> may be included directly. This file might disappear or change contents."
 
23
#endif
 
24
 
 
25
#ifndef __TUMBLER_CACHE_H__
 
26
#define __TUMBLER_CACHE_H__
 
27
 
 
28
#include <tumbler/tumbler-thumbnail.h>
 
29
#include <tumbler/tumbler-thumbnail-flavor.h>
 
30
 
 
31
G_BEGIN_DECLS
 
32
 
 
33
#define TUMBLER_TYPE_CACHE           (tumbler_cache_get_type ())
 
34
#define TUMBLER_CACHE(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUMBLER_TYPE_CACHE, TumblerCache))
 
35
#define TUMBLER_IS_CACHE(obj)        (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUMBLER_TYPE_CACHE))
 
36
#define TUMBLER_CACHE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUMBLER_TYPE_CACHE, TumblerCacheIface))
 
37
 
 
38
typedef struct _TumblerCache      TumblerCache;
 
39
typedef struct _TumblerCacheIface TumblerCacheIface;
 
40
 
 
41
struct _TumblerCacheIface
 
42
{
 
43
  GTypeInterface __parent__;
 
44
 
 
45
  /* signals */
 
46
 
 
47
  /* virtual methods */
 
48
  TumblerThumbnail *(*get_thumbnail) (TumblerCache           *cache,
 
49
                                      const gchar            *uri,
 
50
                                      TumblerThumbnailFlavor *flavor);
 
51
  void              (*cleanup)       (TumblerCache           *cache,
 
52
                                      const gchar            *uri,
 
53
                                      guint64                 since);
 
54
  void              (*do_delete)     (TumblerCache           *cache,
 
55
                                      const GStrv             uris);
 
56
  void              (*copy)          (TumblerCache           *cache,
 
57
                                      const GStrv             from_uris,
 
58
                                      const GStrv             to_uris);
 
59
  void              (*move)          (TumblerCache           *cache,
 
60
                                      const GStrv             from_uris,
 
61
                                      const GStrv             to_uris);
 
62
  gboolean          (*is_thumbnail)  (TumblerCache           *cache,
 
63
                                      const gchar            *uri);
 
64
  GList            *(*get_flavors)   (TumblerCache           *cache);
 
65
};
 
66
 
 
67
GType                   tumbler_cache_get_type (void) G_GNUC_CONST;
 
68
 
 
69
TumblerCache           *tumbler_cache_get_default    (void) G_GNUC_WARN_UNUSED_RESULT;
 
70
 
 
71
TumblerThumbnail       *tumbler_cache_get_thumbnail  (TumblerCache           *cache,
 
72
                                                      const gchar            *uri,
 
73
                                                      TumblerThumbnailFlavor *flavor) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
 
74
void                    tumbler_cache_cleanup        (TumblerCache           *cache,
 
75
                                                      const gchar            *uri_prefix,
 
76
                                                      guint64                 since);
 
77
void                    tumbler_cache_delete         (TumblerCache           *cache,
 
78
                                                      const GStrv             uris);
 
79
void                    tumbler_cache_copy           (TumblerCache           *cache,
 
80
                                                      const GStrv             from_uris,
 
81
                                                      const GStrv             to_uris);
 
82
void                    tumbler_cache_move           (TumblerCache           *cache,
 
83
                                                      const GStrv             from_uris,
 
84
                                                      const GStrv             to_uris);
 
85
gboolean                tumbler_cache_is_thumbnail   (TumblerCache           *cache,
 
86
                                                      const gchar            *uri);
 
87
GList                  *tumbler_cache_get_flavors    (TumblerCache           *cache) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
 
88
TumblerThumbnailFlavor *tumbler_cache_get_flavor     (TumblerCache           *cache,
 
89
                                                      const gchar            *name) G_GNUC_WARN_UNUSED_RESULT;
 
90
 
 
91
G_END_DECLS
 
92
 
 
93
#endif /* !__TUMBLER_CACHE_H__ */