PageRenderTime 34ms CodeModel.GetById 11ms app.highlight 20ms RepoModel.GetById 1ms app.codeStats 0ms

/Source/externals/GData/Source/Clients/Spreadsheets/GDataFeedWorksheet.m

http://google-email-uploader-mac.googlecode.com/
Objective C | 78 lines | 42 code | 15 blank | 21 comment | 2 complexity | cae7f441b6609282463050ca725bd377 MD5 | raw file
 1/* Copyright (c) 2007 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//  GDataFeedWorksheet.m
18//
19
20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_SPREADSHEET_SERVICE
21
22#import "GDataEntryWorksheet.h"
23#import "GDataSpreadsheetConstants.h"
24#import "GDataFeedWorksheet.h"
25#import "GDataCategory.h"
26
27@implementation GDataFeedWorksheet
28
29+ (NSString *)coreProtocolVersionForServiceVersion:(NSString *)serviceVersion {
30  return [GDataSpreadsheetConstants coreProtocolVersionForServiceVersion:serviceVersion];
31}
32
33+ (GDataFeedWorksheet *)worksheetFeedWithXMLData:(NSData *)data {
34  return [self feedWithXMLData:data];
35}
36
37+ (GDataFeedWorksheet *)worksheetFeed {
38  GDataFeedWorksheet *feed = [self object];
39  [feed setNamespaces:[GDataSpreadsheetConstants spreadsheetNamespaces]];
40  return feed;
41}
42
43#pragma mark -
44
45+ (NSString *)standardFeedKind {
46  // spreadsheet categories do not use the standard Kind scheme
47  // (kGDataCategoryScheme) so cannot be init'd by GDataFeedBase
48  return nil;
49}
50
51+ (void)load {
52  // spreadsheet categories do not use the standard Kind scheme
53  // (kGDataCategoryScheme) so cannot be registered with +registerEntryClass
54  [GDataFeedBase registerFeedClass:[self class]
55             forCategoryWithScheme:nil
56                              term:kGDataCategoryWorksheet];
57}
58
59- (id)init {
60  self = [super init];
61  if (self) {
62    [self addCategory:[GDataCategory categoryWithScheme:kGDataCategorySchemeSpreadsheet
63                                                   term:kGDataCategoryWorksheet]];
64  }
65  return self;
66}
67
68- (Class)classForEntries {
69  return [GDataEntryWorksheet class];
70}
71
72+ (NSString *)defaultServiceVersion {
73  return kGDataSpreadsheetDefaultServiceVersion;
74}
75
76@end
77
78#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_SPREADSHEET_SERVICE