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
33namespace Gnome
34{
35
36namespace Vfs
37{
38
39typedef 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
66protected:
67 GnomeVFSMimeApplication* gobject_;
68
69private:
70
71
72public:
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
199namespace Glib
200{
201
210Gnome::Vfs::MimeApplication wrap(GnomeVFSMimeApplication* object, bool take_copy = false);
211
212} // namespace Glib
213
214
215#endif /* _LIBGNOMEVFSMM_MIME_APPLICATION_H */
216
Definition: mime-application.h:43
void unset_key(const Glib::ustring &key)
void set_command(const Glib::ustring &value)
MimeApplicationArgumentType get_argument_type() const
Get the argument type for this application.
void launch(const Glib::ListHandle< Glib::ustring > &uris)
ListHandleStrings get_mime_types() const
bool supports_uri_scheme(const Glib::ustring &uri_scheme) const
void add_mime_type(const Glib::ustring &mime_type)
GnomeVFSMimeApplication * gobject_
Definition: mime-application.h:67
bool get_value_bool(const Glib::ustring &key, bool &got_key) const
Glib::ustring get_command() const
Get the command for this application.
void set_open_multiple_files(bool value=true)
MimeApplication(const Glib::ustring &id)
void remove_from_short_list(const Glib::ustring &mime_type)
bool requires_terminal() const
Test to see if this application requires the terminal.
void set_default(const Glib::ustring &mime_type)
void set_argument_type(const MimeApplicationArgumentType &value)
bool get_value_bool(const Glib::ustring &key) const
void set_value(const Glib::ustring &key, const Glib::ustring &value)
ListHandleStrings get_keys() const
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)
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 remove_mime_type(const Glib::ustring &mime_type)
MimeApplication(GnomeVFSMimeApplication *castitem, bool make_a_copy=false)
Glib::ustring get_name() const
Get the name of this application.
void set_value(const Glib::ustring &key, bool value)
const GnomeVFSMimeApplication * gobj() const
Definition: mime-application.h:61
bool supports_mime_type(const Glib::ustring &mime_type) const
Gnome::Vfs::MimeApplication wrap(GnomeVFSMimeApplication *object, bool take_copy=false)
A Glib::wrap() method for this object.
void add_to_short_list(const Glib::ustring &mime_type)
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 launch(const Glib::ListHandle< Glib::ustring > &uris, const Glib::ustring &envp)
GnomeVFSMimeApplication * gobj()
Definition: mime-application.h:60
MimeApplication(const MimeApplication &src)
void set_name(const Glib::ustring &value)
void set_requires_terminal(bool value=true)
void set_id(const Glib::ustring &value)
MimeApplication & operator=(const MimeApplication &src)
Glib::ustring get_id() const
Get the id of this applicaiton.
Glib::ustring get_value(const Glib::ustring &key) const
void save_to_registry()
This will save to the registry the application that will be associated with a defined mime type.
Glib::ListHandle< Glib::ustring > get_supported_uri_schemes() const
Get a list of this application's supported uri schemes.
Definition: exception.h:34
MimeApplicationArgumentType
Definition: enums.h:569
Definition: address.h:120
Glib::ListHandle< Glib::ustring > ListHandleStrings
Definition: mime-application.h:39
Definition: address.h:37