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

http://macfuse.googlecode.com/ · Objective C · 70 lines · 37 code · 16 blank · 17 comment · 1 complexity · f17b3b7bdbb324fa03d80f3f4dec6757 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. // GDataDocTransferFormat.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_DOCS_SERVICE
  19. #import "GDataDocTransferFormat.h"
  20. #import "GDataDocConstants.h"
  21. #import "GDataValueConstruct.h"
  22. @implementation GDataDocImportFormat
  23. + (NSString *)extensionElementURI { return kGDataNamespaceDocuments; }
  24. + (NSString *)extensionElementPrefix { return kGDataNamespaceDocumentsPrefix; }
  25. + (NSString *)extensionElementLocalName { return @"importFormat"; }
  26. @end
  27. @implementation GDataDocExportFormat
  28. + (NSString *)extensionElementURI { return kGDataNamespaceDocuments; }
  29. + (NSString *)extensionElementPrefix { return kGDataNamespaceDocumentsPrefix; }
  30. + (NSString *)extensionElementLocalName { return @"exportFormat"; }
  31. @end
  32. static NSString* const kSourceAttr = @"source";
  33. static NSString* const kTargetAttr = @"target";
  34. @implementation GDataDocTransferFormat
  35. - (void)addParseDeclarations {
  36. NSArray *attrs = [NSArray arrayWithObjects:
  37. kSourceAttr, kTargetAttr, nil];
  38. [self addLocalAttributeDeclarations:attrs];
  39. }
  40. #pragma mark -
  41. - (NSString *)source {
  42. return [self stringValueForAttribute:kSourceAttr];
  43. }
  44. - (void)setSource:(NSString *)str {
  45. [self setStringValue:str forAttribute:kSourceAttr];
  46. }
  47. - (NSString *)target {
  48. return [self stringValueForAttribute:kTargetAttr];
  49. }
  50. - (void)setTarget:(NSString *)str {
  51. [self setStringValue:str forAttribute:kTargetAttr];
  52. }
  53. @end
  54. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_DOCS_SERVICE