forked from darktable-org/darktable
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtags.h
More file actions
79 lines (58 loc) · 3.79 KB
/
Copy pathtags.h
File metadata and controls
79 lines (58 loc) · 3.79 KB
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
/*
This file is part of darktable,
copyright (c) 2010 henrik andersson.
darktable is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
darktable 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with darktable. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DT_TAGS_H
#define DT_TAGS_H
#include <sqlite3.h>
#include <glib.h>
typedef struct dt_tag_t
{
guint id;
gchar *tag;
}
dt_tag_t;
/** creates a new tag, returns tagid \param[in] name the tag name. \param[in] tagid a pointer to tagid of new tag, this can be NULL \return false if failed to create a tag and indicates that tagid is invalid to use. \note If tag already exists the existing tag id is returned. */
gboolean dt_tag_new(const char *name,guint *tagid);
/** get the name of specified id */
const gchar *dt_tag_get_name(const guint tagid);
/** removes a tag from db and from assigned images. \param final TRUE actually performs the remove \return the amount of images affected. */
guint dt_tag_remove(const guint tagid, gboolean final);
/** checks if tag exists. \param[in] name of tag to check. \return the id of found tag or -1 i not found. */
gboolean dt_tag_exists(const char *name,guint *tagid);
/** attach a list of tags on selected images. \param[in] tagid id of tag to attach. \param[in] imgid the image id to attach tag to, if < 0 selected images are used. */
void dt_tag_attach(guint tagid,gint imgid);
/** attach a list of tags on selected images. \param[in] tags a list of strings of tags. \param[in] imgid the image id to attach tag to, if < 0 selected images are used. \note If tag not exists it's created.*/
void dt_tag_attach_list(GList *tags,gint imgid);
/** detach tag from images. \param[in] tagid if of tag to deattach. \param[in] imgid the image id to attach tag from, if < 0 selected images are used. */
void dt_tag_detach(guint tagid,gint imgid);
/** detach tags from images that matches name, it is valid to use % to match tag */
void dt_tag_detach_by_string(const char *name, gint imgid);
/** retreives a list of tags of specified imgid \param[out] result a list of dt_tag_t. */
uint32_t dt_tag_get_attached(gint imgid,GList **result);
/** get a string of tags, all serialized, and separated with separator */
gchar* dt_tag_get_list(gint imgid, const gchar *separator);
/** get a string of only hierarchical tags, all serialized, and separated with separator */
gchar *dt_tag_get_hierarchical(gint imgid, const gchar *separator);
/** retreives a list of suggested tags matching keyword. \param[in] keyword the keyword to search \param[out] result a pointer to list populated with result. \return the count \note the limit of result is decided by conf value "xxx" */
uint32_t dt_tag_get_suggestions(const gchar *keyword, GList **result);
/** retreives a list of recent tags used. \param[out] result a pointer to list populated with result. \return the count \note the limit of result is decided by conf value "xxx" */
uint32_t dt_tag_get_recent_used(GList **result);
/** frees the memory of a result set. */
void dt_tag_free_result(GList **result);
/** reorgnize tags */
void dt_tag_reorganize(const gchar *source, const gchar *dest);
#endif
// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.sh
// vim: shiftwidth=2 expandtab tabstop=2 cindent
// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-space on;