/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Calendar/GDataReminder.m

http://macfuse.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. // GDataReminder.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CALENDAR_SERVICE
  19. #define GDATAREMINDER_DEFINE_GLOBALS 1
  20. #import "GDataReminder.h"
  21. #import "GDataDateTime.h"
  22. static NSString* const kDaysAttr = @"days";
  23. static NSString* const kHoursAttr = @"hours";
  24. static NSString* const kMinutesAttr = @"minutes";
  25. static NSString* const kMethodAttr = @"method";
  26. static NSString* const kAbsoluteTimeAttr = @"absoluteTime";
  27. @implementation GDataReminder
  28. // reminder, as in
  29. // <gd:reminder absoluteTime="2005-06-06T16:55:00-08:00"/>
  30. //
  31. // http://code.google.com/apis/gdata/common-elements.html#gdReminder
  32. + (NSString *)extensionElementURI { return kGDataNamespaceGData; }
  33. + (NSString *)extensionElementPrefix { return kGDataNamespaceGDataPrefix; }
  34. + (NSString *)extensionElementLocalName { return @"reminder"; }
  35. + (GDataReminder *)reminder {
  36. return [self object];
  37. }
  38. - (void)addParseDeclarations {
  39. NSArray *attrs = [NSArray arrayWithObjects:
  40. kDaysAttr, kHoursAttr, kMinutesAttr,
  41. kAbsoluteTimeAttr, kMethodAttr, nil];
  42. [self addLocalAttributeDeclarations:attrs];
  43. }
  44. #pragma mark -
  45. - (NSString *)days {
  46. return [self stringValueForAttribute:kDaysAttr];
  47. }
  48. - (void)setDays:(NSString *)str {
  49. [self setStringValue:str forAttribute:kDaysAttr];
  50. }
  51. - (NSString *)hours {
  52. return [self stringValueForAttribute:kHoursAttr];
  53. }
  54. - (void)setHours:(NSString *)str {
  55. [self setStringValue:str forAttribute:kHoursAttr];
  56. }
  57. - (NSString *)minutes {
  58. return [self stringValueForAttribute:kMinutesAttr];
  59. }
  60. - (void)setMinutes:(NSString *)str {
  61. [self setStringValue:str forAttribute:kMinutesAttr];
  62. }
  63. - (NSString *)method {
  64. return [self stringValueForAttribute:kMethodAttr];
  65. }
  66. - (void)setMethod:(NSString *)str {
  67. [self setStringValue:str forAttribute:kMethodAttr];
  68. }
  69. - (GDataDateTime *)absoluteTime {
  70. return [self dateTimeForAttribute:kAbsoluteTimeAttr];
  71. }
  72. - (void)setAbsoluteTime:(GDataDateTime *)cdate {
  73. [self setDateTimeValue:cdate forAttribute:kAbsoluteTimeAttr];
  74. }
  75. @end
  76. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CALENDAR_SERVICE