/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Contacts/GDataFeedContact.m

http://macfuse.googlecode.com/ · Objective C · 87 lines · 46 code · 24 blank · 17 comment · 4 complexity · d58103be2106ae321085b90689f18d9e 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. // GDataFeedContact.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CONTACTS_SERVICE
  19. #import "GDataFeedContact.h"
  20. #import "GDataEntryContact.h"
  21. #import "GDataWhere.h"
  22. #import "GDataCategory.h"
  23. #import "GDataContactConstants.h"
  24. @implementation GDataFeedContact
  25. + (NSString *)coreProtocolVersionForServiceVersion:(NSString *)serviceVersion {
  26. return [GDataContactConstants coreProtocolVersionForServiceVersion:serviceVersion];
  27. }
  28. + (NSString *)standardFeedKind {
  29. return kGDataCategoryContact;
  30. }
  31. + (void)load {
  32. [self registerFeedClass];
  33. }
  34. + (GDataFeedContact *)contactFeed {
  35. GDataFeedContact *obj = [self object];
  36. [obj setNamespaces:[GDataContactConstants contactNamespaces]];
  37. return obj;
  38. }
  39. - (void)addExtensionDeclarations {
  40. [super addExtensionDeclarations];
  41. Class feedClass = [self class];
  42. [self addExtensionDeclarationForParentClass:feedClass
  43. childClass:[GDataWhere class]];
  44. }
  45. - (Class)classForEntries {
  46. return [GDataEntryContact class];
  47. }
  48. + (NSString *)defaultServiceVersion {
  49. return kGDataContactDefaultServiceVersion;
  50. }
  51. #pragma mark -
  52. - (NSArray *)entriesWithGroupHref:(NSString *)href {
  53. NSArray *entries = [self entries];
  54. NSMutableArray *array = [NSMutableArray array];
  55. for (GDataEntryContact *entry in entries) {
  56. if ([entry groupMembershipInfoWithHref:href] != nil) {
  57. [array addObject:entry];
  58. }
  59. }
  60. return array;
  61. }
  62. @end
  63. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CONTACTS_SERVICE