… | |
… | |
31 | to structs */ |
31 | to structs */ |
32 | |
32 | |
33 | #ifdef __cplusplus |
33 | #ifdef __cplusplus |
34 | extern "C" { |
34 | extern "C" { |
35 | #endif /* __cplusplus */ |
35 | #endif /* __cplusplus */ |
|
|
36 | |
|
|
37 | /* Forward declaration (for psiconv_object) */ |
|
|
38 | typedef struct psiconv_file_s *psiconv_file; |
36 | |
39 | |
37 | typedef double psiconv_float_t; |
40 | typedef double psiconv_float_t; |
38 | |
41 | |
39 | typedef enum psiconv_file_type { |
42 | typedef enum psiconv_file_type { |
40 | psiconv_unknown_file, |
43 | psiconv_unknown_file, |
… | |
… | |
225 | { |
228 | { |
226 | psiconv_u32 id; |
229 | psiconv_u32 id; |
227 | psiconv_string_t name; |
230 | psiconv_string_t name; |
228 | } *psiconv_application_id_section; |
231 | } *psiconv_application_id_section; |
229 | |
232 | |
|
|
233 | typedef struct psiconv_object_icon_section_s |
|
|
234 | { |
|
|
235 | psiconv_length_t icon_width; |
|
|
236 | psiconv_length_t icon_height; |
|
|
237 | psiconv_string_t icon_name; |
|
|
238 | } *psiconv_object_icon_section; |
|
|
239 | |
|
|
240 | typedef struct psiconv_object_display_section_s |
|
|
241 | { |
|
|
242 | psiconv_bool_t show_icon; |
|
|
243 | psiconv_length_t width; |
|
|
244 | psiconv_length_t height; |
|
|
245 | } *psiconv_object_display_section; |
|
|
246 | |
|
|
247 | typedef struct psiconv_object_s |
|
|
248 | { |
|
|
249 | psiconv_object_icon_section icon; |
|
|
250 | psiconv_object_display_section display; |
|
|
251 | psiconv_file object; |
|
|
252 | } *psiconv_object; |
|
|
253 | |
230 | typedef struct psiconv_in_line_layout_s |
254 | typedef struct psiconv_in_line_layout_s |
231 | { |
255 | { |
232 | psiconv_character_layout layout; |
256 | psiconv_character_layout layout; |
233 | int length; |
257 | int length; |
|
|
258 | /* If object is NULL, this does not apply to an object */ |
|
|
259 | psiconv_object object; |
|
|
260 | psiconv_length_t object_width; |
|
|
261 | psiconv_length_t object_height; |
234 | } *psiconv_in_line_layout; |
262 | } *psiconv_in_line_layout; |
235 | |
263 | |
236 | typedef psiconv_list psiconv_in_line_layouts; /* of struct in_line_layout */ |
264 | typedef psiconv_list psiconv_in_line_layouts; /* of struct in_line_layout */ |
237 | |
265 | |
238 | typedef enum psiconv_replacement_type |
266 | typedef enum psiconv_replacement_type |
… | |
… | |
445 | psiconv_sheet_error_name, |
473 | psiconv_sheet_error_name, |
446 | psiconv_sheet_error_number, |
474 | psiconv_sheet_error_number, |
447 | psiconv_sheet_error_notavail |
475 | psiconv_sheet_error_notavail |
448 | } psiconv_sheet_errorcode_t; |
476 | } psiconv_sheet_errorcode_t; |
449 | |
477 | |
450 | typedef enum psiconv_numberformat |
478 | typedef enum psiconv_sheet_numberformat_code |
451 | { |
479 | { |
452 | psiconv_numberformat_general, |
480 | psiconv_numberformat_general, |
453 | psiconv_numberformat_fixeddecimal, |
481 | psiconv_numberformat_fixeddecimal, |
454 | psiconv_numberformat_scientific, |
482 | psiconv_numberformat_scientific, |
455 | psiconv_numberformat_currency, |
483 | psiconv_numberformat_currency, |
456 | psiconv_numberformat_percent, |
484 | psiconv_numberformat_percent, |
457 | psiconv_numberformat_triads, |
485 | psiconv_numberformat_triads, |
458 | psiconv_numberformat_boolean, |
486 | psiconv_numberformat_boolean, |
459 | psiconv_numberformat_text, |
487 | psiconv_numberformat_text, |
460 | psiconv_numberformat_date_ddmm, |
488 | psiconv_numberformat_date_dmm, |
461 | psiconv_numberformat_date_mmdd, |
489 | psiconv_numberformat_date_mmd, |
462 | psiconv_numberformat_date_ddmmyy, |
490 | psiconv_numberformat_date_ddmmyy, |
463 | psiconv_numberformat_date_mmddyy, |
491 | psiconv_numberformat_date_mmddyy, |
464 | psiconv_numberformat_date_yymmdd, |
492 | psiconv_numberformat_date_yymmdd, |
465 | psiconv_numberformat_date_ddmmm, |
493 | psiconv_numberformat_date_dmmm, |
|
|
494 | psiconv_numberformat_date_dmmmyy, |
466 | psiconv_numberformat_date_ddmmmyy, |
495 | psiconv_numberformat_date_ddmmmyy, |
467 | psiconv_numberformat_date_ddmmmyyyy, |
|
|
468 | psiconv_numberformat_date_mmm, |
496 | psiconv_numberformat_date_mmm, |
469 | psiconv_numberformat_date_monthname, |
497 | psiconv_numberformat_date_monthname, |
470 | psiconv_numberformat_date_mmmyy, |
498 | psiconv_numberformat_date_mmmyy, |
471 | psiconv_numberformat_date_monthnameyy, |
499 | psiconv_numberformat_date_monthnameyy, |
472 | psiconv_numberformat_date_monthnameddyyyy, |
500 | psiconv_numberformat_date_monthnamedyyyy, |
473 | psiconv_numberformat_datetime_ddmmyyyyhhii, |
501 | psiconv_numberformat_datetime_ddmmyyyyhhii, |
474 | psiconv_numberformat_datetime_ddmmyyyyHHii, |
502 | psiconv_numberformat_datetime_ddmmyyyyHHii, |
475 | psiconv_numberformat_datetime_mmddyyyyhhii, |
503 | psiconv_numberformat_datetime_mmddyyyyhhii, |
476 | psiconv_numberformat_datetime_mmddyyyyHHii, |
504 | psiconv_numberformat_datetime_mmddyyyyHHii, |
477 | psiconv_numberformat_datetime_yyyymmddhhii, |
505 | psiconv_numberformat_datetime_yyyymmddhhii, |
478 | psiconv_numberformat_datetime_yyyymmddHHii, |
506 | psiconv_numberformat_datetime_yyyymmddHHii, |
479 | psiconv_numberformat_time_hhii, |
507 | psiconv_numberformat_time_hhii, |
480 | psiconv_numberformat_time_hhiiss, |
508 | psiconv_numberformat_time_hhiiss, |
481 | psiconv_numberformat_time_HHii, |
509 | psiconv_numberformat_time_HHii, |
482 | psiconv_numberformat_time_HHiiss |
510 | psiconv_numberformat_time_HHiiss |
483 | } psiconv_numberformat_t; |
511 | } psiconv_sheet_numberformat_code_t; |
484 | |
512 | |
485 | typedef struct psiconv_numberformat_s |
513 | typedef struct psiconv_sheet_numberformat_s |
486 | { |
514 | { |
487 | psiconv_numberformat_t numberformat; |
515 | psiconv_sheet_numberformat_code_t code; |
488 | psiconv_u8 decimal; |
516 | psiconv_u8 decimal; |
489 | } *psiconv_numberformat; |
517 | } *psiconv_sheet_numberformat; |
|
|
518 | |
|
|
519 | typedef struct psiconv_sheet_cell_layout_s |
|
|
520 | { |
|
|
521 | psiconv_character_layout character; |
|
|
522 | psiconv_paragraph_layout paragraph; |
|
|
523 | psiconv_sheet_numberformat numberformat; |
|
|
524 | } * psiconv_sheet_cell_layout; |
490 | |
525 | |
491 | typedef struct psiconv_sheet_cell_s |
526 | typedef struct psiconv_sheet_cell_s |
492 | { |
527 | { |
493 | psiconv_u16 column; |
528 | psiconv_u16 column; |
494 | psiconv_u16 row; |
529 | psiconv_u16 row; |
495 | psiconv_cell_type_t type; |
530 | psiconv_cell_type_t type; |
496 | union { |
531 | union { |
497 | psiconv_u32 dat_int; |
532 | psiconv_u32 dat_int; |
498 | double dat_float; |
533 | double dat_float; |
499 | char *dat_string; |
534 | char *dat_string; |
500 | psiconv_bool_t dat_bool; |
535 | psiconv_bool_t dat_bool; |
501 | psiconv_sheet_errorcode_t dat_error; |
536 | psiconv_sheet_errorcode_t dat_error; |
502 | } data; |
537 | } data; |
503 | psiconv_character_layout character; |
538 | psiconv_sheet_cell_layout layout; |
504 | psiconv_paragraph_layout paragraph; |
|
|
505 | psiconv_numberformat numberformat; |
|
|
506 | psiconv_bool_t calculated; |
539 | psiconv_bool_t calculated; |
507 | psiconv_u32 ref_formula; |
540 | psiconv_u32 ref_formula; |
508 | } *psiconv_sheet_cell; |
541 | } *psiconv_sheet_cell; |
509 | |
542 | |
510 | typedef psiconv_list psiconv_sheet_cell_list; |
543 | typedef psiconv_list psiconv_sheet_cell_list; |
511 | /* Of struct psiconv_sheet_cell_s */ |
|
|
512 | |
544 | |
513 | typedef struct psiconv_sheet_status_section_s |
545 | typedef struct psiconv_sheet_status_section_s |
514 | { |
546 | { |
515 | psiconv_bool_t show_graph; |
547 | psiconv_bool_t show_graph; |
516 | psiconv_u32 cursor_row; |
548 | psiconv_u32 cursor_row; |
… | |
… | |
673 | double dat_float; |
705 | double dat_float; |
674 | char *dat_string; |
706 | char *dat_string; |
675 | psiconv_sheet_cell_reference_t dat_cellref; |
707 | psiconv_sheet_cell_reference_t dat_cellref; |
676 | psiconv_sheet_cell_block_t dat_cellblock; |
708 | psiconv_sheet_cell_block_t dat_cellblock; |
677 | psiconv_formula_list fun_operands; |
709 | psiconv_formula_list fun_operands; |
|
|
710 | psiconv_u32 dat_variable; |
678 | } data; |
711 | } data; |
679 | } *psiconv_formula; |
712 | } *psiconv_formula; |
680 | |
713 | |
|
|
714 | typedef struct psiconv_sheet_line_s |
|
|
715 | { |
|
|
716 | psiconv_u32 position; |
|
|
717 | psiconv_sheet_cell_layout layout; |
|
|
718 | } *psiconv_sheet_line; |
|
|
719 | |
|
|
720 | typedef psiconv_list psiconv_sheet_line_list; |
|
|
721 | /* Of struct psiconv_sheet_line_s */ |
|
|
722 | |
|
|
723 | typedef struct psiconv_sheet_grid_size_s |
|
|
724 | { |
|
|
725 | psiconv_u32 line_number; |
|
|
726 | psiconv_length_t size; |
|
|
727 | } *psiconv_sheet_grid_size; |
|
|
728 | |
|
|
729 | typedef psiconv_list psiconv_sheet_grid_size_list; |
|
|
730 | /* Of struct psiconv_sheet_grid_size_s */ |
|
|
731 | |
|
|
732 | typedef psiconv_list psiconv_sheet_grid_break_list; /* of psiconv_u32 */ |
|
|
733 | |
|
|
734 | typedef struct psiconv_sheet_grid_section_s |
|
|
735 | { |
|
|
736 | psiconv_bool_t show_column_titles; |
|
|
737 | psiconv_bool_t show_row_titles; |
|
|
738 | psiconv_bool_t show_vertical_grid; |
|
|
739 | psiconv_bool_t show_horizontal_grid; |
|
|
740 | psiconv_bool_t freeze_rows; |
|
|
741 | psiconv_bool_t freeze_columns; |
|
|
742 | psiconv_u32 frozen_rows; |
|
|
743 | psiconv_u32 frozen_columns; |
|
|
744 | psiconv_u32 first_unfrozen_row_displayed; |
|
|
745 | psiconv_u32 first_unfrozen_column_displayed; |
|
|
746 | psiconv_bool_t show_page_breaks; |
|
|
747 | psiconv_u32 first_row; |
|
|
748 | psiconv_u32 first_column; |
|
|
749 | psiconv_u32 last_row; |
|
|
750 | psiconv_u32 last_column; |
|
|
751 | psiconv_length_t default_row_height; |
|
|
752 | psiconv_length_t default_column_width; |
|
|
753 | psiconv_sheet_grid_size_list row_heights; |
|
|
754 | psiconv_sheet_grid_size_list column_heights; |
|
|
755 | psiconv_sheet_grid_break_list row_page_breaks; |
|
|
756 | psiconv_sheet_grid_break_list column_page_breaks; |
|
|
757 | } *psiconv_sheet_grid_section; |
|
|
758 | |
681 | typedef struct psiconv_sheet_worksheet_section_s |
759 | typedef struct psiconv_sheet_worksheet_s |
682 | { |
760 | { |
683 | psiconv_character_layout character; |
761 | psiconv_sheet_cell_layout default_layout; |
684 | psiconv_paragraph_layout paragraph; |
|
|
685 | psiconv_numberformat numberformat; |
|
|
686 | psiconv_sheet_cell_list cells; |
762 | psiconv_sheet_cell_list cells; |
|
|
763 | psiconv_bool_t show_zeros; |
|
|
764 | psiconv_sheet_line_list row_default_layouts; |
|
|
765 | psiconv_sheet_line_list col_default_layouts; |
|
|
766 | psiconv_sheet_grid_section grid; |
687 | } *psiconv_sheet_worksheet_section; |
767 | } *psiconv_sheet_worksheet; |
|
|
768 | |
|
|
769 | typedef psiconv_list psiconv_sheet_worksheet_list; |
|
|
770 | /* of struct psiconv_sheet_worksheet_s */ |
|
|
771 | |
|
|
772 | typedef enum psiconv_variable_type |
|
|
773 | { |
|
|
774 | psiconv_var_int, |
|
|
775 | psiconv_var_float, |
|
|
776 | psiconv_var_string, |
|
|
777 | psiconv_var_cellref, |
|
|
778 | psiconv_var_cellblock |
|
|
779 | } psiconv_variable_type_t; |
|
|
780 | |
|
|
781 | typedef struct psiconv_sheet_variable_s |
|
|
782 | { |
|
|
783 | psiconv_u32 number; |
|
|
784 | char *name; |
|
|
785 | psiconv_variable_type_t type; |
|
|
786 | union { |
|
|
787 | psiconv_s32 dat_int; |
|
|
788 | double dat_float; |
|
|
789 | char *dat_string; |
|
|
790 | psiconv_sheet_cell_reference_t dat_cellref; |
|
|
791 | psiconv_sheet_cell_block_t dat_cellblock; |
|
|
792 | } data; |
|
|
793 | } *psiconv_sheet_variable; |
|
|
794 | |
|
|
795 | typedef psiconv_list psiconv_sheet_variable_list; |
|
|
796 | /* of struct psiconv_sheet_variable_s */ |
|
|
797 | |
|
|
798 | typedef struct psiconv_sheet_name_section_s |
|
|
799 | { |
|
|
800 | char *name; |
|
|
801 | } *psiconv_sheet_name_section; |
|
|
802 | |
|
|
803 | typedef struct psiconv_sheet_info_section_s |
|
|
804 | { |
|
|
805 | psiconv_bool_t auto_recalc; |
|
|
806 | } *psiconv_sheet_info_section; |
688 | |
807 | |
689 | typedef struct psiconv_sheet_workbook_section_s |
808 | typedef struct psiconv_sheet_workbook_section_s |
690 | { |
809 | { |
691 | psiconv_formula_list formulas; |
810 | psiconv_formula_list formulas; |
692 | psiconv_sheet_worksheet_section worksheet; |
811 | psiconv_sheet_worksheet_list worksheets; |
|
|
812 | psiconv_sheet_variable_list variables; |
|
|
813 | psiconv_sheet_info_section info; |
|
|
814 | psiconv_sheet_name_section name; |
693 | } *psiconv_sheet_workbook_section; |
815 | } *psiconv_sheet_workbook_section; |
694 | |
816 | |
695 | typedef struct psiconv_sheet_f_s |
817 | typedef struct psiconv_sheet_f_s |
696 | { |
818 | { |
697 | psiconv_page_layout_section page_sec; |
819 | psiconv_page_layout_section page_sec; |
698 | psiconv_sheet_status_section status_sec; |
820 | psiconv_sheet_status_section status_sec; |
699 | psiconv_sheet_workbook_section workbook_sec; |
821 | psiconv_sheet_workbook_section workbook_sec; |
700 | } *psiconv_sheet_f; |
822 | } *psiconv_sheet_f; |
701 | |
823 | |
|
|
824 | /* NB: psiconv_file is already defined above */ |
702 | typedef struct psiconv_file_s |
825 | struct psiconv_file_s |
703 | { |
826 | { |
704 | psiconv_file_type_t type; |
827 | psiconv_file_type_t type; |
705 | void *file; |
828 | void *file; |
706 | } *psiconv_file; |
829 | }; |
707 | |
830 | |
708 | |
831 | |
709 | /* UID1 */ |
832 | /* UID1 */ |
710 | #define PSICONV_ID_PSION5 0x10000037 |
833 | #define PSICONV_ID_PSION5 0x10000037 |
711 | #define PSICONV_ID_CLIPART 0x10000041 |
834 | #define PSICONV_ID_CLIPART 0x10000041 |
… | |
… | |
760 | extern psiconv_character_layout psiconv_clone_character_layout |
883 | extern psiconv_character_layout psiconv_clone_character_layout |
761 | (psiconv_character_layout ls); |
884 | (psiconv_character_layout ls); |
762 | |
885 | |
763 | /* Get a numbered style. Returns NULL if the style is unknown. */ |
886 | /* Get a numbered style. Returns NULL if the style is unknown. */ |
764 | extern psiconv_word_style psiconv_get_style (psiconv_word_styles_section ss, int nr); |
887 | extern psiconv_word_style psiconv_get_style (psiconv_word_styles_section ss, int nr); |
|
|
888 | /* Get a numbered formula. Returns NULL if the style is unknown. */ |
|
|
889 | extern psiconv_formula psiconv_get_formula (psiconv_formula_list ss, int nr); |
|
|
890 | |
|
|
891 | /* Return the default layout */ |
|
|
892 | extern psiconv_sheet_cell_layout psiconv_get_default_layout |
|
|
893 | (psiconv_sheet_line_list row_defaults, |
|
|
894 | psiconv_sheet_line_list col_defaults, |
|
|
895 | psiconv_sheet_cell_layout cell_default, |
|
|
896 | int row,int col); |
765 | |
897 | |
766 | extern void psiconv_free_color(psiconv_color color); |
898 | extern void psiconv_free_color(psiconv_color color); |
767 | extern void psiconv_free_border(psiconv_border border); |
899 | extern void psiconv_free_border(psiconv_border border); |
768 | extern void psiconv_free_bullet(psiconv_bullet bullet); |
900 | extern void psiconv_free_bullet(psiconv_bullet bullet); |
769 | extern void psiconv_free_font(psiconv_font font); |
901 | extern void psiconv_free_font(psiconv_font font); |
… | |
… | |
776 | (psiconv_word_styles_section styles); |
908 | (psiconv_word_styles_section styles); |
777 | extern void psiconv_free_formula(psiconv_formula formula); |
909 | extern void psiconv_free_formula(psiconv_formula formula); |
778 | extern void psiconv_free_formula_list(psiconv_formula_list list); |
910 | extern void psiconv_free_formula_list(psiconv_formula_list list); |
779 | extern void psiconv_free_sheet_status_section |
911 | extern void psiconv_free_sheet_status_section |
780 | (psiconv_sheet_status_section section); |
912 | (psiconv_sheet_status_section section); |
|
|
913 | extern void psiconv_free_sheet_cell_layout(psiconv_sheet_cell_layout layout); |
|
|
914 | extern void psiconv_free_sheet_grid_break_list |
|
|
915 | (psiconv_sheet_grid_break_list list); |
|
|
916 | extern void psiconv_free_sheet_grid_size(psiconv_sheet_grid_size s); |
|
|
917 | extern void psiconv_free_sheet_grid_size_list |
|
|
918 | (psiconv_sheet_grid_size_list list); |
|
|
919 | extern void psiconv_free_sheet_grid_section(psiconv_sheet_grid_section sec); |
|
|
920 | extern void psiconv_free_sheet_worksheet(psiconv_sheet_worksheet sheet); |
|
|
921 | extern void psiconv_free_sheet_worksheet_list |
|
|
922 | (psiconv_sheet_worksheet_list list); |
|
|
923 | |
781 | extern void psiconv_free_sheet_f(psiconv_sheet_f file); |
924 | extern void psiconv_free_sheet_f(psiconv_sheet_f file); |
782 | extern void psiconv_free_sheet_cell(psiconv_sheet_cell cell); |
925 | extern void psiconv_free_sheet_cell(psiconv_sheet_cell cell); |
783 | extern void psiconv_free_sheet_cell_list(psiconv_sheet_cell_list list); |
926 | extern void psiconv_free_sheet_cell_list(psiconv_sheet_cell_list list); |
784 | extern void psiconv_free_numberformat(psiconv_numberformat numberformat); |
927 | extern void psiconv_free_sheet_numberformat |
|
|
928 | (psiconv_sheet_numberformat numberformat); |
|
|
929 | extern void psiconv_free_sheet_line_list(psiconv_sheet_line_list list); |
|
|
930 | extern void psiconv_free_sheet_line(psiconv_sheet_line line); |
|
|
931 | extern void psiconv_free_sheet_name_section(psiconv_sheet_name_section section); |
|
|
932 | extern void psiconv_free_sheet_variable(psiconv_sheet_variable list); |
|
|
933 | extern void psiconv_free_sheet_variable_list(psiconv_sheet_variable_list list); |
|
|
934 | extern void psiconv_free_sheet_info_section(psiconv_sheet_info_section section); |
785 | extern void psiconv_free_header_section(psiconv_header_section header); |
935 | extern void psiconv_free_header_section(psiconv_header_section header); |
786 | extern void psiconv_free_section_table_entry(psiconv_section_table_entry entry); |
936 | extern void psiconv_free_section_table_entry(psiconv_section_table_entry entry); |
787 | extern void psiconv_free_section_table_section |
937 | extern void psiconv_free_section_table_section |
788 | (psiconv_section_table_section section); |
938 | (psiconv_section_table_section section); |
789 | extern void psiconv_free_application_id_section |
939 | extern void psiconv_free_application_id_section |
790 | (psiconv_application_id_section section); |
940 | (psiconv_application_id_section section); |
|
|
941 | extern void psiconv_free_object_display_section |
|
|
942 | (psiconv_object_display_section section); |
|
|
943 | extern void psiconv_free_object_icon_section |
|
|
944 | (psiconv_object_icon_section section); |
|
|
945 | extern void psiconv_free_object(psiconv_object object); |
791 | extern void psiconv_free_in_line_layout(psiconv_in_line_layout layout); |
946 | extern void psiconv_free_in_line_layout(psiconv_in_line_layout layout); |
792 | extern void psiconv_free_in_line_layouts(psiconv_in_line_layouts layouts); |
947 | extern void psiconv_free_in_line_layouts(psiconv_in_line_layouts layouts); |
793 | extern void psiconv_free_replacement(psiconv_replacement replacement); |
948 | extern void psiconv_free_replacement(psiconv_replacement replacement); |
794 | extern void psiconv_free_replacements(psiconv_replacements replacements); |
949 | extern void psiconv_free_replacements(psiconv_replacements replacements); |
795 | extern void psiconv_free_paragraph(psiconv_paragraph paragraph); |
950 | extern void psiconv_free_paragraph(psiconv_paragraph paragraph); |