/[public]/psiconv/trunk/lib/psiconv/data.h
ViewVC logotype

Diff of /psiconv/trunk/lib/psiconv/data.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 99 Revision 160
32 32
33#ifdef __cplusplus 33#ifdef __cplusplus
34extern "C" { 34extern "C" {
35#endif /* __cplusplus */ 35#endif /* __cplusplus */
36 36
37/* Forward declaration (for psiconv_object) */
38typedef struct psiconv_file_s *psiconv_file;
39
40typedef double psiconv_float_t;
37 41
38typedef enum psiconv_file_type { 42typedef enum psiconv_file_type {
39 psiconv_unknown_file, 43 psiconv_unknown_file,
40 psiconv_word_file, 44 psiconv_word_file,
41 psiconv_texted_file, 45 psiconv_texted_file,
190 psiconv_size_t space_below; 194 psiconv_size_t space_below;
191 psiconv_bool_t keep_together; 195 psiconv_bool_t keep_together;
192 psiconv_bool_t keep_with_next; 196 psiconv_bool_t keep_with_next;
193 psiconv_bool_t on_next_page; 197 psiconv_bool_t on_next_page;
194 psiconv_bool_t no_widow_protection; 198 psiconv_bool_t no_widow_protection;
199 psiconv_bool_t wrap_to_fit_cell;
195 psiconv_length_t border_distance; 200 psiconv_length_t border_distance;
196 psiconv_bullet bullet; 201 psiconv_bullet bullet;
197 psiconv_border left_border; 202 psiconv_border left_border;
198 psiconv_border right_border; 203 psiconv_border right_border;
199 psiconv_border top_border; 204 psiconv_border top_border;
223{ 228{
224 psiconv_u32 id; 229 psiconv_u32 id;
225 psiconv_string_t name; 230 psiconv_string_t name;
226} *psiconv_application_id_section; 231} *psiconv_application_id_section;
227 232
233typedef 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
240typedef 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
247typedef 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
228typedef struct psiconv_in_line_layout_s 254typedef struct psiconv_in_line_layout_s
229{ 255{
230 psiconv_character_layout layout; 256 psiconv_character_layout layout;
231 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;
232} *psiconv_in_line_layout; 262} *psiconv_in_line_layout;
233 263
234typedef psiconv_list psiconv_in_line_layouts; /* of struct in_line_layout */ 264typedef psiconv_list psiconv_in_line_layouts; /* of struct in_line_layout */
235 265
236typedef enum psiconv_replacement_type 266typedef enum psiconv_replacement_type
403typedef struct psiconv_clipart_f_s 433typedef struct psiconv_clipart_f_s
404{ 434{
405 psiconv_cliparts sections; 435 psiconv_cliparts sections;
406} *psiconv_clipart_f; 436} *psiconv_clipart_f;
407 437
438typedef struct psiconv_sheet_ref_s
439{
440 psiconv_s16 offset;
441 psiconv_bool_t absolute;
442} psiconv_sheet_ref_t;
443
444typedef struct psiconv_sheet_cell_reference_s
445{
446 psiconv_sheet_ref_t row;
447 psiconv_sheet_ref_t column;
448} psiconv_sheet_cell_reference_t;
449
450typedef struct psiconv_sheet_cell_block_s
451{
452 psiconv_sheet_cell_reference_t first;
453 psiconv_sheet_cell_reference_t last;
454} psiconv_sheet_cell_block_t;
455
456typedef enum psiconv_cell_type
457{
458 psiconv_cell_blank,
459 psiconv_cell_int,
460 psiconv_cell_bool,
461 psiconv_cell_error,
462 psiconv_cell_float,
463 psiconv_cell_string
464} psiconv_cell_type_t;
465
466typedef enum psiconv_sheet_errorcode
467{
468 psiconv_sheet_error_none,
469 psiconv_sheet_error_null,
470 psiconv_sheet_error_divzero,
471 psiconv_sheet_error_value,
472 psiconv_sheet_error_reference,
473 psiconv_sheet_error_name,
474 psiconv_sheet_error_number,
475 psiconv_sheet_error_notavail
476} psiconv_sheet_errorcode_t;
477
478typedef enum psiconv_sheet_numberformat_code
479{
480 psiconv_numberformat_general,
481 psiconv_numberformat_fixeddecimal,
482 psiconv_numberformat_scientific,
483 psiconv_numberformat_currency,
484 psiconv_numberformat_percent,
485 psiconv_numberformat_triads,
486 psiconv_numberformat_boolean,
487 psiconv_numberformat_text,
488 psiconv_numberformat_date_dmm,
489 psiconv_numberformat_date_mmd,
490 psiconv_numberformat_date_ddmmyy,
491 psiconv_numberformat_date_mmddyy,
492 psiconv_numberformat_date_yymmdd,
493 psiconv_numberformat_date_dmmm,
494 psiconv_numberformat_date_dmmmyy,
495 psiconv_numberformat_date_ddmmmyy,
496 psiconv_numberformat_date_mmm,
497 psiconv_numberformat_date_monthname,
498 psiconv_numberformat_date_mmmyy,
499 psiconv_numberformat_date_monthnameyy,
500 psiconv_numberformat_date_monthnamedyyyy,
501 psiconv_numberformat_datetime_ddmmyyyyhhii,
502 psiconv_numberformat_datetime_ddmmyyyyHHii,
503 psiconv_numberformat_datetime_mmddyyyyhhii,
504 psiconv_numberformat_datetime_mmddyyyyHHii,
505 psiconv_numberformat_datetime_yyyymmddhhii,
506 psiconv_numberformat_datetime_yyyymmddHHii,
507 psiconv_numberformat_time_hhii,
508 psiconv_numberformat_time_hhiiss,
509 psiconv_numberformat_time_HHii,
510 psiconv_numberformat_time_HHiiss
511} psiconv_sheet_numberformat_code_t;
512
513typedef struct psiconv_sheet_numberformat_s
514{
515 psiconv_sheet_numberformat_code_t code;
516 psiconv_u8 decimal;
517} *psiconv_sheet_numberformat;
518
519typedef 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;
525
526typedef struct psiconv_sheet_cell_s
527{
528 psiconv_u16 column;
529 psiconv_u16 row;
530 psiconv_cell_type_t type;
531 union {
532 psiconv_u32 dat_int;
533 double dat_float;
534 char *dat_string;
535 psiconv_bool_t dat_bool;
536 psiconv_sheet_errorcode_t dat_error;
537 } data;
538 psiconv_sheet_cell_layout layout;
539 psiconv_bool_t calculated;
540 psiconv_u32 ref_formula;
541} *psiconv_sheet_cell;
542
543typedef psiconv_list psiconv_sheet_cell_list;
544
408typedef struct psiconv_sheet_status_section_s 545typedef struct psiconv_sheet_status_section_s
409{ 546{
410 psiconv_bool_t show_graph; 547 psiconv_bool_t show_graph;
411 psiconv_u32 cursor_row; 548 psiconv_u32 cursor_row;
412 psiconv_u32 cursor_column; 549 psiconv_u32 cursor_column;
434 psiconv_formula_op_mul, 571 psiconv_formula_op_mul,
435 psiconv_formula_op_div, 572 psiconv_formula_op_div,
436 psiconv_formula_op_pow, 573 psiconv_formula_op_pow,
437 psiconv_formula_op_pos, 574 psiconv_formula_op_pos,
438 psiconv_formula_op_neg, 575 psiconv_formula_op_neg,
576 psiconv_formula_op_not,
577 psiconv_formula_op_and,
578 psiconv_formula_op_or,
439 psiconv_formula_op_con, 579 psiconv_formula_op_con,
440 psiconv_formula_op_bra, 580 psiconv_formula_op_bra,
441 psiconv_formula_mark_eof, 581 psiconv_formula_mark_eof,
442 psiconv_formula_dat_float, 582 psiconv_formula_dat_float,
443 psiconv_formula_dat_int, 583 psiconv_formula_dat_int,
562 psiconv_formula_type_t type; 702 psiconv_formula_type_t type;
563 union { 703 union {
564 psiconv_u32 dat_int; 704 psiconv_u32 dat_int;
565 double dat_float; 705 double dat_float;
566 char *dat_string; 706 char *dat_string;
707 psiconv_sheet_cell_reference_t dat_cellref;
708 psiconv_sheet_cell_block_t dat_cellblock;
567 psiconv_formula_list fun_operands; 709 psiconv_formula_list fun_operands;
710 psiconv_u32 dat_variable;
568 } data; 711 } data;
569} *psiconv_formula; 712} *psiconv_formula;
570 713
714typedef struct psiconv_sheet_line_s
715{
716 psiconv_u32 position;
717 psiconv_sheet_cell_layout layout;
718} *psiconv_sheet_line;
719
720typedef psiconv_list psiconv_sheet_line_list;
721 /* Of struct psiconv_sheet_line_s */
722
723typedef struct psiconv_sheet_grid_size_s
724{
725 psiconv_u32 line_number;
726 psiconv_length_t size;
727} *psiconv_sheet_grid_size;
728
729typedef psiconv_list psiconv_sheet_grid_size_list;
730 /* Of struct psiconv_sheet_grid_size_s */
731
732typedef psiconv_list psiconv_sheet_grid_break_list; /* of psiconv_u32 */
733
734typedef 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
759typedef struct psiconv_sheet_worksheet_s
760{
761 psiconv_sheet_cell_layout default_layout;
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;
767} *psiconv_sheet_worksheet;
768
769typedef psiconv_list psiconv_sheet_worksheet_list;
770 /* of struct psiconv_sheet_worksheet_s */
771
772typedef 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
781typedef 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
795typedef psiconv_list psiconv_sheet_variable_list;
796 /* of struct psiconv_sheet_variable_s */
797
798typedef struct psiconv_sheet_name_section_s
799{
800 char *name;
801} *psiconv_sheet_name_section;
802
803typedef struct psiconv_sheet_info_section_s
804{
805 psiconv_bool_t auto_recalc;
806} *psiconv_sheet_info_section;
807
571typedef struct psiconv_sheet_workbook_section_s 808typedef struct psiconv_sheet_workbook_section_s
572{ 809{
573 psiconv_formula_list formulas; 810 psiconv_formula_list formulas;
811 psiconv_sheet_worksheet_list worksheets;
812 psiconv_sheet_variable_list variables;
813 psiconv_sheet_info_section info;
814 psiconv_sheet_name_section name;
574} *psiconv_sheet_workbook_section; 815} *psiconv_sheet_workbook_section;
575 816
576typedef struct psiconv_sheet_f_s 817typedef struct psiconv_sheet_f_s
577{ 818{
578 psiconv_page_layout_section page_sec; 819 psiconv_page_layout_section page_sec;
579 psiconv_sheet_status_section status_sec; 820 psiconv_sheet_status_section status_sec;
580 psiconv_sheet_workbook_section workbook_sec; 821 psiconv_sheet_workbook_section workbook_sec;
581} *psiconv_sheet_f; 822} *psiconv_sheet_f;
582 823
824/* NB: psiconv_file is already defined above */
583typedef struct psiconv_file_s 825struct psiconv_file_s
584{ 826{
585 psiconv_file_type_t type; 827 psiconv_file_type_t type;
586 void *file; 828 void *file;
587} *psiconv_file; 829};
588 830
589 831
590/* UID1 */ 832/* UID1 */
591#define PSICONV_ID_PSION5 0x10000037 833#define PSICONV_ID_PSION5 0x10000037
592#define PSICONV_ID_CLIPART 0x10000041 834#define PSICONV_ID_CLIPART 0x10000041
608#define PSICONV_ID_PAGE_LAYOUT_SECTION 0x10000105 850#define PSICONV_ID_PAGE_LAYOUT_SECTION 0x10000105
609#define PSICONV_ID_PASSWORD_SECTION 0x100000CD 851#define PSICONV_ID_PASSWORD_SECTION 0x100000CD
610#define PSICONV_ID_SKETCH_SECTION 0x1000007D 852#define PSICONV_ID_SKETCH_SECTION 0x1000007D
611#define PSICONV_ID_SHEET_STATUS_SECTION 0x1000011F 853#define PSICONV_ID_SHEET_STATUS_SECTION 0x1000011F
612#define PSICONV_ID_SHEET_WORKBOOK_SECTION 0x1000011D 854#define PSICONV_ID_SHEET_WORKBOOK_SECTION 0x1000011D
855#define PSICONV_ID_SHEET_GRAPH_SECTION 0x10000121
613 856
614/* Other ids */ 857/* Other ids */
615#define PSICONV_ID_PAGE_DIMENSIONS1 0x100000fd 858#define PSICONV_ID_PAGE_DIMENSIONS1 0x100000fd
616#define PSICONV_ID_PAGE_DIMENSIONS2 0x1000010e 859#define PSICONV_ID_PAGE_DIMENSIONS2 0x1000010e
617#define PSICONV_ID_TEXTED_BODY 0x1000005c 860#define PSICONV_ID_TEXTED_BODY 0x1000005c
620#define PSICONV_ID_TEXTED_LAYOUT 0x10000066 863#define PSICONV_ID_TEXTED_LAYOUT 0x10000066
621#define PSICONV_ID_TEXTED_TEXT 0x10000064 864#define PSICONV_ID_TEXTED_TEXT 0x10000064
622#define PSICONV_ID_STYLE_REMOVABLE 0x1000004F 865#define PSICONV_ID_STYLE_REMOVABLE 0x1000004F
623#define PSICONV_ID_STYLE_BUILT_IN 0x1000004C 866#define PSICONV_ID_STYLE_BUILT_IN 0x1000004C
624#define PSICONV_ID_CLIPART_ITEM 0x10000040 867#define PSICONV_ID_CLIPART_ITEM 0x10000040
868#define PSICONV_ID_OBJECT 0x10000051
869#define PSICONV_ID_OBJECT_DISPLAY_SECTION 0x10000146
870#define PSICONV_ID_OBJECT_ICON_SECTION 0x1000012A
871#define PSICONV_ID_OBJECT_SECTION_TABLE_SECTION 0x10000144
625 872
626 873
627/* Return a clean layout_status. You can modify it at will. Returns NULL 874/* Return a clean layout_status. You can modify it at will. Returns NULL
628 if there is not enough memory. */ 875 if there is not enough memory. */
629extern psiconv_character_layout psiconv_basic_character_layout(void); 876extern psiconv_character_layout psiconv_basic_character_layout(void);
640extern psiconv_character_layout psiconv_clone_character_layout 887extern psiconv_character_layout psiconv_clone_character_layout
641 (psiconv_character_layout ls); 888 (psiconv_character_layout ls);
642 889
643/* Get a numbered style. Returns NULL if the style is unknown. */ 890/* Get a numbered style. Returns NULL if the style is unknown. */
644extern psiconv_word_style psiconv_get_style (psiconv_word_styles_section ss, int nr); 891extern psiconv_word_style psiconv_get_style (psiconv_word_styles_section ss, int nr);
892/* Get a numbered formula. Returns NULL if the style is unknown. */
893extern psiconv_formula psiconv_get_formula (psiconv_formula_list ss, int nr);
894
895/* Return the default layout */
896extern psiconv_sheet_cell_layout psiconv_get_default_layout
897 (psiconv_sheet_line_list row_defaults,
898 psiconv_sheet_line_list col_defaults,
899 psiconv_sheet_cell_layout cell_default,
900 int row,int col);
645 901
646extern void psiconv_free_color(psiconv_color color); 902extern void psiconv_free_color(psiconv_color color);
647extern void psiconv_free_border(psiconv_border border); 903extern void psiconv_free_border(psiconv_border border);
648extern void psiconv_free_bullet(psiconv_bullet bullet); 904extern void psiconv_free_bullet(psiconv_bullet bullet);
649extern void psiconv_free_font(psiconv_font font); 905extern void psiconv_free_font(psiconv_font font);
656 (psiconv_word_styles_section styles); 912 (psiconv_word_styles_section styles);
657extern void psiconv_free_formula(psiconv_formula formula); 913extern void psiconv_free_formula(psiconv_formula formula);
658extern void psiconv_free_formula_list(psiconv_formula_list list); 914extern void psiconv_free_formula_list(psiconv_formula_list list);
659extern void psiconv_free_sheet_status_section 915extern void psiconv_free_sheet_status_section
660 (psiconv_sheet_status_section section); 916 (psiconv_sheet_status_section section);
917extern void psiconv_free_sheet_cell_layout(psiconv_sheet_cell_layout layout);
918extern void psiconv_free_sheet_grid_break_list
919 (psiconv_sheet_grid_break_list list);
920extern void psiconv_free_sheet_grid_size(psiconv_sheet_grid_size s);
921extern void psiconv_free_sheet_grid_size_list
922 (psiconv_sheet_grid_size_list list);
923extern void psiconv_free_sheet_grid_section(psiconv_sheet_grid_section sec);
924extern void psiconv_free_sheet_worksheet(psiconv_sheet_worksheet sheet);
925extern void psiconv_free_sheet_worksheet_list
926 (psiconv_sheet_worksheet_list list);
927
661extern void psiconv_free_sheet_f(psiconv_sheet_f file); 928extern void psiconv_free_sheet_f(psiconv_sheet_f file);
929extern void psiconv_free_sheet_cell(psiconv_sheet_cell cell);
930extern void psiconv_free_sheet_cell_list(psiconv_sheet_cell_list list);
931extern void psiconv_free_sheet_numberformat
932 (psiconv_sheet_numberformat numberformat);
933extern void psiconv_free_sheet_line_list(psiconv_sheet_line_list list);
934extern void psiconv_free_sheet_line(psiconv_sheet_line line);
935extern void psiconv_free_sheet_name_section(psiconv_sheet_name_section section);
936extern void psiconv_free_sheet_variable(psiconv_sheet_variable list);
937extern void psiconv_free_sheet_variable_list(psiconv_sheet_variable_list list);
938extern void psiconv_free_sheet_info_section(psiconv_sheet_info_section section);
662extern void psiconv_free_header_section(psiconv_header_section header); 939extern void psiconv_free_header_section(psiconv_header_section header);
663extern void psiconv_free_section_table_entry(psiconv_section_table_entry entry); 940extern void psiconv_free_section_table_entry(psiconv_section_table_entry entry);
664extern void psiconv_free_section_table_section 941extern void psiconv_free_section_table_section
665 (psiconv_section_table_section section); 942 (psiconv_section_table_section section);
666extern void psiconv_free_application_id_section 943extern void psiconv_free_application_id_section
667 (psiconv_application_id_section section); 944 (psiconv_application_id_section section);
945extern void psiconv_free_object_display_section
946 (psiconv_object_display_section section);
947extern void psiconv_free_object_icon_section
948 (psiconv_object_icon_section section);
949extern void psiconv_free_object(psiconv_object object);
668extern void psiconv_free_in_line_layout(psiconv_in_line_layout layout); 950extern void psiconv_free_in_line_layout(psiconv_in_line_layout layout);
669extern void psiconv_free_in_line_layouts(psiconv_in_line_layouts layouts); 951extern void psiconv_free_in_line_layouts(psiconv_in_line_layouts layouts);
670extern void psiconv_free_replacement(psiconv_replacement replacement); 952extern void psiconv_free_replacement(psiconv_replacement replacement);
671extern void psiconv_free_replacements(psiconv_replacements replacements); 953extern void psiconv_free_replacements(psiconv_replacements replacements);
672extern void psiconv_free_paragraph(psiconv_paragraph paragraph); 954extern void psiconv_free_paragraph(psiconv_paragraph paragraph);

Legend:
Removed from v.99  
changed lines
  Added in v.160

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26