1 | /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ |
---|
2 | /* e-shell.h |
---|
3 | * |
---|
4 | * Copyright (C) 2000 Ximian, Inc. |
---|
5 | * |
---|
6 | * This program is free software; you can redistribute it and/or |
---|
7 | * modify it under the terms of version 2 of the GNU General Public |
---|
8 | * License as published by the Free Software Foundation. |
---|
9 | * |
---|
10 | * This program is distributed in the hope that it will be useful, |
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
13 | * General Public License for more details. |
---|
14 | * |
---|
15 | * You should have received a copy of the GNU General Public |
---|
16 | * License along with this program; if not, write to the |
---|
17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
18 | * Boston, MA 02111-1307, USA. |
---|
19 | * |
---|
20 | * Author: Ettore Perazzoli |
---|
21 | */ |
---|
22 | |
---|
23 | #ifndef _E_SHELL_H_ |
---|
24 | #define _E_SHELL_H_ |
---|
25 | |
---|
26 | #include <liboaf/liboaf.h> /* For the registration stuff. */ |
---|
27 | #include <bonobo/bonobo-xobject.h> |
---|
28 | #include <bonobo-conf/bonobo-config-database.h> |
---|
29 | |
---|
30 | #ifdef __cplusplus |
---|
31 | extern "C" { |
---|
32 | #pragma } |
---|
33 | #endif /* __cplusplus */ |
---|
34 | |
---|
35 | typedef struct _EShell EShell; |
---|
36 | typedef struct _EShellPrivate EShellPrivate; |
---|
37 | typedef struct _EShellClass EShellClass; |
---|
38 | |
---|
39 | #include "Evolution.h" |
---|
40 | |
---|
41 | #include "e-component-registry.h" |
---|
42 | #include "e-shell-view.h" |
---|
43 | #include "e-uri-schema-registry.h" |
---|
44 | #include "e-shell-user-creatable-items-handler.h" |
---|
45 | #include "e-local-storage.h" |
---|
46 | |
---|
47 | |
---|
48 | #define E_TYPE_SHELL (e_shell_get_type ()) |
---|
49 | #define E_SHELL(obj) (GTK_CHECK_CAST ((obj), E_TYPE_SHELL, EShell)) |
---|
50 | #define E_SHELL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_SHELL, EShellClass)) |
---|
51 | #define E_IS_SHELL(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_SHELL)) |
---|
52 | #define E_IS_SHELL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_SHELL)) |
---|
53 | |
---|
54 | |
---|
55 | enum _EShellLineStatus { |
---|
56 | E_SHELL_LINE_STATUS_ONLINE, |
---|
57 | E_SHELL_LINE_STATUS_GOING_OFFLINE, |
---|
58 | E_SHELL_LINE_STATUS_OFFLINE |
---|
59 | }; |
---|
60 | typedef enum _EShellLineStatus EShellLineStatus; |
---|
61 | |
---|
62 | enum _EShellStartupLineMode { |
---|
63 | E_SHELL_STARTUP_LINE_MODE_CONFIG, |
---|
64 | E_SHELL_STARTUP_LINE_MODE_ONLINE, |
---|
65 | E_SHELL_STARTUP_LINE_MODE_OFFLINE |
---|
66 | }; |
---|
67 | typedef enum _EShellStartupLineMode EShellStartupLineMode; |
---|
68 | |
---|
69 | struct _EShell { |
---|
70 | BonoboXObject parent; |
---|
71 | |
---|
72 | EShellPrivate *priv; |
---|
73 | }; |
---|
74 | |
---|
75 | struct _EShellClass { |
---|
76 | BonoboXObjectClass parent_class; |
---|
77 | |
---|
78 | POA_GNOME_Evolution_Shell__epv epv; |
---|
79 | |
---|
80 | void (* no_views_left) (EShell *shell); |
---|
81 | void (* line_status_changed) (EShell *shell, EShellLineStatus status); |
---|
82 | void (* new_view_created) (EShell *shell, EShellView *view); |
---|
83 | |
---|
84 | }; |
---|
85 | |
---|
86 | |
---|
87 | /* ID for registering the shell in the OAF name service. */ |
---|
88 | #define E_SHELL_OAFIID "OAFIID:GNOME_Evolution_Shell" |
---|
89 | |
---|
90 | enum _EShellConstructResult { |
---|
91 | E_SHELL_CONSTRUCT_RESULT_OK, |
---|
92 | E_SHELL_CONSTRUCT_RESULT_INVALIDARG, |
---|
93 | E_SHELL_CONSTRUCT_RESULT_CANNOTREGISTER, |
---|
94 | E_SHELL_CONSTRUCT_RESULT_NOCONFIGDB, |
---|
95 | E_SHELL_CONSTRUCT_RESULT_GENERICERROR |
---|
96 | }; |
---|
97 | typedef enum _EShellConstructResult EShellConstructResult; |
---|
98 | |
---|
99 | |
---|
100 | #include "e-shortcuts.h" |
---|
101 | |
---|
102 | |
---|
103 | GtkType e_shell_get_type (void); |
---|
104 | EShellConstructResult e_shell_construct (EShell *shell, |
---|
105 | const char *iid, |
---|
106 | const char *local_directory, |
---|
107 | gboolean show_splash, |
---|
108 | EShellStartupLineMode startup_line_mode); |
---|
109 | EShell *e_shell_new (const char *local_directory, |
---|
110 | gboolean show_splash, |
---|
111 | EShellStartupLineMode startup_line_mode, |
---|
112 | EShellConstructResult *construct_result_return); |
---|
113 | |
---|
114 | EShellView *e_shell_create_view (EShell *shell, |
---|
115 | const char *uri, |
---|
116 | EShellView *template_view); |
---|
117 | EShellView *e_shell_create_view_from_uri_and_settings (EShell *shell, |
---|
118 | const char *uri, |
---|
119 | int view_num); |
---|
120 | gboolean e_shell_request_close_view (EShell *shell, |
---|
121 | EShellView *view); |
---|
122 | |
---|
123 | |
---|
124 | const char *e_shell_get_local_directory (EShell *shell); |
---|
125 | EShortcuts *e_shell_get_shortcuts (EShell *shell); |
---|
126 | EStorageSet *e_shell_get_storage_set (EShell *shell); |
---|
127 | ELocalStorage *e_shell_get_local_storage (EShell *shell); |
---|
128 | EFolderTypeRegistry *e_shell_get_folder_type_registry (EShell *shell); |
---|
129 | EUriSchemaRegistry *e_shell_get_uri_schema_registry (EShell *shell); |
---|
130 | |
---|
131 | gboolean e_shell_save_settings (EShell *shell); |
---|
132 | gboolean e_shell_restore_from_settings (EShell *shell, |
---|
133 | gboolean restore_all_views); |
---|
134 | |
---|
135 | void e_shell_destroy_all_views (EShell *shell); |
---|
136 | |
---|
137 | void e_shell_unregister_all (EShell *shell); |
---|
138 | void e_shell_disconnect_db (EShell *shell); |
---|
139 | |
---|
140 | void e_shell_component_maybe_crashed (EShell *shell, |
---|
141 | const char *uri, |
---|
142 | const char *type_name, |
---|
143 | EShellView *shell_view); |
---|
144 | |
---|
145 | EShellLineStatus e_shell_get_line_status (EShell *shell); |
---|
146 | void e_shell_go_offline (EShell *shell, |
---|
147 | EShellView *action_view); |
---|
148 | void e_shell_go_online (EShell *shell, |
---|
149 | EShellView *action_view); |
---|
150 | |
---|
151 | void e_shell_set_interactive (EShell *shell, |
---|
152 | gboolean interactive); |
---|
153 | |
---|
154 | void e_shell_send_receive (EShell *shell); |
---|
155 | void e_shell_show_settings (EShell *shell, |
---|
156 | const char *type, |
---|
157 | EShellView *shell_view); |
---|
158 | |
---|
159 | Bonobo_ConfigDatabase e_shell_get_config_db (EShell *shell); |
---|
160 | EComponentRegistry *e_shell_get_component_registry (EShell *shell); |
---|
161 | EShellUserCreatableItemsHandler *e_shell_get_user_creatable_items_handler (EShell *shell); |
---|
162 | |
---|
163 | gboolean e_shell_prepare_for_quit (EShell *shell); |
---|
164 | |
---|
165 | |
---|
166 | const char *e_shell_construct_result_to_string (EShellConstructResult result); |
---|
167 | |
---|
168 | |
---|
169 | gboolean e_shell_parse_uri (EShell *shell, |
---|
170 | const char *uri, |
---|
171 | char **path_return, |
---|
172 | char **extra_return); |
---|
173 | |
---|
174 | #ifdef __cplusplus |
---|
175 | } |
---|
176 | #endif /* __cplusplus */ |
---|
177 | |
---|
178 | #endif /* _E_SHELL_H_ */ |
---|