1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
3 * Header for DAAP (iTunes Music Sharing) hashing, connection
5 * Copyright (C) 2004-2005 Charles Schmidt <cschmidt2@emich.edu>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef __RB_DAAP_CONNECTION_H
24 #define __RB_DAAP_CONNECTION_H
27 #include <glib-object.h>
38 #define RB_TYPE_DAAP_CONNECTION (rb_daap_connection_get_type ())
39 #define RB_DAAP_CONNECTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), RB_TYPE_DAAP_CONNECTION, RBDAAPConnection))
40 #define RB_DAAP_CONNECTION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), RB_TYPE_DAAP_CONNECTION, RBDAAPConnectionClass))
41 #define RB_IS_DAAP_CONNECTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), RB_TYPE_DAAP_CONNECTION))
42 #define RB_IS_DAAP_CONNECTION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), RB_TYPE_DAAP_CONNECTION))
43 #define RB_DAAP_CONNECTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), RB_TYPE_DAAP_CONNECTION, RBDAAPConnectionClass))
45 typedef struct RBDAAPConnectionPrivate RBDAAPConnectionPrivate
;
51 DAAP_GET_REVISION_NUMBER
,
55 DAAP_GET_PLAYLIST_ENTRIES
,
58 } RBDAAPConnectionState
;
62 RBDAAPConnectionPrivate
*priv
;
68 void (* connected
) (RBDAAPConnection
*connection
);
69 void (* disconnected
) (RBDAAPConnection
*connection
);
71 char * (* authenticate
) (RBDAAPConnection
*connection
,
73 void (* connecting
) (RBDAAPConnection
*connection
,
74 RBDAAPConnectionState state
,
77 void (* operation_done
) (RBDAAPConnection
*connection
);
79 } RBDAAPConnectionClass
;
81 /* hmm, maybe should give more error information? */
82 typedef gboolean (* RBDAAPConnectionCallback
) (RBDAAPConnection
*connection
,
87 GType
rb_daap_connection_get_type (void);
89 RBDAAPConnection
* rb_daap_connection_new (const char *name
,
92 gboolean password_protected
,
94 RhythmDBEntryType type
);
96 gboolean
rb_daap_connection_is_connected (RBDAAPConnection
*connection
);
97 void rb_daap_connection_connect (RBDAAPConnection
*connection
,
98 RBDAAPConnectionCallback callback
,
100 void rb_daap_connection_disconnect (RBDAAPConnection
*connection
,
101 RBDAAPConnectionCallback callback
,
104 char * rb_daap_connection_get_headers (RBDAAPConnection
*connection
,
108 GSList
* rb_daap_connection_get_playlists (RBDAAPConnection
*connection
);
112 #endif /* __RB_DAAP_CONNECTION_H */