PageRenderTime 26ms CodeModel.GetById 12ms app.highlight 11ms RepoModel.GetById 2ms app.codeStats 0ms

/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//
17//  GDataEntryYouTubePlaylistLink.m
18//
19
20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE
21
22#import "GDataEntryYouTubePlaylistLink.h"
23#import "GDataYouTubeConstants.h"
24#import "GDataYouTubeElements.h"
25
26@implementation GDataEntryYouTubePlaylistLink
27
28+ (GDataEntryYouTubePlaylistLink *)playlistLinkEntry {
29  
30  GDataEntryYouTubePlaylistLink *entry = [self object];
31
32  [entry setNamespaces:[GDataYouTubeConstants youTubeNamespaces]];
33  
34  return entry;
35}
36
37#pragma mark -
38
39+ (NSString *)standardEntryKind {
40  return kGDataCategoryYouTubePlaylistLink;
41}
42
43+ (void)load {
44  [self registerEntryClass];
45}
46
47- (void)addExtensionDeclarations {
48  
49  [super addExtensionDeclarations];
50  
51  Class entryClass = [self class];
52
53  // YouTube element extensions
54  [self addExtensionDeclarationForParentClass:entryClass
55                                   childClass:[GDataYouTubePrivate class]];
56}
57
58#if !GDATA_SIMPLE_DESCRIPTIONS
59- (NSMutableArray *)itemsForDescription {
60  
61  NSMutableArray *items = [super itemsForDescription];
62
63  if ([self isPrivate]) [items addObject:@"private"];
64
65  return items;
66}
67#endif
68
69#pragma mark -
70
71- (BOOL)isPrivate {
72  GDataYouTubePrivate *obj = [self objectForExtensionClass:[GDataYouTubePrivate class]];
73  return (obj != nil);
74}
75
76- (void)setIsPrivate:(BOOL)flag {
77  if (flag) {
78    GDataYouTubePrivate *private = [GDataYouTubePrivate implicitValue];
79    [self setObject:private forExtensionClass:[GDataYouTubePrivate class]];
80  } else {
81    [self setObject:nil forExtensionClass:[GDataYouTubePrivate class]];
82  }
83}
84
85@end
86
87#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE