libgnomevfsmm  2.26.0
mime-application.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _LIBGNOMEVFSMM_MIME_APPLICATION_H
4 #define _LIBGNOMEVFSMM_MIME_APPLICATION_H
5 
6 
7 #include <glibmm.h>
8 
9 /* Copyright 2003 gnome-vfsmm Development Team
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this library; if not, write to the Free
23  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */
25 
26 #include <libgnomevfs/gnome-vfs-mime-handlers.h>
27 #include <libgnomevfs/gnome-vfs-application-registry.h>
28 
29 #include <libgnomevfsmm/enums.h>
31 
32 
33 namespace Gnome
34 {
35 
36 namespace Vfs
37 {
38 
39 typedef Glib::ListHandle<Glib::ustring> ListHandleStrings;
40 
41 //TODO: What is a MimeApplication? How can I get one. What could I do with one.
43 {
44  public:
45 #ifndef DOXYGEN_SHOULD_SKIP_THIS
46  typedef MimeApplication CppObjectType;
47  typedef GnomeVFSMimeApplication BaseObjectType;
48 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
49 
51 
52  // Use make_a_copy=true when getting it directly from a struct.
53  explicit MimeApplication(GnomeVFSMimeApplication* castitem, bool make_a_copy = false);
54 
57 
59 
60  GnomeVFSMimeApplication* gobj() { return gobject_; }
61  const GnomeVFSMimeApplication* gobj() const { return gobject_; }
62 
64  GnomeVFSMimeApplication* gobj_copy() const;
65 
66 protected:
67  GnomeVFSMimeApplication* gobject_;
68 
69 private:
70 
71 
72 public:
73  MimeApplication(const Glib::ustring& id);
74 
75  MimeApplication(const Glib::ustring& id, const Glib::ustring& name,
76  const Glib::ustring& command, MimeApplicationArgumentType argument_type,
77  ListHandleStrings supported_uri_schemes, bool multiple_files, bool requires_terminal);
78 
79  //Test whether this is a valid instance.
80  operator bool() const;
81 
85  Glib::ustring get_id() const;
86 
90  Glib::ustring get_name() const;
91 
95  Glib::ustring get_command() const;
96 
101 
105  Glib::ListHandle<Glib::ustring> get_supported_uri_schemes() const;
106 
111 
115  bool requires_terminal() const;
116 
117  //TODO: These don't seem to use g_strdup(), but they should.
118  void set_id(const Glib::ustring& value);
119  void set_name(const Glib::ustring& value);
120  void set_command(const Glib::ustring& value);
122  void set_supported_uri_schemes(const Glib::ListHandle<Glib::ustring>& value);
123 
124  void set_open_multiple_files(bool value = true);
125  void set_requires_terminal(bool value = true);
126 
127  /*
128  * Application Registry convenience functions
129  */
130 
136  bool is_user_owned() const;
137 
138  bool exists_in_registry() const;
140 
148 
150 
153 
154  bool supports_mime_type(const Glib::ustring& mime_type) const;
155  bool supports_uri_scheme(const Glib::ustring& uri_scheme) const;
156 
157  Glib::ustring get_value(const Glib::ustring& key) const;
158  bool get_value_bool(const Glib::ustring& key, bool& got_key) const;
159  bool get_value_bool(const Glib::ustring& key) const;
160 
161  void set_value(const Glib::ustring& key, const Glib::ustring& value);
162  void set_value(const Glib::ustring& key, bool value);
163  void unset_key(const Glib::ustring& key);
164 
165  void add_mime_type(const Glib::ustring& mime_type);
166  void remove_mime_type(const Glib::ustring& mime_type);
167 
168  /*
169  * Mime Database convenience functions
170  */
171 
172  #ifdef GLIBMM_EXCEPTIONS_ENABLED
173 
174  void set_default(const Glib::ustring& mime_type) throw(exception);
175  void add_to_short_list(const Glib::ustring& mime_type) throw(exception);
176  void remove_from_short_list(const Glib::ustring& mime_type) throw(exception);
177 
178  void launch(const Glib::ListHandle<Glib::ustring>& uris) throw(exception);
179  void launch(const Glib::ListHandle<Glib::ustring>& uris, const Glib::ustring& envp) throw(exception);
180 
181  #else
182 
183  void set_default(const Glib::ustring& mime_type, std::auto_ptr<Gnome::Vfs::exception>& error);
184  void add_to_short_list(const Glib::ustring& mime_type, std::auto_ptr<Gnome::Vfs::exception>& error);
185  void remove_from_short_list(const Glib::ustring& mime_type, std::auto_ptr<Gnome::Vfs::exception>& error);
186 
187  void launch(const Glib::ListHandle<Glib::ustring>& uris, std::auto_ptr<Gnome::Vfs::exception>& error);
188  void launch(const Glib::ListHandle<Glib::ustring>& uris, const Glib::ustring& envp, std::auto_ptr<Gnome::Vfs::exception>& error);
189 
190  #endif
191 
192 
193 };
194 
195 } // namespace Vfs
196 } // namespace Gnome
197 
198 
199 namespace Glib
200 {
201 
210 Gnome::Vfs::MimeApplication wrap(GnomeVFSMimeApplication* object, bool take_copy = false);
211 
212 } // namespace Glib
213 
214 
215 #endif /* _LIBGNOMEVFSMM_MIME_APPLICATION_H */
216 
Gnome::Vfs::MimeApplication::wrap
Gnome::Vfs::MimeApplication wrap(GnomeVFSMimeApplication *object, bool take_copy=false)
A Glib::wrap() method for this object.
Gnome::Vfs::MimeApplication::add_mime_type
void add_mime_type(const Glib::ustring &mime_type)
Gnome::Vfs::MimeApplication::MimeApplication
MimeApplication(const Glib::ustring &id)
Gnome::Vfs::MimeApplication::gobj
GnomeVFSMimeApplication * gobj()
Definition: mime-application.h:60
Gnome::Vfs::MimeApplication::remove_from_registry
void remove_from_registry()
Gnome::Vfs::MimeApplication::set_id
void set_id(const Glib::ustring &value)
Gnome
Definition: address.h:37
Gnome::Vfs::MimeApplication::unset_key
void unset_key(const Glib::ustring &key)
Gnome::Vfs::MimeApplication::get_value_bool
bool get_value_bool(const Glib::ustring &key, bool &got_key) const
Gnome::Vfs::MimeApplication::get_keys
ListHandleStrings get_keys() const
Gnome::Vfs::MimeApplication::gobj_copy
GnomeVFSMimeApplication * gobj_copy() const
Provides access to the underlying C instance. The caller is responsible for freeing it....
Gnome::Vfs::MimeApplication::MimeApplication
MimeApplication(const MimeApplication &src)
Gnome::Vfs::MimeApplication::get_command
Glib::ustring get_command() const
Get the command for this application.
Gnome::Vfs::MimeApplication::set_name
void set_name(const Glib::ustring &value)
Gnome::Vfs::MimeApplication::set_supported_uri_schemes
void set_supported_uri_schemes(const Glib::ListHandle< Glib::ustring > &value)
Gnome::Vfs::MimeApplication::remove_mime_type
void remove_mime_type(const Glib::ustring &mime_type)
Gnome::Vfs::MimeApplication::set_default
void set_default(const Glib::ustring &mime_type)
Gnome::Vfs::MimeApplication::set_open_multiple_files
void set_open_multiple_files(bool value=true)
Gnome::Vfs::MimeApplication::get_value_bool
bool get_value_bool(const Glib::ustring &key) const
Gnome::Vfs::MimeApplication::get_argument_type
MimeApplicationArgumentType get_argument_type() const
Get the argument type for this application.
Gnome::Vfs::MimeApplication::save_to_registry
void save_to_registry()
This will save to the registry the application that will be associated with a defined mime type.
Gnome::Vfs::MimeApplication::launch
void launch(const Glib::ListHandle< Glib::ustring > &uris)
Gnome::Vfs::MimeApplication::set_command
void set_command(const Glib::ustring &value)
Gnome::Vfs::MimeApplication::can_open_multiple_files
bool can_open_multiple_files() const
Test to see if this application can open multiple files.
Gnome::Vfs::exception
Definition: exception.h:34
Gnome::Vfs::MimeApplication::MimeApplication
MimeApplication()
Gnome::Vfs::MimeApplicationArgumentType
MimeApplicationArgumentType
Definition: enums.h:569
Gnome::Vfs::MimeApplication::get_supported_uri_schemes
Glib::ListHandle< Glib::ustring > get_supported_uri_schemes() const
Get a list of this application's supported uri schemes.
Gnome::Vfs::MimeApplication::~MimeApplication
~MimeApplication()
Gnome::Vfs::MimeApplication::gobj
const GnomeVFSMimeApplication * gobj() const
Definition: mime-application.h:61
Gnome::Vfs::MimeApplication::set_argument_type
void set_argument_type(const MimeApplicationArgumentType &value)
Gnome::Vfs::MimeApplication::get_value
Glib::ustring get_value(const Glib::ustring &key) const
Gnome::Vfs::MimeApplication::MimeApplication
MimeApplication(const Glib::ustring &id, const Glib::ustring &name, const Glib::ustring &command, MimeApplicationArgumentType argument_type, ListHandleStrings supported_uri_schemes, bool multiple_files, bool requires_terminal)
Gnome::Vfs::MimeApplication::get_name
Glib::ustring get_name() const
Get the name of this application.
Gnome::Vfs::MimeApplication::operator=
MimeApplication & operator=(const MimeApplication &src)
Gnome::Vfs::MimeApplication::launch
void launch(const Glib::ListHandle< Glib::ustring > &uris, const Glib::ustring &envp)
Gnome::Vfs::MimeApplication::set_requires_terminal
void set_requires_terminal(bool value=true)
Gnome::Vfs::MimeApplication::supports_uri_scheme
bool supports_uri_scheme(const Glib::ustring &uri_scheme) const
Gnome::Vfs::MimeApplication::get_mime_types
ListHandleStrings get_mime_types() const
Gnome::Vfs::MimeApplication
Definition: mime-application.h:43
Gnome::Vfs::MimeApplication::add_to_short_list
void add_to_short_list(const Glib::ustring &mime_type)
Gnome::Vfs::MimeApplication::is_user_owned
bool is_user_owned() const
Checks whether this application is owned or not.
enums.h
Gnome::Vfs::MimeApplication::requires_terminal
bool requires_terminal() const
Test to see if this application requires the terminal.
Gnome::Vfs::MimeApplication::clear_mime_types
void clear_mime_types()
Gnome::Vfs::MimeApplication::set_value
void set_value(const Glib::ustring &key, bool value)
Gnome::Vfs::MimeApplication::supports_mime_type
bool supports_mime_type(const Glib::ustring &mime_type) const
Gnome::Vfs::MimeApplication::remove_from_short_list
void remove_from_short_list(const Glib::ustring &mime_type)
Gnome::Vfs::MimeApplication::gobject_
GnomeVFSMimeApplication * gobject_
Definition: mime-application.h:67
Gnome::Vfs::MimeApplication::get_id
Glib::ustring get_id() const
Get the id of this applicaiton.
exception.h
Gnome::Vfs::MimeApplication::MimeApplication
MimeApplication(GnomeVFSMimeApplication *castitem, bool make_a_copy=false)
Glib
Definition: address.h:120
Gnome::Vfs::MimeApplication::set_value
void set_value(const Glib::ustring &key, const Glib::ustring &value)
Gnome::Vfs::MimeApplication::exists_in_registry
bool exists_in_registry() const
Gnome::Vfs::ListHandleStrings
Glib::ListHandle< Glib::ustring > ListHandleStrings
Definition: mime-application.h:39