PageRenderTime 5ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/YouTube/GDataYouTubePublicationState.m

http://macfuse.googlecode.com/
Objective C | 92 lines | 44 code | 24 blank | 24 comment | 1 complexity | 3adadf685b9a1b5a099d45b9c206c337 MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, GPL-2.0
  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. // GDataYouTubePublicationState.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE
  19. // yt:state is an extension to GDataAtomPubControl for YouTube video entries,
  20. // as in
  21. //
  22. // <app:control>
  23. // <yt:state name="rejected" reasonCode="32" helpUrl="http://www.youtube.com/">
  24. // incorrect format</yt:state>
  25. // </app:control>
  26. #define GDATAYOUTUBEPUBLICATIONSTATE_DEFINE_GLOBALS 1
  27. #import "GDataYouTubePublicationState.h"
  28. #import "GDataYouTubeConstants.h"
  29. static NSString *const kNameAttr = @"name";
  30. static NSString *const kReasonCodeAttr = @"reasonCode";
  31. static NSString *const kHelpURLAttr = @"helpUrl";
  32. @implementation GDataYouTubePublicationState
  33. + (NSString *)extensionElementURI { return kGDataNamespaceYouTube; }
  34. + (NSString *)extensionElementPrefix { return kGDataNamespaceYouTubePrefix; }
  35. + (NSString *)extensionElementLocalName { return @"state"; }
  36. - (void)addParseDeclarations {
  37. NSArray *attrs = [NSArray arrayWithObjects:
  38. kNameAttr, kReasonCodeAttr, kHelpURLAttr, nil];
  39. [self addLocalAttributeDeclarations:attrs];
  40. [self addContentValueDeclaration];
  41. }
  42. #pragma mark -
  43. - (NSString *)name {
  44. return [self stringValueForAttribute:kNameAttr];
  45. }
  46. - (void)setName:(NSString *)str {
  47. [self setStringValue:str forAttribute:kNameAttr];
  48. }
  49. - (NSString *)reasonCode {
  50. return [self stringValueForAttribute:kReasonCodeAttr];
  51. }
  52. - (void)setReasonCode:(NSString *)str {
  53. [self setStringValue:str forAttribute:kReasonCodeAttr];
  54. }
  55. - (NSString *)helpURLString {
  56. return [self stringValueForAttribute:kHelpURLAttr];
  57. }
  58. - (void)setHelpURLString:(NSString *)str {
  59. [self setStringValue:str forAttribute:kHelpURLAttr];
  60. }
  61. - (NSString *)errorDescription {
  62. return [self contentStringValue];
  63. }
  64. - (void)setErrorDescription:(NSString *)str {
  65. [self setContentStringValue:str];
  66. }
  67. @end
  68. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE