LibreOffice Module vcl (master) 1
|
#include <print.hxx>
Classes | |
struct | MultiPageSetup |
struct | PageSize |
Public Member Functions | |
virtual | ~PrinterController () |
const VclPtr< Printer > & | getPrinter () const |
weld::Window * | getWindow () const |
css::uno::Sequence< css::beans::PropertyValue > | getJobProperties (const css::uno::Sequence< css::beans::PropertyValue > &i_rMergeList) const |
For implementations: get current job properties as changed by e.g. More... | |
css::beans::PropertyValue * | getValue (const OUString &i_rPropertyName) |
Get the PropertyValue of a Property. More... | |
const css::beans::PropertyValue * | getValue (const OUString &i_rPropertyName) const |
bool | getBoolProperty (const OUString &i_rPropertyName, bool i_bFallback) const |
Get a bool property. More... | |
sal_Int32 | getIntProperty (const OUString &i_rPropertyName, sal_Int32 i_nFallback) const |
Get an int property. More... | |
void | setValue (const OUString &i_rPropertyName, const css::uno::Any &i_rValue) |
Set a property value - can also be used to add another UI property. More... | |
void | setValue (const css::beans::PropertyValue &i_rValue) |
const css::uno::Sequence< css::beans::PropertyValue > & | getUIOptions () const |
void | setUIOptions (const css::uno::Sequence< css::beans::PropertyValue > &) |
Set possible UI options. More... | |
bool | isUIOptionEnabled (const OUString &rPropName) const |
Enable/disable an option; this can be used to implement dialog logic. More... | |
bool | isUIChoiceEnabled (const OUString &rPropName, sal_Int32 nChoice) const |
OUString | makeEnabled (const OUString &rPropName) |
MakeEnabled will change the property rPropName depends on to the value. More... | |
virtual int | getPageCount () const =0 |
App must override this. More... | |
virtual css::uno::Sequence< css::beans::PropertyValue > | getPageParameters (int i_nPage) const =0 |
Get the page parameters. More... | |
virtual void | printPage (int i_nPage) const =0 |
App must override this. More... | |
virtual void | jobStarted () |
Will be called after a possible dialog has been shown and the real printjob starts. More... | |
virtual void | jobFinished (css::view::PrintableState) |
css::view::PrintableState | getJobState () const |
void | abortJob () |
bool | isShowDialogs () const |
bool | isDirectPrint () const |
void | dialogsParentClosing () |
int | getFilteredPageCount () const |
VCL_DLLPRIVATE PageSize | getPageFile (int i_inUnfilteredPage, GDIMetaFile &rMtf, bool i_bMayUseCache=false) |
PageSize | getFilteredPageFile (int i_nFilteredPage, GDIMetaFile &o_rMtf, bool i_bMayUseCache=false) |
void | printFilteredPage (int i_nPage) |
VCL_DLLPRIVATE void | setPrinter (const VclPtr< Printer > &) |
void | createProgressDialog () |
bool | isProgressCanceled () const |
VCL_DLLPRIVATE void | setMultipage (const MultiPageSetup &) |
VCL_DLLPRIVATE const MultiPageSetup & | getMultipage () const |
void | setLastPage (bool i_bLastPage) |
VCL_DLLPRIVATE void | setReversePrint (bool i_bReverse) |
VCL_DLLPRIVATE void | setPapersizeFromSetup (bool i_bPapersizeFromSetup) |
VCL_DLLPRIVATE bool | getPapersizeFromSetup () const |
VCL_DLLPRIVATE void | setPaperSizeFromUser (Size i_aUserSize) |
VCL_DLLPRIVATE void | setOrientationFromUser (Orientation eOrientation, bool set) |
void | setPrinterModified (bool i_bPapersizeFromSetup) |
bool | getPrinterModified () const |
VCL_DLLPRIVATE void | pushPropertiesToPrinter () |
VCL_DLLPRIVATE void | resetPaperToLastConfigured () |
void | setJobState (css::view::PrintableState) |
VCL_DLLPRIVATE void | setupPrinter (weld::Window *i_pDlgParent) |
VCL_DLLPRIVATE int | getPageCountProtected () const |
VCL_DLLPRIVATE css::uno::Sequence< css::beans::PropertyValue > | getPageParametersProtected (int i_nPage) const |
VCL_DLLPRIVATE DrawModeFlags | removeTransparencies (GDIMetaFile const &i_rIn, GDIMetaFile &o_rOut) |
VCL_DLLPRIVATE void | resetPrinterOptions (bool i_bFileOutput) |
Protected Member Functions | |
PrinterController (const VclPtr< Printer > &, weld::Window *pDialogParent) | |
Private Attributes | |
std::unique_ptr< ImplPrinterControllerData > | mpImplData |
|
protected |
Definition at line 248 of file print3.cxx.
References mpImplData.
|
virtual |
Definition at line 789 of file print3.cxx.
void PrinterController::abortJob | ( | ) |
Definition at line 1407 of file print3.cxx.
References getPageFile(), mpImplData, RET_CANCEL, setJobState(), and setLastPage().
void PrinterController::createProgressDialog | ( | ) |
Definition at line 1733 of file print3.cxx.
References getPageCountProtected(), getValue(), getWindow(), Application::IsHeadlessModeEnabled(), mpImplData, RET_CANCEL, and weld::DialogController::runAsync().
void PrinterController::dialogsParentClosing | ( | ) |
Definition at line 813 of file print3.cxx.
References mpImplData, and RET_OK.
bool PrinterController::getBoolProperty | ( | const OUString & | i_rPropertyName, |
bool | i_bFallback | ||
) | const |
Get a bool property.
in case the property is unknown or not convertible to bool, i_bFallback is returned
Definition at line 1831 of file print3.cxx.
References getValue().
Referenced by isDirectPrint(), and isShowDialogs().
int PrinterController::getFilteredPageCount | ( | ) | const |
Definition at line 1275 of file print3.cxx.
References getPageCountProtected(), and mpImplData.
Referenced by getFilteredPageFile().
PrinterController::PageSize PrinterController::getFilteredPageFile | ( | int | i_nFilteredPage, |
GDIMetaFile & | o_rMtf, | ||
bool | i_bMayUseCache = false |
||
) |
Definition at line 1132 of file print3.cxx.
References GDIMetaFile::AddAction(), Size::AdjustHeight(), Size::AdjustWidth(), appendSubPage(), vcl::PrinterController::PageSize::aSize, vcl::PrinterController::MultiPageSetup::bDrawBorder, GDIMetaFile::Clear(), getFilteredPageCount(), getPageCountProtected(), getPageFile(), Size::Height(), vcl::LRTB, GDIMetaFile::Move(), mpImplData, vcl::PrinterController::MultiPageSetup::nBottomMargin, vcl::PrinterController::MultiPageSetup::nColumns, vcl::PrinterController::MultiPageSetup::nHorizontalSpacing, vcl::PrinterController::MultiPageSetup::nLeftMargin, vcl::PrinterController::MultiPageSetup::nOrder, vcl::PrinterController::MultiPageSetup::nRightMargin, vcl::PrinterController::MultiPageSetup::nRows, vcl::PrinterController::MultiPageSetup::nTopMargin, vcl::PrinterController::MultiPageSetup::nVerticalSpacing, vcl::RLTB, GDIMetaFile::Scale(), GDIMetaFile::SetPrefMapMode(), GDIMetaFile::SetPrefSize(), vcl::TBLR, vcl::TBRL, Size::Width(), and GDIMetaFile::WindStart().
Referenced by printFilteredPage().
sal_Int32 PrinterController::getIntProperty | ( | const OUString & | i_rPropertyName, |
sal_Int32 | i_nFallback | ||
) | const |
Get an int property.
in case the property is unknown or not convertible to bool, i_nFallback is returned
Definition at line 1840 of file print3.cxx.
References getValue().
css::uno::Sequence< css::beans::PropertyValue > PrinterController::getJobProperties | ( | const css::uno::Sequence< css::beans::PropertyValue > & | i_rMergeList | ) | const |
For implementations: get current job properties as changed by e.g.
print dialog
this gets the current set of properties initially told to Printer::PrintJob
For convenience a second sequence will be merged in to get a combined sequence. In case of duplicate property names, the value of i_MergeList wins.
Definition at line 1475 of file print3.cxx.
References mpImplData.
css::view::PrintableState PrinterController::getJobState | ( | ) | const |
Definition at line 793 of file print3.cxx.
References mpImplData.
const PrinterController::MultiPageSetup & PrinterController::getMultipage | ( | ) | const |
Definition at line 1775 of file print3.cxx.
References mpImplData.
|
pure virtual |
App must override this.
Referenced by getPageCountProtected().
int PrinterController::getPageCountProtected | ( | ) | const |
Definition at line 1017 of file print3.cxx.
References getPageCount(), and mpImplData.
Referenced by createProgressDialog(), getFilteredPageCount(), and getFilteredPageFile().
PrinterController::PageSize PrinterController::getPageFile | ( | int | i_inUnfilteredPage, |
GDIMetaFile & | rMtf, | ||
bool | i_bMayUseCache = false |
||
) |
Definition at line 1039 of file print3.cxx.
References vcl::PrinterController::PageSize::aSize, GDIMetaFile::Clear(), getPageParametersProtected(), mpImplData, printPage(), GDIMetaFile::Record(), Application::Reschedule(), GDIMetaFile::SetPrefMapMode(), GDIMetaFile::SetPrefSize(), GDIMetaFile::Stop(), and GDIMetaFile::WindStart().
Referenced by abortJob(), and getFilteredPageFile().
|
pure virtual |
Get the page parameters.
namely the jobsetup that should be active for the page (describing among others the physical page size) and the "page size". In writer case this would probably be the same as the JobSetup since writer sets the page size draw/impress for example print their page on the paper set on the printer, possibly adjusting the page size to fit. That means the page size can be different from the paper size.
App must override this
Referenced by getPageParametersProtected().
css::uno::Sequence< css::beans::PropertyValue > PrinterController::getPageParametersProtected | ( | int | i_nPage | ) | const |
Definition at line 1028 of file print3.cxx.
References getPageParameters(), and mpImplData.
Referenced by getPageFile().
bool PrinterController::getPapersizeFromSetup | ( | ) | const |
Definition at line 803 of file print3.cxx.
References mpImplData.
bool PrinterController::getPrinterModified | ( | ) | const |
const css::uno::Sequence< css::beans::PropertyValue > & PrinterController::getUIOptions | ( | ) | const |
Definition at line 1519 of file print3.cxx.
References mpImplData.
css::beans::PropertyValue * PrinterController::getValue | ( | const OUString & | i_rPropertyName | ) |
Get the PropertyValue of a Property.
Definition at line 1524 of file print3.cxx.
References mpImplData.
Referenced by createProgressDialog(), getBoolProperty(), getIntProperty(), isUIOptionEnabled(), makeEnabled(), and pushPropertiesToPrinter().
const css::beans::PropertyValue * PrinterController::getValue | ( | const OUString & | i_rPropertyName | ) | const |
Definition at line 1531 of file print3.cxx.
References mpImplData.
weld::Window * PrinterController::getWindow | ( | ) | const |
Definition at line 808 of file print3.cxx.
References mpImplData.
Referenced by createProgressDialog().
bool PrinterController::isDirectPrint | ( | ) | const |
Definition at line 1825 of file print3.cxx.
References getBoolProperty().
bool PrinterController::isProgressCanceled | ( | ) | const |
Definition at line 1765 of file print3.cxx.
References mpImplData.
bool PrinterController::isShowDialogs | ( | ) | const |
Definition at line 1819 of file print3.cxx.
References getBoolProperty(), and Application::IsHeadlessModeEnabled().
bool PrinterController::isUIChoiceEnabled | ( | const OUString & | rPropName, |
sal_Int32 | nChoice | ||
) | const |
Definition at line 1679 of file print3.cxx.
References mpImplData.
bool PrinterController::isUIOptionEnabled | ( | const OUString & | rPropName | ) | const |
Enable/disable an option; this can be used to implement dialog logic.
Definition at line 1625 of file print3.cxx.
References getValue(), isUIOptionEnabled(), and mpImplData.
Referenced by isUIOptionEnabled(), and makeEnabled().
|
virtual |
Definition at line 1403 of file print3.cxx.
|
virtual |
Will be called after a possible dialog has been shown and the real printjob starts.
Definition at line 1399 of file print3.cxx.
OUString PrinterController::makeEnabled | ( | const OUString & | rPropName | ) |
MakeEnabled will change the property rPropName depends on to the value.
that makes rPropName enabled. If the dependency itself is also disabled, no action will be performed.
Definition at line 1693 of file print3.cxx.
References getValue(), isUIOptionEnabled(), mpImplData, and setValue().
void PrinterController::printFilteredPage | ( | int | i_nPage | ) |
Definition at line 1345 of file print3.cxx.
References vcl::PrinterController::PageSize::aSize, vcl::PrinterController::PageSize::bFullPaper, getFilteredPageFile(), GDIMetaFile::Move(), mpImplData, GDIMetaFile::Play(), removeTransparencies(), setJobState(), GDIMetaFile::WindStart(), Point::X(), and Point::Y().
|
pure virtual |
App must override this.
Referenced by getPageFile().
void PrinterController::pushPropertiesToPrinter | ( | ) |
Definition at line 1785 of file print3.cxx.
References getValue(), LongEdge, mpImplData, Off, and ShortEdge.
DrawModeFlags PrinterController::removeTransparencies | ( | GDIMetaFile const & | i_rIn, |
GDIMetaFile & | o_rOut | ||
) |
Definition at line 1283 of file print3.cxx.
References vcl::printer::Auto, COL_TRANSPARENT(), COL_WHITE(), GrayBitmap, GrayFill, GrayGradient, GrayLine, GrayText, mpImplData, vcl::printer::NONE, vcl::printer::Normal, NoTransparency, and vcl::printer::Optimal.
Referenced by printFilteredPage().
void PrinterController::resetPaperToLastConfigured | ( | ) |
void PrinterController::resetPrinterOptions | ( | bool | i_bFileOutput | ) |
Definition at line 860 of file print3.cxx.
References mpImplData.
void PrinterController::setJobState | ( | css::view::PrintableState | i_eState | ) |
Definition at line 798 of file print3.cxx.
References mpImplData.
Referenced by abortJob(), and printFilteredPage().
void PrinterController::setLastPage | ( | bool | i_bLastPage | ) |
void PrinterController::setMultipage | ( | const MultiPageSetup & | i_rMPS | ) |
Definition at line 1770 of file print3.cxx.
References mpImplData.
void PrinterController::setOrientationFromUser | ( | Orientation | eOrientation, |
bool | set | ||
) |
Definition at line 1459 of file print3.cxx.
References mpImplData, and set().
void PrinterController::setPapersizeFromSetup | ( | bool | i_bPapersizeFromSetup | ) |
void PrinterController::setPaperSizeFromUser | ( | Size | i_aUserSize | ) |
Definition at line 1450 of file print3.cxx.
References mpImplData.
Definition at line 824 of file print3.cxx.
References Printer::GetName(), Printer::GetOrientation(), Printer::GetPaperSize(), mpImplData, Portrait, and setValue().
void PrinterController::setPrinterModified | ( | bool | i_bPapersizeFromSetup | ) |
Definition at line 1465 of file print3.cxx.
References mpImplData.
void PrinterController::setReversePrint | ( | bool | i_bReverse | ) |
Definition at line 1429 of file print3.cxx.
References mpImplData.
void PrinterController::setUIOptions | ( | const css::uno::Sequence< css::beans::PropertyValue > & | i_rOptions | ) |
Set possible UI options.
should only be done once before passing the PrinterListener to Printer::PrintJob
Definition at line 1562 of file print3.cxx.
References aPropName, bIsEnabled, DBG_ASSERT, vcl::ImplPrinterControllerData::ControlDependency::maDependsOnName, vcl::ImplPrinterControllerData::ControlDependency::mnDependsOnEntry, mpImplData, SAL_WARN_IF, and setValue().
void PrinterController::setupPrinter | ( | weld::Window * | i_pDlgParent | ) |
Definition at line 867 of file print3.cxx.
References Printer::GetOrientation(), Printer::GetPaperBin(), Printer::GetPaperSize(), getPapersizeFromSetup(), getPrinterModified(), Printer::GetPrinterSettingsPreferred(), mpImplData, OutputDevice::Pop(), OutputDevice::Push(), resetPaperToLastConfigured(), SAL_WARN_IF, OutputDevice::SetMapMode(), Printer::SetOrientation(), setPapersizeFromSetup(), Printer::SetPaperSizeUser(), Printer::Setup(), and SingleJob.
void PrinterController::setValue | ( | const css::beans::PropertyValue & | i_rValue | ) |
Definition at line 1547 of file print3.cxx.
References mpImplData.
void PrinterController::setValue | ( | const OUString & | i_rPropertyName, |
const css::uno::Any & | i_rValue | ||
) |
Set a property value - can also be used to add another UI property.
Definition at line 1538 of file print3.cxx.
References setValue().
Referenced by makeEnabled(), setPrinter(), setUIOptions(), and setValue().
|
private |
Definition at line 319 of file print.hxx.
Referenced by abortJob(), createProgressDialog(), dialogsParentClosing(), getFilteredPageCount(), getFilteredPageFile(), getJobProperties(), getJobState(), getMultipage(), getPageCountProtected(), getPageFile(), getPageParametersProtected(), getPapersizeFromSetup(), getPrinter(), getPrinterModified(), getUIOptions(), getValue(), getWindow(), isProgressCanceled(), isUIChoiceEnabled(), isUIOptionEnabled(), makeEnabled(), PrinterController(), printFilteredPage(), pushPropertiesToPrinter(), removeTransparencies(), resetPaperToLastConfigured(), resetPrinterOptions(), setJobState(), setLastPage(), setMultipage(), setOrientationFromUser(), setPapersizeFromSetup(), setPaperSizeFromUser(), setPrinter(), setPrinterModified(), setReversePrint(), setUIOptions(), setupPrinter(), and setValue().