/[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 102 Revision 159
31 to structs */ 31 to structs */
32 32
33#ifdef __cplusplus 33#ifdef __cplusplus
34extern "C" { 34extern "C" {
35#endif /* __cplusplus */ 35#endif /* __cplusplus */
36
37/* Forward declaration (for psiconv_object) */
38typedef struct psiconv_file_s *psiconv_file;
36 39
37typedef double psiconv_float_t; 40typedef double psiconv_float_t;
38 41
39typedef enum psiconv_file_type { 42typedef enum psiconv_file_type {
40 psiconv_unknown_file, 43 psiconv_unknown_file,
191 psiconv_size_t space_below; 194 psiconv_size_t space_below;
192 psiconv_bool_t keep_together; 195 psiconv_bool_t keep_together;
193 psiconv_bool_t keep_with_next; 196 psiconv_bool_t keep_with_next;
194 psiconv_bool_t on_next_page; 197 psiconv_bool_t on_next_page;
195 psiconv_bool_t no_widow_protection; 198 psiconv_bool_t no_widow_protection;
199 psiconv_bool_t wrap_to_fit_cell;
196 psiconv_length_t border_distance; 200 psiconv_length_t border_distance;
197 psiconv_bullet bullet; 201 psiconv_bullet bullet;
198 psiconv_border left_border; 202 psiconv_border left_border;
199 psiconv_border right_border; 203 psiconv_border right_border;
200 psiconv_border top_border; 204 psiconv_border top_border;
224{ 228{
225 psiconv_u32 id; 229 psiconv_u32 id;
226 psiconv_string_t name; 230 psiconv_string_t name;
227} *psiconv_application_id_section; 231} *psiconv_application_id_section;
228 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
229typedef struct psiconv_in_line_layout_s 254typedef struct psiconv_in_line_layout_s
230{ 255{
231 psiconv_character_layout layout; 256 psiconv_character_layout layout;
232 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;
233} *psiconv_in_line_layout; 262} *psiconv_in_line_layout;
234 263
235typedef psiconv_list psiconv_in_line_layouts; /* of struct in_line_layout */ 264typedef psiconv_list psiconv_in_line_layouts; /* of struct in_line_layout */
236 265
237typedef enum psiconv_replacement_type 266typedef enum psiconv_replacement_type
422{ 451{
423 psiconv_sheet_cell_reference_t first; 452 psiconv_sheet_cell_reference_t first;
424 psiconv_sheet_cell_reference_t last; 453 psiconv_sheet_cell_reference_t last;
425} psiconv_sheet_cell_block_t; 454} psiconv_sheet_cell_block_t;
426 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
427typedef struct psiconv_sheet_status_section_s 545typedef struct psiconv_sheet_status_section_s
428{ 546{
429 psiconv_bool_t show_graph; 547 psiconv_bool_t show_graph;
430 psiconv_u32 cursor_row; 548 psiconv_u32 cursor_row;
431 psiconv_u32 cursor_column; 549 psiconv_u32 cursor_column;
453 psiconv_formula_op_mul, 571 psiconv_formula_op_mul,
454 psiconv_formula_op_div, 572 psiconv_formula_op_div,
455 psiconv_formula_op_pow, 573 psiconv_formula_op_pow,
456 psiconv_formula_op_pos, 574 psiconv_formula_op_pos,
457 psiconv_formula_op_neg, 575 psiconv_formula_op_neg,
576 psiconv_formula_op_not,
577 psiconv_formula_op_and,
578 psiconv_formula_op_or,
458 psiconv_formula_op_con, 579 psiconv_formula_op_con,
459 psiconv_formula_op_bra, 580 psiconv_formula_op_bra,
460 psiconv_formula_mark_eof, 581 psiconv_formula_mark_eof,
461 psiconv_formula_dat_float, 582 psiconv_formula_dat_float,
462 psiconv_formula_dat_int, 583 psiconv_formula_dat_int,
584 double dat_float; 705 double dat_float;
585 char *dat_string; 706 char *dat_string;
586 psiconv_sheet_cell_reference_t dat_cellref; 707 psiconv_sheet_cell_reference_t dat_cellref;
587 psiconv_sheet_cell_block_t dat_cellblock; 708 psiconv_sheet_cell_block_t dat_cellblock;
588 psiconv_formula_list fun_operands; 709 psiconv_formula_list fun_operands;
710 psiconv_u32 dat_variable;
589 } data; 711 } data;
590} *psiconv_formula; 712} *psiconv_formula;
591 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
592typedef struct psiconv_sheet_workbook_section_s 808typedef struct psiconv_sheet_workbook_section_s
593{ 809{
594 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;
595} *psiconv_sheet_workbook_section; 815} *psiconv_sheet_workbook_section;
596 816
597typedef struct psiconv_sheet_f_s 817typedef struct psiconv_sheet_f_s
598{ 818{
599 psiconv_page_layout_section page_sec; 819 psiconv_page_layout_section page_sec;
600 psiconv_sheet_status_section status_sec; 820 psiconv_sheet_status_section status_sec;
601 psiconv_sheet_workbook_section workbook_sec; 821 psiconv_sheet_workbook_section workbook_sec;
602} *psiconv_sheet_f; 822} *psiconv_sheet_f;
603 823
824/* NB: psiconv_file is already defined above */
604typedef struct psiconv_file_s 825struct psiconv_file_s
605{ 826{
606 psiconv_file_type_t type; 827 psiconv_file_type_t type;
607 void *file; 828 void *file;
608} *psiconv_file; 829};
609 830
610 831
611/* UID1 */ 832/* UID1 */
612#define PSICONV_ID_PSION5 0x10000037 833#define PSICONV_ID_PSION5 0x10000037
613#define PSICONV_ID_CLIPART 0x10000041 834#define PSICONV_ID_CLIPART 0x10000041
629#define PSICONV_ID_PAGE_LAYOUT_SECTION 0x10000105 850#define PSICONV_ID_PAGE_LAYOUT_SECTION 0x10000105
630#define PSICONV_ID_PASSWORD_SECTION 0x100000CD 851#define PSICONV_ID_PASSWORD_SECTION 0x100000CD
631#define PSICONV_ID_SKETCH_SECTION 0x1000007D 852#define PSICONV_ID_SKETCH_SECTION 0x1000007D
632#define PSICONV_ID_SHEET_STATUS_SECTION 0x1000011F 853#define PSICONV_ID_SHEET_STATUS_SECTION 0x1000011F
633#define PSICONV_ID_SHEET_WORKBOOK_SECTION 0x1000011D 854#define PSICONV_ID_SHEET_WORKBOOK_SECTION 0x1000011D
855#define PSICONV_ID_SHEET_GRAPH_SECTION 0x10000121
634 856
635/* Other ids */ 857/* Other ids */
636#define PSICONV_ID_PAGE_DIMENSIONS1 0x100000fd 858#define PSICONV_ID_PAGE_DIMENSIONS1 0x100000fd
637#define PSICONV_ID_PAGE_DIMENSIONS2 0x1000010e 859#define PSICONV_ID_PAGE_DIMENSIONS2 0x1000010e
638#define PSICONV_ID_TEXTED_BODY 0x1000005c 860#define PSICONV_ID_TEXTED_BODY 0x1000005c
661extern psiconv_character_layout psiconv_clone_character_layout 883extern psiconv_character_layout psiconv_clone_character_layout
662 (psiconv_character_layout ls); 884 (psiconv_character_layout ls);
663 885
664/* Get a numbered style. Returns NULL if the style is unknown. */ 886/* Get a numbered style. Returns NULL if the style is unknown. */
665extern psiconv_word_style psiconv_get_style (psiconv_word_styles_section ss, int nr); 887extern 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. */
889extern psiconv_formula psiconv_get_formula (psiconv_formula_list ss, int nr);
890
891/* Return the default layout */
892extern 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);
666 897
667extern void psiconv_free_color(psiconv_color color); 898extern void psiconv_free_color(psiconv_color color);
668extern void psiconv_free_border(psiconv_border border); 899extern void psiconv_free_border(psiconv_border border);
669extern void psiconv_free_bullet(psiconv_bullet bullet); 900extern void psiconv_free_bullet(psiconv_bullet bullet);
670extern void psiconv_free_font(psiconv_font font); 901extern void psiconv_free_font(psiconv_font font);
677 (psiconv_word_styles_section styles); 908 (psiconv_word_styles_section styles);
678extern void psiconv_free_formula(psiconv_formula formula); 909extern void psiconv_free_formula(psiconv_formula formula);
679extern void psiconv_free_formula_list(psiconv_formula_list list); 910extern void psiconv_free_formula_list(psiconv_formula_list list);
680extern void psiconv_free_sheet_status_section 911extern void psiconv_free_sheet_status_section
681 (psiconv_sheet_status_section section); 912 (psiconv_sheet_status_section section);
913extern void psiconv_free_sheet_cell_layout(psiconv_sheet_cell_layout layout);
914extern void psiconv_free_sheet_grid_break_list
915 (psiconv_sheet_grid_break_list list);
916extern void psiconv_free_sheet_grid_size(psiconv_sheet_grid_size s);
917extern void psiconv_free_sheet_grid_size_list
918 (psiconv_sheet_grid_size_list list);
919extern void psiconv_free_sheet_grid_section(psiconv_sheet_grid_section sec);
920extern void psiconv_free_sheet_worksheet(psiconv_sheet_worksheet sheet);
921extern void psiconv_free_sheet_worksheet_list
922 (psiconv_sheet_worksheet_list list);
923
682extern void psiconv_free_sheet_f(psiconv_sheet_f file); 924extern void psiconv_free_sheet_f(psiconv_sheet_f file);
925extern void psiconv_free_sheet_cell(psiconv_sheet_cell cell);
926extern void psiconv_free_sheet_cell_list(psiconv_sheet_cell_list list);
927extern void psiconv_free_sheet_numberformat
928 (psiconv_sheet_numberformat numberformat);
929extern void psiconv_free_sheet_line_list(psiconv_sheet_line_list list);
930extern void psiconv_free_sheet_line(psiconv_sheet_line line);
931extern void psiconv_free_sheet_name_section(psiconv_sheet_name_section section);
932extern void psiconv_free_sheet_variable(psiconv_sheet_variable list);
933extern void psiconv_free_sheet_variable_list(psiconv_sheet_variable_list list);
934extern void psiconv_free_sheet_info_section(psiconv_sheet_info_section section);
683extern void psiconv_free_header_section(psiconv_header_section header); 935extern void psiconv_free_header_section(psiconv_header_section header);
684extern void psiconv_free_section_table_entry(psiconv_section_table_entry entry); 936extern void psiconv_free_section_table_entry(psiconv_section_table_entry entry);
685extern void psiconv_free_section_table_section 937extern void psiconv_free_section_table_section
686 (psiconv_section_table_section section); 938 (psiconv_section_table_section section);
687extern void psiconv_free_application_id_section 939extern void psiconv_free_application_id_section
688 (psiconv_application_id_section section); 940 (psiconv_application_id_section section);
941extern void psiconv_free_object_display_section
942 (psiconv_object_display_section section);
943extern void psiconv_free_object_icon_section
944 (psiconv_object_icon_section section);
945extern void psiconv_free_object(psiconv_object object);
689extern void psiconv_free_in_line_layout(psiconv_in_line_layout layout); 946extern void psiconv_free_in_line_layout(psiconv_in_line_layout layout);
690extern void psiconv_free_in_line_layouts(psiconv_in_line_layouts layouts); 947extern void psiconv_free_in_line_layouts(psiconv_in_line_layouts layouts);
691extern void psiconv_free_replacement(psiconv_replacement replacement); 948extern void psiconv_free_replacement(psiconv_replacement replacement);
692extern void psiconv_free_replacements(psiconv_replacements replacements); 949extern void psiconv_free_replacements(psiconv_replacements replacements);
693extern void psiconv_free_paragraph(psiconv_paragraph paragraph); 950extern void psiconv_free_paragraph(psiconv_paragraph paragraph);

Legend:
Removed from v.102  
changed lines
  Added in v.159

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