Mon, 10 Feb 2014 16:22:00 +0530
Merged default branch
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
1 | /* Purple is the legal property of its developers, whose names are too numerous |
| 10229 | 2 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 3 | * source distribution. | |
| 4 | * | |
| 5 | * This program is free software; you can redistribute it and/or modify | |
| 6 | * it under the terms of the GNU General Public License as published by | |
| 7 | * the Free Software Foundation; either version 2 of the License, or | |
| 8 | * (at your option) any later version. | |
| 9 | * | |
| 10 | * This program 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 General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU General Public License | |
| 16 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
15884
diff
changeset
|
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 10229 | 18 | * |
| 19 | */ | |
| 20 | ||
| 21 | /* | |
| 22 | * The following code has been adapted from gnome-desktop-item.[ch], | |
| 23 | * as found on gnome-desktop-2.8.1. | |
| 24 | * | |
| 25 | * Copyright (C) 2004 by Alceste Scalas <alceste.scalas@gmx.net>. | |
| 26 | * | |
| 27 | * Original copyright notice: | |
| 28 | * | |
| 29 | * Copyright (C) 1999, 2000 Red Hat Inc. | |
| 30 | * Copyright (C) 2001 Sid Vicious | |
| 31 | * All rights reserved. | |
| 32 | * | |
| 33 | * This file is part of the Gnome Library. | |
| 34 | * | |
| 35 | * The Gnome Library is free software; you can redistribute it and/or | |
| 36 | * modify it under the terms of the GNU Library General Public License as | |
| 37 | * published by the Free Software Foundation; either version 2 of the | |
| 38 | * License, or (at your option) any later version. | |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
20147
diff
changeset
|
39 | * |
| 10229 | 40 | * The Gnome Library is distributed in the hope that it will be useful, |
| 41 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 42 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 43 | * Library General Public License for more details. | |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
20147
diff
changeset
|
44 | * |
| 10229 | 45 | * You should have received a copy of the GNU Library General Public |
| 46 | * License along with the Gnome Library; see the file COPYING.LIB. If not, | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
15884
diff
changeset
|
47 | * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
15884
diff
changeset
|
48 | * Boston, MA 02111-1301, USA. |
| 10229 | 49 | */ |
| 50 | ||
| 15884 | 51 | #ifndef _PURPLE_DESKTOP_ITEM_H_ |
| 52 | #define _PURPLE_DESKTOP_ITEM_H_ | |
|
35487
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35440
diff
changeset
|
53 | /** |
|
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35440
diff
changeset
|
54 | * SECTION:desktopitem |
|
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35440
diff
changeset
|
55 | * @section_id: libpurple-desktopitem |
|
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35440
diff
changeset
|
56 | * @short_description: <filename>desktopitem.h</filename> |
|
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35440
diff
changeset
|
57 | * @title: Managing .desktop files |
|
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35440
diff
changeset
|
58 | */ |
| 10229 | 59 | |
| 60 | #include <glib.h> | |
| 61 | #include <glib-object.h> | |
| 62 | ||
| 63 | G_BEGIN_DECLS | |
| 64 | ||
| 65 | typedef enum { | |
| 15884 | 66 | PURPLE_DESKTOP_ITEM_TYPE_NULL = 0 /* This means its NULL, that is, not |
| 10229 | 67 | * set */, |
| 15884 | 68 | PURPLE_DESKTOP_ITEM_TYPE_OTHER /* This means it's not one of the below |
| 10229 | 69 | strings types, and you must get the |
| 70 | Type attribute. */, | |
| 71 | ||
| 72 | /* These are the standard compliant types: */ | |
| 15884 | 73 | PURPLE_DESKTOP_ITEM_TYPE_APPLICATION, |
| 74 | PURPLE_DESKTOP_ITEM_TYPE_LINK, | |
| 75 | PURPLE_DESKTOP_ITEM_TYPE_FSDEVICE, | |
| 76 | PURPLE_DESKTOP_ITEM_TYPE_MIME_TYPE, | |
| 77 | PURPLE_DESKTOP_ITEM_TYPE_DIRECTORY, | |
| 78 | PURPLE_DESKTOP_ITEM_TYPE_SERVICE, | |
| 79 | PURPLE_DESKTOP_ITEM_TYPE_SERVICE_TYPE | |
| 80 | } PurpleDesktopItemType; | |
| 10229 | 81 | |
| 15884 | 82 | typedef struct _PurpleDesktopItem PurpleDesktopItem; |
| 10229 | 83 | |
| 15884 | 84 | #define PURPLE_TYPE_DESKTOP_ITEM (purple_desktop_item_get_type ()) |
| 85 | GType purple_desktop_item_get_type (void); | |
| 10229 | 86 | |
| 87 | /* standard */ | |
| 15884 | 88 | #define PURPLE_DESKTOP_ITEM_ENCODING "Encoding" /* string */ |
| 89 | #define PURPLE_DESKTOP_ITEM_VERSION "Version" /* numeric */ | |
| 90 | #define PURPLE_DESKTOP_ITEM_NAME "Name" /* localestring */ | |
| 91 | #define PURPLE_DESKTOP_ITEM_GENERIC_NAME "GenericName" /* localestring */ | |
| 92 | #define PURPLE_DESKTOP_ITEM_TYPE "Type" /* string */ | |
| 93 | #define PURPLE_DESKTOP_ITEM_FILE_PATTERN "FilePattern" /* regexp(s) */ | |
| 94 | #define PURPLE_DESKTOP_ITEM_TRY_EXEC "TryExec" /* string */ | |
| 95 | #define PURPLE_DESKTOP_ITEM_NO_DISPLAY "NoDisplay" /* boolean */ | |
| 96 | #define PURPLE_DESKTOP_ITEM_COMMENT "Comment" /* localestring */ | |
| 97 | #define PURPLE_DESKTOP_ITEM_EXEC "Exec" /* string */ | |
| 98 | #define PURPLE_DESKTOP_ITEM_ACTIONS "Actions" /* strings */ | |
| 99 | #define PURPLE_DESKTOP_ITEM_ICON "Icon" /* string */ | |
| 100 | #define PURPLE_DESKTOP_ITEM_MINI_ICON "MiniIcon" /* string */ | |
| 101 | #define PURPLE_DESKTOP_ITEM_HIDDEN "Hidden" /* boolean */ | |
| 102 | #define PURPLE_DESKTOP_ITEM_PATH "Path" /* string */ | |
| 103 | #define PURPLE_DESKTOP_ITEM_TERMINAL "Terminal" /* boolean */ | |
| 104 | #define PURPLE_DESKTOP_ITEM_TERMINAL_OPTIONS "TerminalOptions" /* string */ | |
| 105 | #define PURPLE_DESKTOP_ITEM_SWALLOW_TITLE "SwallowTitle" /* string */ | |
| 106 | #define PURPLE_DESKTOP_ITEM_SWALLOW_EXEC "SwallowExec" /* string */ | |
| 107 | #define PURPLE_DESKTOP_ITEM_MIME_TYPE "MimeType" /* regexp(s) */ | |
| 108 | #define PURPLE_DESKTOP_ITEM_PATTERNS "Patterns" /* regexp(s) */ | |
| 109 | #define PURPLE_DESKTOP_ITEM_DEFAULT_APP "DefaultApp" /* string */ | |
| 110 | #define PURPLE_DESKTOP_ITEM_DEV "Dev" /* string */ | |
| 111 | #define PURPLE_DESKTOP_ITEM_FS_TYPE "FSType" /* string */ | |
| 112 | #define PURPLE_DESKTOP_ITEM_MOUNT_POINT "MountPoint" /* string */ | |
| 113 | #define PURPLE_DESKTOP_ITEM_READ_ONLY "ReadOnly" /* boolean */ | |
| 114 | #define PURPLE_DESKTOP_ITEM_UNMOUNT_ICON "UnmountIcon" /* string */ | |
| 115 | #define PURPLE_DESKTOP_ITEM_SORT_ORDER "SortOrder" /* strings */ | |
| 116 | #define PURPLE_DESKTOP_ITEM_URL "URL" /* string */ | |
| 117 | #define PURPLE_DESKTOP_ITEM_DOC_PATH "X-GNOME-DocPath" /* string */ | |
| 10229 | 118 | |
| 119 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
120 | * purple_desktop_item_new_from_file: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
121 | * @filename: The filename or directory path to load the PurpleDesktopItem from |
| 10229 | 122 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
123 | * This function loads 'filename' and turns it into a PurpleDesktopItem. |
| 10229 | 124 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
25888
diff
changeset
|
125 | * Returns: The newly loaded item, or NULL on error. |
| 10229 | 126 | */ |
| 15884 | 127 | PurpleDesktopItem *purple_desktop_item_new_from_file (const char *filename); |
| 10229 | 128 | |
| 129 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
130 | * purple_desktop_item_get_entry_type: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
131 | * @item: A desktop item |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
132 | * |
| 10229 | 133 | * Gets the type attribute (the 'Type' field) of the item. This should |
| 134 | * usually be 'Application' for an application, but it can be 'Directory' | |
| 135 | * for a directory description. There are other types available as well. | |
| 136 | * The type usually indicates how the desktop item should be handeled and | |
| 137 | * how the 'Exec' field should be handeled. | |
| 138 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
25888
diff
changeset
|
139 | * Returns: The type of the specified 'item'. The returned memory |
| 15884 | 140 | * remains owned by the PurpleDesktopItem and should not be freed. |
| 10229 | 141 | */ |
| 15884 | 142 | PurpleDesktopItemType purple_desktop_item_get_entry_type (const PurpleDesktopItem *item); |
| 10229 | 143 | |
| 144 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
145 | * purple_desktop_item_get_string: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
25888
diff
changeset
|
146 | * @item: A desktop item |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
25888
diff
changeset
|
147 | * @attr: The attribute to look for |
| 10229 | 148 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
149 | * Gets the value of an attribute of the item, as a string. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
150 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
25888
diff
changeset
|
151 | * Returns: The value of the specified item attribute. |
| 10229 | 152 | */ |
| 15884 | 153 | const char *purple_desktop_item_get_string (const PurpleDesktopItem *item, |
| 10229 | 154 | const char *attr); |
| 155 | ||
| 156 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
157 | * purple_desktop_item_copy: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
158 | * @item: The item to be copied |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
159 | * |
| 15884 | 160 | * Creates a copy of a PurpleDesktopItem. The new copy has a refcount of 1. |
| 10229 | 161 | * Note: Section stack is NOT copied. |
| 162 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
25888
diff
changeset
|
163 | * Returns: The new copy |
| 10229 | 164 | */ |
| 15884 | 165 | PurpleDesktopItem *purple_desktop_item_copy (const PurpleDesktopItem *item); |
| 10229 | 166 | |
| 167 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
168 | * purple_desktop_item_unref: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
169 | * @item: A desktop item |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
170 | * |
| 10229 | 171 | * Decreases the reference count of the specified item, and destroys |
| 172 | * the item if there are no more references left. | |
| 173 | */ | |
| 15884 | 174 | void purple_desktop_item_unref (PurpleDesktopItem *item); |
| 10229 | 175 | |
| 176 | G_END_DECLS | |
| 177 | ||
| 15884 | 178 | #endif /* _PURPLE_DESKTOP_ITEM_H_ */ |