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

http://macfuse.googlecode.com/ · Objective C · 73 lines · 33 code · 17 blank · 23 comment · 1 complexity · a4c17ca126104c2200931e29a5898e34 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. // GDataGroupMembershipInfo.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CONTACTS_SERVICE
  19. #import "GDataGroupMembershipInfo.h"
  20. #import "GDataContactConstants.h"
  21. static NSString* const kHrefAttr = @"href";
  22. static NSString* const kDeletedAttr = @"deleted";
  23. @implementation GDataGroupMembershipInfo
  24. //
  25. // group membership info
  26. //
  27. // <gContact:groupMembershipInfo href="http://..." />
  28. //
  29. // http://code.google.com/apis/contacts/reference.html#groupMembershipInfo
  30. + (NSString *)extensionElementURI { return kGDataNamespaceContact; }
  31. + (NSString *)extensionElementPrefix { return kGDataNamespaceContactPrefix; }
  32. + (NSString *)extensionElementLocalName { return @"groupMembershipInfo"; }
  33. + (GDataGroupMembershipInfo *)groupMembershipInfoWithHref:(NSString *)str {
  34. GDataGroupMembershipInfo *obj = [self object];
  35. [obj setHref:str];
  36. return obj;
  37. }
  38. - (void)addParseDeclarations {
  39. NSArray *attrs = [NSArray arrayWithObjects:kHrefAttr, kDeletedAttr, nil];
  40. [self addLocalAttributeDeclarations:attrs];
  41. }
  42. #pragma mark -
  43. - (NSString *)href {
  44. return [self stringValueForAttribute:kHrefAttr];
  45. }
  46. - (void)setHref:(NSString *)str {
  47. [self setStringValue:str forAttribute:kHrefAttr];
  48. }
  49. - (BOOL)isDeleted {
  50. return [self boolValueForAttribute:kDeletedAttr defaultValue:NO];
  51. }
  52. - (void)setIsDeleted:(BOOL)flag {
  53. [self setBoolValue:flag defaultValue:NO forAttribute:kDeletedAttr];
  54. }
  55. @end
  56. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CONTACTS_SERVICE