desktopitem.h

Go to the documentation of this file.
00001 
00006 /* Purple is the legal property of its developers, whose names are too numerous
00007  * to list here.  Please refer to the COPYRIGHT file distributed with this
00008  * source distribution.
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
00023  *
00024  */
00025 
00026 /*
00027  * The following code has been adapted from gnome-desktop-item.[ch],
00028  * as found on gnome-desktop-2.8.1.
00029  *
00030  *   Copyright (C) 2004 by Alceste Scalas <alceste.scalas@gmx.net>.
00031  *
00032  * Original copyright notice:
00033  *
00034  * Copyright (C) 1999, 2000 Red Hat Inc.
00035  * Copyright (C) 2001 Sid Vicious
00036  * All rights reserved.
00037  *
00038  * This file is part of the Gnome Library.
00039  *
00040  * The Gnome Library is free software; you can redistribute it and/or
00041  * modify it under the terms of the GNU Library General Public License as
00042  * published by the Free Software Foundation; either version 2 of the
00043  * License, or (at your option) any later version.
00044  * 
00045  * The Gnome Library is distributed in the hope that it will be useful,
00046  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00047  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00048  * Library General Public License for more details.
00049  * 
00050  * You should have received a copy of the GNU Library General Public
00051  * License along with the Gnome Library; see the file COPYING.LIB.  If not,
00052  * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00053  * Boston, MA 02111-1301, USA.
00054  */
00055 
00056 #ifndef _PURPLE_DESKTOP_ITEM_H_
00057 #define _PURPLE_DESKTOP_ITEM_H_
00058 
00059 #include <glib.h>
00060 #include <glib-object.h>
00061 
00062 G_BEGIN_DECLS
00063 
00064 typedef enum {
00065     PURPLE_DESKTOP_ITEM_TYPE_NULL = 0 /* This means its NULL, that is, not
00066                       * set */,
00067     PURPLE_DESKTOP_ITEM_TYPE_OTHER /* This means it's not one of the below
00068                      strings types, and you must get the
00069                      Type attribute. */,
00070 
00071     /* These are the standard compliant types: */
00072     PURPLE_DESKTOP_ITEM_TYPE_APPLICATION,
00073     PURPLE_DESKTOP_ITEM_TYPE_LINK,
00074     PURPLE_DESKTOP_ITEM_TYPE_FSDEVICE,
00075     PURPLE_DESKTOP_ITEM_TYPE_MIME_TYPE,
00076     PURPLE_DESKTOP_ITEM_TYPE_DIRECTORY,
00077     PURPLE_DESKTOP_ITEM_TYPE_SERVICE,
00078     PURPLE_DESKTOP_ITEM_TYPE_SERVICE_TYPE
00079 } PurpleDesktopItemType;
00080 
00081 typedef struct _PurpleDesktopItem PurpleDesktopItem;
00082 
00083 #define PURPLE_TYPE_DESKTOP_ITEM         (purple_desktop_item_get_type ())
00084 GType purple_desktop_item_get_type       (void);
00085 
00086 /* standard */
00087 #define PURPLE_DESKTOP_ITEM_ENCODING    "Encoding" /* string */
00088 #define PURPLE_DESKTOP_ITEM_VERSION "Version"  /* numeric */
00089 #define PURPLE_DESKTOP_ITEM_NAME        "Name" /* localestring */
00090 #define PURPLE_DESKTOP_ITEM_GENERIC_NAME    "GenericName" /* localestring */
00091 #define PURPLE_DESKTOP_ITEM_TYPE        "Type" /* string */
00092 #define PURPLE_DESKTOP_ITEM_FILE_PATTERN "FilePattern" /* regexp(s) */
00093 #define PURPLE_DESKTOP_ITEM_TRY_EXEC    "TryExec" /* string */
00094 #define PURPLE_DESKTOP_ITEM_NO_DISPLAY  "NoDisplay" /* boolean */
00095 #define PURPLE_DESKTOP_ITEM_COMMENT "Comment" /* localestring */
00096 #define PURPLE_DESKTOP_ITEM_EXEC        "Exec" /* string */
00097 #define PURPLE_DESKTOP_ITEM_ACTIONS "Actions" /* strings */
00098 #define PURPLE_DESKTOP_ITEM_ICON        "Icon" /* string */
00099 #define PURPLE_DESKTOP_ITEM_MINI_ICON   "MiniIcon" /* string */
00100 #define PURPLE_DESKTOP_ITEM_HIDDEN  "Hidden" /* boolean */
00101 #define PURPLE_DESKTOP_ITEM_PATH        "Path" /* string */
00102 #define PURPLE_DESKTOP_ITEM_TERMINAL    "Terminal" /* boolean */
00103 #define PURPLE_DESKTOP_ITEM_TERMINAL_OPTIONS "TerminalOptions" /* string */
00104 #define PURPLE_DESKTOP_ITEM_SWALLOW_TITLE "SwallowTitle" /* string */
00105 #define PURPLE_DESKTOP_ITEM_SWALLOW_EXEC    "SwallowExec" /* string */
00106 #define PURPLE_DESKTOP_ITEM_MIME_TYPE   "MimeType" /* regexp(s) */
00107 #define PURPLE_DESKTOP_ITEM_PATTERNS    "Patterns" /* regexp(s) */
00108 #define PURPLE_DESKTOP_ITEM_DEFAULT_APP "DefaultApp" /* string */
00109 #define PURPLE_DESKTOP_ITEM_DEV     "Dev" /* string */
00110 #define PURPLE_DESKTOP_ITEM_FS_TYPE "FSType" /* string */
00111 #define PURPLE_DESKTOP_ITEM_MOUNT_POINT "MountPoint" /* string */
00112 #define PURPLE_DESKTOP_ITEM_READ_ONLY   "ReadOnly" /* boolean */
00113 #define PURPLE_DESKTOP_ITEM_UNMOUNT_ICON "UnmountIcon" /* string */
00114 #define PURPLE_DESKTOP_ITEM_SORT_ORDER  "SortOrder" /* strings */
00115 #define PURPLE_DESKTOP_ITEM_URL     "URL" /* string */
00116 #define PURPLE_DESKTOP_ITEM_DOC_PATH    "X-GNOME-DocPath" /* string */
00117 
00125 PurpleDesktopItem *purple_desktop_item_new_from_file (const char *filename);
00126 
00139 PurpleDesktopItemType purple_desktop_item_get_entry_type (const PurpleDesktopItem *item);
00140 
00149 const char *purple_desktop_item_get_string (const PurpleDesktopItem *item,
00150                       const char *attr);
00151 
00160 PurpleDesktopItem *purple_desktop_item_copy (const PurpleDesktopItem *item);
00161 
00168 void purple_desktop_item_unref (PurpleDesktopItem *item);
00169 
00170 G_END_DECLS
00171 
00172 #endif /* _PURPLE_DESKTOP_ITEM_H_ */