PageRenderTime 33ms CodeModel.GetById 20ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://macfuse.googlecode.com/
Objective C | 111 lines | 61 code | 29 blank | 21 comment | 5 complexity | 63813ce79de15c2c225ec4ca2af47eda MD5 | raw file
  1/* Copyright (c) 2009 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//  GDataEntryYouTubeCaptionTrack.m
 18//
 19
 20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE
 21
 22#import "GDataEntryYouTubeCaptionTrack.h"
 23#import "GDataYouTubeConstants.h"
 24#import "GDataYouTubeElements.h"
 25
 26@implementation GDataEntryYouTubeCaptionTrack
 27
 28+ (GDataEntryYouTubeCaptionTrack *)captionTrackEntry {
 29
 30  GDataEntryYouTubeCaptionTrack *entry = [self object];
 31
 32  [entry setNamespaces:[GDataYouTubeConstants youTubeNamespaces]];
 33
 34  return entry;
 35}
 36
 37#pragma mark -
 38
 39+ (NSString *)standardEntryKind {
 40  return kGDataCategoryYouTubeCaptionTrack;
 41}
 42
 43+ (void)load {
 44  [self registerEntryClass];
 45}
 46
 47- (void)addExtensionDeclarations {
 48
 49  [super addExtensionDeclarations];
 50
 51  [self addExtensionDeclarationForParentClass:[self class]
 52                                   childClass:[GDataYouTubeDerived class]];
 53
 54  // the publication state element is an extension to the Atom publishing
 55  // control element
 56  [self addExtensionDeclarationForParentClass:[GDataAtomPubControl class]
 57                                   childClass:[GDataYouTubePublicationState class]];
 58}
 59
 60#if !GDATA_SIMPLE_DESCRIPTIONS
 61- (NSMutableArray *)itemsForDescription {
 62
 63  static struct GDataDescriptionRecord descRecs[] = {
 64    { @"state", @"publicationState", kGDataDescValueLabeled },
 65    { nil, nil, (GDataDescRecTypes)0 }
 66  };
 67
 68  NSMutableArray *items = [super itemsForDescription];
 69  [self addDescriptionRecords:descRecs toItems:items];
 70  return items;
 71}
 72#endif
 73
 74+ (NSString *)defaultServiceVersion {
 75  return kGDataYouTubeDefaultServiceVersion;
 76}
 77
 78#pragma mark -
 79
 80- (GDataYouTubePublicationState *)publicationState {
 81  // publication state is an extension to the entry's atomPubControl
 82  GDataAtomPubControl *atomPubControl = [self atomPubControl];
 83  return [atomPubControl objectForExtensionClass:[GDataYouTubePublicationState class]];
 84}
 85
 86- (void)setGDataYouTubePublicationState:(GDataYouTubePublicationState *)obj {
 87
 88  GDataAtomPubControl *atomPubControl = [self atomPubControl];
 89
 90  if (obj != nil && atomPubControl == nil) {
 91    // to set the publication state, we need to make an atomPubControl element
 92    atomPubControl = [GDataAtomPubControl atomPubControl];
 93  }
 94
 95  [atomPubControl setObject:obj
 96          forExtensionClass:[GDataYouTubePublicationState class]];
 97}
 98
 99- (NSString *)derived {
100  GDataYouTubeDerived *obj = [self objectForExtensionClass:[GDataYouTubeDerived class]];
101  return [obj stringValue];
102}
103
104- (void)setDerived:(NSString *)str {
105  GDataYouTubeDerived *obj = [GDataYouTubeDerived valueWithString:str];
106  [self setObject:obj forExtensionClass:[GDataYouTubeDerived class]];
107}
108
109@end
110
111#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE