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

http://macfuse.googlecode.com/ · Objective C · 87 lines · 45 code · 24 blank · 18 comment · 5 complexity · bfabbcc2b7b4c5733ded128a1e858877 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. // GDataEntryYouTubePlaylistLink.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE
  19. #import "GDataEntryYouTubePlaylistLink.h"
  20. #import "GDataYouTubeConstants.h"
  21. #import "GDataYouTubeElements.h"
  22. @implementation GDataEntryYouTubePlaylistLink
  23. + (GDataEntryYouTubePlaylistLink *)playlistLinkEntry {
  24. GDataEntryYouTubePlaylistLink *entry = [self object];
  25. [entry setNamespaces:[GDataYouTubeConstants youTubeNamespaces]];
  26. return entry;
  27. }
  28. #pragma mark -
  29. + (NSString *)standardEntryKind {
  30. return kGDataCategoryYouTubePlaylistLink;
  31. }
  32. + (void)load {
  33. [self registerEntryClass];
  34. }
  35. - (void)addExtensionDeclarations {
  36. [super addExtensionDeclarations];
  37. Class entryClass = [self class];
  38. // YouTube element extensions
  39. [self addExtensionDeclarationForParentClass:entryClass
  40. childClass:[GDataYouTubePrivate class]];
  41. }
  42. #if !GDATA_SIMPLE_DESCRIPTIONS
  43. - (NSMutableArray *)itemsForDescription {
  44. NSMutableArray *items = [super itemsForDescription];
  45. if ([self isPrivate]) [items addObject:@"private"];
  46. return items;
  47. }
  48. #endif
  49. #pragma mark -
  50. - (BOOL)isPrivate {
  51. GDataYouTubePrivate *obj = [self objectForExtensionClass:[GDataYouTubePrivate class]];
  52. return (obj != nil);
  53. }
  54. - (void)setIsPrivate:(BOOL)flag {
  55. if (flag) {
  56. GDataYouTubePrivate *private = [GDataYouTubePrivate implicitValue];
  57. [self setObject:private forExtensionClass:[GDataYouTubePrivate class]];
  58. } else {
  59. [self setObject:nil forExtensionClass:[GDataYouTubePrivate class]];
  60. }
  61. }
  62. @end
  63. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE