summaryrefslogtreecommitdiff
path: root/thunarx/thunarx-file-info.h
blob: 9668afcde46535d54bacc6d7beeef55dc4587eca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/* vi:set et ai sw=2 sts=2 ts=2: */
/*-
 * Copyright (c) 2005-2006 Benedikt Meurer <benny@xfce.org>
 * Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#if !defined(THUNARX_INSIDE_THUNARX_H) && !defined(THUNARX_COMPILATION)
#error "Only <thunarx/thunarx.h> can be included directly, this file may disappear or change contents"
#endif

#ifndef __THUNARX_FILE_INFO_H__
#define __THUNARX_FILE_INFO_H__

#include <gio/gio.h>

#include <thunarx/thunarx-config.h>

G_BEGIN_DECLS

/*
 * File information namespaces available in the #GFileInfo returned by
 * thunarx_file_info_get_file_info().
 */
#define THUNARX_FILE_INFO_NAMESPACE \
  "access::*," \
  "id::filesystem," \
  "mountable::can-mount,standard::target-uri," \
  "preview::*," \
  "standard::type,standard::is-hidden,standard::is-backup," \
  "standard::is-symlink,standard::name,standard::display-name," \
  "standard::size,standard::symlink-target," \
  "time::*," \
  "trash::*," \
  "recent::*," \
  "unix::gid,unix::uid,unix::mode," \
  "metadata::emblems," \
  "metadata::thunar-view-type," \
  "metadata::thunar-sort-column,metadata::thunar-sort-order," \
  "metadata::thunar-zoom-level"


/*
 * Filesystem information namespaces available in the #GFileInfo
 * returned by thunarx_file_info_get_filesystem_info().
 */
#define THUNARX_FILESYSTEM_INFO_NAMESPACE \
  "filesystem::*"

typedef struct _ThunarxFileInfoIface ThunarxFileInfoIface;
typedef struct _ThunarxFileInfo      ThunarxFileInfo;

#define THUNARX_TYPE_FILE_INFO            (thunarx_file_info_get_type ())
#define THUNARX_FILE_INFO(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), THUNARX_TYPE_FILE_INFO, ThunarxFileInfo))
#define THUNARX_IS_FILE_INFO(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNARX_TYPE_FILE_INFO))
#define THUNARX_FILE_INFO_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), THUNARX_TYPE_FILE_INFO, ThunarxFileInfoIface))

/**
 * ThunarxFileInfoIface:
 * @get_name: See thunarx_file_info_get_name().
 * @get_uri: See thunarx_file_info_get_uri().
 * @get_parent_uri: See thunarx_file_info_get_parent_uri().
 * @get_uri_scheme: See thunarx_file_info_get_uri_scheme().
 * @get_mime_type: See thunarx_file_info_get_mime_type().
 * @has_mime_type: See thunarx_file_info_has_mime_type().
 * @is_directory: See thunarx_file_info_is_directory().
 * @get_file_info: See thunarx_file_info_get_file_info().
 * @get_filesystem_info: See thunarx_filesystem_info_get_filesystem_info().
 * @get_location: See thunarx_location_get_location().
 * @changed: See thunarx_file_info_changed().
 * @renamed: See thunarx_file_info_renamed().
 *
 * Interface with virtual methods implemented by the file manager and accessible
 * from the extensions.
 */

struct _ThunarxFileInfoIface
{
  /*< private >*/
  GTypeInterface __parent__;

  /*< public >*/

  /* virtual methods */
  gchar     *(*get_name)            (ThunarxFileInfo *file_info);

  gchar     *(*get_uri)             (ThunarxFileInfo *file_info);
  gchar     *(*get_parent_uri)      (ThunarxFileInfo *file_info);
  gchar     *(*get_uri_scheme)      (ThunarxFileInfo *file_info);

  gchar     *(*get_mime_type)       (ThunarxFileInfo *file_info);
  gboolean   (*has_mime_type)       (ThunarxFileInfo *file_info,
                                     const gchar     *mime_type);

  gboolean   (*is_directory)        (ThunarxFileInfo *file_info);

  GFileInfo *(*get_file_info)       (ThunarxFileInfo *file_info);
  GFileInfo *(*get_filesystem_info) (ThunarxFileInfo *file_info);
  GFile     *(*get_location)        (ThunarxFileInfo *file_info);

  /*< private >*/
  void (*reserved0) (void);
  void (*reserved1) (void);
  void (*reserved2) (void);
  void (*reserved3) (void);
  void (*reserved4) (void);
  void (*reserved5) (void);
  void (*reserved6) (void);

  /*< public >*/

  /* signals */
  void (*changed) (ThunarxFileInfo *file_info);
  void (*renamed) (ThunarxFileInfo *file_info);

  /*< private >*/
  void (*reserved7) (void);
  void (*reserved8) (void);
  void (*reserved9) (void);
};

GType      thunarx_file_info_get_type            (void) G_GNUC_CONST;

gchar     *thunarx_file_info_get_name            (ThunarxFileInfo *file_info);
gchar     *thunarx_file_info_get_uri             (ThunarxFileInfo *file_info);
gchar     *thunarx_file_info_get_parent_uri      (ThunarxFileInfo *file_info);
gchar     *thunarx_file_info_get_uri_scheme      (ThunarxFileInfo *file_info);

gchar     *thunarx_file_info_get_mime_type       (ThunarxFileInfo *file_info);
gboolean   thunarx_file_info_has_mime_type       (ThunarxFileInfo *file_info,
                                                  const gchar     *mime_type);

gboolean   thunarx_file_info_is_directory        (ThunarxFileInfo *file_info);

GFileInfo *thunarx_file_info_get_file_info       (ThunarxFileInfo *file_info);
GFileInfo *thunarx_file_info_get_filesystem_info (ThunarxFileInfo *file_info);
GFile     *thunarx_file_info_get_location        (ThunarxFileInfo *file_info);

void       thunarx_file_info_changed             (ThunarxFileInfo *file_info);
void       thunarx_file_info_renamed             (ThunarxFileInfo *file_info);


#define THUNARX_TYPE_FILE_INFO_LIST (thunarx_file_info_list_get_type ())

GType      thunarx_file_info_list_get_type       (void) G_GNUC_CONST;

GList     *thunarx_file_info_list_copy           (GList           *file_infos);
void       thunarx_file_info_list_free           (GList           *file_infos);

G_END_DECLS

#endif /* !__THUNARX_FILE_INFO_H__ */