/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/YouTube/GDataServiceGoogleYouTube.h

http://macfuse.googlecode.com/ · C++ Header · 129 lines · 51 code · 25 blank · 53 comment · 1 complexity · b9d08a7979b4010684d84fb8c12cb6d7 MD5 · raw file

  1. /* Copyright (c) 2008 Google Inc.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. //
  16. // GDataServiceGoogleYouTube.h
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE
  19. #import "GDataServiceGoogle.h"
  20. #undef _EXTERN
  21. #undef _INITIALIZE_AS
  22. #ifdef GDATASERVICEYOUTUBE_DEFINE_GLOBALS
  23. #define _EXTERN
  24. #define _INITIALIZE_AS(x) =x
  25. #else
  26. #define _EXTERN GDATA_EXTERN
  27. #define _INITIALIZE_AS(x)
  28. #endif
  29. // standard feed IDs
  30. _EXTERN NSString* const kGDataYouTubeFeedIDFull _INITIALIZE_AS(nil);
  31. _EXTERN NSString* const kGDataYouTubeFeedIDTopRated _INITIALIZE_AS(@"top_rated");
  32. _EXTERN NSString* const kGDataYouTubeFeedIDTopFavorites _INITIALIZE_AS(@"top_favorites");
  33. _EXTERN NSString* const kGDataYouTubeFeedIDMostViewed _INITIALIZE_AS(@"most_viewed");
  34. _EXTERN NSString* const kGDataYouTubeFeedIDMostPopular _INITIALIZE_AS(@"most_popular");
  35. _EXTERN NSString* const kGDataYouTubeFeedIDMostRecent _INITIALIZE_AS(@"most_recent");
  36. _EXTERN NSString* const kGDataYouTubeFeedIDMostDiscussed _INITIALIZE_AS(@"most_discussed");
  37. // _EXTERN NSString* const kGDataYouTubeFeedIDMostLinked _INITIALIZE_AS(@"most_linked"); deprecated
  38. _EXTERN NSString* const kGDataYouTubeFeedIDMostShared _INITIALIZE_AS(@"most_shared");
  39. _EXTERN NSString* const kGDataYouTubeFeedIDOnTheWeb _INITIALIZE_AS(@"on_the_web");
  40. _EXTERN NSString* const kGDataYouTubeFeedIDMostResponded _INITIALIZE_AS(@"most_responded");
  41. _EXTERN NSString* const kGDataYouTubeFeedIDRecentlyFeatured _INITIALIZE_AS(@"recently_featured");
  42. // _EXTERN NSString* const kGDataYouTubeFeedIDWatchOnMobile _INITIALIZE_AS(@"watch_on_mobile"); deprecated
  43. // user feed IDs
  44. _EXTERN NSString* const kGDataYouTubeUserFeedIDProfile _INITIALIZE_AS(nil);
  45. _EXTERN NSString* const kGDataYouTubeUserFeedIDContacts _INITIALIZE_AS(@"contacts");
  46. _EXTERN NSString* const kGDataYouTubeUserFeedIDFavorites _INITIALIZE_AS(@"favorites");
  47. _EXTERN NSString* const kGDataYouTubeUserFeedIDInbox _INITIALIZE_AS(@"inbox");
  48. _EXTERN NSString* const kGDataYouTubeUserFeedIDPlaylists _INITIALIZE_AS(@"playlists");
  49. _EXTERN NSString* const kGDataYouTubeUserFeedIDSubscriptions _INITIALIZE_AS(@"subscriptions");
  50. _EXTERN NSString* const kGDataYouTubeUserFeedIDUploads _INITIALIZE_AS(@"uploads");
  51. _EXTERN NSString* const kGDataYouTubeUserFeedIDNewSubscriptionVideos _INITIALIZE_AS(@"newsubscriptionvideos");
  52. _EXTERN NSString* const kGDataYouTubeUserFeedIDFriendsActivity _INITIALIZE_AS(@"friendsactivity");
  53. _EXTERN NSString* const kGDataYouTubeUserFeedIDRecommendations _INITIALIZE_AS(@"recommendations");
  54. @class GDataQueryYouTube;
  55. @class GDataEntryYouTubeVideo;
  56. // Note that setUserCredentialsWithUsername:password: may require either the
  57. // Google account e-mail address or the YouTube account name, depending on
  58. // how the account was created.
  59. @interface GDataServiceGoogleYouTube : GDataServiceGoogle {
  60. NSString *developerKey_; // required for uploading
  61. }
  62. + (NSString *)serviceRootURLString;
  63. // Utilities for making feed URLs. To set query parameters, use the
  64. // methods in GDataQueryYouTube.
  65. //
  66. // feedID may be nil (or equivalently kGDataYouTubeFeedIDFull)
  67. //
  68. // userID may be kGDataServiceDefaultUser
  69. + (NSURL *)youTubeURLForFeedID:(NSString *)feedID;
  70. + (NSURL *)youTubeURLForUserID:(NSString *)userID
  71. userFeedID:(NSString *)feedID;
  72. + (NSURL *)youTubeUploadURLForUserID:(NSString *)userID;
  73. + (NSURL *)youTubeActivityFeedURLForUserID:(NSString *)userID;
  74. + (NSURL *)youTubeURLForChannelsFeeds;
  75. + (NSURL *)youTubeURLForChannelStandardFeedID:(NSString *)feedID;
  76. // Note:
  77. //
  78. // A developer key is required for uploading, and for updating or deleting
  79. // videos. Entries in feeds retrieved without a developer key will
  80. // not have edit links.
  81. - (NSString *)youTubeDeveloperKey;
  82. - (void)setYouTubeDeveloperKey:(NSString *)str;
  83. // clients may use these fetch methods of GDataServiceGoogle
  84. //
  85. // - (GDataServiceTicket *)fetchFeedWithURL:(NSURL *)feedURL delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  86. // - (GDataServiceTicket *)fetchFeedWithQuery:(GDataQuery *)query delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  87. // - (GDataServiceTicket *)fetchEntryWithURL:(NSURL *)entryURL delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  88. // - (GDataServiceTicket *)fetchEntryByInsertingEntry:(GDataEntryBase *)entryToInsert forFeedURL:(NSURL *)feedURL delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  89. // - (GDataServiceTicket *)fetchEntryByUpdatingEntry:(GDataEntryBase *)entryToUpdate delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  90. // - (GDataServiceTicket *)deleteEntry:(GDataEntryBase *)entryToDelete delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  91. // - (GDataServiceTicket *)deleteResourceURL:(NSURL *)resourceEditURL ETag:(NSString *)etag delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  92. // - (GDataServiceTicket *)fetchFeedWithBatchFeed:(GDataFeedBase *)batchFeed forBatchFeedURL:(NSURL *)feedURL delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  93. //
  94. // finishedSelector has a signature like this for feed fetches:
  95. // - (void)serviceTicket:(GDataServiceTicket *)ticket finishedWithFeed:(GDataFeedBase *)feed error:(NSError *)error;
  96. //
  97. // or this for entry fetches:
  98. // - (void)serviceTicket:(GDataServiceTicket *)ticket finishedWithEntry:(GDataEntryBase *)entry error:(NSError *)error;
  99. //
  100. // The class of the returned feed or entry is determined by the URL fetched.
  101. + (NSString *)serviceRootURLString;
  102. + (NSString *)serviceUploadRootURLString;
  103. @end
  104. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE