1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <gtkmm/filechooser.h>
4 #include <gtkmm/private/filechooser_p.h>
9 /* Copyright 2003 The gtkmm Development Team
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
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 * Library General Public License for more details.
21 * You should have received a copy of the GNU Library 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.
26 #include <gtk/gtkfilechooser.h>
27 //#include <gtk/gtkfilesystem.h> //We include this semi-private header just to get GTK_FILE_SYSTEM_ERROR.
33 const Glib::SignalProxyInfo FileChooser_signal_current_folder_changed_info =
35 "current_folder_changed",
36 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
37 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
41 const Glib::SignalProxyInfo FileChooser_signal_selection_changed_info =
44 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
45 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
49 const Glib::SignalProxyInfo FileChooser_signal_update_preview_info =
52 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
53 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
57 const Glib::SignalProxyInfo FileChooser_signal_file_activated_info =
60 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
61 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
64 } // anonymous namespace
67 GType Glib::Value<Gtk::FileChooserAction>::value_type()
69 return gtk_file_chooser_action_get_type();
73 Gtk::FileChooserError::FileChooserError(Gtk::FileChooserError::Code error_code, const Glib::ustring& error_message)
75 Glib::Error (GTK_FILE_CHOOSER_ERROR, error_code, error_message)
78 Gtk::FileChooserError::FileChooserError(GError* gobject)
83 Gtk::FileChooserError::Code Gtk::FileChooserError::code() const
85 return static_cast<Code>(Glib::Error::code());
88 void Gtk::FileChooserError::throw_func(GError* gobject)
90 throw Gtk::FileChooserError(gobject);
94 GType Glib::Value<Gtk::FileChooserError::Code>::value_type()
96 return gtk_file_chooser_error_get_type();
103 Glib::RefPtr<Gtk::FileChooser> wrap(GtkFileChooser* object, bool take_copy)
105 return Glib::RefPtr<Gtk::FileChooser>( dynamic_cast<Gtk::FileChooser*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
106 //We use dynamic_cast<> in case of multiple inheritance.
116 /* The *_Class implementation: */
118 const Glib::Interface_Class& FileChooser_Class::init()
120 if(!gtype_) // create the GType if necessary
122 // Glib::Interface_Class has to know the interface init function
123 // in order to add interfaces to implementing types.
124 class_init_func_ = &FileChooser_Class::iface_init_function;
126 // We can not derive from another interface, and it is not necessary anyway.
127 gtype_ = gtk_file_chooser_get_type();
133 void FileChooser_Class::iface_init_function(void* g_iface, void*)
135 BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);
137 //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
138 //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
139 g_assert(klass != 0);
144 Glib::ObjectBase* FileChooser_Class::wrap_new(GObject* object)
146 return new FileChooser((GtkFileChooser*)(object));
150 /* The implementation: */
152 FileChooser::FileChooser()
154 Glib::Interface(filechooser_class_.init())
157 FileChooser::FileChooser(GtkFileChooser* castitem)
159 Glib::Interface((GObject*)(castitem))
162 FileChooser::~FileChooser()
166 void FileChooser::add_interface(GType gtype_implementer)
168 filechooser_class_.init().add_interface(gtype_implementer);
171 FileChooser::CppClassType FileChooser::filechooser_class_; // initialize static member
173 GType FileChooser::get_type()
175 return filechooser_class_.init().get_type();
178 GType FileChooser::get_base_type()
180 return gtk_file_chooser_get_type();
184 void FileChooser::set_action(FileChooserAction action)
186 gtk_file_chooser_set_action(gobj(), ((GtkFileChooserAction)(action)));
189 FileChooserAction FileChooser::get_action() const
191 return ((FileChooserAction)(gtk_file_chooser_get_action(const_cast<GtkFileChooser*>(gobj()))));
194 void FileChooser::set_local_only(bool local_only)
196 gtk_file_chooser_set_local_only(gobj(), static_cast<int>(local_only));
199 bool FileChooser::get_local_only() const
201 return gtk_file_chooser_get_local_only(const_cast<GtkFileChooser*>(gobj()));
204 void FileChooser::set_select_multiple(bool select_multiple)
206 gtk_file_chooser_set_select_multiple(gobj(), static_cast<int>(select_multiple));
209 bool FileChooser::get_select_multiple() const
211 return gtk_file_chooser_get_select_multiple(const_cast<GtkFileChooser*>(gobj()));
214 void FileChooser::set_show_hidden(bool show_hidden)
216 gtk_file_chooser_set_show_hidden(gobj(), static_cast<int>(show_hidden));
219 bool FileChooser::get_show_hidden() const
221 return gtk_file_chooser_get_show_hidden(const_cast<GtkFileChooser*>(gobj()));
224 void FileChooser::set_current_name(const Glib::ustring& name)
226 gtk_file_chooser_set_current_name(gobj(), name.c_str());
229 Glib::ustring FileChooser::get_filename() const
231 return Glib::convert_return_gchar_ptr_to_ustring(gtk_file_chooser_get_filename(const_cast<GtkFileChooser*>(gobj())));
234 bool FileChooser::set_filename(const Glib::ustring& filename)
236 return gtk_file_chooser_set_filename(gobj(), filename.c_str());
239 bool FileChooser::select_filename(const Glib::ustring& filename)
241 return gtk_file_chooser_select_filename(gobj(), filename.c_str());
244 void FileChooser::unselect_filename(const Glib::ustring& filename)
246 gtk_file_chooser_unselect_filename(gobj(), filename.c_str());
249 void FileChooser::select_all()
251 gtk_file_chooser_select_all(gobj());
254 void FileChooser::unselect_all()
256 gtk_file_chooser_unselect_all(gobj());
259 Glib::SListHandle<Glib::ustring> FileChooser::get_filenames() const
261 return Glib::SListHandle<Glib::ustring>(gtk_file_chooser_get_filenames(const_cast<GtkFileChooser*>(gobj())), Glib::OWNERSHIP_DEEP);
264 bool FileChooser::set_current_folder(const Glib::ustring& filename)
266 return gtk_file_chooser_set_current_folder(gobj(), filename.c_str());
269 Glib::ustring FileChooser::get_current_folder() const
271 return Glib::convert_return_gchar_ptr_to_ustring(gtk_file_chooser_get_current_folder(const_cast<GtkFileChooser*>(gobj())));
274 Glib::ustring FileChooser::get_uri() const
276 return Glib::convert_return_gchar_ptr_to_ustring(gtk_file_chooser_get_uri(const_cast<GtkFileChooser*>(gobj())));
279 bool FileChooser::set_uri(const Glib::ustring& uri)
281 return gtk_file_chooser_set_uri(gobj(), uri.c_str());
284 bool FileChooser::select_uri(const Glib::ustring& uri)
286 return gtk_file_chooser_select_uri(gobj(), uri.c_str());
289 void FileChooser::unselect_uri(const Glib::ustring& uri)
291 gtk_file_chooser_unselect_uri(gobj(), uri.c_str());
294 Glib::SListHandle<Glib::ustring> FileChooser::get_uris() const
296 return Glib::SListHandle<Glib::ustring>(gtk_file_chooser_get_uris(const_cast<GtkFileChooser*>(gobj())), Glib::OWNERSHIP_DEEP);
299 bool FileChooser::set_current_folder_uri(const Glib::ustring& uri)
301 return gtk_file_chooser_set_current_folder_uri(gobj(), uri.c_str());
304 Glib::ustring FileChooser::get_current_folder_uri() const
306 return Glib::convert_return_gchar_ptr_to_ustring(gtk_file_chooser_get_current_folder_uri(const_cast<GtkFileChooser*>(gobj())));
309 void FileChooser::set_preview_widget(Gtk::Widget& preview_widget)
311 gtk_file_chooser_set_preview_widget(gobj(), (preview_widget).gobj());
314 const Gtk::Widget* FileChooser::get_preview_widget() const
316 return Glib::wrap(gtk_file_chooser_get_preview_widget(const_cast<GtkFileChooser*>(gobj())));
319 Gtk::Widget* FileChooser::get_preview_widget()
321 return Glib::wrap(gtk_file_chooser_get_preview_widget(gobj()));
324 void FileChooser::set_preview_widget_active(bool active)
326 gtk_file_chooser_set_preview_widget_active(gobj(), static_cast<int>(active));
329 bool FileChooser::get_preview_widget_active() const
331 return gtk_file_chooser_get_preview_widget_active(const_cast<GtkFileChooser*>(gobj()));
334 void FileChooser::set_use_preview_label(bool use_label)
336 gtk_file_chooser_set_use_preview_label(gobj(), static_cast<int>(use_label));
339 bool FileChooser::get_use_preview_label() const
341 return gtk_file_chooser_get_use_preview_label(const_cast<GtkFileChooser*>(gobj()));
344 Glib::ustring FileChooser::get_preview_filename() const
346 return Glib::convert_return_gchar_ptr_to_ustring(gtk_file_chooser_get_preview_filename(const_cast<GtkFileChooser*>(gobj())));
349 Glib::ustring FileChooser::get_preview_uri() const
351 return Glib::convert_return_gchar_ptr_to_ustring(gtk_file_chooser_get_preview_uri(const_cast<GtkFileChooser*>(gobj())));
354 void FileChooser::set_extra_widget(Gtk::Widget& extra_widget)
356 gtk_file_chooser_set_extra_widget(gobj(), (extra_widget).gobj());
359 Gtk::Widget* FileChooser::get_extra_widget()
361 return Glib::wrap(gtk_file_chooser_get_extra_widget(gobj()));
364 const Gtk::Widget* FileChooser::get_extra_widget() const
366 return Glib::wrap(gtk_file_chooser_get_extra_widget(const_cast<GtkFileChooser*>(gobj())));
369 void FileChooser::add_filter(const FileFilter& filter)
371 gtk_file_chooser_add_filter(gobj(), const_cast<GtkFileFilter*>((filter).gobj()));
374 void FileChooser::remove_filter(const FileFilter& filter)
376 gtk_file_chooser_remove_filter(gobj(), const_cast<GtkFileFilter*>((filter).gobj()));
379 Glib::SListHandle< FileFilter* > FileChooser::list_filters()
381 return Glib::SListHandle< FileFilter* >(gtk_file_chooser_list_filters(gobj()), Glib::OWNERSHIP_SHALLOW);
384 Glib::SListHandle< const FileFilter* > FileChooser::list_filters() const
386 return Glib::SListHandle< const FileFilter* >(gtk_file_chooser_list_filters(const_cast<GtkFileChooser*>(gobj())), Glib::OWNERSHIP_SHALLOW);
389 void FileChooser::set_filter(const FileFilter& filter)
391 gtk_file_chooser_set_filter(gobj(), const_cast<GtkFileFilter*>((filter).gobj()));
394 FileFilter* FileChooser::get_filter()
397 FileFilter* retvalue = Glib::wrap(gtk_file_chooser_get_filter(gobj()));
400 retvalue->reference(); //The function does not do a ref for us.
404 const FileFilter* FileChooser::get_filter() const
407 const FileFilter* retvalue = Glib::wrap(gtk_file_chooser_get_filter(const_cast<GtkFileChooser*>(gobj())));
410 retvalue->reference(); //The function does not do a ref for us.
414 bool FileChooser::add_shortcut_folder(const Glib::ustring& folder)
417 bool retvalue = gtk_file_chooser_add_shortcut_folder(gobj(), folder.c_str(), &(error));
418 if(error) ::Glib::Error::throw_exception(error);
422 bool FileChooser::remove_shortcut_folder(const Glib::ustring& folder)
425 bool retvalue = gtk_file_chooser_remove_shortcut_folder(gobj(), folder.c_str(), &(error));
426 if(error) ::Glib::Error::throw_exception(error);
430 Glib::SListHandle<Glib::ustring> FileChooser::list_shortcut_folders() const
432 return Glib::SListHandle<Glib::ustring>(gtk_file_chooser_list_shortcut_folders(const_cast<GtkFileChooser*>(gobj())), Glib::OWNERSHIP_DEEP);
435 bool FileChooser::add_shortcut_folder_uri(const Glib::ustring& uri)
438 bool retvalue = gtk_file_chooser_add_shortcut_folder_uri(gobj(), uri.c_str(), &(error));
439 if(error) ::Glib::Error::throw_exception(error);
443 bool FileChooser::remove_shortcut_folder_uri(const Glib::ustring& uri)
446 bool retvalue = gtk_file_chooser_remove_shortcut_folder_uri(gobj(), uri.c_str(), &(error));
447 if(error) ::Glib::Error::throw_exception(error);
451 Glib::SListHandle<Glib::ustring> FileChooser::list_shortcut_folder_uris() const
453 return Glib::SListHandle<Glib::ustring>(gtk_file_chooser_list_shortcut_folder_uris(const_cast<GtkFileChooser*>(gobj())), Glib::OWNERSHIP_DEEP);
457 Glib::SignalProxy0< void > FileChooser::signal_current_folder_changed()
459 return Glib::SignalProxy0< void >(this, &FileChooser_signal_current_folder_changed_info);
462 Glib::SignalProxy0< void > FileChooser::signal_selection_changed()
464 return Glib::SignalProxy0< void >(this, &FileChooser_signal_selection_changed_info);
467 Glib::SignalProxy0< void > FileChooser::signal_update_preview()
469 return Glib::SignalProxy0< void >(this, &FileChooser_signal_update_preview_info);
472 Glib::SignalProxy0< void > FileChooser::signal_file_activated()
474 return Glib::SignalProxy0< void >(this, &FileChooser_signal_file_activated_info);
478 Glib::PropertyProxy<FileChooserAction> FileChooser::property_action()
480 return Glib::PropertyProxy<FileChooserAction>(this, "action");
483 Glib::PropertyProxy_ReadOnly<FileChooserAction> FileChooser::property_action() const
485 return Glib::PropertyProxy_ReadOnly<FileChooserAction>(this, "action");
488 Glib::PropertyProxy<FileFilter*> FileChooser::property_filter()
490 return Glib::PropertyProxy<FileFilter*>(this, "filter");
493 Glib::PropertyProxy_ReadOnly<FileFilter*> FileChooser::property_filter() const
495 return Glib::PropertyProxy_ReadOnly<FileFilter*>(this, "filter");
498 Glib::PropertyProxy<bool> FileChooser::property_folder_mode()
500 return Glib::PropertyProxy<bool>(this, "folder-mode");
503 Glib::PropertyProxy_ReadOnly<bool> FileChooser::property_folder_mode() const
505 return Glib::PropertyProxy_ReadOnly<bool>(this, "folder-mode");
508 Glib::PropertyProxy<bool> FileChooser::property_local_only()
510 return Glib::PropertyProxy<bool>(this, "local-only");
513 Glib::PropertyProxy_ReadOnly<bool> FileChooser::property_local_only() const
515 return Glib::PropertyProxy_ReadOnly<bool>(this, "local-only");
518 Glib::PropertyProxy<Widget*> FileChooser::property_preview_widget()
520 return Glib::PropertyProxy<Widget*>(this, "preview-widget");
523 Glib::PropertyProxy_ReadOnly<Widget*> FileChooser::property_preview_widget() const
525 return Glib::PropertyProxy_ReadOnly<Widget*>(this, "preview-widget");
528 Glib::PropertyProxy<bool> FileChooser::property_preview_widget_active()
530 return Glib::PropertyProxy<bool>(this, "preview-widget-active");
533 Glib::PropertyProxy_ReadOnly<bool> FileChooser::property_preview_widget_active() const
535 return Glib::PropertyProxy_ReadOnly<bool>(this, "preview-widget-active");
538 Glib::PropertyProxy<bool> FileChooser::property_use_preview_label()
540 return Glib::PropertyProxy<bool>(this, "use-preview-label");
543 Glib::PropertyProxy_ReadOnly<bool> FileChooser::property_use_preview_label() const
545 return Glib::PropertyProxy_ReadOnly<bool>(this, "use-preview-label");
548 Glib::PropertyProxy<Widget*> FileChooser::property_extra_widget()
550 return Glib::PropertyProxy<Widget*>(this, "extra-widget");
553 Glib::PropertyProxy_ReadOnly<Widget*> FileChooser::property_extra_widget() const
555 return Glib::PropertyProxy_ReadOnly<Widget*>(this, "extra-widget");
558 Glib::PropertyProxy<bool> FileChooser::property_select_multiple()
560 return Glib::PropertyProxy<bool>(this, "select-multiple");
563 Glib::PropertyProxy_ReadOnly<bool> FileChooser::property_select_multiple() const
565 return Glib::PropertyProxy_ReadOnly<bool>(this, "select-multiple");
568 Glib::PropertyProxy<bool> FileChooser::property_show_hidden()
570 return Glib::PropertyProxy<bool>(this, "show-hidden");
573 Glib::PropertyProxy_ReadOnly<bool> FileChooser::property_show_hidden() const
575 return Glib::PropertyProxy_ReadOnly<bool>(this, "show-hidden");