00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef LIBWPS_INTERNAL_H
00023 #define LIBWPS_INTERNAL_H
00024 #ifdef DEBUG
00025 #include <bitset>
00026 #endif
00027 #include "WPSStream.h"
00028 #include <libwpd/WPXString.h>
00029 #include <libwpd/libwpd_types.h>
00030 #include <string>
00031
00032
00033
00034 #define DELETEP(m) if (m) { delete m; m = NULL; }
00035
00036 #ifdef DEBUG
00037 #define WPS_DEBUG_MSG(M) printf M
00038 #else
00039 #define WPS_DEBUG_MSG(M)
00040 #endif
00041
00042 #define WPS_LE_GET_GUINT16(p) \
00043 (uint16_t)((((uint8_t const *)(p))[0] << 0) | \
00044 (((uint8_t const *)(p))[1] << 8))
00045 #define WPS_LE_GET_GUINT32(p) \
00046 (uint32_t)((((uint8_t const *)(p))[0] << 0) | \
00047 (((uint8_t const *)(p))[1] << 8) | \
00048 (((uint8_t const *)(p))[2] << 16) | \
00049 (((uint8_t const *)(p))[3] << 24))
00050
00051
00052
00053 uint8_t readU8(WPSInputStream *input);
00054 uint16_t readU16(WPSInputStream *input, bool bigendian=false);
00055 uint32_t readU32(WPSInputStream *input, bool bigendian=false);
00056
00057
00058
00059 uint16_t fixedPointToWPUs(const uint32_t fixedPointNumber);
00060
00061 enum WPSNumberingType { ARABIC, LOWERCASE, UPPERCASE, LOWERCASE_ROMAN, UPPERCASE_ROMAN };
00062 enum WPSNoteType { FOOTNOTE, ENDNOTE };
00063 enum WPSHeaderFooterType { HEADER, FOOTER };
00064 enum WPSHeaderFooterInternalType { HEADER_A, HEADER_B, FOOTER_A, FOOTER_B, DUMMY };
00065 enum WPSHeaderFooterOccurence { ODD, EVEN, ALL, NEVER };
00066 enum WPSFormOrientation { PORTRAIT, LANDSCAPE };
00067 enum WPSTabAlignment { LEFT, RIGHT, CENTER, DECIMAL, BAR };
00068 enum WPSVerticalAlignment { TOP, MIDDLE, BOTTOM, FULL };
00069
00070 enum WPSTextColumnType { NEWSPAPER, NEWSPAPER_VERTICAL_BALANCE, PARALLEL, PARALLEL_PROTECT };
00071
00072
00073 #define WPS_EXTRA_LARGE_BIT 1
00074 #define WPS_VERY_LARGE_BIT 2
00075 #define WPS_LARGE_BIT 4
00076 #define WPS_SMALL_PRINT_BIT 8
00077 #define WPS_FINE_PRINT_BIT 16
00078 #define WPS_SUPERSCRIPT_BIT 32
00079 #define WPS_SUBSCRIPT_BIT 64
00080 #define WPS_OUTLINE_BIT 128
00081 #define WPS_ITALICS_BIT 256
00082 #define WPS_SHADOW_BIT 512
00083 #define WPS_REDLINE_BIT 1024
00084 #define WPS_DOUBLE_UNDERLINE_BIT 2048
00085 #define WPS_BOLD_BIT 4096
00086 #define WPS_STRIKEOUT_BIT 8192
00087 #define WPS_UNDERLINE_BIT 16384
00088 #define WPS_SMALL_CAPS_BIT 32768
00089 #define WPS_BLINK_BIT 65536
00090 #define WPS_REVERSEVIDEO_BIT 131072
00091
00092
00093 #define WPS_PARAGRAPH_JUSTIFICATION_LEFT 0x00
00094 #define WPS_PARAGRAPH_JUSTIFICATION_FULL 0x01
00095 #define WPS_PARAGRAPH_JUSTIFICATION_CENTER 0x02
00096 #define WPS_PARAGRAPH_JUSTIFICATION_RIGHT 0x03
00097 #define WPS_PARAGRAPH_JUSTIFICATION_FULL_ALL_LINES 0x04
00098 #define WPS_PARAGRAPH_JUSTIFICATION_DECIMAL_ALIGNED 0x05
00099
00100
00101 #define WPS_PAGE_BREAK 0x00
00102 #define WPS_SOFT_PAGE_BREAK 0x01
00103 #define WPS_COLUMN_BREAK 0x02
00104
00105
00106 #define WPS_LEFT 0x00
00107 #define WPS_RIGHT 0x01
00108 #define WPS_CENTER 0x02
00109 #define WPS_TOP 0x03
00110 #define WPS_BOTTOM 0x04
00111
00112 typedef struct _RGBSColor RGBSColor;
00113 struct _RGBSColor
00114 {
00115 _RGBSColor(uint8_t r, uint8_t g, uint8_t b, uint8_t s);
00116 _RGBSColor(uint16_t red, uint16_t green, uint16_t blue);
00117
00118 _RGBSColor();
00119 uint8_t m_r;
00120 uint8_t m_g;
00121 uint8_t m_b;
00122 uint8_t m_s;
00123 };
00124
00125 typedef struct _WPSColumnDefinition WPSColumnDefinition;
00126 struct _WPSColumnDefinition
00127 {
00128 _WPSColumnDefinition();
00129 float m_width;
00130 float m_leftGutter;
00131 float m_rightGutter;
00132 };
00133
00134 typedef struct _WPSColumnProperties WPSColumnProperties;
00135 struct _WPSColumnProperties
00136 {
00137 _WPSColumnProperties();
00138 uint32_t m_attributes;
00139 uint8_t m_alignment;
00140 };
00141
00142 typedef struct _WPSTabStop WPSTabStop;
00143 struct _WPSTabStop
00144 {
00145 _WPSTabStop(float position, WPSTabAlignment alignment, uint16_t leaderCharacter, uint8_t leaderNumSpaces);
00146 _WPSTabStop();
00147 float m_position;
00148 WPSTabAlignment m_alignment;
00149 uint16_t m_leaderCharacter;
00150 uint8_t m_leaderNumSpaces;
00151 };
00152
00153
00154
00155 class VersionException
00156 {
00157
00158 };
00159
00160 class FileException
00161 {
00162
00163 };
00164
00165 class ParseException
00166 {
00167
00168 };
00169
00170 class GenericException
00171 {
00172
00173 };
00174
00175
00176
00177 #ifdef DEBUG
00178 std::string to_bits(std::string s);
00179 #endif
00180
00181 #endif