/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Finance/GDataEntryFinanceTransaction.m

http://macfuse.googlecode.com/ · Objective C · 84 lines · 42 code · 25 blank · 17 comment · 1 complexity · 15f74f1f946dbeec8c9e80977ec7dbdd MD5 · raw file

  1. /* Copyright (c) 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. // GDataEntryFinanceTransaction.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_FINANCE_SERVICE
  19. #import "GDataEntryFinanceTransaction.h"
  20. #import "GDataFinanceTransactionData.h"
  21. #import "GDataEntryFinancePortfolio.h" // for namespace and constants
  22. @implementation GDataEntryFinanceTransaction
  23. + (GDataEntryFinanceTransaction *)transactionEntry {
  24. GDataEntryFinanceTransaction *obj;
  25. obj = [self object];
  26. [obj setNamespaces:[GDataEntryFinancePortfolio financeNamespaces]];
  27. return obj;
  28. }
  29. #pragma mark -
  30. + (NSString *)standardEntryKind {
  31. return kGDataCategoryFinanceTransaction;
  32. }
  33. + (void)load {
  34. [self registerEntryClass];
  35. }
  36. - (void)addExtensionDeclarations {
  37. [super addExtensionDeclarations];
  38. [self addExtensionDeclarationForParentClass:[self class]
  39. childClass:[GDataFinanceTransactionData class]];
  40. }
  41. #if !GDATA_SIMPLE_DESCRIPTIONS
  42. - (NSMutableArray *)itemsForDescription {
  43. NSMutableArray *items = [super itemsForDescription];
  44. [self addToArray:items objectDescriptionIfNonNil:[self transactionData] withName:@"transaction"];
  45. return items;
  46. }
  47. #endif
  48. + (NSString *)defaultServiceVersion {
  49. return kGDataFinanceDefaultServiceVersion;
  50. }
  51. #pragma mark -
  52. - (void)setTransactionData:(GDataFinanceTransactionData *)obj {
  53. [self setObject:obj forExtensionClass:[GDataFinanceTransactionData class]];
  54. }
  55. - (GDataFinanceTransactionData *)transactionData {
  56. return [self objectForExtensionClass:[GDataFinanceTransactionData class]];
  57. }
  58. @end
  59. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_FINANCE_SERVICE