PageRenderTime 18ms CodeModel.GetById 8ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

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