/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Photos/GDataServiceGooglePhotos.h

http://macfuse.googlecode.com/ · C++ Header · 92 lines · 35 code · 15 blank · 42 comment · 1 complexity · 33a3d80cfc823d16cca84ec5e22a6366 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. // GDataServiceGooglePhotos.h
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_PHOTOS_SERVICE
  19. #import "GDataServiceGoogle.h"
  20. #undef _EXTERN
  21. #undef _INITIALIZE_AS
  22. #ifdef GDATASERVICEGOOGLEPHOTOS_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. // feed of all Google Photos photos, useful for queries searching for photos
  30. _EXTERN NSString* const kGDataGooglePhotosAllFeed _INITIALIZE_AS(@"http://photos.googleapis.com/data/feed/api/all");
  31. // values for photoFeedURLForUserID:
  32. _EXTERN NSString* const kGDataGooglePhotosAccessAll _INITIALIZE_AS(@"all");
  33. _EXTERN NSString* const kGDataGooglePhotosAccessPublic _INITIALIZE_AS(@"public");
  34. _EXTERN NSString* const kGDataGooglePhotosAccessProtected _INITIALIZE_AS(@"protected"); // "sign-in required"
  35. _EXTERN NSString* const kGDataGooglePhotosAccessPrivate _INITIALIZE_AS(@"private");
  36. _EXTERN NSString* const kGDataGooglePhotosAccessVisible _INITIALIZE_AS(@"visible");
  37. _EXTERN NSString* const kGDataGooglePhotosKindAlbum _INITIALIZE_AS(@"album");
  38. _EXTERN NSString* const kGDataGooglePhotosKindPhoto _INITIALIZE_AS(@"photo");
  39. _EXTERN NSString* const kGDataGooglePhotosKindComment _INITIALIZE_AS(@"comment");
  40. _EXTERN NSString* const kGDataGooglePhotosKindTag _INITIALIZE_AS(@"tag");
  41. _EXTERN NSString* const kGDataGooglePhotosKindUser _INITIALIZE_AS(@"user");
  42. // inserting a photo into the feed for the default user and default album ID
  43. // will post the photo into the user's "Drop Box" album
  44. _EXTERN NSString* const kGDataGooglePhotosDropBoxUploadURL _INITIALIZE_AS(@"https://photos.googleapis.com/data/upload/resumable/media/create-session/feed/api/user/default/albumid/default");
  45. _EXTERN NSString* const kGDataGooglePhotosDropBoxAlbumID _INITIALIZE_AS(@"default");
  46. @interface GDataServiceGooglePhotos : GDataServiceGoogle
  47. + (NSString *)serviceRootURLString;
  48. // utility for making a feed URL. To set other query parameters, use the
  49. // methods in GDataQueryGooglePhotos instead of this
  50. + (NSURL *)photoFeedURLForUserID:(NSString *)userID
  51. albumID:(NSString *)albumIDorNil
  52. albumName:(NSString *)albumNameOrNil
  53. photoID:(NSString *)photoIDorNil
  54. kind:(NSString *)feedKindOrNil
  55. access:(NSString *)accessOrNil;
  56. // utility for making a feed URL for a user's contacts feed
  57. + (NSURL *)photoContactsFeedURLForUserID:(NSString *)userID;
  58. // clients may use these fetch methods of GDataServiceGoogle
  59. //
  60. // - (GDataServiceTicket *)fetchFeedWithURL:(NSURL *)feedURL delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  61. // - (GDataServiceTicket *)fetchFeedWithQuery:(GDataQuery *)query delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  62. // - (GDataServiceTicket *)fetchEntryWithURL:(NSURL *)entryURL delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  63. // - (GDataServiceTicket *)fetchEntryByInsertingEntry:(GDataEntryBase *)entryToInsert forFeedURL:(NSURL *)feedURL delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  64. // - (GDataServiceTicket *)fetchEntryByUpdatingEntry:(GDataEntryBase *)entryToUpdate delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  65. // - (GDataServiceTicket *)deleteEntry:(GDataEntryBase *)entryToDelete delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  66. // - (GDataServiceTicket *)deleteResourceURL:(NSURL *)resourceEditURL ETag:(NSString *)etag delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  67. // - (GDataServiceTicket *)fetchFeedWithBatchFeed:(GDataFeedBase *)batchFeed forBatchFeedURL:(NSURL *)feedURL delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  68. //
  69. // finishedSelector has a signature like this for feed fetches:
  70. // - (void)serviceTicket:(GDataServiceTicket *)ticket finishedWithFeed:(GDataFeedBase *)feed error:(NSError *)error;
  71. //
  72. // or this for entry fetches:
  73. // - (void)serviceTicket:(GDataServiceTicket *)ticket finishedWithEntry:(GDataEntryBase *)entry error:(NSError *)error;
  74. //
  75. // The class of the returned feed or entry is determined by the URL fetched.
  76. @end
  77. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_PHOTOS_SERVICE