1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2 /*
3  * nemo-application: main Nemo application class.
4  *
5  * Copyright (C) 2000 Red Hat, Inc.
6  * Copyright (C) 2010 Cosimo Cecchi <cosimoc@gnome.org>
7  *
8  * Nemo is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of the
11  * License, or (at your option) any later version.
12  *
13  * Nemo is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public
19  * License along with this program; if not, write to the
20  * Free Software Foundation, Inc., 51 Franklin Street - Suite 500,
21  * Boston, MA 02110-1335, USA.
22  */
23 
24 #ifndef __NEMO_APPLICATION_H__
25 #define __NEMO_APPLICATION_H__
26 
27 #include <gdk/gdk.h>
28 #include <gio/gio.h>
29 #include <gtk/gtk.h>
30 
31 #include <libnemo-private/nemo-undo-manager.h>
32 
33 #include "nemo-window.h"
34 
35 #define NEMO_TYPE_APPLICATION nemo_application_get_type()
36 #define NEMO_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NEMO_TYPE_APPLICATION, NemoApplication))
37 #define NEMO_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NEMO_TYPE_APPLICATION, NemoApplicationClass))
38 #define NEMO_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NEMO_TYPE_APPLICATION))
39 #define NEMO_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NEMO_TYPE_APPLICATION))
40 #define NEMO_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NEMO_TYPE_APPLICATION, NemoApplicationClass))
41 
42 typedef struct _NemoApplicationPriv NemoApplicationPriv;
43 typedef struct NemoApplicationClass NemoApplicationClass;
44 
45 typedef struct {
46 	GtkApplication parent;
47 
48 	NemoUndoManager *undo_manager;
49 
50 	NemoApplicationPriv *priv;
51 } NemoApplication;
52 
53 struct NemoApplicationClass {
54 	GtkApplicationClass parent_class;
55 
56     void         (* continue_startup) (NemoApplication *application);
57     void         (* continue_quit) (NemoApplication *application);
58 
59     void         (* open_location) (NemoApplication *application,
60                                     GFile *location,
61                                     GFile *selection,
62                                     const char *startup_id,
63                                     const gboolean open_in_tabs);
64 
65     NemoWindow * (* create_window) (NemoApplication *application,
66                                     GdkScreen       *screen);
67 
68     void         (* notify_unmount_done) (NemoApplication *application,
69                                           const gchar *message);
70 
71     void         (* notify_unmount_show) (NemoApplication *application,
72                                           const gchar *message);
73 
74     void         (* close_all_windows)   (NemoApplication *application);
75 
76 };
77 
78 GType nemo_application_get_type (void);
79 NemoApplication *nemo_application_initialize_singleton (GType object_type,
80                                                         const gchar *first_property_name,
81                                                         ...);
82 NemoApplication *nemo_application_get_singleton (void);
83 void nemo_application_quit (NemoApplication *self);
84 NemoWindow *     nemo_application_create_window (NemoApplication *application,
85                                                  GdkScreen           *screen);
86 void nemo_application_open_location (NemoApplication *application,
87                                      GFile *location,
88                                      GFile *selection,
89                                      const char *startup_id,
90                                      const gboolean open_in_tabs);
91 void nemo_application_close_all_windows (NemoApplication *self);
92 
93 void nemo_application_notify_unmount_show (NemoApplication *application,
94                                                const gchar *message);
95 
96 void nemo_application_notify_unmount_done (NemoApplication *application,
97                                                const gchar *message);
98 gboolean nemo_application_check_required_directory (NemoApplication *application,
99                                                     gchar           *path);
100 void nemo_application_check_thumbnail_cache (NemoApplication *application);
101 gboolean nemo_application_get_cache_bad (NemoApplication *application);
102 void nemo_application_clear_cache_flag (NemoApplication *application);
103 void nemo_application_set_cache_flag (NemoApplication *application);
104 void nemo_application_ignore_cache_problem (NemoApplication *application);
105 gboolean nemo_application_get_cache_problem_ignored (NemoApplication *application);
106 gboolean nemo_application_get_show_desktop (NemoApplication *application);
107 
108 #endif /* __NEMO_APPLICATION_H__ */
109