2 * This file is a part of MAFW
4 * Copyright (C) 2007, 2008, 2009 Nokia Corporation, all rights reserved.
6 * Contact: Visa Smolander <visa.smolander@nokia.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; version 2.1 of
11 * the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 #ifndef MAFW_PLAYLIST_ITERATOR_H
26 #define MAFW_PLAYLIST_ITERATOR_H
28 #include <glib-object.h>
29 #include <libmafw/mafw.h>
33 typedef struct _MafwPlaylistIteratorPrivate MafwPlaylistIteratorPrivate;
38 MafwPlaylistIteratorPrivate *priv;
39 } MafwPlaylistIterator;
42 GObjectClass g_object_class;
45 void (*playlist_changed)(MafwPlaylistIterator *iterator,
46 gboolean current_item_changed,
47 GQuark domain, gint code, const gchar *message);
48 } MafwPlaylistIteratorClass;
51 MAFW_PLAYLIST_ITERATOR_MOVE_RESULT_OK,
52 MAFW_PLAYLIST_ITERATOR_MOVE_RESULT_LIMIT,
53 MAFW_PLAYLIST_ITERATOR_MOVE_RESULT_INVALID,
54 MAFW_PLAYLIST_ITERATOR_MOVE_RESULT_ERROR,
55 } MafwPlaylistIteratorMovementResult;
57 #define MAFW_TYPE_PLAYLIST_ITERATOR \
58 (mafw_playlist_iterator_get_type())
59 #define MAFW_PLAYLIST_ITERATOR(obj) \
60 (G_TYPE_CHECK_INSTANCE_CAST((obj), MAFW_TYPE_PLAYLIST_ITERATOR, MafwPlaylistIterator))
61 #define MAFW_IS_PLAYLIST_ITERATOR(obj) \
62 (G_TYPE_CHECK_INSTANCE_TYPE((obj), MAFW_TYPE_PLAYLIST_ITERATOR))
63 #define MAFW_PLAYLIST_ITERATOR_CLASS(klass) \
64 (G_TYPE_CHECK_CLASS_CAST((klass), MAFW_TYPE_PLAYLIST_ITERATOR, MafwPlaylistIterator))
65 #define MAFW_PLAYLIST_ITERATOR_GET_CLASS(obj) \
66 (G_TYPE_INSTANCE_GET_CLASS((obj), MAFW_TYPE_PLAYLIST_ITERATOR, \
67 MafwPlaylistIteratorClass))
68 #define MAFW_IS_PLAYLIST_ITERATOR_CLASS(klass) \
69 (G_TYPE_CHECK_CLASS_TYPE((klass), MAFW_TYPE_PLAYLIST_ITERATOR))
73 GType mafw_playlist_iterator_get_type(void);
74 MafwPlaylistIterator *mafw_playlist_iterator_new(void);
75 void mafw_playlist_iterator_initialize(MafwPlaylistIterator *iterator,
76 MafwPlaylist *playlist,
78 void mafw_playlist_iterator_invalidate(MafwPlaylistIterator *iterator);
79 gboolean mafw_playlist_iterator_is_valid(MafwPlaylistIterator *iterator);
80 void mafw_playlist_iterator_reset(MafwPlaylistIterator *iterator, GError **error);
81 void mafw_playlist_iterator_move_to_last(MafwPlaylistIterator *iterator, GError **error);
82 MafwPlaylistIteratorMovementResult mafw_playlist_iterator_move_to_next(MafwPlaylistIterator *iterator,
84 MafwPlaylistIteratorMovementResult mafw_playlist_iterator_move_to_prev(MafwPlaylistIterator *iterator,
86 MafwPlaylistIteratorMovementResult mafw_playlist_iterator_move_to_index(MafwPlaylistIterator *iterator,
89 void mafw_playlist_iterator_update(MafwPlaylistIterator *iterator, GError **error);
90 const gchar *mafw_playlist_iterator_get_current_objectid(MafwPlaylistIterator *iterator);
91 gint mafw_playlist_iterator_get_current_index(MafwPlaylistIterator *iterator);
92 gint mafw_playlist_iterator_get_size(MafwPlaylistIterator *iterator,