/* gstreamermm - a C++ wrapper for gstreamer
 *
 * Copyright 2008 The gstreamermm 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, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gst/gstelement.h>
#include <gstreamermm/pluginfeature.h>

_DEFS(gstreamermm,gst)

namespace Gst
{

class Index;

/** Gst::IndexFactory - Create Indexes from a factory.
 * Gst::IndexFactory is used to dynamically create Gst::Index implementations.
 */
class IndexFactory : public PluginFeature
{
  _CLASS_GOBJECT(IndexFactory, GstIndexFactory, GST_INDEX_FACTORY, PluginFeature, GstPluginFeature)
  _CUSTOM_DTOR

protected:
  _WRAP_CTOR(IndexFactory(const Glib::ustring& name, const Glib::ustring& longdesc, GType type), gst_index_factory_new)

public:
  /** Create a new index factory with the given parameters
   *
   * @param name Name of the index factory to create.
   * @param longdesc Long description of the index factory to create.
   * @param type The GType of the Gst::Index element of this factory.
   * @return A new Gst::IndexFactory.
   */
  _WRAP_CREATE(const Glib::ustring& name, const Glib::ustring& longdesc, GType type)

  _WRAP_METHOD(static Glib::RefPtr<Gst::IndexFactory> find(const Glib::ustring& name), gst_index_factory_find)
  _WRAP_METHOD(Glib::RefPtr<Gst::Index> create_index(), gst_index_factory_create)
  _WRAP_METHOD(static Glib::RefPtr<Gst::Index> create_index(const Glib::ustring& factory_name), gst_index_factory_make)

  //Destruction occurs in destructor.
  _IGNORE(gst_index_factory_destroy)
};

} // namespace Gst
