IParent.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using FastReport.Utils;
  5. namespace FastReport
  6. {
  7. /// <summary>
  8. /// Implement this interface if your object can contain list of child objects.
  9. /// </summary>
  10. public interface IParent
  11. {
  12. /// <summary>
  13. /// Gets a value indicating that this object can contain the specified child object.
  14. /// </summary>
  15. /// <param name="child">Child object.</param>
  16. /// <returns><b>true</b> if this object can contain the specified child object; otherwise, <b>false</b>.</returns>
  17. bool CanContain(Base child);
  18. /// <summary>
  19. /// Gets a list of child objects.
  20. /// </summary>
  21. /// <param name="list">List to fill with values.</param>
  22. void GetChildObjects(ObjectCollection list);
  23. /// <summary>
  24. /// Adds a child object to this object's childs.
  25. /// </summary>
  26. /// <param name="child">Object to add.</param>
  27. void AddChild(Base child);
  28. /// <summary>
  29. /// Removes a specified object from this object's childs.
  30. /// </summary>
  31. /// <param name="child"></param>
  32. void RemoveChild(Base child);
  33. /// <summary>
  34. /// Returns z-order of the specified child object.
  35. /// </summary>
  36. /// <param name="child">Child object.</param>
  37. /// <returns>Z-order of the specified object.</returns>
  38. /// <remarks>
  39. /// This method must return the index of a specified child object in the internal child list.
  40. /// </remarks>
  41. int GetChildOrder(Base child);
  42. /// <summary>
  43. /// Sets the z-order of the specified object.
  44. /// </summary>
  45. /// <param name="child">Child object.</param>
  46. /// <param name="order">New Z-order.</param>
  47. /// <remarks>
  48. /// This method must place the specified child object at the specified position in the internal child list.
  49. /// </remarks>
  50. void SetChildOrder(Base child, int order);
  51. /// <summary>
  52. /// Updates the children layout when the size of this object is changed by dx, dy values.
  53. /// </summary>
  54. /// <param name="dx">X delta.</param>
  55. /// <param name="dy">Y delta.</param>
  56. /// <remarks>
  57. /// This method must update positions/sizes of child objects whose <b>Dock</b> or <b>Anchor</b> properties
  58. /// are set to non-default values.
  59. /// </remarks>
  60. void UpdateLayout(float dx, float dy);
  61. }
  62. }