PageRenderTime 43ms CodeModel.GetById 18ms app.highlight 23ms RepoModel.GetById 1ms app.codeStats 0ms

/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/WebmasterTools/GDataEntrySiteMessage.m

http://macfuse.googlecode.com/
Objective C | 195 lines | 129 code | 48 blank | 18 comment | 1 complexity | a0999fffdeda0187ed9f8b39acf26d0e 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//  GDataEntrySitemap.m
 18//
 19
 20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_WEBMASTERTOOLS_SERVICE
 21
 22#import "GDataEntrySiteMessage.h"
 23#import "GDataWebmasterToolsConstants.h"
 24
 25// private extensions
 26
 27@interface GDataSiteMessageBody : GDataValueElementConstruct <GDataExtension>
 28@end
 29
 30@implementation GDataSiteMessageBody
 31+ (NSString *)extensionElementURI       { return kGDataNamespaceWebmasterTools; }
 32+ (NSString *)extensionElementPrefix    { return kGDataNamespaceWebmasterToolsPrefix; }
 33+ (NSString *)extensionElementLocalName { return @"body"; }
 34@end
 35
 36@interface GDataSiteMessageDate: GDataValueElementConstruct <GDataExtension>
 37@end
 38
 39@implementation GDataSiteMessageDate
 40+ (NSString *)extensionElementURI       { return kGDataNamespaceWebmasterTools; }
 41+ (NSString *)extensionElementPrefix    { return kGDataNamespaceWebmasterToolsPrefix; }
 42+ (NSString *)extensionElementLocalName { return @"date"; }
 43@end
 44
 45@interface GDataSiteMessageLanguage: GDataValueElementConstruct <GDataExtension>
 46@end
 47
 48@implementation GDataSiteMessageLanguage
 49+ (NSString *)extensionElementURI       { return kGDataNamespaceWebmasterTools; }
 50+ (NSString *)extensionElementPrefix    { return kGDataNamespaceWebmasterToolsPrefix; }
 51+ (NSString *)extensionElementLocalName { return @"language"; }
 52@end
 53
 54@interface GDataSiteMessageRead: GDataValueElementConstruct <GDataExtension>
 55@end
 56
 57@implementation GDataSiteMessageRead
 58+ (NSString *)extensionElementURI       { return kGDataNamespaceWebmasterTools; }
 59+ (NSString *)extensionElementPrefix    { return kGDataNamespaceWebmasterToolsPrefix; }
 60+ (NSString *)extensionElementLocalName { return @"read"; }
 61@end
 62
 63@interface GDataSiteMessageSubject: GDataValueElementConstruct <GDataExtension>
 64@end
 65
 66@implementation GDataSiteMessageSubject
 67+ (NSString *)extensionElementURI       { return kGDataNamespaceWebmasterTools; }
 68+ (NSString *)extensionElementPrefix    { return kGDataNamespaceWebmasterToolsPrefix; }
 69+ (NSString *)extensionElementLocalName { return @"subject"; }
 70@end
 71
 72
 73@implementation GDataEntrySiteMessage
 74
 75+ (id)messageEntry {
 76  GDataEntrySiteMessage *obj = [self object];
 77
 78  [obj setNamespaces:[GDataWebmasterToolsConstants webmasterToolsNamespaces]];
 79
 80  return obj;
 81}
 82
 83#pragma mark -
 84
 85+ (NSString *)standardEntryKind {
 86  return kGDataCategorySiteMessage;
 87}
 88
 89+ (void)load {
 90  [self registerEntryClass];
 91}
 92
 93- (void)addExtensionDeclarations {
 94
 95  [super addExtensionDeclarations];
 96
 97  Class entryClass = [self class];
 98
 99  [self addExtensionDeclarationForParentClass:entryClass
100                                 childClasses:
101   [GDataSiteMessageBody class],
102   [GDataSiteMessageDate class],
103   [GDataSiteMessageLanguage class],
104   [GDataSiteMessageRead class],
105   [GDataSiteMessageSubject class],
106   nil];
107}
108
109#if !GDATA_SIMPLE_DESCRIPTIONS
110- (NSMutableArray *)itemsForDescription {
111
112  static struct GDataDescriptionRecord descRecs[] = {
113    { @"body",     @"body",                    kGDataDescValueLabeled   },
114    { @"date",     @"messageDate.stringValue", kGDataDescValueLabeled   },
115    { @"language", @"language",                kGDataDescValueLabeled   },
116    { @"read",     @"read",                    kGDataDescBooleanLabeled },
117    { @"subject",  @"subject",                 kGDataDescValueLabeled   },
118    { nil, nil, (GDataDescRecTypes)0 }
119  };
120
121  NSMutableArray *items = [super itemsForDescription];
122  [self addDescriptionRecords:descRecs toItems:items];
123  return items;
124}
125#endif
126
127+ (NSString *)defaultServiceVersion {
128  return kGDataWebmasterToolsDefaultServiceVersion;
129}
130
131#pragma mark -
132
133- (NSString *)body {
134  GDataSiteMessageBody *obj;
135
136  obj = [self objectForExtensionClass:[GDataSiteMessageBody class]];
137  return [obj stringValue];
138}
139
140- (void)setBody:(NSString *)str {
141  GDataSiteMessageBody *obj = [GDataSiteMessageBody valueWithString:str];
142  [self setObject:obj forExtensionClass:[GDataSiteMessageBody class]];
143}
144
145- (GDataDateTime *)messageDate {
146  GDataSiteMessageDate *obj;
147
148  obj = [self objectForExtensionClass:[GDataSiteMessageDate class]];
149  return [obj dateTimeValue];
150}
151
152- (void)setMessageDate:(GDataDateTime *)dateTime {
153  GDataSiteMessageDate *obj = [GDataSiteMessageDate valueWithDateTime:dateTime];
154  [self setObject:obj forExtensionClass:[GDataSiteMessageDate class]];
155}
156
157- (NSString *)language {
158  GDataSiteMessageLanguage *obj;
159
160  obj = [self objectForExtensionClass:[GDataSiteMessageLanguage class]];
161  return [obj stringValue];
162}
163
164- (void)setLanguage:(NSString *)str {
165  GDataSiteMessageLanguage *obj = [GDataSiteMessageLanguage valueWithString:str];
166  [self setObject:obj forExtensionClass:[GDataSiteMessageLanguage class]];
167}
168
169- (NSNumber *)read { // boolean
170  GDataSiteMessageRead *obj;
171
172  obj = [self objectForExtensionClass:[GDataSiteMessageRead class]];
173  return [obj boolNumberValue];
174}
175
176- (void)setRead:(NSNumber *)num {
177  GDataSiteMessageRead *obj = [GDataSiteMessageRead valueWithNumber:num];
178  [self setObject:obj forExtensionClass:[GDataSiteMessageRead class]];
179}
180
181- (NSString *)subject {
182  GDataSiteMessageSubject *obj;
183
184  obj = [self objectForExtensionClass:[GDataSiteMessageSubject class]];
185  return [obj stringValue];
186}
187
188- (void)setSubject:(NSString *)str {
189  GDataSiteMessageSubject *obj = [GDataSiteMessageSubject valueWithString:str];
190  [self setObject:obj forExtensionClass:[GDataSiteMessageSubject class]];
191}
192
193@end
194
195#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_WEBMASTERTOOLS_SERVICE