Домой Классы Статические функции Перечисления (ENUM) Записи (RECORD)

{Report|_printing}


(включая защищенные члены)

CLASS {Report|_printing} , UNTESTED, BITWISE:



IMPORT : {Geometry} , {Canvas} , {Font} , {Bitmap} , {Mathematics} .

STR Title|_of_report_document , INIT


      

ENUMERATION {wrap|_words_syllabels} :

        'NO_WRAP|_CUT_TEXT' ,

        'WRAP_WORDS' ,

        'WRAP_SYLLABELS' .



ENUMERATION {align_text} :

        'LEFT|_ALIGN' ,

        'RIGHT|_ALIGN' ,

        'CENTER|_ALIGN' ,

        'JUSTIFY|_SIDES' .



ENUMERATION {vertical_align} :

        'TOP|_ALIGN' ,

        'BOTTOM|_ALIGN' ,

        'CENTER_VERTICAL' .


CONSTANT INT {font_style} :

          BOLD|_STYLE = 1

          ITALIC|_STYLE = 2

          UNDERLINE|_STYLE = 4

          STRIKEOUT|_STYLE = 8 .



STRUCTURE {margins|_for_cell}

      REAL Left|_margin

      REAL Right|_margin

      REAL Top|_margin

      REAL Bottom|_margin .



STRUCTURE {cell|_of_band}

      STR Name|_of_cell

      INT Band|_index

      {rect} Bounds|_relative_to_band

      {rect} Bounds0|_initial

      REAL Border|_width

      REAL Border_ex|ternal_width

      STR Borders|_lines_LRTB_Diagonal_Zdiagonal

      {margins} Margins|_4_sides

      {wrap} Wrap|_words

      BOOL Scale_down|_to_fit_text

      BOOL Scale_up

      BOOL Transparent

      INT Background

      INT Foreground

      {align_text} Align|_text

      {vertical_align} Vertical_align

      BOOL Show_pages_count|_rather_then_text

      INT Font_face_index INDEXING STR

      INT Font_style

      REAL Font_size .


STR all_font_faces[]


 

METHOD use_font_face ( STR Font_face|_custom ) ==> INT



--------------------------------------------------------- 'bands and cells'

STR Band_names[] , READ


{cell} Cells|_array[] , READ


STR Values|_text_of_all_cells[] , READ


REAL cell_border


REAL external_border


STR sides|_borders



---------------------------------------------------------------- 'creating'

   

METHOD Band|_create ( STR Band_name )



METHOD Band_borders|_set ( REAL Value|_border , REAL External_border )



METHOD Border_sides ( STR Sides|_border_LRTB_D_Z )


{wrap} wrapping|_for_cells_created


BOOL scale_down|_for_cells_created


BOOL scale_up|_for_cells_created


  

METHOD Margins|_for_next_cells ( {margins} M|argins_to_set )



METHOD Wrapping|_and_scaling (
     
{wrap} Wrap|_to_set ,
     
BOOL Scale_down|_to_fit ,
     
BOOL Scale_up )


{align_text} aligning|_for_cells_created


{vertical_align} vertical_align|_for_cells_created


 

METHOD Align|_text (
     
{align_text} Align|_text ,
     
{vertical_align} Vertical_align )


STR font_face|_for_cells_created


REAL font_size|_for_cells_created


INT font_style|_for_cells_created


 

METHOD Font|_custom ( STR Font_face , REAL Font_size , STR Font_style )


INT foreground|_for_cells_created


INT background|_for_cells_created


 

METHOD Colors|_custom ( INT Foreground , INT Background )


{margins} margins|_for_cells_created


     

METHOD Cell|_create (
     
STR Name|_of_cell ,
     
{rect} Rect|angle ,
     
STR Value|_initial )



METHOD Cell_r|ight (
     
STR Name|_of_cell ,
     
{rect} Rect|angle ,
     
STR Value|_initial )



METHOD Cell_d|own (
     
STR Name|_of_cell ,
     
{rect} Rect|angle ,
     
STR Value|_initial )



METHOD Show_pages_count|_just_created_cell_wiil_be_show_rather_then_value



METHOD Total_pages|_count_generated ==> INT



------------------------------------------- 'using bands / cells in report'

INDEXING (STR, {page_attr})

INT Current|_band_index , READ


   

METHOD Set_current ( INT New_current ) , SETTER FOR Current



METHOD Band_name ==> STR



METHOD Select|_band_by_name ( STR Name_band )


BOOL OK|_if_last_change_was_successful , READ


    

METHOD Change|_value_while_printing (
     
STR Cell_name ,
     
STR Value|_to_set )



METHOD Is_fit|_text_of_all_cells_of_band ==> BOOL



METHOD Resize|_all_cells_in_band_vertically (
     
REAL Percents|_100_to_reset )



METHOD Resize_to_fit ( REAL Maximal|_percents , REAL Delta|_percents )



------------------------------------------------------ 'printing / drawing'

{Canvas} Canvas|_destination , READ


{Bitmap} Fake|_bitmap


        

METHOD Destination|_canvas_set ( {Canvas} Value|_canvas )



ENUMERATION {move_pos|ition_direction} :

        'NOT_MOVE' ,

        'MOVE_DOWN' ,

        'MOVE_RIGHT' .



METHOD Print_down



METHOD Print_right



METHOD Print_band (
     
BOOL Wrap|_next_line_if_too_wide_band ,
     
BOOL Next_page|_if_too_high_band ,
     
{move_pos} Move|_position_after_printing_band ) ==> BOOL



METHOD is_external_border ( STR Side|_LTRB ) ==> BOOL



METHOD Band_height ( STR Name|_of_band ) ==> REAL



METHOD Band_width ( STR Name|_of_band ) ==> REAL


BOOL line_ex|ternal_drawing_now


 

METHOD line_command (
     
{point} P1|_start_line ,
     
{point} P2|_end_line ,
     
{cell} C|ell_line_beloning_to )


BOOL make_commands|_rather_then_calculate_output


INDEXING ({cell},STR)

INT index_cell|_command


      

METHOD calculate_out|put_rectangle (
     
{rect} Dest|ination_rectangle ,
     
BOOL Syllabels ) ==> {rect}



METHOD get_maximal_portion (
     
STR Words|_array [] ,
     
BOOL Word_br|eak_flags [] ,
     
REAL Width_max|imum_allowed ) ==> STR



FUNCTION separate_by_syllabels (
     
STR Words|_array [] ,
     
BOOL Word_br|eak_flags [] ,
     
INT Index_w|ord_to_separate INDEXING STR )



FUNCTION cut_single_syllabel (
     
STR S|tring_word_to_cut_single_syllabel ,
     
BOOL End|_of_entire_word ) ==> INT



FUNCTION count_vowels ( STR S|tring_word ) ==> INT



FUNCTION is_vowel ( STR L|etter_to_test ) ==> BOOL


BOOL Syllabels_second|_time_to_try_to_fit_only


 

METHOD adjust_output (
     
{rect} Dest|ination_rectangle ) ==> BOOL


{rect} out_r|ectangle


   

METHOD print_text_commands (
     
{Geometry}.{rect} Dest|ination_rectangle ,
     
INT Index|_of_cell INDEXING ({cell},STR) )



METHOD Desired_rect|angle_for_cell ( STR Name|_cell ) ==> {rect}



METHOD rect_desired|_by_index ==> {rect}


REAL height_to_restore_band[]


INT band_to_restore_height[]


      

METHOD do_set_band_height (
     
INT B|and_index_to_set_height ,
     
REAL H|eight_to_set ,
     
BOOL Store|_in_stack_of_heights_set )



METHOD Set_band_height ( REAL H|eight_to_set ) , PUSH



METHOD restore_band_height , POP



METHOD Band_rect|angle ==> {rect}



METHOD make_single_command (
     
{rect} Dest|ination_rectangle ,
     
STR Text|_to_output )



METHOD make_single_command_1_word (
     
{rect} Dest|ination_rectangle ,
     
STR Text|_to_output ,
     
BOOL Right|_align )



------------------------------------------------------------ 'page control'

REAL page_width


REAL page_height


BOOL Landscape|_orientation , READ


 

METHOD Set_landscape (
     
BOOL V|alue_landscape ) , SETTER FOR Landscape


{margins} page_margins


            

METHOD Page_width ==> REAL



METHOD Page_height ==> REAL



METHOD Height_available ==> REAL



METHOD Width_available ==> REAL



METHOD Page_margin_left ==> REAL



METHOD Page_margin_right ==> REAL



METHOD Page_margin_top ==> REAL



METHOD Page_margin_bottom ==> REAL



ENUMERATION {page_size} :

        'A4|_USUAL_PAGE_FORMAT' ,

        'A3|_LARGE_PAGE' ,

        'A5|_SMALL_PAGE' ,

        'CUSTOM_SIZE' .



METHOD Set_page|_size_and_orientation (
     
{page_size} Page_format ,
     
{point} Size|_for_case_of_CUSTOM_SIZE ,
     
BOOL Is_landscape )



METHOD Set_margins|_page ( {margins} Value|_to_set )



STRUCTURE {page_attr|ibutes}

      REAL Page_width|_in_points

      REAL Page_height|_in_points

      BOOL Landscape|_orientation

      {margins} Margins|_page .


{page_attr} page_attr|ibutes[]


INDEXING {page_attr}

INT page|_current_index_from_0


INT last_page|_printing


{point} Position|_in_page


   

METHOD Count|_pages ==> INT



METHOD Page_number|_current_from_1 ==> INT



METHOD End_page



--------------------------------------------------- 'stored print commands'

  

ENUMERATION {kind_command|_to_print} :

        'RECT|ANGLE_WO_LINES' ,

        'LINE|_COMMAND' ,

        'TEXT|_COMMAND' ,

        'COUNT|_PAGES' .



STRUCTURE {command|_info}

      INT Page|_index

      {kind_command} Kind|_of_command

      {point} Point1|_line

      {point} Point2|_line

      REAL Line_width

      INT Color|_line_fill_or_text

      BOOL Transparent

      BOOL Show_pages_count

      INT Font_face_index INDEXING STR

      REAL Font_size

      INT Font_style .


{command} all_commands|_to_print_pages[]


STR all_text|_for_commands[]


 

METHOD Clear|_all_commands_before_prepare_report



------------------------------------------------------ 'draw page commands'

REAL Scale_draw


BOOL Do_not_reset|_transforms_before_draw


BOOL Do_not_rotate|_if_landscape|_set_TRUE_to_preview_when_landscape


BOOL Do_not_erase


 

METHOD Draw_page ( INT Index|_of_page_to_print )



--------------------------------------------------------- 'generate report'

   

FUNCTION Generate|_override_next_method (
     
{Report} R|eport_to_generate ) , HANDLER



METHOD generate|_custom



METHOD Generated ==> BOOL



----------------------------------------------------- 'methods to override'

  

METHOD page_started , CALLBACK



METHOD page_ended , CALLBACK


END