// Generated by gmmproc 2.84.0 -- DO NOT MODIFY! #ifndef _GTKMM_FILTER_H #define _GTKMM_FILTER_H #include #include #include /* Copyright (C) 2020 The gtkmm Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #include #include #ifndef DOXYGEN_SHOULD_SKIP_THIS #endif /* DOXYGEN_SHOULD_SKIP_THIS */ #ifndef DOXYGEN_SHOULD_SKIP_THIS namespace Gtk { class GTKMM_API Filter_Class; } // namespace Gtk #endif //DOXYGEN_SHOULD_SKIP_THIS namespace Gtk { /** Filtering items. * * A %Gtk::Filter object describes the filtering to be performed by a * Gtk::FilterListModel. * * The model will use the filter to determine if it should include items * or not by calling match() for each item and only keeping the * ones that the function returns true for. * * Filters may change what items they match through their lifetime. In that * case, they will emit the signal_changed() signal to notify that previous * filter results are no longer valid and that items should be checked again * via match(). * * GTK provides various pre-made filter implementations for common filtering * operations. These filters often include properties that can be linked to * various widgets to easily allow searches. * * However, in particular for large lists or complex search methods, it is * also possible to subclass %Gtk::Filter and provide one's own filter. * * @see Gtk::FilterListModel * @ingroup ListView * @newin{3,98} */ class GTKMM_API Filter : public Glib::Object { #ifndef DOXYGEN_SHOULD_SKIP_THIS public: using CppObjectType = Filter; using CppClassType = Filter_Class; using BaseObjectType = GtkFilter; using BaseClassType = GtkFilterClass; // noncopyable Filter(const Filter&) = delete; Filter& operator=(const Filter&) = delete; private: friend class Filter_Class; static CppClassType filter_class_; protected: explicit Filter(const Glib::ConstructParams& construct_params); explicit Filter(GtkFilter* castitem); #endif /* DOXYGEN_SHOULD_SKIP_THIS */ public: Filter(Filter&& src) noexcept; Filter& operator=(Filter&& src) noexcept; ~Filter() noexcept override; /** Get the GType for this class, for use with the underlying GObject type system. */ static GType get_type() G_GNUC_CONST; #ifndef DOXYGEN_SHOULD_SKIP_THIS static GType get_base_type() G_GNUC_CONST; #endif ///Provides access to the underlying C GObject. GtkFilter* gobj() { return reinterpret_cast(gobject_); } ///Provides access to the underlying C GObject. const GtkFilter* gobj() const { return reinterpret_cast(gobject_); } ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. GtkFilter* gobj_copy(); private: protected: Filter(); public: /** @addtogroup gtkmmEnums gtkmm Enums and Flags */ /** * @var Match::SOME * The filter matches some items, * Gtk::Filter::match() may return true or false. * * @var Match::NONE * The filter does not match any item, * Gtk::Filter::match() will always return false. * * @var Match::ALL * The filter matches all items, * Gtk::Filter::match() will alays return true. */ /** Describes the known strictness of a filter. * * Note that for filters where the strictness is not known, * `Gtk::Filter::Match::SOME` is always an acceptable value, * even if a filter does match all or no items. * * @ingroup gtkmmEnums */ enum class Match { SOME, NONE, ALL }; /** * @var Change::DIFFERENT * The filter change cannot be * described with any of the other enumeration values. * * @var Change::LESS_STRICT * The filter is less strict than * it was before: All items that it used to return true * still return true, others now may, too. * * @var Change::MORE_STRICT * The filter is more strict than * it was before: All items that it used to return false * still return false, others now may, too. * * @var Change::DIFFERENT_REWATCH * Similar to Gtk::Filter::Change::DIFFERENT, * but signs that item watches should be recreated. This is used by * Gtk::FilterListModel to keep the list up-to-date when items * change. * * @newin{4,20} * * @var Change::LESS_STRICT_REWATCH * Similar to Gtk::Filter::Change::LESS_STRICT, * but signs that item watches should be recreated. This is used by * Gtk::FilterListModel to keep the list up-to-date when items * change. * * @newin{4,20} * * @var Change::MORE_STRICT_REWATCH * Similar to Gtk::Filter::Change::MORE_STRICT, * but signs that item watches should be recreated. This is used by * Gtk::FilterListModel to keep the list up-to-date when items * change. * * @newin{4,20} */ /** Describes changes in a filter in more detail and allows objects * using the filter to optimize refiltering items. * * If you are writing an implementation and are not sure which * value to pass, `Gtk::Filter::Change::DIFFERENT` is always a correct * choice. * * New values may be added in the future. * * @ingroup gtkmmEnums */ enum class Change { DIFFERENT, LESS_STRICT, MORE_STRICT, DIFFERENT_REWATCH, LESS_STRICT_REWATCH, MORE_STRICT_REWATCH }; /** Checks if the given @a item is matched by the filter or not. * * @param item The item to check. * @return True if the filter matches the item. */ bool match(const Glib::RefPtr& item); /** Gets the known strictness of a filter. * * If the strictness is not known, [enum@Gtk.FilterMatch.some] is returned. * * This value may change after emission of the signal_changed() * signal. * * This function is meant purely for optimization purposes. Filters can * choose to omit implementing it, but `Gtk::FilterListModel` uses it. * * @return The strictness of @a self. */ Match get_strictness(); /** * @par Slot Prototype: * void on_my_%changed(Change change) * * Flags: Run Last * * Emitted whenever the filter changed. * * Users of the filter should then check items again via * Gtk::Filter::match(). * * `Gtk::FilterListModel` handles this signal automatically. * * Depending on the @a change parameter, not all items need * to be checked, but only some. Refer to the Gtk::Filter::Change * documentation for details. * * @param change How the filter changed. */ Glib::SignalProxy signal_changed(); protected: // for filter implementations /** Notifies all users of the filter that it has changed. * * This emits the signal_changed() signal. Users * of the filter should then check items again via * match(). * * Depending on the @a change parameter, not all items need to * be changed, but only some. Refer to the Gtk::Filter::Change * documentation for details. * * This function is intended for implementers of `Gtk::Filter` * subclasses and should not be called from other functions. * * @param change How the filter changed. */ void changed(Change change = Change::DIFFERENT); virtual bool match_vfunc(const Glib::RefPtr& item); virtual Match get_strictness_vfunc(); public: public: //C++ methods used to invoke GTK+ virtual functions: protected: //GTK+ Virtual Functions (override these to change behaviour): //Default Signal Handlers:: }; } // namespace Gtk #ifndef DOXYGEN_SHOULD_SKIP_THIS namespace Glib { template <> class GTKMM_API Value : public Glib::Value_Enum { public: static GType value_type() G_GNUC_CONST; }; } // namespace Glib #endif /* DOXYGEN_SHOULD_SKIP_THIS */ #ifndef DOXYGEN_SHOULD_SKIP_THIS namespace Glib { template <> class GTKMM_API Value : public Glib::Value_Enum { public: static GType value_type() G_GNUC_CONST; }; } // namespace Glib #endif /* DOXYGEN_SHOULD_SKIP_THIS */ namespace Glib { /** A Glib::wrap() method for this object. * * @param object The C instance. * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. * @result A C++ instance that wraps this C instance. * * @relates Gtk::Filter */ GTKMM_API Glib::RefPtr wrap(GtkFilter* object, bool take_copy = false); } #endif /* _GTKMM_FILTER_H */