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

http://macfuse.googlecode.com/ · Objective C · 73 lines · 40 code · 16 blank · 17 comment · 1 complexity · 4abb1ea93f8cae69704e4c122d841049 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. // GDataQueryFinance.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_FINANCE_SERVICE
  19. #import "GDataQueryFinance.h"
  20. #import "GDataServiceGoogleFinance.h"
  21. static NSString *const kReturnsParamName = @"returns";
  22. static NSString *const kPositionsParamName = @"positions";
  23. static NSString *const kTransactionsParamName = @"transactions";
  24. @implementation GDataQueryFinance
  25. + (GDataQueryFinance *)financeQueryWithFeedURL:(NSURL *)feedURL {
  26. return [self queryWithFeedURL:feedURL];
  27. }
  28. #pragma mark -
  29. - (void)setShouldIncludeReturns:(BOOL)flag {
  30. [self addCustomParameterWithName:kReturnsParamName
  31. boolValue:flag
  32. defaultValue:NO];
  33. }
  34. - (BOOL)shouldIncludeReturns {
  35. return [self boolValueForParameterWithName:kReturnsParamName
  36. defaultValue:NO];
  37. }
  38. - (void)setShouldIncludePositions:(BOOL)flag {
  39. [self addCustomParameterWithName:kPositionsParamName
  40. boolValue:flag
  41. defaultValue:NO];
  42. }
  43. - (BOOL)shouldIncludePositions {
  44. return [self boolValueForParameterWithName:kPositionsParamName
  45. defaultValue:NO];
  46. }
  47. - (void)setShouldIncludeTransactions:(BOOL)flag {
  48. [self addCustomParameterWithName:kTransactionsParamName
  49. boolValue:flag
  50. defaultValue:NO];
  51. }
  52. - (BOOL)shouldIncludeTransactions {
  53. return [self boolValueForParameterWithName:kTransactionsParamName
  54. defaultValue:NO];
  55. }
  56. @end
  57. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_FINANCE_SERVICE