ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/format.h in xlsxwriter-0.2.1.pre.2 vs ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/format.h in xlsxwriter-0.2.2
- old
+ new
@@ -1,9 +1,9 @@
/*
* libxlsxwriter
*
- * Copyright 2014-2019, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
+ * Copyright 2014-2020, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
*/
/**
* @page format_page The Format object
*
@@ -70,18 +70,18 @@
* @brief The type for RGB colors in libxlsxwriter.
*
* The type for RGB colors in libxlsxwriter. The valid range is `0x000000`
* (black) to `0xFFFFFF` (white). See @ref working_with_colors.
*/
-typedef int32_t lxw_color_t;
+typedef uint32_t lxw_color_t;
#define LXW_FORMAT_FIELD_LEN 128
#define LXW_DEFAULT_FONT_NAME "Calibri"
#define LXW_DEFAULT_FONT_FAMILY 2
#define LXW_DEFAULT_FONT_THEME 1
#define LXW_PROPERTY_UNSET -1
-#define LXW_COLOR_UNSET -1
+#define LXW_COLOR_UNSET 0x000000
#define LXW_COLOR_MASK 0xFFFFFF
#define LXW_MIN_FONT_SIZE 1.0
#define LXW_MAX_FONT_SIZE 409.0
#define LXW_FORMAT_FIELD_COPY(dst, src) \
@@ -90,12 +90,14 @@
dst[LXW_FORMAT_FIELD_LEN - 1] = '\0'; \
} while (0)
/** Format underline values for format_set_underline(). */
enum lxw_format_underlines {
+ LXW_UNDERLINE_NONE = 0,
+
/** Single underline */
- LXW_UNDERLINE_SINGLE = 1,
+ LXW_UNDERLINE_SINGLE,
/** Double underline */
LXW_UNDERLINE_DOUBLE,
/** Single accounting underline */
@@ -346,14 +348,17 @@
typedef struct lxw_format {
FILE *file;
lxw_hash_table *xf_format_indices;
+ lxw_hash_table *dxf_format_indices;
uint16_t *num_xf_formats;
+ uint16_t *num_dxf_formats;
int32_t xf_index;
int32_t dxf_index;
+ int32_t xf_id;
char num_format[LXW_FORMAT_FIELD_LEN];
char font_name[LXW_FORMAT_FIELD_LEN];
char font_scheme[LXW_FORMAT_FIELD_LEN];
uint16_t num_format_index;
@@ -385,10 +390,12 @@
uint8_t text_justlast;
int16_t rotation;
lxw_color_t fg_color;
lxw_color_t bg_color;
+ lxw_color_t dxf_fg_color;
+ lxw_color_t dxf_bg_color;
uint8_t pattern;
uint8_t has_fill;
uint8_t has_dxf_fill;
int32_t fill_index;
int32_t fill_count;
@@ -429,10 +436,11 @@
char font_name[LXW_FORMAT_FIELD_LEN];
double font_size;
uint8_t bold;
uint8_t italic;
uint8_t underline;
+ uint8_t theme;
uint8_t font_strikeout;
uint8_t font_outline;
uint8_t font_shadow;
uint8_t font_script;
uint8_t font_family;
@@ -481,16 +489,15 @@
/* *INDENT-ON* */
lxw_format *lxw_format_new(void);
void lxw_format_free(lxw_format *format);
int32_t lxw_format_get_xf_index(lxw_format *format);
+int32_t lxw_format_get_dxf_index(lxw_format *format);
lxw_font *lxw_format_get_font_key(lxw_format *format);
lxw_border *lxw_format_get_border_key(lxw_format *format);
lxw_fill *lxw_format_get_fill_key(lxw_format *format);
-lxw_color_t lxw_format_check_color(lxw_color_t color);
-
/**
* @brief Set the font used in the cell.
*
* @param format Pointer to a Format instance.
* @param font_name Cell font name.
@@ -670,10 +677,13 @@
* @skipline set_num_format
* @until 1209
*
* @image html format_set_num_format.png
*
+ * To set a number format that matches an Excel format category such as "Date"
+ * or "Currency" see @ref ww_formats_categories.
+ *
* The number system used for dates is described in @ref working_with_dates.
*
* For more information on number formats in Excel refer to the
* [Microsoft documentation on cell formats](http://office.microsoft.com/en-gb/assistance/HP051995001033.aspx).
*/
@@ -747,10 +757,11 @@
* in international versions. The listed date and currency formats may also
* vary depending on system settings.
* - The dollar sign in the above format appears as the defined local currency
* symbol.
* - These formats can also be set via format_set_num_format().
+ * - See also @ref ww_formats_categories.
*/
void format_set_num_format_index(lxw_format *format, uint8_t index);
/**
* @brief Set the cell unlocked state.
@@ -1197,9 +1208,12 @@
void format_set_font_scheme(lxw_format *format, const char *font_scheme);
void format_set_font_condense(lxw_format *format);
void format_set_font_extend(lxw_format *format);
void format_set_reading_order(lxw_format *format, uint8_t value);
void format_set_theme(lxw_format *format, uint8_t value);
+void format_set_hyperlink(lxw_format *format);
+void format_set_color_indexed(lxw_format *format, uint8_t value);
+void format_set_font_only(lxw_format *format);
/* Declarations required for unit testing. */
#ifdef TESTING
#endif /* TESTING */