summaryrefslogtreecommitdiff
path: root/libgnome-desktop/libgnomeui/gnome-ditem-edit.h
blob: de47b7c7bb24b582937a3f134da6a8ab3d28590b (plain)
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*  -*- Mode: C; c-set-style: linux; indent-tabs-mode: nil; c-basic-offset: 8 -*-

   Copyright (C) 1999 Free Software Foundation
   All rights reserved.
    
   The Gnome Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public License as
   published by the Free Software Foundation; either version 2 of the
   License, or (at your option) any later version.

   The Gnome Library 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
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with the Gnome Library; see the file COPYING.LIB.  If not,
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.

   GnomeDItemEdit Developers: Havoc Pennington, based on code by John Ellis
*/
/*
  @NOTATION@
*/

/******************** NOTE: this is an object, not a widget.
 ********************       You must supply a GtkNotebook.
 The reason for this is that you might want this in a property box, 
 or in your own notebook. Look at the test program at the bottom 
 of gnome-dentry-edit.c for a usage example.
 */

#ifndef GNOME_DITEM_EDIT_H
#define GNOME_DITEM_EDIT_H

#ifndef GNOME_DISABLE_DEPRECATED

#include <gtk/gtk.h>
#include <libgnome/gnome-desktop-item.h>

G_BEGIN_DECLS

typedef struct _GnomeDItemEdit        GnomeDItemEdit;
typedef struct _GnomeDItemEditPrivate GnomeDItemEditPrivate;
typedef struct _GnomeDItemEditClass   GnomeDItemEditClass;

#define GNOME_TYPE_DITEM_EDIT            (gnome_ditem_edit_get_type ())
#define GNOME_DITEM_EDIT(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_DITEM_EDIT, GnomeDItemEdit))
#define GNOME_DITEM_EDIT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_TYPE_DITEM_EDIT, GnomeDItemEditClass))
#define GNOME_IS_DITEM_EDIT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_TYPE_DITEM_EDIT))
#define GNOME_IS_DITEM_EDIT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_DITEM_EDIT))
#define GNOME_DITEM_EDIT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_TYPE_DITEM_EDIT, GnomeDItemEditClass))

struct _GnomeDItemEdit {
        GtkNotebook __parent__;
  
	/*< private >*/
	GnomeDItemEditPrivate *_priv;
};

struct _GnomeDItemEditClass {
        GtkNotebookClass __parent__;

        /* Any information changed */
        void (* changed)         (GnomeDItemEdit * gee);
        /* These more specific signals are provided since they 
           will likely require a display update */
        /* The icon in particular has changed. */
        void (* icon_changed)    (GnomeDItemEdit * gee);
        /* The name of the item has changed. */
        void (* name_changed)    (GnomeDItemEdit * gee);
};

GType             gnome_ditem_edit_get_type     (void) G_GNUC_CONST;

/*create a new ditem and get the children using the below functions 
  or use the utility new_notebook below*/
GtkWidget *       gnome_ditem_edit_new          (void);

void              gnome_ditem_edit_clear        (GnomeDItemEdit   *dee);

/* Make the display reflect ditem at path */
gboolean          gnome_ditem_edit_load_uri     (GnomeDItemEdit   *dee,
						 const gchar      *uri,
						 GError          **error);

/* Copy the contents of this ditem into the display */
void              gnome_ditem_edit_set_ditem    (GnomeDItemEdit   *dee,
                                                 const GnomeDesktopItem *ditem);

/* Get a pointer (not a copy) to the ditem based on the contents
 * of the display */
GnomeDesktopItem *gnome_ditem_edit_get_ditem    (GnomeDItemEdit   *dee);

/* Return an allocated string, you need to g_free it. */
gchar *           gnome_ditem_edit_get_icon     (GnomeDItemEdit   *dee);
gchar *           gnome_ditem_edit_get_name     (GnomeDItemEdit   *dee);

/* set the string type of the entry */
void              gnome_ditem_edit_set_entry_type (GnomeDItemEdit *dee,
						   const char     *type);

/* force directory only */
void              gnome_ditem_edit_set_directory_only (GnomeDItemEdit *dee,
						       gboolean        directory_only);

/* eeeeeeeeek!, evil api */
void              gnome_ditem_edit_grab_focus   (GnomeDItemEdit   *dee);

void              gnome_ditem_edit_set_editable (GnomeDItemEdit   *dee,
						 gboolean          editable);

G_END_DECLS
   
#endif /* GNOME_DISABLE_DEPRECATED */

#endif /* GNOME_DITEM_EDIT_H */