1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- 2 3 nemo-desktop-link.h: Class that handles the links on the desktop 4 5 Copyright (C) 2003 Red Hat, Inc. 6 7 This program is free software; you can redistribute it and/or 8 modify it under the terms of the GNU General Public License as 9 published by the Free Software Foundation; either version 2 of the 10 License, or (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 General Public License for more details. 16 17 You should have received a copy of the GNU General Public 18 License along with this program; if not, write to the 19 Free Software Foundation, Inc., 51 Franklin Street - Suite 500, 20 Boston, MA 02110-1335, USA. 21 22 Author: Alexander Larsson <alexl@redhat.com> 23 */ 24 25 #ifndef NEMO_DESKTOP_LINK_H 26 #define NEMO_DESKTOP_LINK_H 27 28 #include <libnemo-private/nemo-file.h> 29 #include <gio/gio.h> 30 31 #define NEMO_TYPE_DESKTOP_LINK nemo_desktop_link_get_type() 32 #define NEMO_DESKTOP_LINK(obj) \ 33 (G_TYPE_CHECK_INSTANCE_CAST ((obj), NEMO_TYPE_DESKTOP_LINK, NemoDesktopLink)) 34 #define NEMO_DESKTOP_LINK_CLASS(klass) \ 35 (G_TYPE_CHECK_CLASS_CAST ((klass), NEMO_TYPE_DESKTOP_LINK, NemoDesktopLinkClass)) 36 #define NEMO_IS_DESKTOP_LINK(obj) \ 37 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NEMO_TYPE_DESKTOP_LINK)) 38 #define NEMO_IS_DESKTOP_LINK_CLASS(klass) \ 39 (G_TYPE_CHECK_CLASS_TYPE ((klass), NEMO_TYPE_DESKTOP_LINK)) 40 #define NEMO_DESKTOP_LINK_GET_CLASS(obj) \ 41 (G_TYPE_INSTANCE_GET_CLASS ((obj), NEMO_TYPE_DESKTOP_LINK, NemoDesktopLinkClass)) 42 43 typedef struct NemoDesktopLinkDetails NemoDesktopLinkDetails; 44 45 typedef struct { 46 GObject parent_slot; 47 NemoDesktopLinkDetails *details; 48 } NemoDesktopLink; 49 50 typedef struct { 51 GObjectClass parent_slot; 52 } NemoDesktopLinkClass; 53 54 typedef enum { 55 NEMO_DESKTOP_LINK_HOME, 56 NEMO_DESKTOP_LINK_COMPUTER, 57 NEMO_DESKTOP_LINK_TRASH, 58 NEMO_DESKTOP_LINK_MOUNT, 59 NEMO_DESKTOP_LINK_NETWORK 60 } NemoDesktopLinkType; 61 62 GType nemo_desktop_link_get_type (void); 63 64 NemoDesktopLink * nemo_desktop_link_new (NemoDesktopLinkType type); 65 NemoDesktopLink * nemo_desktop_link_new_from_mount (GMount *mount); 66 NemoDesktopLinkType nemo_desktop_link_get_link_type (NemoDesktopLink *link); 67 NemoFile * nemo_desktop_link_get_file (NemoDesktopLink *link); 68 char * nemo_desktop_link_get_file_name (NemoDesktopLink *link); 69 char * nemo_desktop_link_get_display_name (NemoDesktopLink *link); 70 GIcon * nemo_desktop_link_get_icon (NemoDesktopLink *link); 71 GFile * nemo_desktop_link_get_activation_location (NemoDesktopLink *link); 72 char * nemo_desktop_link_get_activation_uri (NemoDesktopLink *link); 73 gboolean nemo_desktop_link_get_date (NemoDesktopLink *link, 74 NemoDateType date_type, 75 time_t *date); 76 GMount * nemo_desktop_link_get_mount (NemoDesktopLink *link); 77 gboolean nemo_desktop_link_can_rename (NemoDesktopLink *link); 78 gboolean nemo_desktop_link_rename (NemoDesktopLink *link, 79 const char *name); 80 81 82 #endif /* NEMO_DESKTOP_LINK_H */ 83