/* Copyright (C) 2007 The cluttermm 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 <glibmm/object.h>
#include <cluttermm/types.h>

_DEFS(cluttermm,clutter)
_PINCLUDE(glibmm/private/object_p.h)

namespace Clutter
{

_WRAP_ENUM(TimelineDirection, ClutterTimelineDirection)

class Timeline : public Glib::Object
{
  _CLASS_GOBJECT(Timeline, ClutterTimeline, CLUTTER_TIMELINE, Glib::Object, GObject)

protected:
  _WRAP_METHOD_DOCS_ONLY(clutter_timeline_new)
  explicit Timeline(guint msecs);

public:
  _WRAP_CREATE(guint msecs)
  _WRAP_METHOD(Glib::RefPtr<Timeline> clone() const, clutter_timeline_clone)

  _WRAP_METHOD(void set_duration(guint msecs), clutter_timeline_set_duration)
  _WRAP_METHOD(guint get_duration() const, clutter_timeline_get_duration)
  _WRAP_METHOD(void start(), clutter_timeline_start)
  _WRAP_METHOD(void pause(), clutter_timeline_pause)
  _WRAP_METHOD(void stop(), clutter_timeline_stop)
  _WRAP_METHOD(void rewind(), clutter_timeline_rewind)
  _WRAP_METHOD(void set_loop(bool loop = true), clutter_timeline_set_loop)
  _WRAP_METHOD(bool get_loop() const, clutter_timeline_get_loop)
  _WRAP_METHOD(void skip(guint n_frames), clutter_timeline_skip)
  _WRAP_METHOD(void advance(guint frame_num), clutter_timeline_advance)
  _WRAP_METHOD(guint get_delta() const, clutter_timeline_get_delta)
  _WRAP_METHOD(bool is_playing() const, clutter_timeline_is_playing)
  _WRAP_METHOD(void set_delay(guint msecs), clutter_timeline_set_delay)
  _WRAP_METHOD(guint get_delay() const, clutter_timeline_get_delay)
  _WRAP_METHOD(guint get_elapsed_time() const, clutter_timeline_get_elapsed_time)
  _WRAP_METHOD(double get_progress() const, clutter_timeline_get_progress)
  _WRAP_METHOD(void set_direction(TimelineDirection direction), clutter_timeline_set_direction)
  _WRAP_METHOD(TimelineDirection get_direction() const, clutter_timeline_get_direction)

  _WRAP_METHOD_DOCS_ONLY(clutter_timeline_list_markers)
  std::vector<Glib::ustring> list_markers(int frame_num) const;
  _WRAP_METHOD(void add_marker_at_time(const Glib::ustring& marker_name, guint msecs), clutter_timeline_add_marker_at_time)
  _WRAP_METHOD(bool has_marker(const Glib::ustring& marker_name), clutter_timeline_has_marker)
  _WRAP_METHOD(void remove_marker(const Glib::ustring& marker_name), clutter_timeline_remove_marker)
  _WRAP_METHOD(void advance_to_marker(const Glib::ustring& marker_name), clutter_timeline_advance_to_marker)

  //clutter_timeline_do_tick() is marked as private in the header.
  _IGNORE(clutter_timeline_do_tick)

  _WRAP_PROPERTY("delay", guint)
  _WRAP_PROPERTY("direction", TimelineDirection)
  _WRAP_PROPERTY("duration", guint)
  _WRAP_PROPERTY("loop", bool)

  _WRAP_SIGNAL(void completed(), "completed")
  _WRAP_SIGNAL(void new_frame(int fram_num), "new-frame")
  _WRAP_SIGNAL(void paused(), "paused")
  _WRAP_SIGNAL(void started(), "started")

  // TODO: This signal is detailed, though I don't think we can wrap the
  // detail in Glibmm yet. armin.
#m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING)
  _WRAP_SIGNAL(void marker_reached(const Glib::ustring& marker_name, int frame_num), "marker-reached")

};

} // namespace Clutter
