PageRenderTime 28ms CodeModel.GetById 12ms app.highlight 13ms RepoModel.GetById 2ms app.codeStats 0ms

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

http://macfuse.googlecode.com/
Objective C | 116 lines | 68 code | 30 blank | 18 comment | 5 complexity | 68d95f49175ac6bb505ec67a49aa47c0 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//
 17//  GDataFeedYouTubePlaylist.m
 18//
 19
 20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE
 21
 22#import "GDataFeedYouTubePlaylist.h"
 23#import "GDataYouTubeConstants.h"
 24
 25@implementation GDataFeedYouTubePlaylist
 26
 27+ (GDataFeedYouTubePlaylist *)playlistFeed {
 28  
 29  GDataFeedYouTubePlaylist *feed = [self object];
 30  
 31  [feed setNamespaces:[GDataYouTubeConstants youTubeNamespaces]];
 32  
 33  return feed;
 34}
 35
 36+ (NSString *)standardFeedKind {
 37  return kGDataCategoryYouTubePlaylist;
 38}
 39
 40+ (void)load {
 41  [self registerFeedClass];
 42}
 43
 44- (void)addExtensionDeclarations {
 45
 46  [super addExtensionDeclarations];
 47
 48  Class feedClass = [self class];
 49  [self addExtensionDeclarationForParentClass:feedClass
 50                                 childClasses:
 51   [GDataYouTubePrivate class],
 52   [GDataYouTubePlaylistID class],
 53
 54   // YouTubeMediaGroup encapsulates YouTubeMediaContent
 55   [GDataYouTubeMediaGroup class],
 56   nil];
 57}
 58
 59#if !GDATA_SIMPLE_DESCRIPTIONS
 60- (NSMutableArray *)itemsForDescription {
 61  
 62  NSMutableArray *items = [super itemsForDescription];
 63  
 64  if ([self isPrivate]) [items addObject:@"private"];
 65
 66  [self addToArray:items objectDescriptionIfNonNil:[self mediaGroup] withName:@"mediaGroup"];
 67
 68  return items;
 69}
 70#endif
 71
 72- (Class)classForEntries {
 73  return kUseRegisteredEntryClass;
 74}
 75
 76#pragma mark -
 77
 78- (BOOL)isPrivate {
 79  GDataYouTubePrivate *obj = [self objectForExtensionClass:[GDataYouTubePrivate class]];
 80  return (obj != nil);
 81}
 82
 83- (void)setIsPrivate:(BOOL)flag {
 84  if (flag) {
 85    GDataYouTubePrivate *private = [GDataYouTubePrivate implicitValue];
 86    [self setObject:private forExtensionClass:[GDataYouTubePrivate class]];
 87  } else {
 88    [self setObject:nil forExtensionClass:[GDataYouTubePrivate class]];
 89  }
 90}
 91
 92- (GDataYouTubeMediaGroup *)mediaGroup {
 93  return [self objectForExtensionClass:[GDataYouTubeMediaGroup class]];
 94}
 95
 96- (void)setMediaGroup:(GDataYouTubeMediaGroup *)obj {
 97  [self setObject:obj forExtensionClass:[GDataYouTubeMediaGroup class]];
 98}
 99
100- (NSString *)playlistID {
101  GDataYouTubePlaylistID *obj = [self objectForExtensionClass:[GDataYouTubePlaylistID class]];
102  return [obj stringValue];
103}
104
105- (void)setPlaylistID:(NSString *)str {
106  GDataYouTubePlaylistID *obj = [GDataYouTubePlaylistID valueWithString:str];
107  [self setObject:obj forExtensionClass:[GDataYouTubePlaylistID class]];
108}
109
110+ (NSString *)defaultServiceVersion {
111  return kGDataYouTubeDefaultServiceVersion;
112}
113
114@end
115
116#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE