MT5APIConfigReport.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. //+------------------------------------------------------------------+
  2. //| MetaTrader 5 API |
  3. //| Copyright 2000-2019, MetaQuotes Software Corp. |
  4. //| http://www.metaquotes.net |
  5. //+------------------------------------------------------------------+
  6. #pragma once
  7. #include "MT5APIConfigParam.h"
  8. //+------------------------------------------------------------------+
  9. //| Plugin module configuration |
  10. //+------------------------------------------------------------------+
  11. class IMTConReportModule
  12. {
  13. public:
  14. //--- snapshot mode flags
  15. enum EnSnapshots
  16. {
  17. SNAPSHOT_NONE =0x0, // without snapshots
  18. SNAPSHOT_USERS =0x1, // users database snapshot for request
  19. SNAPSHOT_USERS_FULL =0x2, // full users database snapshot
  20. SNAPSHOT_ACCOUNTS =0x4, // trade account states snapshot
  21. SNAPSHOT_ACCOUNTS_FULL =0x8, // trade account states snapshot for request
  22. SNAPSHOT_ORDERS =0x10, // orders database snapshot
  23. SNAPSHOT_ORDERS_FULL =0x20, // orders database snapshot for request
  24. SNAPSHOT_POSITIONS =0x40, // positions database snapshot
  25. SNAPSHOT_POSITIONS_FULL=0x80, // positions database snapshot for request
  26. //---
  27. SNAPSHOT_FIRST =SNAPSHOT_NONE,
  28. SNAPSHOT_LAST =SNAPSHOT_POSITIONS_FULL,
  29. };
  30. //--- types reports
  31. enum EnTypes
  32. {
  33. TYPE_NONE =0x0, // no support
  34. TYPE_HTML =0x1, // HTML
  35. TYPE_TABLE =0x2, // binary table
  36. //---
  37. TYPE_FIRST =TYPE_NONE,
  38. TYPE_LAST =TYPE_TABLE,
  39. TYPE_ALL =TYPE_HTML|TYPE_TABLE
  40. };
  41. //--- common methods
  42. virtual void Release(void)=0;
  43. virtual MTAPIRES Assign(const IMTConReportModule* param)=0;
  44. virtual MTAPIRES Clear(void)=0;
  45. //--- default report name
  46. virtual LPCWSTR Name(void) const=0;
  47. //--- vendor name
  48. virtual LPCWSTR Vendor(void) const=0;
  49. //--- report description
  50. virtual LPCWSTR Description(void) const=0;
  51. //--- report file name
  52. virtual LPCWSTR Module(void) const=0;
  53. //--- report index in file
  54. virtual UINT Index(void) const=0;
  55. //--- MT5 server-owner id
  56. virtual UINT64 Server(void) const=0;
  57. //--- plugin version
  58. virtual UINT Version(void) const=0;
  59. //--- plugin Server API version
  60. virtual UINT VersionAPI(void) const=0;
  61. //--- neccessary Internet Explorer version
  62. virtual UINT VersionIE(void) const=0;
  63. //--- available types
  64. virtual UINT Types(void) const=0;
  65. //--- neccessary data snapshots
  66. virtual UINT Snapshots(void) const=0;
  67. //--- report default parameters
  68. virtual UINT ParameterTotal(void) const=0;
  69. virtual MTAPIRES ParameterNext(const UINT pos,IMTConParam* param) const=0;
  70. virtual MTAPIRES ParameterGet(LPCWSTR name,IMTConParam* param) const=0;
  71. //--- report request input params
  72. virtual UINT InputTotal(void) const=0;
  73. virtual MTAPIRES InputNext(const UINT pos,IMTConParam* param) const=0;
  74. virtual MTAPIRES InputGet(LPCWSTR name,IMTConParam* param) const=0;
  75. };
  76. //+------------------------------------------------------------------+
  77. //| Plugin instance configuration |
  78. //+------------------------------------------------------------------+
  79. class IMTConReport
  80. {
  81. public:
  82. //--- report mode
  83. enum EnReportMode
  84. {
  85. REPORT_DISABLED=0,
  86. REPORT_ENABLED =1,
  87. //--- enumeration borders
  88. REPORT_FIRST =REPORT_DISABLED,
  89. REPORT_LAST =REPORT_ENABLED,
  90. };
  91. //--- common methods
  92. virtual void Release(void)=0;
  93. virtual MTAPIRES Assign(const IMTConReport* param)=0;
  94. virtual MTAPIRES Clear(void)=0;
  95. //--- plugin name
  96. virtual LPCWSTR Name(void) const=0;
  97. virtual MTAPIRES Name(LPCWSTR name)=0;
  98. //--- MT5 server ID
  99. virtual UINT64 Server(void) const=0;
  100. virtual MTAPIRES Server(const UINT64 server)=0;
  101. //--- plugin report name
  102. virtual LPCWSTR Module(void) const=0;
  103. virtual MTAPIRES Module(LPCWSTR name)=0;
  104. //--- plugin mode
  105. virtual UINT Mode(void) const=0;
  106. virtual MTAPIRES Mode(const UINT mode)=0;
  107. //--- plugin parameters
  108. virtual MTAPIRES ParameterAdd(IMTConParam* param)=0;
  109. virtual MTAPIRES ParameterUpdate(const UINT pos,const IMTConParam* param)=0;
  110. virtual MTAPIRES ParameterDelete(const UINT pos)=0;
  111. virtual MTAPIRES ParameterClear(void)=0;
  112. virtual MTAPIRES ParameterShift(const UINT pos,const int shift)=0;
  113. virtual UINT ParameterTotal(void) const=0;
  114. virtual MTAPIRES ParameterNext(const UINT pos,IMTConParam* param) const=0;
  115. virtual MTAPIRES ParameterGet(LPCWSTR name,IMTConParam* param) const=0;
  116. };
  117. //+------------------------------------------------------------------+
  118. //| Plugin events notification interface |
  119. //+------------------------------------------------------------------+
  120. class IMTConReportSink
  121. {
  122. public:
  123. virtual void OnReportAdd(const IMTConReport* /*report*/) { }
  124. virtual void OnReportUpdate(const IMTConReport* /*report*/) { }
  125. virtual void OnReportDelete(const IMTConReport* /*report*/) { }
  126. virtual void OnReportSync(void) { }
  127. };
  128. //+------------------------------------------------------------------+