/core/externals/update-engine/externals/gdata-objectivec-client/Source/ACL/GDataACLRole.m

http://macfuse.googlecode.com/ · Objective C · 63 lines · 29 code · 13 blank · 21 comment · 3 complexity · a675821533b0f9169e55281297045060 MD5 · raw file

  1. /* Copyright (c) 2007-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. // GDataACLRole.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_ACLS \
  19. || GDATA_INCLUDE_CALENDAR_SERVICE || GDATA_INCLUDE_DOCS_SERVICE
  20. #define GDATAACLROLE_DEFINE_GLOBALS 1
  21. #import "GDataACLRole.h"
  22. #import "GDataEntryACL.h" // for namespace
  23. @implementation GDataACLRole
  24. // an element with a value attribute, as in
  25. // <gAcl:role value='owner'></gAcl:role>
  26. //
  27. // http://code.google.com/apis/calendar/reference.html#gacl_reference
  28. + (NSString *)extensionElementURI { return kGDataNamespaceACL; }
  29. + (NSString *)extensionElementPrefix { return kGDataNamespaceACLPrefix; }
  30. + (NSString *)extensionElementLocalName { return @"role"; }
  31. @end
  32. @implementation GDataACLAdditionalRole
  33. + (NSString *)extensionElementURI { return kGDataNamespaceACL; }
  34. + (NSString *)extensionElementPrefix { return kGDataNamespaceACLPrefix; }
  35. + (NSString *)extensionElementLocalName { return @"additionalRole"; }
  36. @end
  37. @implementation GDataACLRoleBase
  38. + (id)roleWithValue:(NSString *)value {
  39. GDataACLRole *obj = [self object];
  40. [obj setStringValue:value];
  41. return obj;
  42. }
  43. - (NSString *)value {
  44. return [self stringValue];
  45. }
  46. - (void)setValue:(NSString *)str {
  47. [self setStringValue:str];
  48. }
  49. @end
  50. #endif // !GDATA_REQUIRE_SERVICE_INCLUDE || GDATA_INCLUDE_*