1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 
3 /*
4  *  GThumb
5  *
6  *  Copyright (C) 2009 The Free Software Foundation, Inc.
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef GTH_COMMENT_H
23 #define GTH_COMMENT_H
24 
25 #include <glib.h>
26 #include <glib-object.h>
27 #include <gio/gio.h>
28 #include <gthumb.h>
29 
30 #define GTH_TYPE_COMMENT (gth_comment_get_type ())
31 #define GTH_COMMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTH_TYPE_COMMENT, GthComment))
32 #define GTH_COMMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTH_TYPE_COMMENT, GthCommentClass))
33 #define GTH_IS_COMMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTH_TYPE_COMMENT))
34 #define GTH_IS_COMMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTH_TYPE_COMMENT))
35 #define GTH_COMMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTH_TYPE_COMMENT, GthCommentClass))
36 
37 typedef struct _GthComment GthComment;
38 typedef struct _GthCommentClass GthCommentClass;
39 typedef struct _GthCommentPrivate GthCommentPrivate;
40 
41 struct _GthComment {
42         GObject     parent_instance;
43         GthCommentPrivate *priv;
44 };
45 
46 struct _GthCommentClass {
47         GObjectClass parent_class;
48 };
49 
50 GFile *           gth_comment_get_comment_file           (GFile         *file);
51 GType             gth_comment_get_type                   (void);
52 GthComment *      gth_comment_new                        (void);
53 GthComment *      gth_comment_new_for_file               (GFile         *file,
54 							  GCancellable  *cancellable,
55 							  GError       **error);
56 char *            gth_comment_to_data                    (GthComment    *comment,
57 							  gsize         *length);
58 GthComment *      gth_comment_dup                        (GthComment    *comment);
59 void              gth_comment_reset                      (GthComment    *comment);
60 void              gth_comment_set_caption                (GthComment    *comment,
61 							  const char    *value);
62 void              gth_comment_set_note                   (GthComment    *comment,
63 							  const char    *value);
64 void              gth_comment_set_place                  (GthComment    *comment,
65 							  const char    *value);
66 void              gth_comment_set_rating                 (GthComment    *comment,
67 							  int            value);
68 void              gth_comment_clear_categories           (GthComment    *comment);
69 void              gth_comment_add_category               (GthComment    *comment,
70 							  const char    *value);
71 void              gth_comment_reset_time                 (GthComment    *comment);
72 void              gth_comment_set_time_from_exif_format  (GthComment    *comment,
73 							  const char    *value);
74 void              gth_comment_set_time_from_time_t       (GthComment    *comment,
75 							  time_t         value);
76 const char *      gth_comment_get_caption                (GthComment    *comment);
77 const char *      gth_comment_get_note                   (GthComment    *comment);
78 const char *      gth_comment_get_place                  (GthComment    *comment);
79 int               gth_comment_get_rating                 (GthComment    *comment);
80 GPtrArray *       gth_comment_get_categories             (GthComment    *comment);
81 GDate *           gth_comment_get_date                   (GthComment    *comment);
82 GthTime *         gth_comment_get_time_of_day            (GthComment    *comment);
83 char *            gth_comment_get_time_as_exif_format    (GthComment    *comment);
84 void              gth_comment_update_general_attributes  (GthFileData   *file_data);
85 void              gth_comment_update_from_general_attributes
86 							 (GthFileData   *file_data);
87 
88 #endif /* GTH_COMMENT_H */
89