PageRenderTime 31ms CodeModel.GetById 1ms app.highlight 25ms RepoModel.GetById 3ms 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
 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//  GDataYouTubePublicationState.m
18//
19
20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE
21
22// yt:state is an extension to GDataAtomPubControl for YouTube video entries, 
23// as in 
24//
25//  <app:control>
26//    <yt:state name="rejected" reasonCode="32" helpUrl="http://www.youtube.com/">
27//          incorrect format</yt:state>
28//  </app:control>
29
30
31#define GDATAYOUTUBEPUBLICATIONSTATE_DEFINE_GLOBALS 1
32#import "GDataYouTubePublicationState.h"
33
34#import "GDataYouTubeConstants.h"
35
36static NSString *const kNameAttr = @"name";
37static NSString *const kReasonCodeAttr = @"reasonCode";
38static NSString *const kHelpURLAttr = @"helpUrl";
39
40@implementation GDataYouTubePublicationState 
41
42+ (NSString *)extensionElementURI       { return kGDataNamespaceYouTube; }
43+ (NSString *)extensionElementPrefix    { return kGDataNamespaceYouTubePrefix; }
44+ (NSString *)extensionElementLocalName { return @"state"; }
45
46- (void)addParseDeclarations {
47  
48  NSArray *attrs = [NSArray arrayWithObjects:
49                    kNameAttr, kReasonCodeAttr, kHelpURLAttr, nil];
50  
51  [self addLocalAttributeDeclarations:attrs]; 
52
53  [self addContentValueDeclaration];
54}
55
56#pragma mark -
57
58- (NSString *)name {
59  return [self stringValueForAttribute:kNameAttr];
60}
61
62- (void)setName:(NSString *)str {
63  [self setStringValue:str forAttribute:kNameAttr];
64}
65
66- (NSString *)reasonCode {
67  return [self stringValueForAttribute:kReasonCodeAttr];
68}
69
70- (void)setReasonCode:(NSString *)str {
71  [self setStringValue:str forAttribute:kReasonCodeAttr];
72}
73
74- (NSString *)helpURLString {
75  return [self stringValueForAttribute:kHelpURLAttr];
76}
77
78- (void)setHelpURLString:(NSString *)str {
79  [self setStringValue:str forAttribute:kHelpURLAttr];
80}
81
82- (NSString *)errorDescription {
83  return [self contentStringValue]; 
84}
85
86- (void)setErrorDescription:(NSString *)str {
87  [self setContentStringValue:str];
88}
89
90@end
91
92#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE