/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Contacts/GDataServiceGoogleContact.h

http://macfuse.googlecode.com/ · C++ Header · 111 lines · 35 code · 21 blank · 55 comment · 1 complexity · 2841a68b8dbbbb7e5c3d8e7aa97983d1 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. // GDataServiceGoogleContact.h
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CONTACTS_SERVICE
  19. #import "GDataServiceGoogle.h"
  20. #undef _EXTERN
  21. #undef _INITIALIZE_AS
  22. #ifdef GDATASERVICEGOOGLECONTACT_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. // GDataXML contacts for the authenticated user
  30. //
  31. // Full feeds include all extendedProperties, which must be preserved
  32. // when updating entries; thin feeds include no extendedProperties.
  33. //
  34. // For a feed that includes only extendedProperties with a specific
  35. // property name, use contactFeedURLForPropertyName:
  36. // or contactGroupFeedURLForPropertyName:
  37. //
  38. // Google Contacts limits contacts to one extended property per property
  39. // name. Requesting a feed for a specific property name avoids the need
  40. // to preserve other applications' property names when updating entries.
  41. // AllContacts includes actual and suggested contacts
  42. // Groups is for group feeds
  43. _EXTERN NSString* const kGDataGoogleContactAllContactsFeedName _INITIALIZE_AS(@"contacts");
  44. _EXTERN NSString* const kGDataGoogleContactGroupsFeedName _INITIALIZE_AS(@"groups");
  45. // Projections - full (include all extended properties) or thin (exclude
  46. // extended properties)
  47. _EXTERN NSString* const kGDataGoogleContactFullProjection _INITIALIZE_AS(@"full");
  48. _EXTERN NSString* const kGDataGoogleContactThinProjection _INITIALIZE_AS(@"thin");
  49. _EXTERN NSString* kGDataGoogleContactDefaultThinFeed _INITIALIZE_AS(@"https://www.google.com/m8/feeds/contacts/default/thin");
  50. _EXTERN NSString* kGDataGoogleContactDefaultFullFeed _INITIALIZE_AS(@"https://www.google.com/m8/feeds/contacts/default/full");
  51. _EXTERN NSString* kGDataGoogleContactGroupDefaultThinFeed _INITIALIZE_AS(@"https://www.google.com/m8/feeds/groups/default/thin");
  52. _EXTERN NSString* kGDataGoogleContactGroupDefaultFullFeed _INITIALIZE_AS(@"https://www.google.com/m8/feeds/groups/default/full");
  53. @interface GDataServiceGoogleContact : GDataServiceGoogle
  54. + (NSURL *)contactURLForFeedName:(NSString *)feedName
  55. userID:(NSString *)userID
  56. projection:(NSString *)projection;
  57. // convenience URL generators for contacts feed
  58. //
  59. // Use kGDataServiceDefaultUser as the username to specify the authenticated
  60. // user
  61. + (NSURL *)contactFeedURLForUserID:(NSString *)userID;
  62. + (NSURL *)groupFeedURLForUserID:(NSString *)userID;
  63. + (NSURL *)contactFeedURLForUserID:(NSString *)userID
  64. projection:(NSString *)projection;
  65. + (NSURL *)contactFeedURLForPropertyName:(NSString *)property;
  66. + (NSURL *)contactGroupFeedURLForPropertyName:(NSString *)property;
  67. - (GDataServiceTicket *)fetchContactFeedForUsername:(NSString *)username
  68. delegate:(id)delegate
  69. didFinishSelector:(SEL)finishedSelector;
  70. // clients may use these fetch methods of GDataServiceGoogle
  71. //
  72. // - (GDataServiceTicket *)fetchFeedWithURL:(NSURL *)feedURL delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  73. // - (GDataServiceTicket *)fetchFeedWithQuery:(GDataQuery *)query delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  74. // - (GDataServiceTicket *)fetchEntryWithURL:(NSURL *)entryURL delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  75. // - (GDataServiceTicket *)fetchEntryByInsertingEntry:(GDataEntryBase *)entryToInsert forFeedURL:(NSURL *)feedURL delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  76. // - (GDataServiceTicket *)fetchEntryByUpdatingEntry:(GDataEntryBase *)entryToUpdate delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  77. // - (GDataServiceTicket *)deleteEntry:(GDataEntryBase *)entryToDelete delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  78. // - (GDataServiceTicket *)deleteResourceURL:(NSURL *)resourceEditURL ETag:(NSString *)etag delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  79. // - (GDataServiceTicket *)fetchFeedWithBatchFeed:(GDataFeedBase *)batchFeed forBatchFeedURL:(NSURL *)feedURL delegate:(id)delegate didFinishSelector:(SEL)finishedSelector;
  80. //
  81. // finishedSelector has a signature like this for feed fetches:
  82. // - (void)serviceTicket:(GDataServiceTicket *)ticket finishedWithFeed:(GDataFeedBase *)feed error:(NSError *)error;
  83. //
  84. // or this for entry fetches:
  85. // - (void)serviceTicket:(GDataServiceTicket *)ticket finishedWithEntry:(GDataEntryBase *)entry error:(NSError *)error;
  86. //
  87. // The class of the returned feed or entry is determined by the URL fetched.
  88. + (NSString *)serviceRootURLString;
  89. @end
  90. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CONTACTS_SERVICE