#include <ie_imp_Psion.h>
Public Member Functions | |
IE_Imp_Psion (PD_Document *pDocument) | |
~IE_Imp_Psion () | |
Protected Member Functions | |
virtual UT_Error | _loadFile (GsfInput *input) |
UT_Error | getCharacterAttributes (const psiconv_character_layout layout, UT_UTF8String &props) |
UT_Error | getParagraphAttributes (const psiconv_paragraph_layout layout, UT_UTF8String &props) |
UT_Error | applyCharacterAttributes (const psiconv_character_layout layout) |
UT_Error | applyParagraphAttributes (const psiconv_paragraph_layout layout, const gchar *stylename) |
UT_Error | applyPageAttributes (const psiconv_page_layout_section layout, bool &with_header, bool &with_footer) |
UT_Error | prepareCharacters (const psiconv_ucs2 *input, int length, UT_UCS4String &text) |
UT_Error | readParagraphs (const psiconv_text_and_layout psiontext, const psiconv_word_styles_section style_sec) |
UT_Error | applyStyles (const psiconv_word_styles_section style_sec) |
UT_Error | processHeaderFooter (const psiconv_page_layout_section layout, bool with_header, bool with_footer) |
UT_Error | insertImage (const psiconv_in_line_layout in_line) |
UT_Error | insertObject (const psiconv_in_line_layout in_line) |
virtual UT_Error | parseFile (const psiconv_file psionfile)=0 |
Private Attributes | |
bool | list |
IE_Imp_Psion::IE_Imp_Psion | ( | PD_Document * | pDocument | ) | [inline] |
IE_Imp_Psion::~IE_Imp_Psion | ( | ) | [inline] |
UT_Error IE_Imp_Psion::_loadFile | ( | GsfInput * | fp | ) | [protected, virtual] |
UT_Error IE_Imp_Psion::applyCharacterAttributes | ( | const psiconv_character_layout | layout | ) | [protected] |
Get all character-related attributes and add them to the document.
It does an appendFmt setting the current character attributes. The next appendSpan will use these settings.
References IE_Imp::appendFmt(), getCharacterAttributes(), UT_DEBUGMSG, UT_return_val_if_fail, and UT_UTF8String::utf8_str().
Referenced by readParagraphs().
UT_Error IE_Imp_Psion::applyPageAttributes | ( | const psiconv_page_layout_section | layout, | |
bool & | with_header, | |||
bool & | with_footer | |||
) | [protected] |
Add the page attributes to the documents
Set all page (section) attributes, and do an appendStrux(PTX_Section,...) These settings are global for the whole document: Psion documents contain only one single section.
References IE_Imp::appendStrux(), IE_Imp::getDoc(), PTX_Section, UT_DEBUGMSG, UT_return_val_if_fail, UT_std_string_sprintf(), UT_UTF8String_sprintf(), and UT_UTF8String::utf8_str().
Referenced by IE_Imp_Psion_TextEd::parseFile(), and IE_Imp_Psion_Word::parseFile().
UT_Error IE_Imp_Psion::applyParagraphAttributes | ( | const psiconv_paragraph_layout | layout, | |
const gchar * | stylename | |||
) | [protected] |
Get all paragraph-related attributes and add them to the document.
It does an appendStrux setting the current paragraph attributes and opening a new paragraph. Several special cases are handled here too, mostly for bullets.
References PD_Document::appendList(), IE_Imp::appendObject(), IE_Imp::appendSpan(), IE_Imp::appendStrux(), IE_Imp::getDoc(), getParagraphAttributes(), global_listid, list, PTO_Field, PTX_Block, UCS_TAB, UT_DEBUGMSG, UT_IE_IMPORTERROR, UT_return_val_if_fail, and UT_UTF8String::utf8_str().
Referenced by readParagraphs().
UT_Error IE_Imp_Psion::applyStyles | ( | const psiconv_word_styles_section | style_sec | ) | [protected] |
Append all styles from the Psion Word Styles Section.
References UT_UTF8String::clear(), gchar, getCharacterAttributes(), IE_Imp::getDoc(), getParagraphAttributes(), prepare_style_name(), style, UT_DEBUGMSG, UT_IE_IMPORTERROR, and UT_UTF8String::utf8_str().
Referenced by IE_Imp_Psion_Word::parseFile().
UT_Error IE_Imp_Psion::getCharacterAttributes | ( | const psiconv_character_layout | layout, | |
UT_UTF8String & | props | |||
) | [protected] |
Get all character-related attributes and append them to props.
If props is not empty, we start with '; ', else we do not.
References UT_UTF8String::appendUCS4(), UT_UTF8String::length(), UT_return_val_if_fail, and UT_UTF8String_sprintf().
Referenced by applyCharacterAttributes(), and applyStyles().
UT_Error IE_Imp_Psion::getParagraphAttributes | ( | const psiconv_paragraph_layout | layout, | |
UT_UTF8String & | props | |||
) | [protected] |
Get all paragraph-related attributes and append them to props.
If props is not empty, we start with '; ', else we do not.
References UT_UTF8String::length(), UT_ASSERT, UT_IE_IMPORTERROR, UT_return_val_if_fail, and UT_UTF8String_sprintf().
Referenced by applyParagraphAttributes(), and applyStyles().
UT_Error IE_Imp_Psion::insertImage | ( | const psiconv_in_line_layout | in_line | ) | [protected] |
Insert an image in the current document.
The image is found in an in_line Psiconv element.
References IE_Imp::appendObject(), IE_Imp::getDoc(), PD_Document::getUID(), UT_UniqueId::Image, PTO_Image, UT_DEBUGMSG, UT_IE_IMPORTERROR, UT_UTF8String_sprintf(), and UT_UTF8String::utf8_str().
Referenced by insertObject().
UT_Error IE_Imp_Psion::insertObject | ( | const psiconv_in_line_layout | in_line | ) | [protected] |
Insert an object.
At the moment, we only handle images. All other objects are ignored.
References insertImage(), and UT_DEBUGMSG.
Referenced by readParagraphs().
virtual UT_Error IE_Imp_Psion::parseFile | ( | const psiconv_file | psionfile | ) | [protected, pure virtual] |
Implemented in IE_Imp_Psion_Word, and IE_Imp_Psion_TextEd.
Referenced by _loadFile().
UT_Error IE_Imp_Psion::prepareCharacters | ( | const psiconv_ucs2 * | input, | |
int | length, | |||
UT_UCS4String & | text | |||
) | [protected] |
References UT_DEBUGMSG, and UT_UCS4String::utf8_str().
Referenced by readParagraphs().
UT_Error IE_Imp_Psion::processHeaderFooter | ( | const psiconv_page_layout_section | layout, | |
bool | with_header, | |||
bool | with_footer | |||
) | [protected] |
References IE_Imp::appendStrux(), PTX_SectionHdrFtr, and readParagraphs().
Referenced by IE_Imp_Psion_TextEd::parseFile(), and IE_Imp_Psion_Word::parseFile().
UT_Error IE_Imp_Psion::readParagraphs | ( | const psiconv_text_and_layout | psiontext, | |
const psiconv_word_styles_section | style_sec | |||
) | [protected] |
Read all Psion paragraphs and add them to the document.
References IE_Imp::appendSpan(), applyCharacterAttributes(), applyParagraphAttributes(), UT_UCS4String::clear(), gchar, insertObject(), UT_UCS4String::length(), prepare_style_name(), prepareCharacters(), style, text, UT_UCS4String::ucs4_str(), UT_ASSERT, UT_DEBUGMSG, and UT_IE_IMPORTERROR.
Referenced by IE_Imp_Psion_TextEd::parseFile(), IE_Imp_Psion_Word::parseFile(), and processHeaderFooter().
bool IE_Imp_Psion::list [private] |
Referenced by applyParagraphAttributes().