/* Copyright (C) 2006 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gtkmm/object.h>

_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/object_p.h)

namespace Gtk
{

_WRAP_ENUM(RecentFilterFlags, GtkRecentFilterFlags)


/** TODO: Add documentation when the C docs are online.
 */
class RecentFilter : public Gtk::Object
{
  _CLASS_GTKOBJECT(RecentFilter, GtkRecentFilter, GTK_RECENT_FILTER, Gtk::Object, GtkObject)
public:
  _CTOR_DEFAULT

  _WRAP_METHOD(void set_name(const Glib::ustring& name), gtk_recent_filter_set_name)
  _WRAP_METHOD(Glib::ustring get_name() const, gtk_recent_filter_get_name)

  _WRAP_METHOD(void add_mime_type(const Glib::ustring& mime_type), gtk_recent_filter_add_mime_type)
  _WRAP_METHOD(void add_pattern(const Glib::ustring& pattern), gtk_recent_filter_add_pattern)
  _WRAP_METHOD(void add_pixbuf_formats(), gtk_recent_filter_add_pixbuf_formats)
  _WRAP_METHOD(void add_application(const Glib::ustring& application), gtk_recent_filter_add_application)
  _WRAP_METHOD(void add_group(const Glib::ustring& group), gtk_recent_filter_add_group)
  _WRAP_METHOD(void add_age(int days), gtk_recent_filter_add_age)

  class Info
  {
  public:
    Info();

    ///This bitmask tells us which of the other variables contain useful information.
    RecentFilterFlags contains;

    Glib::ustring uri;
    Glib::ustring display_name;
    Glib::ustring mime_type;
    std::list<Glib::ustring> applications;
    std::list<Glib::ustring> groups;
    int age;
  };

  /// For instance, bool on_custom(const Gtk::RecentFilter::Info& filter_info);
  typedef sigc::slot<bool, const Info&> SlotCustom;
  
  void add_custom(RecentFilterFlags needed, const SlotCustom& slot);
  _IGNORE(gtk_recent_filter_add_custom)

  _WRAP_METHOD(RecentFilterFlags get_needed() const, gtk_recent_filter_get_needed)

  // Method is used by class RecentChooser implementors.
  _IGNORE(gtk_recent_filter_filter)
  //_WRAP_METHOD(bool filter(const GtkRecentFilterInfo* filter_info), gtk_recent_filter_filter)
};

} // namespace Gtk
