1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2
3
* Header for DAAP (iTunes Music Sharing) hashing, connection
4
* Copyright (C) 2004,2005 Charles Schmidt <cschmidt2@emich.edu>
5
* Copyright (C) 2004-2005 Charles Schmidt <cschmidt2@emich.edu>
6
7
* This program is free software; you can redistribute it and/or modify
7
8
* it under the terms of the GNU General Public License as published by
16
17
* You should have received a copy of the GNU General Public License
17
18
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
22
23
#ifndef __RB_DAAP_CONNECTION_H
23
#define __RB_DAAP_CONNECTIONH
24
#define __RB_DAAP_CONNECTION_H
26
27
#include <glib-object.h>
43
43
#define RB_IS_DAAP_CONNECTION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), RB_TYPE_DAAP_CONNECTION))
44
44
#define RB_DAAP_CONNECTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), RB_TYPE_DAAP_CONNECTION, RBDAAPConnectionClass))
46
typedef struct RBDAAPConnectionPrivate RBDAAPConnectionPrivate;
52
DAAP_GET_REVISION_NUMBER,
56
DAAP_GET_PLAYLIST_ENTRIES,
59
} RBDAAPConnectionState;
63
RBDAAPConnectionPrivate *priv;
49
64
} RBDAAPConnection;
52
67
GObjectClass parent;
69
void (* connected) (RBDAAPConnection *connection);
70
void (* disconnected) (RBDAAPConnection *connection);
72
char * (* authenticate) (RBDAAPConnection *connection,
74
void (* connecting) (RBDAAPConnection *connection,
75
RBDAAPConnectionState state,
78
void (* operation_done) (RBDAAPConnection *connection);
53
80
} RBDAAPConnectionClass;
56
83
/* hmm, maybe should give more error information? */
57
typedef gboolean (*RBDAAPConnectionCallback) (RBDAAPConnection *connection,
62
rb_daap_connection_new (const gchar *name,
65
gboolean password_protected,
67
RhythmDBEntryType type,
68
RBDAAPConnectionCallback callback,
71
/* will cause an assertion failure if the login has not completed yet (probably should FIXME) */
73
rb_daap_connection_logout (RBDAAPConnection *connection,
74
RBDAAPConnectionCallback callback,
78
rb_daap_connection_get_headers (RBDAAPConnection *connection,
83
rb_daap_connection_get_playlists (RBDAAPConnection *connection);
86
rb_daap_connection_get_type (void);
84
typedef gboolean (* RBDAAPConnectionCallback) (RBDAAPConnection *connection,
89
GType rb_daap_connection_get_type (void);
91
RBDAAPConnection * rb_daap_connection_new (const char *name,
94
gboolean password_protected,
96
RhythmDBEntryType type);
98
gboolean rb_daap_connection_is_connected (RBDAAPConnection *connection);
99
void rb_daap_connection_connect (RBDAAPConnection *connection,
100
RBDAAPConnectionCallback callback,
102
void rb_daap_connection_disconnect (RBDAAPConnection *connection,
103
RBDAAPConnectionCallback callback,
106
char * rb_daap_connection_get_headers (RBDAAPConnection *connection,
110
GSList * rb_daap_connection_get_playlists (RBDAAPConnection *connection);