/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Finance/GDataPortfolioElements.h

http://macfuse.googlecode.com/ · C++ Header · 119 lines · 46 code · 29 blank · 44 comment · 1 complexity · b9b05407d6cc2c1416588f028f9d9e52 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. // GDataPortfolioElements.h
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_FINANCE_SERVICE
  19. //
  20. // GDataPortfolioBase is a common base class for both GDataPortfolioData (which
  21. // adds currencyCode) and GDataPositionData (which adds shares).
  22. //
  23. #import "GDataObject.h"
  24. #import "GDataMoney.h"
  25. @class GDataCostBasis;
  26. @class GDataGain;
  27. @class GDataDaysGain;
  28. @class GDataMarketValue;
  29. @interface GDataPortfolioBase : GDataObject
  30. // attributes
  31. - (NSNumber *)gainPercentage; // double
  32. - (void)setGainPercentage:(NSNumber *)num;
  33. - (NSDecimalNumber *)return1w;
  34. - (void)setReturn1w:(NSNumber *)num;
  35. - (NSDecimalNumber *)return1y;
  36. - (void)setReturn1y:(NSNumber *)num;
  37. - (NSDecimalNumber *)return3m;
  38. - (void)setReturn3m:(NSNumber *)num;
  39. - (NSDecimalNumber *)return3y;
  40. - (void)setReturn3y:(NSNumber *)num;
  41. - (NSDecimalNumber *)return4w;
  42. - (void)setReturn4w:(NSNumber *)num;
  43. - (NSDecimalNumber *)return5y;
  44. - (void)setReturn5y:(NSNumber *)num;
  45. - (NSDecimalNumber *)returnOverall;
  46. - (void)setReturnOverall:(NSNumber *)num;
  47. - (NSDecimalNumber *)returnYTD;
  48. - (void)setReturnYTD:(NSNumber *)num;
  49. // extensions: these are derived from GDataMoneyElements
  50. - (GDataCostBasis *)costBasis;
  51. - (void)setCostBasis:(GDataCostBasis *)obj;
  52. - (GDataGain *)gain;
  53. - (void)setGain:(GDataGain *)obj;
  54. - (GDataDaysGain *)daysGain;
  55. - (void)setDaysGain:(GDataDaysGain *)obj;
  56. - (GDataMarketValue *)marketValue;
  57. - (void)setMarketValue:(GDataMarketValue *)obj;
  58. @end
  59. // portfolio data, like
  60. //
  61. // <gf:portfolioData currencyCode='USD' gainPercentage='1.894857932'
  62. // return1w='-0.07711772724' return1y='0.3969560994' return3m='0.197468495'
  63. // return3y='1.228892613' return4w='-0.003721445821' return5y='1.894857932'
  64. // returnOverall='1.894857932' returnYTD='0.4172674026'>
  65. // <gf:costBasis>
  66. // <gd:money amount='52158.0' currencyCode='USD'/>
  67. // </gf:costBasis>
  68. // <gf:daysGain>
  69. // <gd:money amount='7321.0' currencyCode='USD'/>
  70. // </gf:daysGain>
  71. // <gf:gain>
  72. // <gd:money amount='98832.0' currencyCode='USD'/>
  73. // </gf:gain>
  74. // <gf:marketValue>
  75. // <gd:money amount='150990.0' currencyCode='USD'/>
  76. // </gf:marketValue>
  77. // </gf:portfolioData>
  78. @interface GDataPortfolioData : GDataPortfolioBase <GDataExtension>
  79. + (GDataPortfolioData *)portfolioData;
  80. - (NSString *)currencyCode;
  81. - (void)setCurrencyCode:(NSString *)str;
  82. @end
  83. // position data element is like portfolioData, but has a shares attribute
  84. // and lacks a currencyCode attribute
  85. @interface GDataPositionData : GDataPortfolioBase <GDataExtension>
  86. + (GDataPositionData *)positionData;
  87. - (NSDecimalNumber *)shares;
  88. - (void)setShares:(NSNumber *)num;
  89. @end
  90. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_FINANCE_SERVICE