PageRenderTime 41ms CodeModel.GetById 13ms app.highlight 23ms RepoModel.GetById 2ms app.codeStats 0ms

/Source/externals/GData/Source/Clients/Calendar/GDataReminder.m

http://google-email-uploader-mac.googlecode.com/
Objective C | 98 lines | 55 code | 22 blank | 21 comment | 1 complexity | 6e839dffafaae04c9668c609cf9197de MD5 | raw file
 1/* Copyright (c) 2007-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//  GDataReminder.m
18//
19
20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CALENDAR_SERVICE
21
22#define GDATAREMINDER_DEFINE_GLOBALS 1
23#import "GDataReminder.h"
24#import "GDataDateTime.h"
25
26static NSString* const kDaysAttr = @"days";
27static NSString* const kHoursAttr = @"hours";
28static NSString* const kMinutesAttr = @"minutes";
29static NSString* const kMethodAttr = @"method";
30static NSString* const kAbsoluteTimeAttr = @"absoluteTime";
31
32
33@implementation GDataReminder
34// reminder, as in 
35//   <gd:reminder absoluteTime="2005-06-06T16:55:00-08:00"/>
36//
37// http://code.google.com/apis/gdata/common-elements.html#gdReminder
38
39+ (NSString *)extensionElementURI       { return kGDataNamespaceGData; }
40+ (NSString *)extensionElementPrefix    { return kGDataNamespaceGDataPrefix; }
41+ (NSString *)extensionElementLocalName { return @"reminder"; }
42
43+ (GDataReminder *)reminder {
44  return [self object];
45}
46
47- (void)addParseDeclarations {
48  NSArray *attrs = [NSArray arrayWithObjects: 
49                    kDaysAttr, kHoursAttr, kMinutesAttr, 
50                    kAbsoluteTimeAttr, kMethodAttr, nil];
51  
52  [self addLocalAttributeDeclarations:attrs];
53}
54
55#pragma mark -
56
57- (NSString *)days {
58  return [self stringValueForAttribute:kDaysAttr];
59}
60
61- (void)setDays:(NSString *)str {
62  [self setStringValue:str forAttribute:kDaysAttr];
63}
64
65- (NSString *)hours {
66  return [self stringValueForAttribute:kHoursAttr];
67}
68
69- (void)setHours:(NSString *)str {
70  [self setStringValue:str forAttribute:kHoursAttr];
71}
72
73- (NSString *)minutes {
74  return [self stringValueForAttribute:kMinutesAttr];
75}
76
77- (void)setMinutes:(NSString *)str {
78  [self setStringValue:str forAttribute:kMinutesAttr];
79}
80
81- (NSString *)method {
82  return [self stringValueForAttribute:kMethodAttr];
83}
84
85- (void)setMethod:(NSString *)str {
86  [self setStringValue:str forAttribute:kMethodAttr];
87}
88
89- (GDataDateTime *)absoluteTime {
90  return [self dateTimeForAttribute:kAbsoluteTimeAttr];
91}
92
93- (void)setAbsoluteTime:(GDataDateTime *)cdate {
94  [self setDateTimeValue:cdate forAttribute:kAbsoluteTimeAttr];
95}
96@end
97
98#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CALENDAR_SERVICE