MT5APIConfigHoliday.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //+------------------------------------------------------------------+
  2. //| MetaTrader 5 API |
  3. //| Copyright 2000-2019, MetaQuotes Software Corp. |
  4. //| http://www.metaquotes.net |
  5. //+------------------------------------------------------------------+
  6. #pragma once
  7. //+------------------------------------------------------------------+
  8. //| Holidays config interface |
  9. //+------------------------------------------------------------------+
  10. class IMTConHoliday
  11. {
  12. public:
  13. //--- holiday modes
  14. enum EnHolidayMode
  15. {
  16. HOLIDAY_DISABLED=0,
  17. HOLIDAY_ENABLED =1,
  18. //--- enumeration borders
  19. HOLIDAY_FIRST =HOLIDAY_DISABLED,
  20. HOLIDAY_LAST =HOLIDAY_ENABLED,
  21. };
  22. //--- common methods
  23. virtual void Release(void)=0;
  24. virtual MTAPIRES Assign(const IMTConHoliday* holiday)=0;
  25. virtual MTAPIRES Clear(void)=0;
  26. //--- holiday description
  27. virtual LPCWSTR Description(void) const=0;
  28. virtual MTAPIRES Description(LPCWSTR descr)=0;
  29. //--- EnHolidayMode
  30. virtual UINT Mode(void) const=0;
  31. virtual MTAPIRES Mode(const UINT mode)=0;
  32. //--- holiday year (for example: 2010, 0 - every year)
  33. virtual UINT Year(void) const=0;
  34. virtual MTAPIRES Year(const UINT year)=0;
  35. //--- holiday month (1-January, 12-December)
  36. virtual UINT Month(void) const=0;
  37. virtual MTAPIRES Month(const UINT month)=0;
  38. //--- holiday day (1-31)
  39. virtual UINT Day(void) const=0;
  40. virtual MTAPIRES Day(const UINT day)=0;
  41. //--- holiday working time from (in minutes - 100 means 01:40)
  42. virtual UINT WorkFrom(void) const=0;
  43. virtual MTAPIRES WorkFrom(const UINT from)=0;
  44. virtual UINT WorkFromHours(void) const=0;
  45. virtual UINT WorkFromMinutes(void) const=0;
  46. //--- holiday working time to (in minutes - 100 means 01:40)
  47. virtual UINT WorkTo(void) const=0;
  48. virtual MTAPIRES WorkTo(const UINT from)=0;
  49. virtual UINT WorkToHours(void) const=0;
  50. virtual UINT WorkToMinutes(void) const=0;
  51. //--- holiday symbols list
  52. virtual MTAPIRES SymbolAdd(LPCWSTR path)=0;
  53. virtual MTAPIRES SymbolUpdate(const UINT pos,LPCWSTR path)=0;
  54. virtual MTAPIRES SymbolDelete(const UINT pos)=0;
  55. virtual MTAPIRES SymbolClear(void)=0;
  56. virtual MTAPIRES SymbolShift(const UINT pos,const int shift)=0;
  57. virtual UINT SymbolTotal(void) const=0;
  58. virtual LPCWSTR SymbolNext(const UINT pos) const=0;
  59. };
  60. //+------------------------------------------------------------------+
  61. //| Holiday config events notification interface |
  62. //+------------------------------------------------------------------+
  63. class IMTConHolidaySink
  64. {
  65. public:
  66. virtual void OnHolidayAdd(const IMTConHoliday* /*config*/) { }
  67. virtual void OnHolidayUpdate(const IMTConHoliday* /*config*/) { }
  68. virtual void OnHolidayDelete(const IMTConHoliday* /*config*/) { }
  69. virtual void OnHolidaySync(void) { }
  70. };
  71. //+------------------------------------------------------------------+