Пример #1
0
void BookReader::addHyperlinkControl(FBTextKind kind, const std::string &label) {
	myHyperlinkKind = kind;
	std::string type;
	switch (myHyperlinkKind) {
		case INTERNAL_HYPERLINK:
		case FOOTNOTE:
			myHyperlinkType = HYPERLINK_INTERNAL;
			type = "internal";
			break;
		case EXTERNAL_HYPERLINK:
			myHyperlinkType = HYPERLINK_EXTERNAL;
			type = "external";
			break;
		/*case BOOK_HYPERLINK:
			myHyperlinkType = HYPERLINK_BOOK;
			type = "book";
			break;*/
		default:
			myHyperlinkType = HYPERLINK_NONE;
			break;
	}
	ZLLogger::Instance().println(
		"hyperlink",
		" + control (" + type + "): " + label
	);
	if (paragraphIsOpen()) {
		flushTextBufferToParagraph();
		myCurrentTextModel->addHyperlinkControl(kind, myHyperlinkType, label);
	}
	myHyperlinkReference = label;
}
Пример #2
0
void BookReader::addHyperlinkControl(FBTextKind kind, const std::string &label) {
	myHyperlinkKind = kind;
	switch (myHyperlinkKind) {
		case INTERNAL_HYPERLINK:
		case FOOTNOTE:
			myHyperlinkType = "internal";
			break;
		case EXTERNAL_HYPERLINK:
			myHyperlinkType = "external";
			break;
		case BOOK_HYPERLINK:
			myHyperlinkType = "book";
			break;
		default:
			myHyperlinkType.erase();
			break;
	}
	ZLLogger::Instance().println(
		"hyperlink",
		" + control (" + myHyperlinkType + "): " + label
	);
	if (myTextParagraphExists) {
		flushTextBufferToParagraph();
		myCurrentTextModel->addHyperlinkControl(kind, label, myHyperlinkType);
	}
	myHyperlinkReference = label;
}
Пример #3
0
void BookReader::addControl(FBTextKind kind, bool start) {
	if (myTextParagraphExists) {
		flushTextBufferToParagraph();
		myCurrentTextModel->addControl(kind, start);
	}
	if (!start && !myHyperlinkReference.empty() && (kind == myHyperlinkKind)) {
		myHyperlinkReference.erase();
	}
}
Пример #4
0
void BookReader::addImageReference(const std::string &id, short vOffset) {
	if (myCurrentTextModel != 0) {
		mySectionContainsRegularContents = true;
		if (myTextParagraphExists) {
			flushTextBufferToParagraph();
			myCurrentTextModel->addImage(id, myModel.imageMap(), vOffset);
		} else {
			beginParagraph();
			myCurrentTextModel->addControl(IMAGE, true);
			myCurrentTextModel->addImage(id, myModel.imageMap(), vOffset);
			myCurrentTextModel->addControl(IMAGE, false);
			endParagraph();
		}
	}
}
Пример #5
0
void BookReader::addImageReference(const std::string &id, short vOffset, bool isCover) {
	if (myCurrentTextModel != 0) {
		mySectionContainsRegularContents = true;
		if (paragraphIsOpen()) {
			flushTextBufferToParagraph();
			myCurrentTextModel->addImage(id, vOffset, isCover);
		} else {
			beginParagraph();
			myCurrentTextModel->addControl(IMAGE, true);
			myCurrentTextModel->addImage(id, vOffset, isCover);
			myCurrentTextModel->addControl(IMAGE, false);
			endParagraph();
		}
	}
}
Пример #6
0
void BookReader::endParagraph() {
	if (myTextParagraphExists) {
		flushTextBufferToParagraph();
		myTextParagraphExists = false;
	}
}
Пример #7
0
void BookReader::addControl(const ZLTextStyleEntry &entry) {
	if (myTextParagraphExists) {
		flushTextBufferToParagraph();
		myCurrentTextModel->addControl(entry);
	}
}
Пример #8
0
void BookReader::addStyleCloseEntry() {
	if (paragraphIsOpen()) {
		flushTextBufferToParagraph();
		myCurrentTextModel->addStyleCloseEntry();
	}
}
Пример #9
0
void BookReader::addStyleEntry(const ZLTextStyleEntry &entry) {
	if (paragraphIsOpen()) {
		flushTextBufferToParagraph();
		myCurrentTextModel->addStyleEntry(entry);
	}
}
Пример #10
0
void BookReader::endParagraph() {
	if (paragraphIsOpen()) {
		flushTextBufferToParagraph();
		myModelsWithOpenParagraphs.remove(myCurrentTextModel);
	}
}
Пример #11
0
void BookReader::addFixedHSpace(unsigned char length) {
	if (paragraphIsOpen()) {
		flushTextBufferToParagraph();
		myCurrentTextModel->addFixedHSpace(length);
	}
}
Пример #12
0
void BookReader::addStyleEntry(const ZLTextStyleEntry &entry, const std::vector<std::string> &fontFamilies, unsigned char depth) {
	if (paragraphIsOpen()) {
		flushTextBufferToParagraph();
		myCurrentTextModel->addStyleEntry(entry, fontFamilies, depth);
	}
}
Пример #13
0
void BookReader::addStyleCloseEntry() {
	if (myTextParagraphExists) {
		flushTextBufferToParagraph();
		myCurrentTextModel->addStyleCloseEntry();
	}
}