|
Packit |
4b6dd7 |
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
|
|
Packit |
4b6dd7 |
/*
|
|
Packit |
4b6dd7 |
* GData Client
|
|
Packit |
4b6dd7 |
* Copyright (C) Philip Withnall 2008-2009, 2015 <philip@tecnocode.co.uk>
|
|
Packit |
4b6dd7 |
*
|
|
Packit |
4b6dd7 |
* GData Client is free software; you can redistribute it and/or
|
|
Packit |
4b6dd7 |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit |
4b6dd7 |
* License as published by the Free Software Foundation; either
|
|
Packit |
4b6dd7 |
* version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
4b6dd7 |
*
|
|
Packit |
4b6dd7 |
* GData Client is distributed in the hope that it will be useful,
|
|
Packit |
4b6dd7 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
4b6dd7 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
4b6dd7 |
* Lesser General Public License for more details.
|
|
Packit |
4b6dd7 |
*
|
|
Packit |
4b6dd7 |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit |
4b6dd7 |
* License along with GData Client. If not, see <http://www.gnu.org/licenses/>.
|
|
Packit |
4b6dd7 |
*/
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
#ifndef GDATA_YOUTUBE_SERVICE_H
|
|
Packit |
4b6dd7 |
#define GDATA_YOUTUBE_SERVICE_H
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
#include <glib.h>
|
|
Packit |
4b6dd7 |
#include <glib-object.h>
|
|
Packit |
4b6dd7 |
#include <libsoup/soup.h>
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
#include <gdata/gdata-service.h>
|
|
Packit |
4b6dd7 |
#include <gdata/gdata-upload-stream.h>
|
|
Packit |
4b6dd7 |
#include <gdata/services/youtube/gdata-youtube-video.h>
|
|
Packit |
4b6dd7 |
#include <gdata/app/gdata-app-categories.h>
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
G_BEGIN_DECLS
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
/**
|
|
Packit |
4b6dd7 |
* GDataYouTubeStandardFeedType:
|
|
Packit |
4b6dd7 |
* @GDATA_YOUTUBE_TOP_RATED_FEED: This feed contains the most highly rated
|
|
Packit |
4b6dd7 |
* YouTube videos. Deprecated: 0.17.0: Google no longer supports this feed
|
|
Packit |
4b6dd7 |
* type, and it will return results equivalent to
|
|
Packit |
4b6dd7 |
* %GDATA_YOUTUBE_MOST_POPULAR_FEED.
|
|
Packit |
4b6dd7 |
* @GDATA_YOUTUBE_TOP_FAVORITES_FEED: This feed contains videos most frequently
|
|
Packit |
4b6dd7 |
* flagged as favorite videos. Deprecated: 0.17.0: Google no longer
|
|
Packit |
4b6dd7 |
* supports this feed type, and it will return results equivalent to
|
|
Packit |
4b6dd7 |
* %GDATA_YOUTUBE_MOST_POPULAR_FEED.
|
|
Packit |
4b6dd7 |
* @GDATA_YOUTUBE_MOST_VIEWED_FEED: This feed contains the most frequently
|
|
Packit |
4b6dd7 |
* watched YouTube videos. Deprecated: 0.17.0: Google no longer supports
|
|
Packit |
4b6dd7 |
* this feed type, and it will return results equivalent to
|
|
Packit |
4b6dd7 |
* %GDATA_YOUTUBE_MOST_POPULAR_FEED.
|
|
Packit |
4b6dd7 |
* @GDATA_YOUTUBE_MOST_POPULAR_FEED: This feed contains the most popular YouTube
|
|
Packit |
4b6dd7 |
* videos, selected using an algorithm that combines many different signals to
|
|
Packit |
4b6dd7 |
* determine overall popularity. As of version 0.17.0, this is the only
|
|
Packit |
4b6dd7 |
* supported feed type.
|
|
Packit |
4b6dd7 |
* @GDATA_YOUTUBE_MOST_RECENT_FEED: This feed contains the videos most recently
|
|
Packit |
4b6dd7 |
* submitted to YouTube. Deprecated: 0.17.0: Google no longer supports
|
|
Packit |
4b6dd7 |
* this feed type, and it will return results equivalent to
|
|
Packit |
4b6dd7 |
* %GDATA_YOUTUBE_MOST_POPULAR_FEED.
|
|
Packit |
4b6dd7 |
* @GDATA_YOUTUBE_MOST_DISCUSSED_FEED: This feed contains the YouTube videos
|
|
Packit |
4b6dd7 |
* that have received the most comments. Deprecated: 0.17.0: Google no
|
|
Packit |
4b6dd7 |
* longer supports this feed type, and it will return results equivalent to
|
|
Packit |
4b6dd7 |
* %GDATA_YOUTUBE_MOST_POPULAR_FEED.
|
|
Packit |
4b6dd7 |
* @GDATA_YOUTUBE_MOST_LINKED_FEED: This feed contains the YouTube videos that
|
|
Packit |
4b6dd7 |
* receive the most links from other websites. Deprecated: 0.17.0: Google
|
|
Packit |
4b6dd7 |
* no longer supports this feed type, and it will return results equivalent to
|
|
Packit |
4b6dd7 |
* %GDATA_YOUTUBE_MOST_POPULAR_FEED.
|
|
Packit |
4b6dd7 |
* @GDATA_YOUTUBE_MOST_RESPONDED_FEED: This feed contains YouTube videos that
|
|
Packit |
4b6dd7 |
* receive the most video responses. Deprecated: 0.17.0: Google no longer
|
|
Packit |
4b6dd7 |
* supports this feed type, and it will return results equivalent to
|
|
Packit |
4b6dd7 |
* %GDATA_YOUTUBE_MOST_POPULAR_FEED.
|
|
Packit |
4b6dd7 |
* @GDATA_YOUTUBE_RECENTLY_FEATURED_FEED: This feed contains videos recently
|
|
Packit |
4b6dd7 |
* featured on the YouTube home page or featured videos tab. Deprecated:
|
|
Packit |
4b6dd7 |
* 0.17.0: Google no longer supports this feed type, and it will return
|
|
Packit |
4b6dd7 |
* results equivalent to %GDATA_YOUTUBE_MOST_POPULAR_FEED.
|
|
Packit |
4b6dd7 |
* @GDATA_YOUTUBE_WATCH_ON_MOBILE_FEED: This feed contains videos suitable for
|
|
Packit |
4b6dd7 |
* playback on mobile devices. Deprecated: 0.17.0: Google no longer
|
|
Packit |
4b6dd7 |
* supports this feed type, and it will return results equivalent to
|
|
Packit |
4b6dd7 |
* %GDATA_YOUTUBE_MOST_POPULAR_FEED.
|
|
Packit |
4b6dd7 |
*
|
|
Packit |
4b6dd7 |
* Standard feed types for standard feed queries with
|
|
Packit |
4b6dd7 |
* gdata_youtube_service_query_standard_feed(). For more information, see the
|
|
Packit |
4b6dd7 |
* <ulink type="http" url="https://developers.google.com/youtube/2.0/developers_guide_protocol_video_feeds#Standard_feeds">online
|
|
Packit |
4b6dd7 |
* documentation</ulink>.
|
|
Packit |
4b6dd7 |
*/
|
|
Packit |
4b6dd7 |
typedef enum {
|
|
Packit |
4b6dd7 |
GDATA_YOUTUBE_TOP_RATED_FEED,
|
|
Packit |
4b6dd7 |
GDATA_YOUTUBE_TOP_FAVORITES_FEED,
|
|
Packit |
4b6dd7 |
GDATA_YOUTUBE_MOST_VIEWED_FEED,
|
|
Packit |
4b6dd7 |
GDATA_YOUTUBE_MOST_POPULAR_FEED,
|
|
Packit |
4b6dd7 |
GDATA_YOUTUBE_MOST_RECENT_FEED,
|
|
Packit |
4b6dd7 |
GDATA_YOUTUBE_MOST_DISCUSSED_FEED,
|
|
Packit |
4b6dd7 |
GDATA_YOUTUBE_MOST_LINKED_FEED,
|
|
Packit |
4b6dd7 |
GDATA_YOUTUBE_MOST_RESPONDED_FEED,
|
|
Packit |
4b6dd7 |
GDATA_YOUTUBE_RECENTLY_FEATURED_FEED,
|
|
Packit |
4b6dd7 |
GDATA_YOUTUBE_WATCH_ON_MOBILE_FEED
|
|
Packit |
4b6dd7 |
} GDataYouTubeStandardFeedType;
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
/**
|
|
Packit |
4b6dd7 |
* GDataYouTubeServiceError:
|
|
Packit |
4b6dd7 |
* @GDATA_YOUTUBE_SERVICE_ERROR_API_QUOTA_EXCEEDED: the API request quota for this developer account has been exceeded
|
|
Packit |
4b6dd7 |
* @GDATA_YOUTUBE_SERVICE_ERROR_ENTRY_QUOTA_EXCEEDED: the entry (e.g. video) quota for this user account has been exceeded
|
|
Packit |
4b6dd7 |
* @GDATA_YOUTUBE_SERVICE_ERROR_CHANNEL_REQUIRED: the currently authenticated user doesn't have a YouTube channel, but the current action requires one;
|
|
Packit |
4b6dd7 |
* if this error is received, inform the user that they need a YouTube channel, and provide a link to
|
|
Packit |
4b6dd7 |
* <ulink type="http" url="https://www.youtube.com/create_channel">https://www.youtube.com/create_channel</ulink>
|
|
Packit |
4b6dd7 |
*
|
|
Packit |
4b6dd7 |
* Error codes for #GDataYouTubeService operations.
|
|
Packit |
4b6dd7 |
*/
|
|
Packit |
4b6dd7 |
typedef enum {
|
|
Packit |
4b6dd7 |
GDATA_YOUTUBE_SERVICE_ERROR_API_QUOTA_EXCEEDED,
|
|
Packit |
4b6dd7 |
GDATA_YOUTUBE_SERVICE_ERROR_ENTRY_QUOTA_EXCEEDED,
|
|
Packit |
4b6dd7 |
GDATA_YOUTUBE_SERVICE_ERROR_CHANNEL_REQUIRED,
|
|
Packit |
4b6dd7 |
} GDataYouTubeServiceError;
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
#define GDATA_TYPE_YOUTUBE_SERVICE (gdata_youtube_service_get_type ())
|
|
Packit |
4b6dd7 |
#define GDATA_YOUTUBE_SERVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_YOUTUBE_SERVICE, GDataYouTubeService))
|
|
Packit |
4b6dd7 |
#define GDATA_YOUTUBE_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_YOUTUBE_SERVICE, GDataYouTubeServiceClass))
|
|
Packit |
4b6dd7 |
#define GDATA_IS_YOUTUBE_SERVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_YOUTUBE_SERVICE))
|
|
Packit |
4b6dd7 |
#define GDATA_IS_YOUTUBE_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_YOUTUBE_SERVICE))
|
|
Packit |
4b6dd7 |
#define GDATA_YOUTUBE_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_YOUTUBE_SERVICE, GDataYouTubeServiceClass))
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
#define GDATA_YOUTUBE_SERVICE_ERROR gdata_youtube_service_error_quark ()
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
typedef struct _GDataYouTubeServicePrivate GDataYouTubeServicePrivate;
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
/**
|
|
Packit |
4b6dd7 |
* GDataYouTubeService:
|
|
Packit |
4b6dd7 |
*
|
|
Packit |
4b6dd7 |
* All the fields in the #GDataYouTubeService structure are private and should never be accessed directly.
|
|
Packit |
4b6dd7 |
*/
|
|
Packit |
4b6dd7 |
typedef struct {
|
|
Packit |
4b6dd7 |
GDataService parent;
|
|
Packit |
4b6dd7 |
GDataYouTubeServicePrivate *priv;
|
|
Packit |
4b6dd7 |
} GDataYouTubeService;
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
/**
|
|
Packit |
4b6dd7 |
* GDataYouTubeServiceClass:
|
|
Packit |
4b6dd7 |
*
|
|
Packit |
4b6dd7 |
* All the fields in the #GDataYouTubeServiceClass structure are private and should never be accessed directly.
|
|
Packit |
4b6dd7 |
*/
|
|
Packit |
4b6dd7 |
typedef struct {
|
|
Packit |
4b6dd7 |
/*< private >*/
|
|
Packit |
4b6dd7 |
GDataServiceClass parent;
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
/*< private >*/
|
|
Packit |
4b6dd7 |
/* Padding for future expansion */
|
|
Packit |
4b6dd7 |
void (*_g_reserved0) (void);
|
|
Packit |
4b6dd7 |
void (*_g_reserved1) (void);
|
|
Packit |
4b6dd7 |
void (*_g_reserved2) (void);
|
|
Packit |
4b6dd7 |
void (*_g_reserved3) (void);
|
|
Packit |
4b6dd7 |
void (*_g_reserved4) (void);
|
|
Packit |
4b6dd7 |
void (*_g_reserved5) (void);
|
|
Packit |
4b6dd7 |
} GDataYouTubeServiceClass;
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
GType gdata_youtube_service_get_type (void) G_GNUC_CONST;
|
|
Packit |
4b6dd7 |
GQuark gdata_youtube_service_error_quark (void) G_GNUC_CONST;
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
GDataYouTubeService *gdata_youtube_service_new (const gchar *developer_key, GDataAuthorizer *authorizer) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
GDataAuthorizationDomain *gdata_youtube_service_get_primary_authorization_domain (void) G_GNUC_CONST;
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
GDataFeed *gdata_youtube_service_query_standard_feed (GDataYouTubeService *self, GDataYouTubeStandardFeedType feed_type, GDataQuery *query,
|
|
Packit |
4b6dd7 |
GCancellable *cancellable,
|
|
Packit |
4b6dd7 |
GDataQueryProgressCallback progress_callback, gpointer progress_user_data,
|
|
Packit |
4b6dd7 |
GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
|
|
Packit |
4b6dd7 |
void gdata_youtube_service_query_standard_feed_async (GDataYouTubeService *self, GDataYouTubeStandardFeedType feed_type, GDataQuery *query,
|
|
Packit |
4b6dd7 |
GCancellable *cancellable,
|
|
Packit |
4b6dd7 |
GDataQueryProgressCallback progress_callback, gpointer progress_user_data,
|
|
Packit |
4b6dd7 |
GDestroyNotify destroy_progress_user_data,
|
|
Packit |
4b6dd7 |
GAsyncReadyCallback callback, gpointer user_data);
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
GDataFeed *gdata_youtube_service_query_videos (GDataYouTubeService *self, GDataQuery *query,
|
|
Packit |
4b6dd7 |
GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data,
|
|
Packit |
4b6dd7 |
GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
|
|
Packit |
4b6dd7 |
void gdata_youtube_service_query_videos_async (GDataYouTubeService *self, GDataQuery *query,
|
|
Packit |
4b6dd7 |
GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data,
|
|
Packit |
4b6dd7 |
GDestroyNotify destroy_progress_user_data,
|
|
Packit |
4b6dd7 |
GAsyncReadyCallback callback, gpointer user_data);
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
GDataFeed *gdata_youtube_service_query_related (GDataYouTubeService *self, GDataYouTubeVideo *video, GDataQuery *query,
|
|
Packit |
4b6dd7 |
GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data,
|
|
Packit |
4b6dd7 |
GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
|
|
Packit |
4b6dd7 |
void gdata_youtube_service_query_related_async (GDataYouTubeService *self, GDataYouTubeVideo *video, GDataQuery *query,
|
|
Packit |
4b6dd7 |
GCancellable *cancellable, GDataQueryProgressCallback progress_callback, gpointer progress_user_data,
|
|
Packit |
4b6dd7 |
GDestroyNotify destroy_progress_user_data,
|
|
Packit |
4b6dd7 |
GAsyncReadyCallback callback, gpointer user_data);
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
GDataUploadStream *gdata_youtube_service_upload_video (GDataYouTubeService *self, GDataYouTubeVideo *video, const gchar *slug,
|
|
Packit |
4b6dd7 |
const gchar *content_type, GCancellable *cancellable,
|
|
Packit |
4b6dd7 |
GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
|
|
Packit |
4b6dd7 |
GDataYouTubeVideo *gdata_youtube_service_finish_video_upload (GDataYouTubeService *self, GDataUploadStream *upload_stream,
|
|
Packit |
4b6dd7 |
GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
const gchar *gdata_youtube_service_get_developer_key (GDataYouTubeService *self) G_GNUC_PURE;
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
GDataAPPCategories *gdata_youtube_service_get_categories (GDataYouTubeService *self, GCancellable *cancellable,
|
|
Packit |
4b6dd7 |
GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
|
|
Packit |
4b6dd7 |
void gdata_youtube_service_get_categories_async (GDataYouTubeService *self, GCancellable *cancellable, GAsyncReadyCallback callback,
|
|
Packit |
4b6dd7 |
gpointer user_data);
|
|
Packit |
4b6dd7 |
GDataAPPCategories *gdata_youtube_service_get_categories_finish (GDataYouTubeService *self, GAsyncResult *async_result,
|
|
Packit |
4b6dd7 |
GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
G_END_DECLS
|
|
Packit |
4b6dd7 |
|
|
Packit |
4b6dd7 |
#endif /* !GDATA_YOUTUBE_SERVICE_H */
|