PageRenderTime 41ms CodeModel.GetById 24ms app.highlight 14ms RepoModel.GetById 1ms app.codeStats 0ms

/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Contacts/GDataContactRelation.m

http://macfuse.googlecode.com/
Objective C | 83 lines | 46 code | 20 blank | 17 comment | 1 complexity | 868065040bddb450154393bd80ff6bc7 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//  GDataContactRelation.m
18//
19
20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CONTACTS_SERVICE
21
22#define GDATACONTACTRELATION_DEFINE_GLOBALS 1
23#import "GDataContactRelation.h"
24
25#import "GDataContactConstants.h"
26
27static NSString* const kRelAttr = @"rel";
28static NSString* const kLabelAttr = @"label";
29
30@implementation GDataContactRelation
31
32+ (NSString *)extensionElementURI       { return kGDataNamespaceContact; }
33+ (NSString *)extensionElementPrefix    { return kGDataNamespaceContactPrefix; }
34+ (NSString *)extensionElementLocalName { return @"relation"; }
35
36+ (id)relationWithRel:(NSString *)rel
37                label:(NSString *)label
38                value:(NSString *)value {
39  
40  GDataContactRelation *obj = [self object];
41  [obj setRel:rel];
42  [obj setLabel:label];
43  [obj setStringValue:value];
44  return obj;
45}
46
47- (void)addParseDeclarations {
48  NSArray *attrs = [NSArray arrayWithObjects:
49                    kRelAttr, kLabelAttr, nil]; 
50  [self addLocalAttributeDeclarations:attrs];
51  
52  [self addContentValueDeclaration];
53}
54
55#pragma mark -
56
57- (NSString *)rel {
58  return [self stringValueForAttribute:kRelAttr]; 
59}
60
61- (void)setRel:(NSString *)str {
62  [self setStringValue:str forAttribute:kRelAttr];
63}
64
65- (NSString *)label {
66  return [self stringValueForAttribute:kLabelAttr]; 
67}
68
69- (void)setLabel:(NSString *)str {
70  [self setStringValue:str forAttribute:kLabelAttr];
71}
72
73- (NSString *)stringValue {
74  return [self contentStringValue]; 
75}
76
77- (void)setStringValue:(NSString *)str {
78  [self setContentStringValue:str];
79}
80
81@end
82
83#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CONTACTS_SERVICE