00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _LIBGNOMEVFSMM_MIME_HANDLERS_H
00020 #define _LIBGNOMEVFSMM_MIME_HANDLERS_H
00021
00022 #include <glibmm.h>
00023
00024 #include <libgnomevfsmm/enums.h>
00025 #include <libgnomevfsmm/exception.h>
00026 #include <libgnomevfsmm/mime-application.h>
00027 #include <libgnomevfsmm/mime-action.h>
00028
00029
00030
00031
00032
00033 #include <libgnomevfs/gnome-vfs-mime-handlers.h>
00034 #ifdef DISABLE_ORBIT
00035 typedef void Bonobo_ServerInfo;
00036 #endif
00037
00038 namespace Gnome
00039 {
00040
00041 namespace Vfs
00042 {
00043
00044
00045
00046
00047
00048
00049
00050
00051 namespace Mime
00052 {
00053
00054 typedef Glib::ListHandle<Gnome::Vfs::MimeApplication*> ListHandleApps;
00055
00056 typedef Glib::ListHandle<Glib::ustring> ListHandleStrings;
00057
00058
00059
00060
00061
00062
00063
00068 MimeActionType get_default_action_type(const Glib::ustring& mime_type);
00069
00074 MimeApplication get_default_application(const Glib::ustring& mime_type);
00075
00080 GnomeVFSMimeAction* get_default_action(const Glib::ustring& mime_type);
00081
00082
00083
00084
00085
00086
00091 ListHandleApps get_short_list_applications(const Glib::ustring& mime_type);
00092
00093
00098 ListHandleApps get_all_applications(const Glib::ustring& mime_type);
00099
00100
00101
00102
00103
00104
00105
00106
00112 bool id_in_application_list(const Glib::ustring& id, const ListHandleApps& applications);
00113
00114
00119 ListHandleStrings id_list_from_application_list(const ListHandleApps& applications);
00120
00121
00122
00123
00124
00133 Glib::ustring get_icon(const Glib::ustring& mime_type);
00134
00139 Glib::ustring get_description(const Glib::ustring& mime_type);
00140
00146 bool can_be_executable(const Glib::ustring& mime_type);
00147
00152 bool type_is_known(const Glib::ustring& mime_type);
00153
00158 ListHandleStrings get_extensions_list(const Glib::ustring& mime_type);
00159
00165 Glib::ustring get_extensions_string(const Glib::ustring& mime_type, bool pretty = false);
00166
00170 ListHandleStrings get_registered_types();
00171
00172
00173
00174
00175
00181 Glib::ustring get_value(Glib::ustring& mime_type, Glib::ustring& key);
00182
00187 ListHandleStrings get_key_list(Glib::ustring& mime_type);
00188
00189
00190
00191
00192
00193
00198 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00199 void set_default_action_type(const Glib::ustring& mime_type, MimeActionType action_type) throw(exception);
00200 #else
00201 void set_default_action_type(const Glib::ustring& mime_type, MimeActionType action_type, std::auto_ptr<Gnome::Vfs::exception>& error);
00202 #endif //GLIBMM_EXCEPTIONS_ENABLED
00203
00208 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00209 void set_default_application(const Glib::ustring& mime_type, const Glib::ustring& application_id) throw(exception);
00210 #else
00211 void set_default_application(const Glib::ustring& mime_type, const Glib::ustring& application_id, std::auto_ptr<Gnome::Vfs::exception>& error);
00212 #endif //GLIBMM_EXCEPTIONS_ENABLED
00213
00218 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00219 void set_default_component(const Glib::ustring& mime_type, const Glib::ustring& iid) throw(exception);
00220 #else
00221 void set_default_component(const Glib::ustring& mime_type, const Glib::ustring& iid, std::auto_ptr<Gnome::Vfs::exception>& error);
00222 #endif //GLIBMM_EXCEPTIONS_ENABLED
00223
00231 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00232 void set_icon(const Glib::ustring& mime_type, const Glib::ustring& filename) throw(exception);
00233 #else
00234 void set_icon(const Glib::ustring& mime_type, const Glib::ustring& filename, std::auto_ptr<Gnome::Vfs::exception>& error);
00235 #endif //GLIBMM_EXCEPTIONS_ENABLED
00236
00242 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00243 void set_description(const Glib::ustring& mime_type, const Glib::ustring& description) throw(exception);
00244 #else
00245 void set_description(const Glib::ustring& mime_type, const Glib::ustring& description, std::auto_ptr<Gnome::Vfs::exception>& error);
00246 #endif //GLIBMM_EXCEPTIONS_ENABLED
00247
00252 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00253 void set_can_be_executable(const Glib::ustring& mime_type, bool new_value) throw(exception);
00254 #else
00255 void set_can_be_executable(const Glib::ustring& mime_type, bool new_value, std::auto_ptr<Gnome::Vfs::exception>& error);
00256 #endif //GLIBMM_EXCEPTIONS_ENABLED
00257
00263 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00264 void set_short_list_applications(const Glib::ustring& mime_type, ListHandleStrings& application_ids) throw(exception);
00265 #else
00266 void set_short_list_applications(const Glib::ustring& mime_type, ListHandleStrings& application_ids, std::auto_ptr<Gnome::Vfs::exception>& error);
00267 #endif //GLIBMM_EXCEPTIONS_ENABLED
00268
00274 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00275 void set_short_list_components(const Glib::ustring& mime_type, ListHandleStrings& component_iids) throw(exception);
00276 #else
00277 void set_short_list_components(const Glib::ustring& mime_type, ListHandleStrings& component_iids, std::auto_ptr<Gnome::Vfs::exception>& error);
00278 #endif //GLIBMM_EXCEPTIONS_ENABLED
00279
00285 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00286 void add_application_to_short_list(const Glib::ustring& mime_type, Glib::ustring& application_id) throw(exception);
00287 #else
00288 void add_application_to_short_list(const Glib::ustring& mime_type, Glib::ustring& application_id, std::auto_ptr<Gnome::Vfs::exception>& error);
00289 #endif //GLIBMM_EXCEPTIONS_ENABLED
00290
00296 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00297 void remove_application_from_short_list(const Glib::ustring& mime_type, Glib::ustring& application_id) throw(exception);
00298 #else
00299 void remove_application_from_short_list(const Glib::ustring& mime_type, Glib::ustring& application_id, std::auto_ptr<Gnome::Vfs::exception>& error);
00300 #endif //GLIBMM_EXCEPTIONS_ENABLED
00301
00307 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00308 void add_component_to_short_list(const Glib::ustring& mime_type, Glib::ustring& component_iid) throw(exception);
00309 #else
00310 void add_component_to_short_list(const Glib::ustring& mime_type, Glib::ustring& component_iid, std::auto_ptr<Gnome::Vfs::exception>& error);
00311 #endif //GLIBMM_EXCEPTIONS_ENABLED
00312
00318 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00319 void remove_component_from_short_list(const Glib::ustring& mime_type, Glib::ustring& component_iid) throw(exception);
00320 #else
00321 void remove_component_from_short_list(const Glib::ustring& mime_type, Glib::ustring& component_iid, std::auto_ptr<Gnome::Vfs::exception>& error);
00322 #endif //GLIBMM_EXCEPTIONS_ENABLED
00323
00328 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00329 void add_extension(const Glib::ustring& mime_type, Glib::ustring& extension) throw(exception);
00330 #else
00331 void add_extension(const Glib::ustring& mime_type, Glib::ustring& extension, std::auto_ptr<Gnome::Vfs::exception>& error);
00332 #endif //GLIBMM_EXCEPTIONS_ENABLED
00333
00338 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00339 void remove_extension(const Glib::ustring& mime_type, Glib::ustring& extension) throw(exception);
00340 #else
00341 void remove_extension(const Glib::ustring& mime_type, Glib::ustring& extension, std::auto_ptr<Gnome::Vfs::exception>& error);
00342 #endif //GLIBMM_EXCEPTIONS_ENABLED
00343
00349 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00350 void set_extensions_list(const Glib::ustring& mime_type, const Glib::ustring& extensions_list) throw(exception);
00351 #else
00352 void set_extensions_list(const Glib::ustring& mime_type, const Glib::ustring& extensions_list, std::auto_ptr<Gnome::Vfs::exception>& error);
00353 #endif //GLIBMM_EXCEPTIONS_ENABLED
00354
00359 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00360 void extend_all_applications(const Glib::ustring& mime_type, ListHandleStrings& application_ids) throw(exception);
00361 #else
00362 void extend_all_applications(const Glib::ustring& mime_type, ListHandleStrings& application_ids, std::auto_ptr<Gnome::Vfs::exception>& error);
00363 #endif //GLIBMM_EXCEPTIONS_ENABLED
00364
00369 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00370 void remove_from_all_applications(const Glib::ustring& mime_type, ListHandleStrings& application_ids) throw(exception);
00371 #else
00372 void remove_from_all_applications(const Glib::ustring& mime_type, ListHandleStrings& application_ids, std::auto_ptr<Gnome::Vfs::exception>& error);
00373 #endif //GLIBMM_EXCEPTIONS_ENABLED
00374
00379 void registered_mime_type_delete(const Glib::ustring& mime_type);
00380
00386 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00387 void set_registered_type_key(const Glib::ustring& mime_type, const Glib::ustring& key, const Glib::ustring& data) throw(exception);
00388 #else
00389 void set_registered_type_key(const Glib::ustring& mime_type, const Glib::ustring& key, const Glib::ustring& data, std::auto_ptr<Gnome::Vfs::exception>& error);
00390 #endif //GLIBMM_EXCEPTIONS_ENABLED
00391
00398 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00399 void set_value(const Glib::ustring& mime_type, const Glib::ustring& key, const Glib::ustring& value) throw(exception);
00400 #else
00401 void set_value(const Glib::ustring& mime_type, const Glib::ustring& key, const Glib::ustring& value, std::auto_ptr<Gnome::Vfs::exception>& error);
00402 #endif //GLIBMM_EXCEPTIONS_ENABLED
00403
00404
00405
00406
00407
00412 void freeze();
00413
00416 void thaw();
00417
00421 void info_reload();
00422
00425 void reset();
00426
00427 }
00428 }
00429 }
00430
00431 #endif