PageRenderTime 49ms CodeModel.GetById 13ms app.highlight 29ms RepoModel.GetById 2ms app.codeStats 0ms

/Source/externals/GData/Source/Clients/Contacts/GDataContactLanguage.m

http://google-email-uploader-mac.googlecode.com/
Objective C | 70 lines | 35 code | 18 blank | 17 comment | 1 complexity | 1b8eb575d6a646f0f5345ab48076aaba 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//  GDataContactLanguage.m
18//
19
20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CONTACTS_SERVICE
21
22#import "GDataContactLanguage.h"
23
24#import "GDataContactConstants.h"
25
26static NSString* const kLabelAttr = @"label";
27static NSString *const kCodeAttr = @"code";
28
29@implementation GDataContactLanguage
30
31+ (NSString *)extensionElementURI       { return kGDataNamespaceContact; }
32+ (NSString *)extensionElementPrefix    { return kGDataNamespaceContactPrefix; }
33+ (NSString *)extensionElementLocalName { return @"language"; }
34
35+ (id)languageWithCode:(NSString *)code
36                 label:(NSString *)label {
37  
38  GDataContactLanguage *obj = [self object];
39  [obj setLabel:label];
40  [obj setCode:code];
41  return obj;
42}
43
44- (void)addParseDeclarations {
45  NSArray *attrs = [NSArray arrayWithObjects:kLabelAttr, kCodeAttr, nil];
46  
47  [self addLocalAttributeDeclarations:attrs];
48}
49
50#pragma mark -
51
52- (NSString *)label {
53  return [self stringValueForAttribute:kLabelAttr];
54}
55
56- (void)setLabel:(NSString *)str {
57  [self setStringValue:str forAttribute:kLabelAttr];
58}
59
60- (NSString *)code {
61  return [self stringValueForAttribute:kCodeAttr];
62}
63
64- (void)setCode:(NSString *)str {
65  [self setStringValue:str forAttribute:kCodeAttr];
66}
67
68@end
69
70#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CONTACTS_SERVICE