IDesignerPlugin.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. using System;
  2. using System.IO;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.Windows.Forms;
  6. using System.Drawing;
  7. using System.ComponentModel;
  8. using FastReport.Forms;
  9. using FastReport.Utils;
  10. namespace FastReport.Design
  11. {
  12. /// <summary>
  13. /// Provides functionality required for report designer plugins such as toolbars and toolwindows.
  14. /// </summary>
  15. public interface IDesignerPlugin
  16. {
  17. /// <summary>
  18. /// Gets the plugin name.
  19. /// </summary>
  20. string PluginName
  21. {
  22. get;
  23. }
  24. /// <summary>
  25. /// Saves the plugin state.
  26. /// </summary>
  27. /// <example>This example shows how to save the state:
  28. /// <code>
  29. /// public void SaveState()
  30. /// {
  31. /// XmlItem xi = Config.Root.FindItem("Designer").FindItem(Name);
  32. /// xi.SetProp("ShowGrid", DialogWorkspace.ShowGrid ? "1" : "0");
  33. /// }
  34. /// </code>
  35. /// </example>
  36. void SaveState();
  37. /// <summary>
  38. /// Restores the plugin state.
  39. /// </summary>
  40. /// <example>This example shows how to restore the state:
  41. /// <code>
  42. /// public void RestoreState()
  43. /// {
  44. /// XmlItem xi = Config.Root.FindItem("Designer").FindItem(Name);
  45. /// DialogWorkspace.ShowGrid = xi.GetProp("ShowGrid") != "0";
  46. /// }
  47. /// </code>
  48. /// </example>
  49. void RestoreState();
  50. /// <summary>
  51. /// Updates plugin state when current selection was changed.
  52. /// </summary>
  53. /// <remarks>
  54. /// Typically you need to do the same work in the <see cref="SelectionChanged"/> and
  55. /// <see cref="UpdateContent"/> methods.
  56. /// </remarks>
  57. void SelectionChanged();
  58. /// <summary>
  59. /// Updates plugin state when the report was modified.
  60. /// </summary>
  61. /// <remarks>
  62. /// Typically you need to do the same work in the <see cref="SelectionChanged"/> and
  63. /// <see cref="UpdateContent"/> methods.
  64. /// </remarks>
  65. void UpdateContent();
  66. /// <summary>
  67. /// Locks the plugin.
  68. /// </summary>
  69. /// <remarks>
  70. /// This method is called by the designer when report is loading. It may be needed to disable
  71. /// some operations (like painting) that use the report.
  72. /// </remarks>
  73. void Lock();
  74. /// <summary>
  75. /// Unlocks the plugin.
  76. /// </summary>
  77. /// This method is called by the designer when report is loaded. It follows the <b>Lock</b>
  78. /// method call and must reset the lock.
  79. void Unlock();
  80. /// <summary>
  81. /// Localizes the plugin.
  82. /// </summary>
  83. /// <remarks>
  84. /// This method is called by the designer when current localization is changed.
  85. /// </remarks>
  86. void Localize();
  87. /// <summary>
  88. /// Gets an options page that will be used in the Designer Options dialog to edit the plugin options.
  89. /// </summary>
  90. /// <returns>The options page, if implemented; otherwise, <b>null</b>.</returns>
  91. DesignerOptionsPage GetOptionsPage();
  92. /// <summary>
  93. /// Updates UI style of the plugin.
  94. /// </summary>
  95. /// <remarks>
  96. /// The plugin should update its style according to the designer's <b>UIStyle</b> property.
  97. /// </remarks>
  98. void UpdateUIStyle();
  99. /// <summary>
  100. /// Updates layout on dpi change.
  101. /// </summary>
  102. void UpdateDpiDependencies();
  103. }
  104. }