Frameworks/libpurple.framework/Versions/0.6.2/Headers/desktopitem.h
changeset 2592 e8d15275025e
parent 1739 8b0daad9656c
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Frameworks/libpurple.framework/Versions/0.6.2/Headers/desktopitem.h	Fri Aug 21 13:25:11 2009 -0700
     1.3 @@ -0,0 +1,172 @@
     1.4 +/**
     1.5 + * @file desktopitem.h Functions for managing .desktop files
     1.6 + * @ingroup core
     1.7 + */
     1.8 +
     1.9 +/* Purple is the legal property of its developers, whose names are too numerous
    1.10 + * to list here.  Please refer to the COPYRIGHT file distributed with this
    1.11 + * source distribution.
    1.12 + *
    1.13 + * This program is free software; you can redistribute it and/or modify
    1.14 + * it under the terms of the GNU General Public License as published by
    1.15 + * the Free Software Foundation; either version 2 of the License, or
    1.16 + * (at your option) any later version.
    1.17 + *
    1.18 + * This program is distributed in the hope that it will be useful,
    1.19 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.20 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.21 + * GNU General Public License for more details.
    1.22 + *
    1.23 + * You should have received a copy of the GNU General Public License
    1.24 + * along with this program; if not, write to the Free Software
    1.25 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
    1.26 + *
    1.27 + */
    1.28 +
    1.29 +/*
    1.30 + * The following code has been adapted from gnome-desktop-item.[ch],
    1.31 + * as found on gnome-desktop-2.8.1.
    1.32 + *
    1.33 + *   Copyright (C) 2004 by Alceste Scalas <alceste.scalas@gmx.net>.
    1.34 + *
    1.35 + * Original copyright notice:
    1.36 + *
    1.37 + * Copyright (C) 1999, 2000 Red Hat Inc.
    1.38 + * Copyright (C) 2001 Sid Vicious
    1.39 + * All rights reserved.
    1.40 + *
    1.41 + * This file is part of the Gnome Library.
    1.42 + *
    1.43 + * The Gnome Library is free software; you can redistribute it and/or
    1.44 + * modify it under the terms of the GNU Library General Public License as
    1.45 + * published by the Free Software Foundation; either version 2 of the
    1.46 + * License, or (at your option) any later version.
    1.47 + *
    1.48 + * The Gnome Library is distributed in the hope that it will be useful,
    1.49 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.50 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.51 + * Library General Public License for more details.
    1.52 + *
    1.53 + * You should have received a copy of the GNU Library General Public
    1.54 + * License along with the Gnome Library; see the file COPYING.LIB.  If not,
    1.55 + * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    1.56 + * Boston, MA 02111-1301, USA.
    1.57 + */
    1.58 +
    1.59 +#ifndef _PURPLE_DESKTOP_ITEM_H_
    1.60 +#define _PURPLE_DESKTOP_ITEM_H_
    1.61 +
    1.62 +#include <glib.h>
    1.63 +#include <glib-object.h>
    1.64 +
    1.65 +G_BEGIN_DECLS
    1.66 +
    1.67 +typedef enum {
    1.68 +	PURPLE_DESKTOP_ITEM_TYPE_NULL = 0 /* This means its NULL, that is, not
    1.69 +					  * set */,
    1.70 +	PURPLE_DESKTOP_ITEM_TYPE_OTHER /* This means it's not one of the below
    1.71 +					 strings types, and you must get the
    1.72 +					 Type attribute. */,
    1.73 +
    1.74 +	/* These are the standard compliant types: */
    1.75 +	PURPLE_DESKTOP_ITEM_TYPE_APPLICATION,
    1.76 +	PURPLE_DESKTOP_ITEM_TYPE_LINK,
    1.77 +	PURPLE_DESKTOP_ITEM_TYPE_FSDEVICE,
    1.78 +	PURPLE_DESKTOP_ITEM_TYPE_MIME_TYPE,
    1.79 +	PURPLE_DESKTOP_ITEM_TYPE_DIRECTORY,
    1.80 +	PURPLE_DESKTOP_ITEM_TYPE_SERVICE,
    1.81 +	PURPLE_DESKTOP_ITEM_TYPE_SERVICE_TYPE
    1.82 +} PurpleDesktopItemType;
    1.83 +
    1.84 +typedef struct _PurpleDesktopItem PurpleDesktopItem;
    1.85 +
    1.86 +#define PURPLE_TYPE_DESKTOP_ITEM         (purple_desktop_item_get_type ())
    1.87 +GType purple_desktop_item_get_type       (void);
    1.88 +
    1.89 +/* standard */
    1.90 +#define PURPLE_DESKTOP_ITEM_ENCODING	"Encoding" /* string */
    1.91 +#define PURPLE_DESKTOP_ITEM_VERSION	"Version"  /* numeric */
    1.92 +#define PURPLE_DESKTOP_ITEM_NAME		"Name" /* localestring */
    1.93 +#define PURPLE_DESKTOP_ITEM_GENERIC_NAME	"GenericName" /* localestring */
    1.94 +#define PURPLE_DESKTOP_ITEM_TYPE		"Type" /* string */
    1.95 +#define PURPLE_DESKTOP_ITEM_FILE_PATTERN "FilePattern" /* regexp(s) */
    1.96 +#define PURPLE_DESKTOP_ITEM_TRY_EXEC	"TryExec" /* string */
    1.97 +#define PURPLE_DESKTOP_ITEM_NO_DISPLAY	"NoDisplay" /* boolean */
    1.98 +#define PURPLE_DESKTOP_ITEM_COMMENT	"Comment" /* localestring */
    1.99 +#define PURPLE_DESKTOP_ITEM_EXEC		"Exec" /* string */
   1.100 +#define PURPLE_DESKTOP_ITEM_ACTIONS	"Actions" /* strings */
   1.101 +#define PURPLE_DESKTOP_ITEM_ICON		"Icon" /* string */
   1.102 +#define PURPLE_DESKTOP_ITEM_MINI_ICON	"MiniIcon" /* string */
   1.103 +#define PURPLE_DESKTOP_ITEM_HIDDEN	"Hidden" /* boolean */
   1.104 +#define PURPLE_DESKTOP_ITEM_PATH		"Path" /* string */
   1.105 +#define PURPLE_DESKTOP_ITEM_TERMINAL	"Terminal" /* boolean */
   1.106 +#define PURPLE_DESKTOP_ITEM_TERMINAL_OPTIONS "TerminalOptions" /* string */
   1.107 +#define PURPLE_DESKTOP_ITEM_SWALLOW_TITLE "SwallowTitle" /* string */
   1.108 +#define PURPLE_DESKTOP_ITEM_SWALLOW_EXEC	"SwallowExec" /* string */
   1.109 +#define PURPLE_DESKTOP_ITEM_MIME_TYPE	"MimeType" /* regexp(s) */
   1.110 +#define PURPLE_DESKTOP_ITEM_PATTERNS	"Patterns" /* regexp(s) */
   1.111 +#define PURPLE_DESKTOP_ITEM_DEFAULT_APP	"DefaultApp" /* string */
   1.112 +#define PURPLE_DESKTOP_ITEM_DEV		"Dev" /* string */
   1.113 +#define PURPLE_DESKTOP_ITEM_FS_TYPE	"FSType" /* string */
   1.114 +#define PURPLE_DESKTOP_ITEM_MOUNT_POINT	"MountPoint" /* string */
   1.115 +#define PURPLE_DESKTOP_ITEM_READ_ONLY	"ReadOnly" /* boolean */
   1.116 +#define PURPLE_DESKTOP_ITEM_UNMOUNT_ICON "UnmountIcon" /* string */
   1.117 +#define PURPLE_DESKTOP_ITEM_SORT_ORDER	"SortOrder" /* strings */
   1.118 +#define PURPLE_DESKTOP_ITEM_URL		"URL" /* string */
   1.119 +#define PURPLE_DESKTOP_ITEM_DOC_PATH	"X-GNOME-DocPath" /* string */
   1.120 +
   1.121 +/**
   1.122 + * This function loads 'filename' and turns it into a PurpleDesktopItem.
   1.123 + *
   1.124 + * @param filename The filename or directory path to load the PurpleDesktopItem from
   1.125 + *
   1.126 + * @return The newly loaded item, or NULL on error.
   1.127 + */
   1.128 +PurpleDesktopItem *purple_desktop_item_new_from_file (const char *filename);
   1.129 +
   1.130 +/**
   1.131 + * Gets the type attribute (the 'Type' field) of the item.  This should
   1.132 + * usually be 'Application' for an application, but it can be 'Directory'
   1.133 + * for a directory description.  There are other types available as well.
   1.134 + * The type usually indicates how the desktop item should be handeled and
   1.135 + * how the 'Exec' field should be handeled.
   1.136 + *
   1.137 + * @param item A desktop item
   1.138 + *
   1.139 + * @return The type of the specified 'item'. The returned memory
   1.140 + * remains owned by the PurpleDesktopItem and should not be freed.
   1.141 + */
   1.142 +PurpleDesktopItemType purple_desktop_item_get_entry_type (const PurpleDesktopItem *item);
   1.143 +
   1.144 +/**
   1.145 + * Gets the value of an attribute of the item, as a string.
   1.146 + *
   1.147 + * @param item A desktop item
   1.148 + * @param attr The attribute to look for
   1.149 + *
   1.150 + * @return The value of the specified item attribute.
   1.151 + */
   1.152 +const char *purple_desktop_item_get_string (const PurpleDesktopItem *item,
   1.153 +					  const char *attr);
   1.154 +
   1.155 +/**
   1.156 + * Creates a copy of a PurpleDesktopItem.  The new copy has a refcount of 1.
   1.157 + * Note: Section stack is NOT copied.
   1.158 + *
   1.159 + * @param item The item to be copied
   1.160 + *
   1.161 + * @return The new copy
   1.162 + */
   1.163 +PurpleDesktopItem *purple_desktop_item_copy (const PurpleDesktopItem *item);
   1.164 +
   1.165 +/**
   1.166 + * Decreases the reference count of the specified item, and destroys
   1.167 + * the item if there are no more references left.
   1.168 + *
   1.169 + * @param item A desktop item
   1.170 + */
   1.171 +void purple_desktop_item_unref (PurpleDesktopItem *item);
   1.172 +
   1.173 +G_END_DECLS
   1.174 +
   1.175 +#endif /* _PURPLE_DESKTOP_ITEM_H_ */