pub struct PageGrid {Show 15 fields
pub page_w: f64,
pub page_h: f64,
pub margins: [f64; 6],
pub gap: f64,
pub scale: f32,
pub hf_sides: [f64; 2],
pub hf_text_k: f32,
pub paper_pt: (f32, f32),
pub row_bands: Vec<(u32, u32)>,
pub col_bands: Vec<(u32, u32)>,
pub rows_complete: bool,
pub cols_complete: bool,
pub data_rows: (usize, usize),
pub data_cols: (usize, usize),
pub page_order: PageOrder,
/* private fields */
}Expand description
One sheet paginated for the Page Layout view.
Fields§
§page_w: f64Page size in layout units.
page_h: f64§margins: [f64; 6]Left, right, top, bottom, header and footer margins in layout units.
gap: f64Gap between pages in layout units.
scale: f32Print scale (1.0 = 100%): screen sizes of cells are zoom × scale.
hf_sides: [f64; 2]Left and right margins of headers and footers in layout units (the side margins, or a fixed 0.7 inch, at most a quarter of the page width, with Align with Page Margins off).
hf_text_k: f32Layout units per sheet pixel of header and footer text: 1 with Scale with Document on,
otherwise 1 / scale, so the text keeps its point size on paper.
paper_pt: (f32, f32)Paper size in points (after orientation), for the rulers.
row_bands: Vec<(u32, u32)>§col_bands: Vec<(u32, u32)>§rows_complete: boolThe bands reach the sheet’s last row / column.
cols_complete: bool§data_rows: (usize, usize)Bands holding printed data: [first, last] row bands and column bands.
data_cols: (usize, usize)§page_order: PageOrderThe sheet’s page order, which numbers the printed pages.
Implementations§
Source§impl PageGrid
impl PageGrid
Sourcepub fn build(
wb: &Workbook,
si: usize,
need_row: u32,
need_col: u32,
) -> Option<PageGrid>
pub fn build( wb: &Workbook, si: usize, need_row: u32, need_col: u32, ) -> Option<PageGrid>
Paginates sheet si far enough to cover row need_row and column need_col (and at
least the printed area). None when the sheet doesn’t exist.
Sourcepub fn covers(&self, r: u32, c: u32) -> bool
pub fn covers(&self, r: u32, c: u32) -> bool
The grid covers row r and column c (else it needs a rebuild with more pages).
pub fn page_y(&self, i: usize) -> f64
Sourcepub fn page_rect(&self, i: usize, j: usize) -> (f64, f64, f64, f64)
pub fn page_rect(&self, i: usize, j: usize) -> (f64, f64, f64, f64)
The page rectangle (x, y, w, h) of page (i, j).
Sourcepub fn content_rect(&self, i: usize, j: usize) -> (f64, f64, f64, f64)
pub fn content_rect(&self, i: usize, j: usize) -> (f64, f64, f64, f64)
Where the cells of page (i, j) go: inside the margins.
Sourcepub fn page_col_at(&self, x: f64) -> usize
pub fn page_col_at(&self, x: f64) -> usize
Page column under x (the nearest one in gaps).
pub fn page_row_at(&self, y: f64) -> usize
Sourcepub fn col_at(&self, x: f64) -> u32
pub fn col_at(&self, x: f64) -> u32
Column under x, clamped to the page’s columns (margins and gaps hit the nearest one).
pub fn row_at(&self, y: f64) -> u32
Sourcepub fn page_at(&self, x: f64, y: f64) -> Option<(usize, usize)>
pub fn page_at(&self, x: f64, y: f64) -> Option<(usize, usize)>
The page (i, j) whose paper contains the point, if any.
Sourcepub fn on_cells(&self, x: f64, y: f64) -> bool
pub fn on_cells(&self, x: f64, y: f64) -> bool
The point lies on cells (inside a page’s margins, on a cell of that page).
Sourcepub fn hf_zone_at(&self, x: f64, y: f64) -> Option<((usize, usize), HfZone)>
pub fn hf_zone_at(&self, x: f64, y: f64) -> Option<((usize, usize), HfZone)>
The header or footer section under the point: the top or bottom margin of a page, split into thirds between the header and footer side margins.
Sourcepub fn is_data_page(&self, i: usize, j: usize) -> bool
pub fn is_data_page(&self, i: usize, j: usize) -> bool
Page (i, j) holds printed data (others are “Click to add data” pages).
Sourcepub fn page_number(&self, i: usize, j: usize) -> Option<(usize, usize)>
pub fn page_number(&self, i: usize, j: usize) -> Option<(usize, usize)>
Printed page number of page (i, j) (in the sheet’s page order) and the printed page count.
Sourcepub fn pages_in(
&self,
x0: f64,
y0: f64,
x1: f64,
y1: f64,
) -> ((usize, usize), (usize, usize))
pub fn pages_in( &self, x0: f64, y0: f64, x1: f64, y1: f64, ) -> ((usize, usize), (usize, usize))
Page rows and columns overlapping the layout rectangle [x0, x1] × [y0, y1].
Sourcepub fn row_band(&self, i: usize) -> Option<(u32, u32)>
pub fn row_band(&self, i: usize) -> Option<(u32, u32)>
Rows (first, last) of a page row and columns of a page column.