1 /*
2  * Copyright (C) 2002 - 2004 Red Hat, Inc.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __ENTRY_DIRECTORIES_H__
19 #define __ENTRY_DIRECTORIES_H__
20 
21 #include <glib.h>
22 #include "desktop-entries.h"
23 
24 G_BEGIN_DECLS
25 
26 typedef struct EntryDirectory EntryDirectory;
27 
28 typedef void (*EntryDirectoryChangedFunc) (EntryDirectory *ed,
29                                            gpointer        user_data);
30 
31 EntryDirectory *entry_directory_new        (DesktopEntryType  entry_type,
32                                             const char       *path);
33 
34 EntryDirectory *entry_directory_ref   (EntryDirectory *ed);
35 void            entry_directory_unref (EntryDirectory *ed);
36 
37 void entry_directory_get_flat_contents (EntryDirectory   *ed,
38                                         DesktopEntrySet  *desktop_entries,
39                                         DesktopEntrySet  *directory_entries,
40                                         GSList          **subdirs);
41 
42 
43 typedef struct EntryDirectoryList EntryDirectoryList;
44 
45 EntryDirectoryList *entry_directory_list_new   (void);
46 EntryDirectoryList *entry_directory_list_ref   (EntryDirectoryList *list);
47 void                entry_directory_list_unref (EntryDirectoryList *list);
48 
49 int  entry_directory_list_get_length  (EntryDirectoryList *list);
50 gboolean _entry_directory_list_compare (const EntryDirectoryList *a,
51                                         const EntryDirectoryList *b);
52 
53 void entry_directory_list_prepend     (EntryDirectoryList *list,
54                                        EntryDirectory     *ed);
55 void entry_directory_list_append_list (EntryDirectoryList *list,
56                                        EntryDirectoryList *to_append);
57 
58 void entry_directory_list_add_monitors    (EntryDirectoryList        *list,
59                                            EntryDirectoryChangedFunc  callback,
60                                            gpointer                   user_data);
61 void entry_directory_list_remove_monitors (EntryDirectoryList        *list,
62                                            EntryDirectoryChangedFunc  callback,
63                                            gpointer                   user_data);
64 
65 DesktopEntry* entry_directory_list_get_directory (EntryDirectoryList *list,
66                                                   const char         *relative_path);
67 
68 DesktopEntrySet *_entry_directory_list_get_all_desktops (EntryDirectoryList *list);
69 void             _entry_directory_list_empty_desktop_cache (void);
70 
71 G_END_DECLS
72 
73 #endif /* __ENTRY_DIRECTORIES_H__ */
74