/core/externals/update-engine/externals/gdata-objectivec-client/Source/Media/GDataMediaCredit.m

http://macfuse.googlecode.com/ · Objective C · 79 lines · 41 code · 19 blank · 19 comment · 2 complexity · 3a77b19bfa5a6fa8f647eb3b97e8bdb6 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. // GDataMediaCredit.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_PHOTOS_SERVICE \
  19. || GDATA_INCLUDE_YOUTUBE_SERVICE
  20. #import "GDataMediaCredit.h"
  21. #import "GDataMediaGroup.h"
  22. static NSString* const kSchemeAttr = @"scheme";
  23. static NSString* const kRoleAttr = @"role";
  24. @implementation GDataMediaCredit
  25. // like <media:credit role="producer" scheme="urn:ebu">entity name</media:credit>
  26. // http://search.yahoo.com/mrss
  27. + (NSString *)extensionElementURI { return kGDataNamespaceMedia; }
  28. + (NSString *)extensionElementPrefix { return kGDataNamespaceMediaPrefix; }
  29. + (NSString *)extensionElementLocalName { return @"credit"; }
  30. + (GDataMediaCredit *)mediaCreditWithString:(NSString *)str {
  31. GDataMediaCredit* obj = [self object];
  32. [obj setStringValue:str];
  33. return obj;
  34. }
  35. - (void)addParseDeclarations {
  36. NSArray *attrs = [NSArray arrayWithObjects:
  37. kRoleAttr, kSchemeAttr, nil];
  38. [self addLocalAttributeDeclarations:attrs];
  39. [self addContentValueDeclaration];
  40. }
  41. - (NSString *)role {
  42. return [self stringValueForAttribute:kRoleAttr];
  43. }
  44. - (void)setRole:(NSString *)str {
  45. [self setStringValue:str forAttribute:kRoleAttr];
  46. }
  47. - (NSString *)scheme {
  48. return [self stringValueForAttribute:kSchemeAttr];
  49. }
  50. - (void)setScheme:(NSString *)str {
  51. [self setStringValue:str forAttribute:kSchemeAttr];
  52. }
  53. - (NSString *)stringValue {
  54. return [self contentStringValue];
  55. }
  56. - (void)setStringValue:(NSString *)str {
  57. [self setContentStringValue:str];
  58. }
  59. @end
  60. #endif // #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_*_SERVICE