diff --git a/common.cpp b/common.cpp index 565f9f5..0968bb7 100644 --- a/common.cpp +++ b/common.cpp @@ -9,6 +9,7 @@ #include #include #include +#include QString uncompressText(const QByteArray& compressed) @@ -81,3 +82,174 @@ QString localePath() QString szPath = settings.value("file/locale", QString("%1%2locale").arg(szAppPath).arg(QDir::separator())).toString(); return(szPath); } + +QString paperName(QPagedPaintDevice::PageSize paperSize) +{ + QMap list = paperList(); + return(list.value(paperSize)); +} + +QPagedPaintDevice::PageSize paperKey(const QString& szPaperSize) +{ + QMap list = paperList(); + return(list.key(szPaperSize)); +} + +QMap paperList() +{ + QMap list; + + list.insert(QPagedPaintDevice::A0, QObject::tr("A0")); + list.insert(QPagedPaintDevice::A1, QObject::tr("A1")); + list.insert(QPagedPaintDevice::A2, QObject::tr("A2")); + list.insert(QPagedPaintDevice::A3, QObject::tr("A3")); + list.insert(QPagedPaintDevice::A4, QObject::tr("A4")); + list.insert(QPagedPaintDevice::A5, QObject::tr("A5")); + list.insert(QPagedPaintDevice::A6, QObject::tr("A6")); + list.insert(QPagedPaintDevice::A7, QObject::tr("A7")); + list.insert(QPagedPaintDevice::A8, QObject::tr("A8")); + list.insert(QPagedPaintDevice::A9, QObject::tr("A9")); + list.insert(QPagedPaintDevice::B0, QObject::tr("B0")); + list.insert(QPagedPaintDevice::B1, QObject::tr("B1")); + list.insert(QPagedPaintDevice::B2, QObject::tr("B2")); + list.insert(QPagedPaintDevice::B3, QObject::tr("B3")); + list.insert(QPagedPaintDevice::B4, QObject::tr("B4")); + list.insert(QPagedPaintDevice::B5, QObject::tr("B5")); + list.insert(QPagedPaintDevice::B6, QObject::tr("B6")); + list.insert(QPagedPaintDevice::B7, QObject::tr("B7")); + list.insert(QPagedPaintDevice::B8, QObject::tr("B8")); + list.insert(QPagedPaintDevice::B9, QObject::tr("B9")); + list.insert(QPagedPaintDevice::B10, QObject::tr("B10")); + list.insert(QPagedPaintDevice::C5E, QObject::tr("C5E")); + list.insert(QPagedPaintDevice::Comm10E, QObject::tr("Comm10E")); + list.insert(QPagedPaintDevice::DLE, QObject::tr("DLE")); + list.insert(QPagedPaintDevice::Executive, QObject::tr("Executive")); + list.insert(QPagedPaintDevice::Folio, QObject::tr("Folio")); + list.insert(QPagedPaintDevice::Ledger, QObject::tr("Ledger")); + list.insert(QPagedPaintDevice::Legal, QObject::tr("Legal")); + list.insert(QPagedPaintDevice::Letter, QObject::tr("Letter")); + list.insert(QPagedPaintDevice::Tabloid, QObject::tr("Tabloid")); + list.insert(QPagedPaintDevice::Custom, QObject::tr("Custom")); + list.insert(QPagedPaintDevice::A10, QObject::tr("A10")); + list.insert(QPagedPaintDevice::A3Extra, QObject::tr("A3Extra")); + list.insert(QPagedPaintDevice::A4Extra, QObject::tr("A4Extra")); + list.insert(QPagedPaintDevice::A4Plus, QObject::tr("A4Plus")); + list.insert(QPagedPaintDevice::A4Small, QObject::tr("A4Small")); + list.insert(QPagedPaintDevice::A5Extra, QObject::tr("A5Extra")); + list.insert(QPagedPaintDevice::B5Extra, QObject::tr("B5Extra")); + list.insert(QPagedPaintDevice::JisB0, QObject::tr("JisB0")); + list.insert(QPagedPaintDevice::JisB1, QObject::tr("JisB1")); + list.insert(QPagedPaintDevice::JisB2, QObject::tr("JisB2")); + list.insert(QPagedPaintDevice::JisB3, QObject::tr("JisB3")); + list.insert(QPagedPaintDevice::JisB4, QObject::tr("JisB4")); + list.insert(QPagedPaintDevice::JisB5, QObject::tr("JisB5")); + list.insert(QPagedPaintDevice::JisB6, QObject::tr("JisB6")); + list.insert(QPagedPaintDevice::JisB7, QObject::tr("JisB7")); + list.insert(QPagedPaintDevice::JisB8, QObject::tr("JisB8")); + list.insert(QPagedPaintDevice::JisB9, QObject::tr("JisB9")); + list.insert(QPagedPaintDevice::JisB10, QObject::tr("JisB10")); + list.insert(QPagedPaintDevice::AnsiA, QObject::tr("Letter")); + list.insert(QPagedPaintDevice::AnsiB, QObject::tr("Ledger")); + list.insert(QPagedPaintDevice::AnsiC, QObject::tr("AnsiC")); + list.insert(QPagedPaintDevice::AnsiD, QObject::tr("AnsiD")); + list.insert(QPagedPaintDevice::AnsiE, QObject::tr("AnsiE")); + list.insert(QPagedPaintDevice::LegalExtra, QObject::tr("LegalExtra")); + list.insert(QPagedPaintDevice::LetterExtra, QObject::tr("LetterExtra")); + list.insert(QPagedPaintDevice::LetterPlus, QObject::tr("LetterPlus")); + list.insert(QPagedPaintDevice::LetterSmall, QObject::tr("LetterSmall")); + list.insert(QPagedPaintDevice::TabloidExtra, QObject::tr("TabloidExtra")); + list.insert(QPagedPaintDevice::ArchA, QObject::tr("ArchA")); + list.insert(QPagedPaintDevice::ArchB, QObject::tr("ArchB")); + list.insert(QPagedPaintDevice::ArchC, QObject::tr("ArchC")); + list.insert(QPagedPaintDevice::ArchD, QObject::tr("ArchD")); + list.insert(QPagedPaintDevice::ArchE, QObject::tr("ArchE")); + list.insert(QPagedPaintDevice::Imperial7x9, QObject::tr("Imperial7x9")); + list.insert(QPagedPaintDevice::Imperial8x10, QObject::tr("Imperial8x10")); + list.insert(QPagedPaintDevice::Imperial9x11, QObject::tr("Imperial9x11")); + list.insert(QPagedPaintDevice::Imperial9x12, QObject::tr("Imperial9x12")); + list.insert(QPagedPaintDevice::Imperial10x11, QObject::tr("Imperial10x11")); + list.insert(QPagedPaintDevice::Imperial10x13, QObject::tr("Imperial10x13")); + list.insert(QPagedPaintDevice::Imperial10x14, QObject::tr("Imperial10x14")); + list.insert(QPagedPaintDevice::Imperial12x11, QObject::tr("Imperial12x11")); + list.insert(QPagedPaintDevice::Imperial15x11, QObject::tr("Imperial15x11")); + list.insert(QPagedPaintDevice::ExecutiveStandard, QObject::tr("ExecutiveStandard")); + list.insert(QPagedPaintDevice::Note, QObject::tr("Note")); + list.insert(QPagedPaintDevice::Quarto, QObject::tr("Quarto")); + list.insert(QPagedPaintDevice::Statement, QObject::tr("Statement")); + list.insert(QPagedPaintDevice::SuperA, QObject::tr("SuperA")); + list.insert(QPagedPaintDevice::SuperB, QObject::tr("SuperB")); + list.insert(QPagedPaintDevice::Postcard, QObject::tr("Postcard")); + list.insert(QPagedPaintDevice::DoublePostcard, QObject::tr("DoublePostcard")); + list.insert(QPagedPaintDevice::Prc16K, QObject::tr("Prc16K")); + list.insert(QPagedPaintDevice::Prc32K, QObject::tr("Prc32K")); + list.insert(QPagedPaintDevice::Prc32KBig, QObject::tr("Prc32KBig")); + list.insert(QPagedPaintDevice::FanFoldUS, QObject::tr("FanFoldUS")); + list.insert(QPagedPaintDevice::FanFoldGerman, QObject::tr("FanFoldGerman")); + list.insert(QPagedPaintDevice::FanFoldGermanLegal, QObject::tr("FanFoldGermanLegal")); + list.insert(QPagedPaintDevice::EnvelopeB4, QObject::tr("EnvelopeB4")); + list.insert(QPagedPaintDevice::EnvelopeB5, QObject::tr("EnvelopeB5")); + list.insert(QPagedPaintDevice::EnvelopeB6, QObject::tr("EnvelopeB6")); + list.insert(QPagedPaintDevice::EnvelopeC0, QObject::tr("EnvelopeC0")); + list.insert(QPagedPaintDevice::EnvelopeC1, QObject::tr("EnvelopeC1")); + list.insert(QPagedPaintDevice::EnvelopeC2, QObject::tr("EnvelopeC2")); + list.insert(QPagedPaintDevice::EnvelopeC3, QObject::tr("EnvelopeC3")); + list.insert(QPagedPaintDevice::EnvelopeC4, QObject::tr("EnvelopeC4")); + list.insert(QPagedPaintDevice::EnvelopeC5, QObject::tr("EnvelopeC5")); + list.insert(QPagedPaintDevice::EnvelopeC6, QObject::tr("EnvelopeC6")); + list.insert(QPagedPaintDevice::EnvelopeC65, QObject::tr("EnvelopeC65")); + list.insert(QPagedPaintDevice::EnvelopeC7, QObject::tr("EnvelopeC7")); + list.insert(QPagedPaintDevice::EnvelopeDL, QObject::tr("EnvelopeDL")); + list.insert(QPagedPaintDevice::Envelope9, QObject::tr("Envelope9")); + list.insert(QPagedPaintDevice::Envelope10, QObject::tr("Envelope10")); + list.insert(QPagedPaintDevice::Envelope11, QObject::tr("Envelope11")); + list.insert(QPagedPaintDevice::Envelope12, QObject::tr("Envelope12")); + list.insert(QPagedPaintDevice::Envelope14, QObject::tr("Envelope14")); + list.insert(QPagedPaintDevice::EnvelopeMonarch, QObject::tr("EnvelopeMonarch")); + list.insert(QPagedPaintDevice::EnvelopePersonal, QObject::tr("EnvelopePersonal")); + list.insert(QPagedPaintDevice::EnvelopeChou3, QObject::tr("EnvelopeChou3")); + list.insert(QPagedPaintDevice::EnvelopeChou4, QObject::tr("EnvelopeChou4")); + list.insert(QPagedPaintDevice::EnvelopeInvite, QObject::tr("EnvelopeInvite")); + list.insert(QPagedPaintDevice::EnvelopeItalian, QObject::tr("EnvelopeItalian")); + list.insert(QPagedPaintDevice::EnvelopeKaku2, QObject::tr("EnvelopeKaku2")); + list.insert(QPagedPaintDevice::EnvelopeKaku3, QObject::tr("EnvelopeKaku3")); + list.insert(QPagedPaintDevice::EnvelopePrc1, QObject::tr("EnvelopePrc1")); + list.insert(QPagedPaintDevice::EnvelopePrc2, QObject::tr("EnvelopePrc2")); + list.insert(QPagedPaintDevice::EnvelopePrc3, QObject::tr("EnvelopePrc3")); + list.insert(QPagedPaintDevice::EnvelopePrc4, QObject::tr("EnvelopePrc4")); + list.insert(QPagedPaintDevice::EnvelopePrc5, QObject::tr("EnvelopePrc5")); + list.insert(QPagedPaintDevice::EnvelopePrc6, QObject::tr("EnvelopePrc6")); + list.insert(QPagedPaintDevice::EnvelopePrc7, QObject::tr("EnvelopePrc7")); + list.insert(QPagedPaintDevice::EnvelopePrc8, QObject::tr("EnvelopePrc8")); + list.insert(QPagedPaintDevice::EnvelopePrc9, QObject::tr("EnvelopePrc9")); + list.insert(QPagedPaintDevice::EnvelopePrc10, QObject::tr("EnvelopePrc10")); + list.insert(QPagedPaintDevice::EnvelopeYou4, QObject::tr("EnvelopeYou4")); + + return(list); +} + +QString unitName(QPrinter::Unit unit) +{ + QMap list = unitList(); + return(list.value(unit)); +} + +QPrinter::Unit unitKey(const QString& szUnit) +{ + QMap list = unitList(); + return(list.key(szUnit)); +} + +QMap unitList() +{ + QMap list; + + list.insert(QPrinter::Millimeter, QObject::tr("Millimeter")); + list.insert(QPrinter::Point, QObject::tr("Point")); + list.insert(QPrinter::Inch, QObject::tr("Inch")); + list.insert(QPrinter::Pica, QObject::tr("Pica")); + list.insert(QPrinter::Didot, QObject::tr("Didot")); + list.insert(QPrinter::Cicero, QObject::tr("Cicero")); + list.insert(QPrinter::DevicePixel, QObject::tr("DevicePixel")); + + return(list); +} diff --git a/common.h b/common.h index b49eba6..a914c66 100644 --- a/common.h +++ b/common.h @@ -14,6 +14,8 @@ #include #include +#include +#include #ifdef __GNUC__ @@ -25,13 +27,6 @@ #endif -enum UNIT -{ - UNIT_mm = 1, - UNIT_cm = 1, - UNIT_inch = 3, -}; - enum ALIGN { ALIGN_left = 1, @@ -40,12 +35,6 @@ enum ALIGN ALIGN_block = 4, }; -enum ORIENTATION -{ - ORIENTATION_portrait = 1, - ORIENTATION_landscape = 2, -}; - /*! \brief @@ -102,4 +91,12 @@ QByteArray textDocument2Blob(cTextDocument* lpTextDocument); */ QString localePath(); +QString paperName(QPagedPaintDevice::PageSize paperSize); +QPagedPaintDevice::PageSize paperKey(const QString& szPaperSize); +QMap paperList(); + +QString unitName(QPrinter::Unit unit); +QPrinter::Unit unitKey(const QString& szUnit); +QMap unitList(); + #endif // COMMON_H diff --git a/cpropertieswindow.cpp b/cpropertieswindow.cpp index 01984b9..681f69d 100644 --- a/cpropertieswindow.cpp +++ b/cpropertieswindow.cpp @@ -15,6 +15,18 @@ cPropertiesWindow::cPropertiesWindow(QWidget *parent) : ui->setupUi(this); ui->m_lpTab->setCurrentIndex(0); + QMap paperLst = paperList(); + QMap::iterator i; + + for(i = paperLst.begin();i != paperLst.end();i++) + ui->m_lpPaperSize->addItem(i.value(), QVariant::fromValue((int)i.key())); + + QMap unitLst = unitList(); + QMap::iterator iUnit; + + for(iUnit = unitLst.begin();iUnit != unitLst.end();iUnit++) + ui->m_lpUnit->addItem(iUnit.value(), QVariant::fromValue((int)iUnit.key())); + fillFontSize(ui->m_lpAuthorFontSize); fillFontSize(ui->m_lpChapterNameFontSize); fillFontSize(ui->m_lpPartNameFontSize); @@ -262,6 +274,24 @@ cPropertiesWindow::~cPropertiesWindow() delete ui; } +void setAlign(ALIGN align, cRadioButton* lpLeft, cRadioButton* lpCenter, cRadioButton* lpRight) +{ + switch(align) + { + case ALIGN_left: + lpLeft->setChecked(true); + break; + case ALIGN_center: + lpCenter->setChecked(true); + break; + case ALIGN_right: + lpRight->setChecked(true); + break; + case ALIGN_block: + break; + } +} + void cPropertiesWindow::setBook(cStoryBook *lpStoryBook) { m_lpStoryBook = lpStoryBook; @@ -281,18 +311,14 @@ void cPropertiesWindow::setBook(cStoryBook *lpStoryBook) ui->m_lpTitleBold->setChecked(lpStoryBook->titleBold()); ui->m_lpTitleItalic->setChecked(lpStoryBook->titleItalic()); ui->m_lpTitleUnderline->setChecked(lpStoryBook->titleUnderline()); - ui->m_lpTitleLeft->setChecked(lpStoryBook->titleAlign() == ALIGN_left); - ui->m_lpTitleCenter->setChecked(lpStoryBook->titleAlign() == ALIGN_center); - ui->m_lpTitleRight->setChecked(lpStoryBook->titleAlign() == ALIGN_right); + setAlign(lpStoryBook->titleAlign(), ui->m_lpTitleLeft, ui->m_lpTitleCenter, ui->m_lpTitleRight); ui->m_lpPrintSubtitle->setChecked(lpStoryBook->printSubTitle()); ui->m_lpSubtitleFont->setCurrentText(lpStoryBook->subtitleFont()); ui->m_lpSubtitleFontSize->setCurrentText(QString("%1").arg(lpStoryBook->subtitleFontSize())); ui->m_lpSubtitleBold->setChecked(lpStoryBook->subtitleBold()); ui->m_lpSubtitleItalic->setChecked(lpStoryBook->subtitleItalic()); ui->m_lpSubtitleUnderline->setChecked(lpStoryBook->subtitleUnderline()); - ui->m_lpSubtitleLeft->setChecked(lpStoryBook->subtitleAlign() == ALIGN_left); - ui->m_lpSubtitleCenter->setChecked(lpStoryBook->subtitleAlign() == ALIGN_center); - ui->m_lpSubtitleRight->setChecked(lpStoryBook->subtitleAlign() == ALIGN_right); + setAlign(lpStoryBook->subtitleAlign(), ui->m_lpSubtitleLeft, ui->m_lpSubtitleCenter, ui->m_lpSubtitleRight); ui->m_lpPrintShortDescription->setChecked(lpStoryBook->printShortDescription()); ui->m_lpPrintDescription->setChecked(lpStoryBook->printDescription()); ui->m_lpPrintAuthor->setChecked(lpStoryBook->printAuthor()); @@ -301,18 +327,14 @@ void cPropertiesWindow::setBook(cStoryBook *lpStoryBook) ui->m_lpAuthorBold->setChecked(lpStoryBook->authorBold()); ui->m_lpAuthorItalic->setChecked(lpStoryBook->authorItalic()); ui->m_lpAuthorUnderline->setChecked(lpStoryBook->authorUnderline()); - ui->m_lpAuthorLeft->setChecked(lpStoryBook->authorAlign() == ALIGN_left); - ui->m_lpAuthorCenter->setChecked(lpStoryBook->authorAlign() == ALIGN_center); - ui->m_lpAuthorRight->setChecked(lpStoryBook->authorAlign() == ALIGN_right); + setAlign(lpStoryBook->authorAlign(), ui->m_lpAuthorLeft, ui->m_lpAuthorCenter, ui->m_lpAuthorRight); ui->m_lpPrintPartName->setChecked(lpStoryBook->printPartName()); ui->m_lpPartNameFont->setCurrentText(lpStoryBook->partFont()); ui->m_lpPartNameFontSize->setCurrentText(QString("%1").arg(lpStoryBook->partFontSize())); ui->m_lpPartNameBold->setChecked(lpStoryBook->partBold()); ui->m_lpPartNameItalic->setChecked(lpStoryBook->partItalic()); ui->m_lpPartNameUnderline->setChecked(lpStoryBook->partUnderline()); - ui->m_lpPartNameLeft->setChecked(lpStoryBook->partAlign() == ALIGN_left); - ui->m_lpPartNameCenter->setChecked(lpStoryBook->partAlign() == ALIGN_center); - ui->m_lpPartNameRight->setChecked(lpStoryBook->partAlign() == ALIGN_right); + setAlign(lpStoryBook->partAlign(), ui->m_lpPartNameLeft, ui->m_lpPartNameCenter, ui->m_lpPartNameRight); ui->m_lpPrintPartDescription->setChecked(lpStoryBook->printPartDescription()); ui->m_lpPrintPartText->setChecked(lpStoryBook->printPartText()); ui->m_lpPrintChapterName->setChecked(lpStoryBook->printChapterName()); @@ -321,9 +343,7 @@ void cPropertiesWindow::setBook(cStoryBook *lpStoryBook) ui->m_lpChapterNameBold->setChecked(lpStoryBook->chapterBold()); ui->m_lpChapterNameItalic->setChecked(lpStoryBook->chapterItalic()); ui->m_lpChapterNameUnderline->setChecked(lpStoryBook->chapterUnderline()); - ui->m_lpChapterNameLeft->setChecked(lpStoryBook->chapterAlign() == ALIGN_left); - ui->m_lpChapterNameCenter->setChecked(lpStoryBook->chapterAlign() == ALIGN_center); - ui->m_lpChapterNameRight->setChecked(lpStoryBook->chapterAlign() == ALIGN_right); + setAlign(lpStoryBook->chapterAlign(), ui->m_lpChapterNameLeft, ui->m_lpChapterNameCenter, ui->m_lpChapterNameRight); ui->m_lpPrintChapterDescription->setChecked(lpStoryBook->printChapterDescription()); ui->m_lpPrintChapterText->setChecked(lpStoryBook->printChapterText()); ui->m_lpPrintSceneName->setChecked(lpStoryBook->printSceneName()); @@ -332,14 +352,12 @@ void cPropertiesWindow::setBook(cStoryBook *lpStoryBook) ui->m_lpSceneNameBold->setChecked(lpStoryBook->sceneBold()); ui->m_lpSceneNameItalic->setChecked(lpStoryBook->sceneItalic()); ui->m_lpSceneNameUnderline->setChecked(lpStoryBook->sceneUnderline()); - ui->m_lpSceneNameLeft->setChecked(lpStoryBook->sceneAlign() == ALIGN_left); - ui->m_lpSceneNameCenter->setChecked(lpStoryBook->sceneAlign() == ALIGN_center); - ui->m_lpSceneNameRight->setChecked(lpStoryBook->sceneAlign() == ALIGN_right); + setAlign(lpStoryBook->sceneAlign(), ui->m_lpSceneNameLeft, ui->m_lpSceneNameCenter, ui->m_lpSceneNameRight); ui->m_lpPrintSceneDescription->setChecked(lpStoryBook->printSceneDescription()); ui->m_lpPrintSceneText->setChecked(lpStoryBook->printSceneText()); - ui->m_lpPaperSize->setCurrentText(lpStoryBook->paperSize()); - ui->m_lpOrientationPortrait->setChecked(lpStoryBook->paperOrientation() == ORIENTATION_portrait); - ui->m_lpOrientationLandscape->setChecked(lpStoryBook->paperOrientation() == ORIENTATION_landscape); + ui->m_lpPaperSize->setCurrentText(paperName(lpStoryBook->paperSize())); + ui->m_lpOrientationPortrait->setChecked(lpStoryBook->paperOrientation() == QPrinter::Portrait); + ui->m_lpOrientationLandscape->setChecked(lpStoryBook->paperOrientation() == QPrinter::Landscape); ui->m_lpUnit->setCurrentText(QString("%1").arg(lpStoryBook->unit())); ui->m_lpMarginLeft->setValue(lpStoryBook->leftMargin()); ui->m_lpMarginRight->setValue(lpStoryBook->rightMargin()); @@ -885,27 +903,27 @@ void cPropertiesWindow::onPrintSceneTextChanged(bool checked) void cPropertiesWindow::onPaperSizeChanged(const QString &text) { - m_lpStoryBook->setPaperSize(text); + m_lpStoryBook->setPaperSize(paperKey(text)); m_lpMainWindow->somethingChanged(); } void cPropertiesWindow::onOrientationPortraitChanged(bool checked) { if(checked) - m_lpStoryBook->setPaperOrientation(ORIENTATION_portrait); + m_lpStoryBook->setPaperOrientation(QPrinter::Portrait); m_lpMainWindow->somethingChanged(); } void cPropertiesWindow::onOrientationLandscapeChanged(bool checked) { if(checked) - m_lpStoryBook->setPaperOrientation(ORIENTATION_landscape); + m_lpStoryBook->setPaperOrientation(QPrinter::Landscape); m_lpMainWindow->somethingChanged(); } void cPropertiesWindow::onUnitChanged(const QString &text) { - m_lpStoryBook->setUnit(text.toInt()); + m_lpStoryBook->setUnit(unitKey(text)); m_lpMainWindow->somethingChanged(); } diff --git a/cpropertieswindow.ui b/cpropertieswindow.ui index f0130bc..7063dcc 100644 --- a/cpropertieswindow.ui +++ b/cpropertieswindow.ui @@ -454,6 +454,12 @@ center + + true + + + m_lpPartAlign + @@ -495,6 +501,9 @@ left + + m_lpPartAlign + @@ -505,6 +514,9 @@ left + + m_lpSceneAlign + @@ -519,6 +531,12 @@ center + + true + + + m_lpSceneAlign + @@ -553,6 +571,9 @@ right + + m_lpPartAlign + @@ -662,6 +683,9 @@ center + + true + @@ -699,6 +723,9 @@ right + + m_lpSceneAlign + @@ -822,9 +849,11 @@ + - + + diff --git a/cstorybook.cpp b/cstorybook.cpp index a701393..ad761df 100644 --- a/cstorybook.cpp +++ b/cstorybook.cpp @@ -32,7 +32,64 @@ cStoryBook::cStoryBook(QObject *parent) : QObject(parent), m_szProject(""), - m_bIsOpen(false) + m_bIsOpen(false), + m_bPrintTitle(true), + m_szTitleFont(""), + m_iTitleFontSize(8), + m_bTitleBold(true), + m_bTitleItalic(true), + m_bTitleUnderline(true), + m_iTitleAlign(ALIGN_left), + m_bPrintSubTitle(true), + m_szSubtitleFont(""), + m_iSubtitleFontSize(8), + m_bSubtitleBold(true), + m_bSubtitleItalic(true), + m_bSubtitleUnderline(true), + m_iSubtitleAlign(ALIGN_left), + m_bPrintShortDescription(true), + m_bPrintDescription(true), + m_bPrintAuthor(true), + m_szAuthorFont(""), + m_iAuthorFontSize(8), + m_bAuthorBold(true), + m_bAuthorItalic(true), + m_bAuthorUnderline(true), + m_iAuthorAlign(ALIGN_left), + m_bPrintPartName(true), + m_szPartFont(""), + m_iPartFontSize(8), + m_bPartBold(true), + m_bPartItalic(true), + m_bPartUnderline(true), + m_iPartAlign(ALIGN_left), + m_bPrintPartDescription(true), + m_bPrintPartText(true), + m_bPrintChapterName(true), + m_szChapterFont(""), + m_iChapterFontSize(8), + m_bChapterBold(true), + m_bChapterItalic(true), + m_bChapterUnderline(true), + m_iChapterAlign(ALIGN_left), + m_bPrintChapterDescription(true), + m_bPrintChapterText(true), + m_bPrintSceneName(true), + m_szSceneFont(""), + m_iSceneFontSize(8), + m_bSceneBold(true), + m_bSceneItalic(true), + m_bSceneUnderline(true), + m_iSceneAlign(ALIGN_left), + m_bPrintSceneDescription(true), + m_bPrintSceneText(true), + m_paperSize(QPagedPaintDevice::A4), + m_iPaperOrientation(QPrinter::Portrait), + m_dLeftMargin(10), + m_dRightMargin(10), + m_dTopMargin(10), + m_dBottomMargin(10), + m_iUnit(QPrinter::Millimeter) { m_book.setTitle("untitled"); m_bIsOpen = true; @@ -343,7 +400,7 @@ bool cStoryBook::createDatabase() " sceneAlign INTEGER, " " printSceneDescription BOOLEAN, " " printSceneText BOOLEAN, " - " paperSize TEXT, " + " paperSize INTEGER, " " paperOrientation INTEGER, " " leftMargin REAL, " " rightMargin REAL, " @@ -409,13 +466,13 @@ bool cStoryBook::createDatabase() query.bindValue(":sceneAlign", ALIGN_left); query.bindValue(":printSceneDescription", true); query.bindValue(":printSceneText", true); - query.bindValue(":paperSize", "A4"); - query.bindValue(":paperOrientation", ORIENTATION_portrait); + query.bindValue(":paperSize", QPagedPaintDevice::A4); + query.bindValue(":paperOrientation", QPrinter::Portrait); query.bindValue(":leftMargin", 10); query.bindValue(":rightMargin", 10); query.bindValue(":topMargin", 10); query.bindValue(":bottomMargin", 10); - query.bindValue(":unit", UNIT_mm); + query.bindValue(":unit", QPrinter::Millimeter); if(!query.exec()) { myDebug << query.lastError().text(); @@ -634,14 +691,14 @@ bool cStoryBook::loadConfig() m_bTitleBold = query.value("titleBold").toBool(); m_bTitleItalic = query.value("titleItalic").toBool(); m_bTitleUnderline = query.value("titleUnderline").toBool(); - m_iTitleAlign = query.value("titleAlign").toInt(); + m_iTitleAlign = (ALIGN)query.value("titleAlign").toInt(); m_bPrintSubTitle = query.value("printSubTitle").toBool(); m_szSubtitleFont = query.value("subtitleFont").toString(); m_iSubtitleFontSize = query.value("subtitleFontSize").toInt(); m_bSubtitleBold = query.value("subtitleBold").toBool(); m_bSubtitleItalic = query.value("subtitleItalic").toBool(); m_bSubtitleUnderline = query.value("subtitleUnderline").toBool(); - m_iSubtitleAlign = query.value("subtitleAlign").toInt(); + m_iSubtitleAlign = (ALIGN)query.value("subtitleAlign").toInt(); m_bPrintShortDescription = query.value("printShortDescription").toBool(); m_bPrintDescription = query.value("printDescription").toBool(); m_bPrintAuthor = query.value("printAuthor").toBool(); @@ -650,14 +707,14 @@ bool cStoryBook::loadConfig() m_bAuthorBold = query.value("authorBold").toBool(); m_bAuthorItalic = query.value("authorItalic").toBool(); m_bAuthorUnderline = query.value("authorUnderline").toBool(); - m_iAuthorAlign = query.value("authorAlign").toInt(); + m_iAuthorAlign = (ALIGN)query.value("authorAlign").toInt(); m_bPrintPartName = query.value("printPartName").toBool(); m_szPartFont = query.value("partFont").toString(); m_iPartFontSize = query.value("partFontSize").toInt(); m_bPartBold = query.value("partBold").toBool(); m_bPartItalic = query.value("partItalic").toBool(); m_bPartUnderline = query.value("partUnderline").toBool(); - m_iPartAlign = query.value("partAlign").toInt(); + m_iPartAlign = (ALIGN)query.value("partAlign").toInt(); m_bPrintPartDescription = query.value("printPartDescription").toBool(); m_bPrintPartText = query.value("printPartText").toBool(); m_bPrintChapterName = query.value("printChapterName").toBool(); @@ -666,7 +723,7 @@ bool cStoryBook::loadConfig() m_bChapterBold = query.value("chapterBold").toBool(); m_bChapterItalic = query.value("chapterItalic").toBool(); m_bChapterUnderline = query.value("chapterUnderline").toBool(); - m_iChapterAlign = query.value("chapterAlign").toInt(); + m_iChapterAlign = (ALIGN)query.value("chapterAlign").toInt(); m_bPrintChapterDescription = query.value("printChapterDescription").toBool(); m_bPrintChapterText = query.value("printChapterText").toBool(); m_bPrintSceneName = query.value("printSceneName").toBool(); @@ -675,16 +732,16 @@ bool cStoryBook::loadConfig() m_bSceneBold = query.value("sceneBold").toBool(); m_bSceneItalic = query.value("sceneItalic").toBool(); m_bSceneUnderline = query.value("sceneUnderline").toBool(); - m_iSceneAlign = query.value("sceneAlign").toInt(); + m_iSceneAlign = (ALIGN)query.value("sceneAlign").toInt(); m_bPrintSceneDescription = query.value("printSceneDescription").toBool(); m_bPrintSceneText = query.value("printSceneText").toBool(); - m_szPaperSize = query.value("paperSize").toString(); - m_iPaperOrientation = query.value("paperOrientation").toInt(); + m_paperSize = (QPagedPaintDevice::PageSize)query.value("paperSize").toInt(); + m_iPaperOrientation = (QPrinter::Orientation)query.value("paperOrientation").toInt(); m_dLeftMargin = query.value("leftMargin").toDouble(); m_dRightMargin = query.value("rightMargin").toDouble(); m_dTopMargin = query.value("topMargin").toDouble(); m_dBottomMargin = query.value("bottomMargin").toDouble(); - m_iUnit = query.value("unit").toInt(); + m_iUnit = (QPrinter::Unit)query.value("unit").toInt(); return(true); } @@ -792,7 +849,7 @@ bool cStoryBook::saveConfig() query.bindValue(":sceneAlign", m_iSceneAlign); query.bindValue(":printSceneDescription", m_bPrintSceneDescription); query.bindValue(":printSceneText", m_bPrintSceneText); - query.bindValue(":paperSize", m_szPaperSize); + query.bindValue(":paperSize", m_paperSize); query.bindValue(":paperOrientation", m_iPaperOrientation); query.bindValue(":leftMargin", m_dLeftMargin); query.bindValue(":rightMargin", m_dRightMargin); @@ -1383,12 +1440,12 @@ void cStoryBook::setTitleUnderline(const bool& value) m_bTitleUnderline = value; } -qint16 cStoryBook::titleAlign() +ALIGN cStoryBook::titleAlign() { return(m_iTitleAlign); } -void cStoryBook::setTitleAlign(const qint16& value) +void cStoryBook::setTitleAlign(const ALIGN& value) { m_iTitleAlign = value; } @@ -1453,12 +1510,12 @@ void cStoryBook::setSubtitleUnderline(const bool& value) m_bSubtitleUnderline = value; } -qint16 cStoryBook::subtitleAlign() +ALIGN cStoryBook::subtitleAlign() { return(m_iSubtitleAlign); } -void cStoryBook::setSubtitleAlign(const qint16& value) +void cStoryBook::setSubtitleAlign(const ALIGN& value) { m_iSubtitleAlign = value; } @@ -1543,12 +1600,12 @@ void cStoryBook::setAuthorUnderline(const bool& value) m_bAuthorUnderline = value; } -qint16 cStoryBook::authorAlign() +ALIGN cStoryBook::authorAlign() { return(m_iAuthorAlign); } -void cStoryBook::setAuthorAlign(const qint16& value) +void cStoryBook::setAuthorAlign(const ALIGN& value) { m_iAuthorAlign = value; } @@ -1613,12 +1670,12 @@ void cStoryBook::setPartUnderline(const bool& value) m_bPartUnderline = value; } -qint16 cStoryBook::partAlign() +ALIGN cStoryBook::partAlign() { return(m_iPartAlign); } -void cStoryBook::setPartAlign(const qint16& value) +void cStoryBook::setPartAlign(const ALIGN& value) { m_iPartAlign = value; } @@ -1703,12 +1760,12 @@ void cStoryBook::setChapterUnderline(const bool& value) m_bChapterUnderline = value; } -qint16 cStoryBook::chapterAlign() +ALIGN cStoryBook::chapterAlign() { return(m_iChapterAlign); } -void cStoryBook::setChapterAlign(const qint16& value) +void cStoryBook::setChapterAlign(const ALIGN& value) { m_iChapterAlign = value; } @@ -1793,12 +1850,12 @@ void cStoryBook::setSceneUnderline(const bool& value) m_bSceneUnderline = value; } -qint16 cStoryBook::sceneAlign() +ALIGN cStoryBook::sceneAlign() { return(m_iSceneAlign); } -void cStoryBook::setSceneAlign(const qint16& value) +void cStoryBook::setSceneAlign(const ALIGN& value) { m_iSceneAlign = value; } @@ -1823,22 +1880,22 @@ void cStoryBook::setPrintSceneText(const bool& value) m_bPrintSceneText = value; } -QString cStoryBook::paperSize() +QPagedPaintDevice::PageSize cStoryBook::paperSize() { - return(m_szPaperSize); + return(m_paperSize); } -void cStoryBook::setPaperSize(const QString& value) +void cStoryBook::setPaperSize(const QPagedPaintDevice::PageSize& value) { - m_szPaperSize = value; + m_paperSize = value; } -qint16 cStoryBook::paperOrientation() +QPrinter::Orientation cStoryBook::paperOrientation() { return(m_iPaperOrientation); } -void cStoryBook::setPaperOrientation(const qint16& value) +void cStoryBook::setPaperOrientation(const QPrinter::Orientation& value) { m_iPaperOrientation = value; } @@ -1883,12 +1940,12 @@ void cStoryBook::setBottomMargin(const qreal& value) m_dBottomMargin = value; } -qint16 cStoryBook::unit() +QPrinter::Unit cStoryBook::unit() { return(m_iUnit); } -void cStoryBook::setUnit(const qint16& value) +void cStoryBook::setUnit(const QPrinter::Unit& value) { m_iUnit = value; } diff --git a/cstorybook.h b/cstorybook.h index e7371e7..0b17aa9 100644 --- a/cstorybook.h +++ b/cstorybook.h @@ -16,6 +16,7 @@ #include "cobject.h" #include "crecherche.h" #include "cimage.h" +#include "common.h" #include #include @@ -25,6 +26,9 @@ #include +#include +#include + /*! \brief @@ -63,7 +67,7 @@ public: \fn save \return bool */ - bool save(); + bool save(); /*! \brief @@ -71,7 +75,7 @@ public: \param szProject \return bool */ - bool saveAs(const QString& szProject); + bool saveAs(const QString& szProject); /*! \brief @@ -80,7 +84,7 @@ public: \param szFileName \return bool */ - bool printPdf(const QString& szFileName); + bool printPdf(const QString& szFileName); /*! \brief @@ -88,14 +92,14 @@ public: \fn openDatabase \return bool */ - bool openDatabase(); + bool openDatabase(); /*! \brief \fn verify \return bool */ - bool verify(); + bool verify(); /*! \brief @@ -103,14 +107,14 @@ public: \fn title \return QString */ - QString title(); + QString title(); /*! \brief \fn author \return QString */ - QString author(); + QString author(); /*! \brief @@ -119,7 +123,7 @@ public: \param lpView \return bool */ - bool fillOutlineList(QTreeView* lpView); + bool fillOutlineList(QTreeView* lpView); /*! \brief @@ -127,7 +131,7 @@ public: \param lpView \return bool */ - bool fillCharacterList(QTreeView* lpView); + bool fillCharacterList(QTreeView* lpView); /*! \brief @@ -135,7 +139,7 @@ public: \param lpView \return bool */ - bool fillPlaceList(QTreeView* lpView); + bool fillPlaceList(QTreeView* lpView); /*! \brief @@ -143,7 +147,7 @@ public: \param lpView \return bool */ - bool fillObjectList(QTreeView* lpView); + bool fillObjectList(QTreeView* lpView); /*! \brief @@ -151,7 +155,7 @@ public: \param lpView \return bool */ - bool fillRechercheList(QTreeView* lpView); + bool fillRechercheList(QTreeView* lpView); /*! \brief @@ -159,49 +163,49 @@ public: \fn project \return QString */ - QString project(); + QString project(); /*! \brief \fn book \return cBook */ - cBook* book(); + cBook* book(); /*! \brief \fn chapterList \return cChapterList */ - cChapterList* chapterList(); + cChapterList* chapterList(); /*! \brief \fn sceneList \return cSceneList */ - cSceneList* sceneList(); + cSceneList* sceneList(); /*! \brief \fn characterList \return cCharacterList */ - cCharacterList* characterList(); + cCharacterList* characterList(); /*! \brief \fn placeList \return cPlaceList */ - cPlaceList* placeList(); + cPlaceList* placeList(); /*! \brief \fn objectList \return cObjectList */ - cObjectList* objectList(); + cObjectList* objectList(); /*! \brief @@ -210,7 +214,7 @@ public: \param szPartName \return bool */ - bool addPart(const QString& szPartName); + bool addPart(const QString& szPartName); /*! \brief @@ -220,7 +224,7 @@ public: \param szChapterName \return bool */ - bool addChapter(cPart* lpPart, const QString& szChapterName); + bool addChapter(cPart* lpPart, const QString& szChapterName); /*! \brief @@ -230,7 +234,7 @@ public: \param szSceneName \return bool */ - bool addScene(cChapter* lpChapter, const QString& szSceneName); + bool addScene(cChapter* lpChapter, const QString& szSceneName); /*! \brief @@ -239,7 +243,7 @@ public: \param szCharacterName \return bool */ - bool addCharacter(const QString& szCharacterName); + bool addCharacter(const QString& szCharacterName); /*! \brief @@ -248,7 +252,7 @@ public: \param szPlaceName \return bool */ - bool addPlace(const QString& szPlaceName); + bool addPlace(const QString& szPlaceName); /*! \brief @@ -257,7 +261,7 @@ public: \param szObjectName \return bool */ - bool addObject(const QString& szObjectName); + bool addObject(const QString& szObjectName); /*! \brief @@ -266,7 +270,7 @@ public: \param szRechercheName \return bool */ - bool addRecherche(const QString& szRechercheName); + bool addRecherche(const QString& szRechercheName); /*! \brief @@ -275,7 +279,7 @@ public: \param lpPart \return bool */ - bool hasChapter(cPart* lpPart); + bool hasChapter(cPart* lpPart); /*! \brief @@ -284,7 +288,7 @@ public: \param lpChapter \return bool */ - bool hasScene(cChapter* lpChapter); + bool hasScene(cChapter* lpChapter); /*! \brief @@ -293,7 +297,7 @@ public: \param lpCharacter \return bool */ - bool characterInUse(cCharacter* lpCharacter); + bool characterInUse(cCharacter* lpCharacter); /*! \brief @@ -302,7 +306,7 @@ public: \param lpPlace \return bool */ - bool placeInUse(cPlace* lpPlace); + bool placeInUse(cPlace* lpPlace); /*! \brief @@ -311,7 +315,7 @@ public: \param lpObject \return bool */ - bool objectInUse(cObject* lpObject); + bool objectInUse(cObject* lpObject); /*! \brief @@ -320,249 +324,249 @@ public: \param lpRecherche \return bool */ - bool rechercheInUse(cRecherche* lpRecherche); + bool rechercheInUse(cRecherche* lpRecherche); - bool printTitle(); - void setPrintTitle(const bool& value); + bool printTitle(); + void setPrintTitle(const bool& value); - QString titleFont(); - void setTitleFont(const QString& value); + QString titleFont(); + void setTitleFont(const QString& value); - qint16 titleFontSize(); - void setTitleFontSize(const qint16& value); + qint16 titleFontSize(); + void setTitleFontSize(const qint16& value); - bool titleBold(); - void setTitleBold(const bool& value); + bool titleBold(); + void setTitleBold(const bool& value); - bool titleItalic(); - void setTitleItalic(const bool& value); + bool titleItalic(); + void setTitleItalic(const bool& value); - bool titleUnderline(); - void setTitleUnderline(const bool& value); + bool titleUnderline(); + void setTitleUnderline(const bool& value); - qint16 titleAlign(); - void setTitleAlign(const qint16& value); + ALIGN titleAlign(); + void setTitleAlign(const ALIGN& value); - bool printSubTitle(); - void setPrintSubTitle(const bool& value); + bool printSubTitle(); + void setPrintSubTitle(const bool& value); - QString subtitleFont(); - void setSubtitleFont(const QString& value); + QString subtitleFont(); + void setSubtitleFont(const QString& value); - qint16 subtitleFontSize(); - void setSubtitleFontSize(const qint16& value); + qint16 subtitleFontSize(); + void setSubtitleFontSize(const qint16& value); - bool subtitleBold(); - void setSubtitleBold(const bool& value); + bool subtitleBold(); + void setSubtitleBold(const bool& value); - bool subtitleItalic(); - void setSubtitleItalic(const bool& value); + bool subtitleItalic(); + void setSubtitleItalic(const bool& value); - bool subtitleUnderline(); - void setSubtitleUnderline(const bool& value); + bool subtitleUnderline(); + void setSubtitleUnderline(const bool& value); - qint16 subtitleAlign(); - void setSubtitleAlign(const qint16& value); + ALIGN subtitleAlign(); + void setSubtitleAlign(const ALIGN& value); - bool printShortDescription(); - void setPrintShortDescription(const bool& value); + bool printShortDescription(); + void setPrintShortDescription(const bool& value); - bool printDescription(); - void setPrintDescription(const bool& value); + bool printDescription(); + void setPrintDescription(const bool& value); - bool printAuthor(); - void setPrintAuthor(const bool& value); + bool printAuthor(); + void setPrintAuthor(const bool& value); - QString authorFont(); - void setAuthorFont(const QString& value); + QString authorFont(); + void setAuthorFont(const QString& value); - qint16 authorFontSize(); - void setAuthorFontSize(const qint16& value); + qint16 authorFontSize(); + void setAuthorFontSize(const qint16& value); - bool authorBold(); - void setAuthorBold(const bool& value); + bool authorBold(); + void setAuthorBold(const bool& value); - bool authorItalic(); - void setAuthorItalic(const bool& value); + bool authorItalic(); + void setAuthorItalic(const bool& value); - bool authorUnderline(); - void setAuthorUnderline(const bool& value); + bool authorUnderline(); + void setAuthorUnderline(const bool& value); - qint16 authorAlign(); - void setAuthorAlign(const qint16& value); + ALIGN authorAlign(); + void setAuthorAlign(const ALIGN& value); - bool printPartName(); - void setPrintPartName(const bool& value); + bool printPartName(); + void setPrintPartName(const bool& value); - QString partFont(); - void setPartFont(const QString& value); + QString partFont(); + void setPartFont(const QString& value); - qint16 partFontSize(); - void setPartFontSize(const qint16& value); + qint16 partFontSize(); + void setPartFontSize(const qint16& value); - bool partBold(); - void setPartBold(const bool& value); + bool partBold(); + void setPartBold(const bool& value); - bool partItalic(); - void setPartItalic(const bool& value); + bool partItalic(); + void setPartItalic(const bool& value); - bool partUnderline(); - void setPartUnderline(const bool& value); + bool partUnderline(); + void setPartUnderline(const bool& value); - qint16 partAlign(); - void setPartAlign(const qint16& value); + ALIGN partAlign(); + void setPartAlign(const ALIGN& value); - bool printPartDescription(); - void setPrintPartDescription(const bool& value); + bool printPartDescription(); + void setPrintPartDescription(const bool& value); - bool printPartText(); - void setPrintPartText(const bool& value); + bool printPartText(); + void setPrintPartText(const bool& value); - bool printChapterName(); - void setPrintChapterName(const bool& value); + bool printChapterName(); + void setPrintChapterName(const bool& value); - QString chapterFont(); - void setChapterFont(const QString& value); + QString chapterFont(); + void setChapterFont(const QString& value); - qint16 chapterFontSize(); - void setChapterFontSize(const qint16& value); + qint16 chapterFontSize(); + void setChapterFontSize(const qint16& value); - bool chapterBold(); - void setChapterBold(const bool& value); + bool chapterBold(); + void setChapterBold(const bool& value); - bool chapterItalic(); - void setChapterItalic(const bool& value); + bool chapterItalic(); + void setChapterItalic(const bool& value); - bool chapterUnderline(); - void setChapterUnderline(const bool& value); + bool chapterUnderline(); + void setChapterUnderline(const bool& value); - qint16 chapterAlign(); - void setChapterAlign(const qint16& value); + ALIGN chapterAlign(); + void setChapterAlign(const ALIGN& value); - bool printChapterDescription(); - void setPrintChapterDescription(const bool& value); + bool printChapterDescription(); + void setPrintChapterDescription(const bool& value); - bool printChapterText(); - void setPrintChapterText(const bool& value); + bool printChapterText(); + void setPrintChapterText(const bool& value); - bool printSceneName(); - void setPrintSceneName(const bool& value); + bool printSceneName(); + void setPrintSceneName(const bool& value); - QString sceneFont(); - void setSceneFont(const QString& value); + QString sceneFont(); + void setSceneFont(const QString& value); - qint16 sceneFontSize(); - void setSceneFontSize(const qint16& value); + qint16 sceneFontSize(); + void setSceneFontSize(const qint16& value); - bool sceneBold(); - void setSceneBold(const bool& value); + bool sceneBold(); + void setSceneBold(const bool& value); - bool sceneItalic(); - void setSceneItalic(const bool& value); + bool sceneItalic(); + void setSceneItalic(const bool& value); - bool sceneUnderline(); - void setSceneUnderline(const bool& value); + bool sceneUnderline(); + void setSceneUnderline(const bool& value); - qint16 sceneAlign(); - void setSceneAlign(const qint16& value); + ALIGN sceneAlign(); + void setSceneAlign(const ALIGN& value); - bool printSceneDescription(); - void setPrintSceneDescription(const bool& value); + bool printSceneDescription(); + void setPrintSceneDescription(const bool& value); - bool printSceneText(); - void setPrintSceneText(const bool& value); + bool printSceneText(); + void setPrintSceneText(const bool& value); - QString paperSize(); - void setPaperSize(const QString& value); + QPagedPaintDevice::PageSize paperSize(); + void setPaperSize(const QPagedPaintDevice::PageSize& value); - qint16 paperOrientation(); - void setPaperOrientation(const qint16& value); + QPrinter::Orientation paperOrientation(); + void setPaperOrientation(const QPrinter::Orientation& value); - qreal leftMargin(); - void setLeftMargin(const qreal& value); + qreal leftMargin(); + void setLeftMargin(const qreal& value); - qreal rightMargin(); - void setRightMargin(const qreal& value); + qreal rightMargin(); + void setRightMargin(const qreal& value); - qreal topMargin(); - void setTopMargin(const qreal& value); + qreal topMargin(); + void setTopMargin(const qreal& value); - qreal bottomMargin(); - void setBottomMargin(const qreal& value); + qreal bottomMargin(); + void setBottomMargin(const qreal& value); - qint16 unit(); - void setUnit(const qint16& value); + QPrinter::Unit unit(); + void setUnit(const QPrinter::Unit& value); private: - QString m_szProject; /*!< TODO: describe */ - bool m_bIsOpen; /*!< TODO: describe */ - QSqlDatabase m_db; /*!< TODO: describe */ - cBook m_book; /*!< TODO: describe */ - cPartList m_partList; /*!< TODO: describe */ - cChapterList m_chapterList; /*!< TODO: describe */ - cSceneList m_sceneList; /*!< TODO: describe */ - cCharacterList m_characterList; /*!< TODO: describe */ - cPlaceList m_placeList; /*!< TODO: describe */ - cObjectList m_objectList; /*!< TODO: describe */ - cRechercheList m_rechercheList; /*!< TODO: describe */ + QString m_szProject; /*!< TODO: describe */ + bool m_bIsOpen; /*!< TODO: describe */ + QSqlDatabase m_db; /*!< TODO: describe */ + cBook m_book; /*!< TODO: describe */ + cPartList m_partList; /*!< TODO: describe */ + cChapterList m_chapterList; /*!< TODO: describe */ + cSceneList m_sceneList; /*!< TODO: describe */ + cCharacterList m_characterList; /*!< TODO: describe */ + cPlaceList m_placeList; /*!< TODO: describe */ + cObjectList m_objectList; /*!< TODO: describe */ + cRechercheList m_rechercheList; /*!< TODO: describe */ - bool m_bPrintTitle; /*!< TODO: describe */ - QString m_szTitleFont; /*!< TODO: describe */ - qint16 m_iTitleFontSize; /*!< TODO: describe */ - bool m_bTitleBold; /*!< TODO: describe */ - bool m_bTitleItalic; /*!< TODO: describe */ - bool m_bTitleUnderline; /*!< TODO: describe */ - qint16 m_iTitleAlign; /*!< TODO: describe */ - bool m_bPrintSubTitle; /*!< TODO: describe */ - QString m_szSubtitleFont; /*!< TODO: describe */ - qint16 m_iSubtitleFontSize; /*!< TODO: describe */ - bool m_bSubtitleBold; /*!< TODO: describe */ - bool m_bSubtitleItalic; /*!< TODO: describe */ - bool m_bSubtitleUnderline; /*!< TODO: describe */ - qint16 m_iSubtitleAlign; /*!< TODO: describe */ - bool m_bPrintShortDescription; /*!< TODO: describe */ - bool m_bPrintDescription; /*!< TODO: describe */ - bool m_bPrintAuthor; /*!< TODO: describe */ - QString m_szAuthorFont; /*!< TODO: describe */ - qint16 m_iAuthorFontSize; /*!< TODO: describe */ - bool m_bAuthorBold; /*!< TODO: describe */ - bool m_bAuthorItalic; /*!< TODO: describe */ - bool m_bAuthorUnderline; /*!< TODO: describe */ - qint16 m_iAuthorAlign; /*!< TODO: describe */ - bool m_bPrintPartName; /*!< TODO: describe */ - QString m_szPartFont; /*!< TODO: describe */ - qint16 m_iPartFontSize; /*!< TODO: describe */ - bool m_bPartBold; /*!< TODO: describe */ - bool m_bPartItalic; /*!< TODO: describe */ - bool m_bPartUnderline; /*!< TODO: describe */ - qint16 m_iPartAlign; /*!< TODO: describe */ - bool m_bPrintPartDescription; /*!< TODO: describe */ - bool m_bPrintPartText; /*!< TODO: describe */ - bool m_bPrintChapterName; /*!< TODO: describe */ - QString m_szChapterFont; /*!< TODO: describe */ - qint16 m_iChapterFontSize; /*!< TODO: describe */ - bool m_bChapterBold; /*!< TODO: describe */ - bool m_bChapterItalic; /*!< TODO: describe */ - bool m_bChapterUnderline; /*!< TODO: describe */ - qint16 m_iChapterAlign; /*!< TODO: describe */ - bool m_bPrintChapterDescription; /*!< TODO: describe */ - bool m_bPrintChapterText; /*!< TODO: describe */ - bool m_bPrintSceneName; /*!< TODO: describe */ - QString m_szSceneFont; /*!< TODO: describe */ - qint16 m_iSceneFontSize; /*!< TODO: describe */ - bool m_bSceneBold; /*!< TODO: describe */ - bool m_bSceneItalic; /*!< TODO: describe */ - bool m_bSceneUnderline; /*!< TODO: describe */ - qint16 m_iSceneAlign; /*!< TODO: describe */ - bool m_bPrintSceneDescription; /*!< TODO: describe */ - bool m_bPrintSceneText; /*!< TODO: describe */ - QString m_szPaperSize; /*!< TODO: describe */ - qint16 m_iPaperOrientation; /*!< TODO: describe */ - qreal m_dLeftMargin; /*!< TODO: describe */ - qreal m_dRightMargin; /*!< TODO: describe */ - qreal m_dTopMargin; /*!< TODO: describe */ - qreal m_dBottomMargin; /*!< TODO: describe */ - qint16 m_iUnit; /*!< TODO: describe */ + bool m_bPrintTitle; /*!< TODO: describe */ + QString m_szTitleFont; /*!< TODO: describe */ + qint16 m_iTitleFontSize; /*!< TODO: describe */ + bool m_bTitleBold; /*!< TODO: describe */ + bool m_bTitleItalic; /*!< TODO: describe */ + bool m_bTitleUnderline; /*!< TODO: describe */ + ALIGN m_iTitleAlign; /*!< TODO: describe */ + bool m_bPrintSubTitle; /*!< TODO: describe */ + QString m_szSubtitleFont; /*!< TODO: describe */ + qint16 m_iSubtitleFontSize; /*!< TODO: describe */ + bool m_bSubtitleBold; /*!< TODO: describe */ + bool m_bSubtitleItalic; /*!< TODO: describe */ + bool m_bSubtitleUnderline; /*!< TODO: describe */ + ALIGN m_iSubtitleAlign; /*!< TODO: describe */ + bool m_bPrintShortDescription; /*!< TODO: describe */ + bool m_bPrintDescription; /*!< TODO: describe */ + bool m_bPrintAuthor; /*!< TODO: describe */ + QString m_szAuthorFont; /*!< TODO: describe */ + qint16 m_iAuthorFontSize; /*!< TODO: describe */ + bool m_bAuthorBold; /*!< TODO: describe */ + bool m_bAuthorItalic; /*!< TODO: describe */ + bool m_bAuthorUnderline; /*!< TODO: describe */ + ALIGN m_iAuthorAlign; /*!< TODO: describe */ + bool m_bPrintPartName; /*!< TODO: describe */ + QString m_szPartFont; /*!< TODO: describe */ + qint16 m_iPartFontSize; /*!< TODO: describe */ + bool m_bPartBold; /*!< TODO: describe */ + bool m_bPartItalic; /*!< TODO: describe */ + bool m_bPartUnderline; /*!< TODO: describe */ + ALIGN m_iPartAlign; /*!< TODO: describe */ + bool m_bPrintPartDescription; /*!< TODO: describe */ + bool m_bPrintPartText; /*!< TODO: describe */ + bool m_bPrintChapterName; /*!< TODO: describe */ + QString m_szChapterFont; /*!< TODO: describe */ + qint16 m_iChapterFontSize; /*!< TODO: describe */ + bool m_bChapterBold; /*!< TODO: describe */ + bool m_bChapterItalic; /*!< TODO: describe */ + bool m_bChapterUnderline; /*!< TODO: describe */ + ALIGN m_iChapterAlign; /*!< TODO: describe */ + bool m_bPrintChapterDescription; /*!< TODO: describe */ + bool m_bPrintChapterText; /*!< TODO: describe */ + bool m_bPrintSceneName; /*!< TODO: describe */ + QString m_szSceneFont; /*!< TODO: describe */ + qint16 m_iSceneFontSize; /*!< TODO: describe */ + bool m_bSceneBold; /*!< TODO: describe */ + bool m_bSceneItalic; /*!< TODO: describe */ + bool m_bSceneUnderline; /*!< TODO: describe */ + ALIGN m_iSceneAlign; /*!< TODO: describe */ + bool m_bPrintSceneDescription; /*!< TODO: describe */ + bool m_bPrintSceneText; /*!< TODO: describe */ + QPagedPaintDevice::PageSize m_paperSize; /*!< TODO: describe */ + QPrinter::Orientation m_iPaperOrientation; /*!< TODO: describe */ + qreal m_dLeftMargin; /*!< TODO: describe */ + qreal m_dRightMargin; /*!< TODO: describe */ + qreal m_dTopMargin; /*!< TODO: describe */ + qreal m_dBottomMargin; /*!< TODO: describe */ + QPrinter::Unit m_iUnit; /*!< TODO: describe */ /*! \brief