2006-12-14 Francisco Javier F. Serrador <serrador@openshine.com>
[rhythmbox.git] / shell / rb-shell.h
blobc14529988bfd765594bb0f835a56232e5c0da110
1 /*
2 * arch-tag: Header for main Rhythmbox shell
4 * Copyright (C) 2002 Jorn Baayen
5 * Copyright (C) 2004 Colin Walters <walters@redhat.com>
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, or (at your option)
10 * 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_SHELL_H
24 #define __RB_SHELL_H
26 #include "rb-source.h"
27 #include "rhythmdb.h"
28 #include "rb-song-info.h"
30 G_BEGIN_DECLS
32 #define RB_TYPE_SHELL (rb_shell_get_type ())
33 #define RB_SHELL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), RB_TYPE_SHELL, RBShell))
34 #define RB_SHELL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), RB_TYPE_SHELL, RBShellClass))
35 #define RB_IS_SHELL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), RB_TYPE_SHELL))
36 #define RB_IS_SHELL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), RB_TYPE_SHELL))
37 #define RB_SHELL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), RB_TYPE_SHELL, RBShellClass))
39 enum
41 RB_SHELL_ERROR_NO_SUCH_URI,
42 RB_SHELL_ERROR_NO_SUCH_PROPERTY,
43 RB_SHELL_ERROR_IMMUTABLE_PROPERTY,
44 RB_SHELL_ERROR_INVALID_PROPERTY_TYPE,
45 RB_SHELL_ERROR_NO_SOURCE_FOR_URI
48 #define RB_SHELL_ERROR rb_shell_error_quark ()
50 GQuark rb_shell_error_quark (void);
52 typedef enum
54 RB_SHELL_UI_LOCATION_SIDEBAR,
55 RB_SHELL_UI_LOCATION_MAIN_TOP,
56 RB_SHELL_UI_LOCATION_MAIN_BOTTOM,
57 } RBShellUILocation;
59 GType rb_shell_ui_location_get_type (void);
60 #define RB_TYPE_SHELL_UI_LOCATION (rb_shell_ui_location_get_type())
62 typedef struct RBShellPrivate RBShellPrivate;
64 typedef struct
66 GObject parent;
68 RBShellPrivate *priv;
69 } RBShell;
71 typedef struct
73 GObjectClass parent_class;
75 /* signals */
76 void (*visibility_changed) (RBShell *shell, gboolean visible);
77 void (*create_song_info) (RBShell *shell, RBSongInfo *song_info, gboolean multi);
78 } RBShellClass;
80 GType rb_shell_get_type (void);
82 RBShell * rb_shell_new (int argc, char **argv,
83 gboolean no_registration,
84 gboolean no_update,
85 gboolean dry_run,
86 char *rhythmdb,
87 char *playlists);
89 gboolean rb_shell_present (RBShell *shell, guint32 timestamp, GError **error);
91 RBSource * rb_shell_guess_source_for_uri (RBShell *shell, const char *uri);
93 gboolean rb_shell_add_uri (RBShell *shell,
94 const char *uri,
95 const char *title,
96 const char *genre,
97 GError **error);
99 gboolean rb_shell_load_uri (RBShell *shell, const char *uri, gboolean play, GError **error);
101 GObject * rb_shell_get_player (RBShell *shell);
102 const char * rb_shell_get_player_path(RBShell *shell);
103 GObject * rb_shell_get_playlist_manager (RBShell *shell);
104 const char * rb_shell_get_playlist_manager_path (RBShell *shell);
105 GObject * rb_shell_get_ui_manager (RBShell *shell);
107 void rb_shell_toggle_visibility (RBShell *shell);
109 gboolean rb_shell_get_song_properties (RBShell *shell,
110 const char *uri,
111 GHashTable **properties,
112 GError **error);
114 gboolean rb_shell_set_song_property (RBShell *shell,
115 const char *uri,
116 const char *propname,
117 const GValue *value,
118 GError **error);
120 gboolean rb_shell_add_to_queue (RBShell *shell,
121 const gchar *uri,
122 GError **error);
124 gboolean rb_shell_remove_from_queue (RBShell *shell,
125 const gchar *uri,
126 GError **error);
128 gboolean rb_shell_clear_queue (RBShell *shell,
129 GError **error);
131 gboolean rb_shell_quit (RBShell *shell,
132 GError **error);
134 void rb_shell_hidden_notify (RBShell *shell,
135 guint timeout,
136 const char *primary,
137 GtkWidget *icon,
138 const char *secondary,
139 gboolean requested);
140 void rb_shell_notify_playing_entry (RBShell *shell,
141 RhythmDBEntry *entry,
142 gboolean requested);
143 gboolean rb_shell_do_notify (RBShell *shell,
144 gboolean requested,
145 GError **error);
147 void rb_shell_register_entry_type_for_source (RBShell *shell,
148 RBSource *source,
149 RhythmDBEntryType type);
150 RBSource * rb_shell_get_source_by_entry_type (RBShell *shell,
151 RhythmDBEntryType type);
153 gboolean rb_shell_get_party_mode (RBShell *shell);
155 void rb_shell_append_source (RBShell *shell, RBSource *source, RBSource *parent);
157 void rb_shell_add_widget (RBShell *shell, GtkWidget *widget, RBShellUILocation location);
158 void rb_shell_remove_widget (RBShell *shell, GtkWidget *widget, RBShellUILocation location);
160 G_END_DECLS
162 #endif /* __RB_SHELL_H */