Multipage View Feature Specification Version 002 Pre-Alpha Draft 2007-07-23 CHANGES TO PREVIOUS DRAFT added changes category added TOC extended draft added more graphical examples TOC Introduction A) Constant Number of Pages per ROW 1.Two-Page View 2.Generalized: n-Page View 3.Single-ROW View [spec not yet written] B) Dynamically Calculate Number of Pages for each ROW C) Discussion
Types of Multipage View There are various possibilities for multipage views. Roughly, OOo Writer should be able to display a constant number of pages on each row, or, alternatively, compute dynamically the number of pages that fit horizontally in each row. At the other extreme, there can be a single row with ALL pages being displayed sequentially on this row. A)Constant Number of Pages 1.Two-Page View it is unlikely to have 2 differing page sizes BUT both normal as well as landscape pages will be displayed left margin: is the furthest left margin of any page right margin: is the furthest right margin of any page the boundary between 2 adjacent pages shall have a fixed horizontal position first column of pages shall be right-aligned to this boudary second column of pages shall be left-aligned to this boundary
Various Options: First ROW a)Two Pages in the first row b)Single Page in the first row: right hand page is usually an odd-numbered page Allow larger Pages to extend beyond Viewing Area a)fit all pages: all pages will fit the viewing area (as shown for the landscape page 4 in the first picture) calculate max(width(column_1)) and max(width(column_2)) use [max(...1) + max(...2)] to calculate zoom factor Should we allow different zoom-factors for every ROW? b)allow wider pages to extend beyond the view area, forcing horizontal scrolling: in the next picture, page 2 would extend to the right margin of the display and page 4 would extend beyond the viewing area. Adjacent Page Separation a)customizable space between the 2 adjacent pages b)NO space between the 2 adjacent pages (continuous horizontal display)
ZOOM a)Zoom: Fit Width IF 'FIT ALL Pages' selected: OOo shall determine the widest page in the 1st column and in the 2nd column, and calculate the maximal width as the following sum: max_width = max width column 1 + space between columns + max width column 2 zoom-factor = (View_Area_Width – 'some space on the margins' * 2) / max_width IF 'Allow Wider Pages Extend Beyond View Area' is selected: either neglect landscape pages and consider only the normal pages for computing the zoom factor (DISADVANTAGE: if one column consists entirely of landscape pages) use MEDIANS: compute ALL width for column 1, calculate the median for these column widths compute similarly ALL width for column 2 and the median thereof use these medians in the calculation of the zoom factor this will ensure that AT LEAST 50% of pages in both columns will be displayed within the boundaries of the viewing area WITHOUT the need to scroll horizontally!
[yet, it is still possible to have to scroll for (almost) every pair of pages, IF both columns contain alternating normal/landscape pages, e.g. NL, LN, NL, LN, NN] alternatively, compute ALL (width page column 1 + width page column 2), and use the median of this array in the calculation of the zoom factor set the vertical boundary between the 2 adjacent pages so that most pages in column 1 and most pages in column 2 can be viewed without scrolling b)Explicit Zoom: the zoom-factor was set explicitly by the user center the vertical boundary separating 2 adjacent pages alternatively: maximize number of pages that are displayed without need of H-scroll calculate ALL (width page in column 1 + that in column 2) IF max(of previously calculated width) < View_Area_Width – 2 * Margins – Space_Between_Columns => ALL pages fit within the Display View WITHOUT horizontal scrolling! ELSE ... (will need to think a more advanced algorithm)
View Only Text Area a)View Full Page b)View only Text Area (without the white margins) 2.n-Page View more complex: will need to think a little bit deeper about it A)Dynamically Calculate the Number of Pages that Fit 1.FOR ( i = _page_begin TO _page_end ) IF ( width(page[i]) > View_Area_Width ) either zoom to fit, IF such option is selected or simply draw the page and allow for horizontal scrolling i++; create new page row; LOOP ELSE FOR ( j = i; i <= _page_end; i++ ) IF ( ( width_sum += width(page[i] + width(page[++i]) ) < View_Area_Width ) INNER LOOP ELSE draw page[j] TO page[i - 1] on current page row new page row EXIT INNER LOOP/ RUN OUTER LOOP
# INNER LOOP EXITED W/O DRAWING PAGES[j:i] draw page[j] TO page[i] on current page row i++; # EXIT OUTER LOOP 2.LOOP FURTHER DISCUSSION / TO-DO's - NONE WRITTEN - - BUT A LOT TODO -
Types of Multipage View There are various possibilities for multipage views. Roughly, OOo Writer should be able to display a constant number of pages on each row, or, alternatively, compute dynamically the number of pages that fit horizontally in each row. At the other extreme, there can be a single row with ALL pages being displayed sequentially on this row. A)Constant Number of Pages 1.Two-Page View it is unlikely to have 2 differing page sizes BUT both normal as well as landscape pages will be displayed left margin: is the furthest left margin of any page right margin: is the furthest right margin of any page the boundary between 2 adjacent pages shall have a fixed horizontal position first column of pages shall be right-aligned to this boudary second column of pages shall be left-aligned to this boundary
[yet, it is still possible to have to scroll for (almost) every pair of pages, IF both columns contain alternating normal/landscape pages, e.g. NL, LN, NL, LN, NN] alternatively, compute ALL (width page column 1 + width page column 2), and use the median of this array in the calculation of the zoom factor set the vertical boundary between the 2 adjacent pages so that most pages in column 1 and most pages in column 2 can be viewed without scrolling b)Explicit Zoom: the zoom-factor was set explicitly by the user center the vertical boundary separating 2 adjacent pages alternatively: maximize number of pages that are displayed without need of H-scroll calculate ALL (width page in column 1 + that in column 2) IF max(of previously calculated width) < View_Area_Width – 2 * Margins – Space_Between_Columns => ALL pages fit within the Display View WITHOUT horizontal scrolling! ELSE ... (will need to think a more advanced algorithm)
ZOOM a)Zoom: Fit Width IF 'FIT ALL Pages' selected: OOo shall determine the widest page in the 1st column and in the 2nd column, and calculate the maximal width as the following sum: max_width = max width column 1 + space between columns + max width column 2 zoom-factor = (View_Area_Width – 'some space on the margins' * 2) / max_width IF 'Allow Wider Pages Extend Beyond View Area' is selected: either neglect landscape pages and consider only the normal pages for computing the zoom factor (DISADVANTAGE: if one column consists entirely of landscape pages) use MEDIANS: compute ALL width for column 1, calculate the median for these column widths compute similarly ALL width for column 2 and the median thereof use these medians in the calculation of the zoom factor this will ensure that AT LEAST 50% of pages in both columns will be displayed within the boundaries of the viewing area WITHOUT the need to scroll horizontally!
[yet, it is still possible to have to scroll for (almost) every pair of pages, IF both columns contain alternating normal/landscape pages, e.g. NL, LN, NL, LN, NN] alternatively, compute ALL (width page column 1 + width page column 2), and use the median of this array in the calculation of the zoom factor set the vertical boundary between the 2 adjacent pages so that most pages in column 1 and most pages in column 2 can be viewed without scrolling b)Explicit Zoom: the zoom-factor was set explicitly by the user center the vertical boundary separating 2 adjacent pages alternatively: maximize number of pages that are displayed without need of H-scroll calculate ALL (width page in column 1 + that in column 2) IF max(of previously calculated width) < View_Area_Width – 2 * Margins – Space_Between_Columns => ALL pages fit within the Display View WITHOUT horizontal scrolling! ELSE ... (will need to think a more advanced algorithm)
# INNER LOOP EXITED W/O DRAWING PAGES[j:i] draw page[j] TO page[i] on current page row i++; # EXIT OUTER LOOP 2.LOOP FURTHER DISCUSSION / TO-DO's - NONE WRITTEN - - BUT A LOT TODO -
facing pages