PageRenderTime 19ms CodeModel.GetById 2ms app.highlight 15ms RepoModel.GetById 1ms app.codeStats 0ms

/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Docs/GDataDocFeature.m

http://macfuse.googlecode.com/
Objective C | 101 lines | 59 code | 19 blank | 23 comment | 1 complexity | a3f02e50b1b9da020480bb612702ebb8 MD5 | raw file
  1/* Copyright (c) 2010 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#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_DOCS_SERVICE
 17
 18//
 19//  GDataDocFeature.m
 20//
 21
 22#import "GDataDocFeature.h"
 23#import "GDataDocConstants.h"
 24
 25@interface GDataDocFeatureName : GDataValueElementConstruct <GDataExtension>
 26@end
 27
 28@implementation GDataDocFeatureName
 29+ (NSString *)extensionElementURI       { return kGDataNamespaceDocuments; }
 30+ (NSString *)extensionElementPrefix    { return kGDataNamespaceDocumentsPrefix; }
 31+ (NSString *)extensionElementLocalName { return @"featureName"; }
 32@end
 33
 34@interface GDataDocFeatureRate : GDataValueElementConstruct <GDataExtension>
 35@end
 36
 37@implementation GDataDocFeatureRate
 38+ (NSString *)extensionElementURI       { return kGDataNamespaceDocuments; }
 39+ (NSString *)extensionElementPrefix    { return kGDataNamespaceDocumentsPrefix; }
 40+ (NSString *)extensionElementLocalName { return @"featureRate"; }
 41@end
 42
 43@implementation GDataDocFeature
 44// a docs feature, such as
 45//
 46//  <docs:feature>
 47//    <docs:featureName>ocr</docs:featureName>
 48//    <docs:featureRate>rate</docs:featureRate>
 49//  </docs:feature>
 50
 51+ (NSString *)extensionElementURI       { return kGDataNamespaceDocuments; }
 52+ (NSString *)extensionElementPrefix    { return kGDataNamespaceDocumentsPrefix; }
 53+ (NSString *)extensionElementLocalName { return @"feature"; }
 54
 55- (void)addExtensionDeclarations {
 56
 57  [super addExtensionDeclarations];
 58
 59  [self addExtensionDeclarationForParentClass:[self class]
 60                                 childClasses:
 61   [GDataDocFeatureName class],
 62   [GDataDocFeatureRate class],
 63   nil];
 64}
 65
 66#if !GDATA_SIMPLE_DESCRIPTIONS
 67- (NSMutableArray *)itemsForDescription {
 68  static struct GDataDescriptionRecord descRecs[] = {
 69    { @"name", @"featureName",  kGDataDescValueLabeled },
 70    { @"rate", @"featureRate",  kGDataDescValueLabeled },
 71    { nil, nil, (GDataDescRecTypes)0 }
 72  };
 73
 74  NSMutableArray *items = [super itemsForDescription];
 75  [self addDescriptionRecords:descRecs toItems:items];
 76  return items;
 77}
 78#endif
 79
 80- (NSString *)featureName {
 81  GDataDocFeatureName *obj = [self objectForExtensionClass:[GDataDocFeatureName class]];
 82  return [obj stringValue];
 83}
 84
 85- (void)setFeatureName:(NSString *)str {
 86  GDataDocFeatureName *obj = [GDataDocFeatureName valueWithString:str];
 87  [self setObject:obj forExtensionClass:[GDataDocFeatureName class]];
 88}
 89
 90- (NSString *)featureRate {
 91  GDataDocFeatureRate *obj = [self objectForExtensionClass:[GDataDocFeatureRate class]];
 92  return [obj stringValue];
 93}
 94
 95- (void)setFeatureRate:(NSString *)str {
 96  GDataDocFeatureRate *obj = [GDataDocFeatureRate valueWithString:str];
 97  [self setObject:obj forExtensionClass:[GDataDocFeatureRate class]];
 98}
 99@end
100
101#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_DOCS_SERVICE