PageRenderTime 12ms CodeModel.GetById 1ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/core/externals/update-engine/externals/gdata-objectivec-client/Source/Elements/GDataOrganizationName.m

http://macfuse.googlecode.com/
Objective C | 82 lines | 44 code | 19 blank | 19 comment | 1 complexity | 285f598732dbd7a1a068765694d4d7c9 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//  GDataOrganizationName.m
18//
19
20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CONTACTS_SERVICE
21
22#import "GDataOrganizationName.h"
23
24static NSString* const kYomiAttr = @"yomi";
25
26@implementation GDataOrganizationName
27// organization name
28//    <gd:orgName yomi="Ak Me">Acme Corp</gd:orgName>
29
30+ (NSString *)extensionElementURI       { return kGDataNamespaceGData; }
31+ (NSString *)extensionElementPrefix    { return kGDataNamespaceGDataPrefix; }
32+ (NSString *)extensionElementLocalName { return @"orgName"; }
33
34+ (id)organizationNameWithString:(NSString *)str {
35  GDataOrganizationName *obj = [self object];
36  [obj setStringValue:str];
37  return obj;
38}
39
40- (void)addParseDeclarations {
41
42  NSArray *attrs = [NSArray arrayWithObject:kYomiAttr];
43  [self addLocalAttributeDeclarations:attrs];
44
45  [self addContentValueDeclaration];
46}
47
48#if !GDATA_SIMPLE_DESCRIPTIONS
49- (NSMutableArray *)itemsForDescription {
50  static struct GDataDescriptionRecord descRecs[] = {
51    { @"value", @"stringValue", kGDataDescValueLabeled },
52    { @"yomi",  @"yomi",        kGDataDescValueLabeled },
53    { nil, nil, (GDataDescRecTypes)0 }
54  };
55
56  NSMutableArray *items = [super itemsForDescription];
57  [self addDescriptionRecords:descRecs toItems:items];
58  return items;
59}
60#endif
61
62#pragma mark -
63
64- (NSString *)stringValue {
65  return [self contentStringValue];
66}
67
68- (void)setStringValue:(NSString *)str {
69  [self setContentStringValue:str];
70}
71
72- (NSString *)yomi {
73  return [self stringValueForAttribute:kYomiAttr];
74}
75
76- (void)setYomi:(NSString *)str {
77  [self setStringValue:str forAttribute:kYomiAttr];
78}
79
80@end
81
82#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CONTACTS_SERVICE