Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members

mime-application.h

Go to the documentation of this file.
00001 // -*- c++ -*- 00002 // Generated by gtkmmproc -- DO NOT MODIFY! 00003 #ifndef _LIBGNOMEVFSMM_MIME_APPLICATION_H 00004 #define _LIBGNOMEVFSMM_MIME_APPLICATION_H 00005 00006 #include <glibmm.h> 00007 00008 /* Copyright 2003 gnome-vfsmm Development Team 00009 * 00010 * This library is free software; you can redistribute it and/or 00011 * modify it under the terms of the GNU Library General Public 00012 * License as published by the Free Software Foundation; either 00013 * version 2 of the License, or (at your option) any later version. 00014 * 00015 * This library is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 * Library General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU Library General Public 00021 * License along with this library; if not, write to the Free 00022 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00023 */ 00024 00025 #include <libgnomevfs/gnome-vfs-mime-handlers.h> 00026 #include <libgnomevfs/gnome-vfs-application-registry.h> 00027 00028 #include <libgnomevfsmm/enums.h> 00029 #include <libgnomevfsmm/exception.h> 00030 00031 00032 namespace Gnome 00033 { 00034 00035 namespace Vfs 00036 { 00037 00038 typedef Glib::ListHandle<Glib::ustring> ListHandleStrings; 00039 00040 //TODO: What is a MimeApplication? How can I get one. What could I do with one. 00041 class MimeApplication 00042 { 00043 public: 00044 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00045 typedef MimeApplication CppObjectType; 00046 typedef GnomeVFSMimeApplication BaseObjectType; 00047 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00048 00049 MimeApplication(); 00050 00051 // Use make_a_copy=true when getting it directly from a struct. 00052 explicit MimeApplication(GnomeVFSMimeApplication* castitem, bool make_a_copy = false); 00053 00054 MimeApplication(const MimeApplication& src); 00055 MimeApplication& operator=(const MimeApplication& src); 00056 00057 ~MimeApplication(); 00058 00059 GnomeVFSMimeApplication* gobj() { return gobject_; } 00060 const GnomeVFSMimeApplication* gobj() const { return gobject_; } 00061 00063 GnomeVFSMimeApplication* gobj_copy() const; 00064 00065 protected: 00066 GnomeVFSMimeApplication* gobject_; 00067 00068 private: 00069 00070 00071 public: 00072 MimeApplication(const Glib::ustring& id); 00073 00074 MimeApplication(const Glib::ustring& id, const Glib::ustring& name, 00075 const Glib::ustring& command, MimeApplicationArgumentType argument_type, 00076 ListHandleStrings supported_uri_schemes, bool multiple_files, bool requires_terminal); 00077 00078 //Test whether this is a valid instance. 00079 operator bool() const; 00080 00084 Glib::ustring get_id() const; 00085 00089 Glib::ustring get_name() const; 00090 00094 Glib::ustring get_command() const; 00095 00099 MimeApplicationArgumentType get_argument_type() const; 00100 00104 Glib::ListHandle<Glib::ustring> get_supported_uri_schemes() const; 00105 00109 bool can_open_multiple_files() const; 00110 00114 bool requires_terminal() const; 00115 00116 //TODO: These don't seem to use g_strdup(), but they should. 00117 void set_id(const Glib::ustring& value); 00118 void set_name(const Glib::ustring& value); 00119 void set_command(const Glib::ustring& value); 00120 void set_argument_type(const MimeApplicationArgumentType& value); 00121 void set_supported_uri_schemes(const Glib::ListHandle<Glib::ustring>& value); 00122 00123 void set_open_multiple_files(bool value = true); 00124 void set_requires_terminal(bool value = true); 00125 00126 /* 00127 * Application Registry convenience functions 00128 */ 00129 00135 bool is_user_owned() const; 00136 00137 bool exists_in_registry() const; 00138 void remove_from_registry(); 00139 00146 void save_to_registry(); 00147 00148 ListHandleStrings get_keys() const; 00149 00150 ListHandleStrings get_mime_types() const; 00151 void clear_mime_types(); 00152 00153 bool supports_mime_type(const Glib::ustring& mime_type) const; 00154 bool supports_uri_scheme(const Glib::ustring& uri_scheme) const; 00155 00156 Glib::ustring get_value(const Glib::ustring& key) const; 00157 bool get_value_bool(const Glib::ustring& key, bool& got_key) const; 00158 bool get_value_bool(const Glib::ustring& key) const; 00159 00160 void set_value(const Glib::ustring& key, const Glib::ustring& value); 00161 void set_value(const Glib::ustring& key, bool value); 00162 void unset_key(const Glib::ustring& key); 00163 00164 void add_mime_type(const Glib::ustring& mime_type); 00165 void remove_mime_type(const Glib::ustring& mime_type); 00166 00167 /* 00168 * Mime Database convenience functions 00169 */ 00170 void set_default(const Glib::ustring& mime_type) throw(exception); 00171 void add_to_short_list(const Glib::ustring& mime_type) throw(exception); 00172 void remove_from_short_list(const Glib::ustring& mime_type) throw(exception); 00173 00174 void launch(const Glib::ListHandle<Glib::ustring>& uris) throw(exception); 00175 void launch(const Glib::ListHandle<Glib::ustring>& uris, const Glib::ustring& envp) throw(exception); 00176 00177 00178 }; 00179 00180 } // namespace Vfs 00181 } // namespace Gnome 00182 00183 00184 namespace Glib 00185 { 00186 00192 Gnome::Vfs::MimeApplication wrap(GnomeVFSMimeApplication* object, bool take_copy = false); 00193 00194 } // namespace Glib 00195 00196 #endif /* _LIBGNOMEVFSMM_MIME_APPLICATION_H */ 00197

Generated on Sun Jun 20 21:46:20 2004 for libgnomevfsmm by doxygen 1.3.7