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 
55  MimeApplication(const MimeApplication& src);
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 
110  bool can_open_multiple_files() const;
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;
139  void remove_from_registry();
140 
147  void save_to_registry();
148 
149  ListHandleStrings get_keys() const;
150 
151  ListHandleStrings get_mime_types() const;
152  void clear_mime_types();
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 
void unset_key(const Glib::ustring &key)
void set_value(const Glib::ustring &key, const Glib::ustring &value)
Definition: mime-application.h:42
Definition: address.h:119
void set_supported_uri_schemes(const Glib::ListHandle< Glib::ustring > &value)
bool can_open_multiple_files() const
Test to see if this application can open multiple files.
void add_mime_type(const Glib::ustring &mime_type)
Definition: address.h:36
Glib::ListHandle< Glib::ustring > ListHandleStrings
Definition: mime-application.h:39
void set_requires_terminal(bool value=true)
ListHandleStrings get_mime_types() const
void set_argument_type(const MimeApplicationArgumentType &value)
Gnome::Vfs::MimeApplication wrap(GnomeVFSMimeApplication *object, bool take_copy=false)
A Glib::wrap() method for this object.
void set_open_multiple_files(bool value=true)
bool supports_mime_type(const Glib::ustring &mime_type) const
Glib::ustring get_value(const Glib::ustring &key) const
bool supports_uri_scheme(const Glib::ustring &uri_scheme) const
bool get_value_bool(const Glib::ustring &key, bool &got_key) const
bool requires_terminal() const
Test to see if this application requires the terminal.
void save_to_registry()
This will save to the registry the application that will be associated with a defined mime type...
MimeApplicationArgumentType get_argument_type() const
Get the argument type for this application.
void set_command(const Glib::ustring &value)
Glib::ListHandle< Glib::ustring > get_supported_uri_schemes() const
Get a list of this application&#39;s supported uri schemes.
ListHandleStrings get_keys() const
MimeApplication & operator=(const MimeApplication &src)
MimeApplicationArgumentType
Definition: enums.h:568
bool exists_in_registry() const
void add_to_short_list(const Glib::ustring &mime_type)
bool is_user_owned() const
Checks whether this application is owned or not.
GnomeVFSMimeApplication * gobj_copy() const
Provides access to the underlying C instance. The caller is responsible for freeing it...
void launch(const Glib::ListHandle< Glib::ustring > &uris)
Glib::ustring get_command() const
Get the command for this application.
Glib::ustring get_name() const
Get the name of this application.
Definition: exception.h:33
void remove_from_short_list(const Glib::ustring &mime_type)
Glib::ustring get_id() const
Get the id of this applicaiton.
void set_name(const Glib::ustring &value)
GnomeVFSMimeApplication * gobject_
Definition: mime-application.h:67
GnomeVFSMimeApplication * gobj()
Definition: mime-application.h:60
const GnomeVFSMimeApplication * gobj() const
Definition: mime-application.h:61
void remove_mime_type(const Glib::ustring &mime_type)
void set_default(const Glib::ustring &mime_type)
void set_id(const Glib::ustring &value)