/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/IXLRow.cs

# · C# · 190 lines · 52 code · 36 blank · 102 comment · 0 complexity · a5af03bc74326f50bc5f52159210898f MD5 · raw file

  1. using System;
  2. namespace ClosedXML.Excel
  3. {
  4. public interface IXLRow : IXLRangeBase
  5. {
  6. /// <summary>
  7. /// Gets or sets the height of this row.
  8. /// </summary>
  9. /// <value>
  10. /// The width of this row.
  11. /// </value>
  12. Double Height { get; set; }
  13. /// <summary>
  14. /// Deletes this row and shifts the rows below this one accordingly.
  15. /// </summary>
  16. void Delete();
  17. /// <summary>
  18. /// Gets this row's number
  19. /// </summary>
  20. Int32 RowNumber();
  21. /// <summary>
  22. /// Inserts X number of rows below this one.
  23. /// <para>All rows below will be shifted accordingly.</para>
  24. /// </summary>
  25. /// <param name="numberOfRows">The number of rows to insert.</param>
  26. IXLRows InsertRowsBelow(Int32 numberOfRows);
  27. /// <summary>
  28. /// Inserts X number of rows above this one.
  29. /// <para>This row and all below will be shifted accordingly.</para>
  30. /// </summary>
  31. /// <param name="numberOfRows">The number of rows to insert.</param>
  32. IXLRows InsertRowsAbove(Int32 numberOfRows);
  33. IXLRow AdjustToContents();
  34. /// <summary>
  35. /// Adjusts the height of the row based on its contents, starting from the startColumn.
  36. /// </summary>
  37. /// <param name="startColumn">The column to start calculating the row height.</param>
  38. IXLRow AdjustToContents(Int32 startColumn);
  39. /// <summary>
  40. /// Adjusts the height of the row based on its contents, starting from the startColumn and ending at endColumn.
  41. /// </summary>
  42. /// <param name="startColumn">The column to start calculating the row height.</param>
  43. /// <param name="endColumn">The column to end calculating the row height.</param>
  44. IXLRow AdjustToContents(Int32 startColumn, Int32 endColumn);
  45. IXLRow AdjustToContents(Double minHeight, Double maxHeight);
  46. IXLRow AdjustToContents(Int32 startColumn, Double minHeight, Double maxHeight);
  47. IXLRow AdjustToContents(Int32 startColumn, Int32 endColumn, Double minHeight, Double maxHeight);
  48. /// <summary>Hides this row.</summary>
  49. IXLRow Hide();
  50. /// <summary>Unhides this row.</summary>
  51. IXLRow Unhide();
  52. /// <summary>
  53. /// Gets a value indicating whether this row is hidden or not.
  54. /// </summary>
  55. /// <value>
  56. /// <c>true</c> if this row is hidden; otherwise, <c>false</c>.
  57. /// </value>
  58. Boolean IsHidden { get; }
  59. /// <summary>
  60. /// Gets or sets the outline level of this row.
  61. /// </summary>
  62. /// <value>
  63. /// The outline level of this row.
  64. /// </value>
  65. Int32 OutlineLevel { get; set; }
  66. /// <summary>
  67. /// Adds this row to the next outline level (Increments the outline level for this row by 1).
  68. /// </summary>
  69. IXLRow Group();
  70. /// <summary>
  71. /// Adds this row to the next outline level (Increments the outline level for this row by 1).
  72. /// </summary>
  73. /// <param name="collapse">If set to <c>true</c> the row will be shown collapsed.</param>
  74. IXLRow Group(Boolean collapse);
  75. /// <summary>
  76. /// Sets outline level for this row.
  77. /// </summary>
  78. /// <param name="outlineLevel">The outline level.</param>
  79. IXLRow Group(Int32 outlineLevel);
  80. /// <summary>
  81. /// Sets outline level for this row.
  82. /// </summary>
  83. /// <param name="outlineLevel">The outline level.</param>
  84. /// <param name="collapse">If set to <c>true</c> the row will be shown collapsed.</param>
  85. IXLRow Group(Int32 outlineLevel, Boolean collapse);
  86. /// <summary>
  87. /// Adds this row to the previous outline level (decrements the outline level for this row by 1).
  88. /// </summary>
  89. IXLRow Ungroup();
  90. /// <summary>
  91. /// Adds this row to the previous outline level (decrements the outline level for this row by 1).
  92. /// </summary>
  93. /// <param name="fromAll">If set to <c>true</c> it will remove this row from all outline levels.</param>
  94. IXLRow Ungroup(Boolean fromAll);
  95. /// <summary>
  96. /// Show this row as collapsed.
  97. /// </summary>
  98. IXLRow Collapse();
  99. /// <summary>
  100. /// Gets the cell in the specified column.
  101. /// </summary>
  102. /// <param name="columnNumber">The cell's column.</param>
  103. IXLCell Cell(Int32 columnNumber);
  104. /// <summary>
  105. /// Gets the cell in the specified column.
  106. /// </summary>
  107. /// <param name="columnLetter">The cell's column.</param>
  108. IXLCell Cell(String columnLetter);
  109. /// <summary>
  110. /// Returns the specified group of cells, separated by commas.
  111. /// <para>e.g. Cells("1"), Cells("1:5"), Cells("1,3:5")</para>
  112. /// </summary>
  113. /// <param name="cellsInRow">The row's cells to return.</param>
  114. new IXLCells Cells(String cellsInRow);
  115. /// <summary>
  116. /// Returns the specified group of cells.
  117. /// </summary>
  118. /// <param name="firstColumn">The first column in the group of cells to return.</param>
  119. /// <param name="lastColumn">The last column in the group of cells to return.</param>
  120. IXLCells Cells(Int32 firstColumn, Int32 lastColumn);
  121. /// <summary>
  122. /// Returns the specified group of cells.
  123. /// </summary>
  124. /// <param name="firstColumn">The first column in the group of cells to return.</param>
  125. /// <param name="lastColumn">The last column in the group of cells to return.</param>
  126. IXLCells Cells(String firstColumn, String lastColumn);
  127. /// <summary>Expands this row (if it's collapsed).</summary>
  128. IXLRow Expand();
  129. Int32 CellCount();
  130. IXLRangeRow CopyTo(IXLCell cell);
  131. IXLRangeRow CopyTo(IXLRangeBase range);
  132. IXLRow CopyTo(IXLRow row);
  133. IXLRow Sort();
  134. IXLRow SortLeftToRight(XLSortOrder sortOrder = XLSortOrder.Ascending, Boolean matchCase = false, Boolean ignoreBlanks = true);
  135. IXLRangeRow Row(Int32 start, Int32 end);
  136. IXLRangeRow Row(IXLCell start, IXLCell end);
  137. IXLRangeRows Rows(String columns);
  138. /// <summary>
  139. /// Adds a horizontal page break after this row.
  140. /// </summary>
  141. IXLRow AddHorizontalPageBreak();
  142. IXLRow SetDataType(XLCellValues dataType);
  143. IXLRow RowAbove();
  144. IXLRow RowAbove(Int32 step);
  145. IXLRow RowBelow();
  146. IXLRow RowBelow(Int32 step);
  147. /// <summary>
  148. /// Clears the contents of this row.
  149. /// </summary>
  150. /// <param name="clearOptions">Specify what you want to clear.</param>
  151. new IXLRow Clear(XLClearOptions clearOptions = XLClearOptions.ContentsAndFormats);
  152. IXLRangeRow RowUsed(Boolean includeFormats = false);
  153. }
  154. }