20#include <libxml/xmlwriter.h>
22#include <officecfg/Office/Common.hxx>
32#include <svx/strings.hrc>
38#include <osl/diagnose.h>
71 bool bWeb =
dynamic_cast<SwWebView*
>(
this) !=
nullptr;
103 if ( pOld && pOld->IsPrinting() )
106 if ( (SfxPrinterChangeFlags::JOBSETUP | SfxPrinterChangeFlags::PRINTER) & nDiffFlags )
109 if ( nDiffFlags & SfxPrinterChangeFlags::PRINTER )
112 bool bWeb =
dynamic_cast< const SwWebView *
>( this ) !=
nullptr;
113 if ( nDiffFlags & SfxPrinterChangeFlags::OPTIONS )
116 const bool bChgOri = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_ORIENTATION);
117 const bool bChgSize = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_SIZE);
118 if ( bChgOri || bChgSize )
173 bool bWeb =
dynamic_cast<SwWebView*
>( this ) !=
nullptr;
180 const OUString& sFaxName(pPrintOptions->
GetFaxName());
181 if (!sFaxName.isEmpty())
186 SfxCallMode::SYNCHRON|SfxCallMode::RECORD,
187 { &aPrinterName, &aSilent });
192 VclMessageType::Info, VclButtonsType::Ok,
194 TranslateId pResId = bWeb ? STR_WEBOPTIONS : STR_TEXTOPTIONS;
195 xInfoBox->set_primary_text(xInfoBox->get_primary_text().replaceFirst(
"%1",
SwResId(pResId)));
197 SfxUInt16Item aDefPage(SID_SW_EDITOPTIONS, TP_OPTPRINT_PAGE);
199 SfxCallMode::SYNCHRON|SfxCallMode::RECORD,
205 case SID_PRINTDOCDIRECT:
209 bool bSilent = pSilentItem && pSilentItem->
GetValue();
211 if(pPrintFromMergeItem)
213 bool bFromMerge = pPrintFromMergeItem && pPrintFromMergeItem->
GetValue();
214 bool bPrintSelection =
false;
215 if(!bSilent && !bFromMerge &&
219 std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog(
"PrintMergeDialog"));
220 short nRet = xBox->run();
234 else if( rReq.
GetSlot() == SID_PRINTDOCDIRECT && ! bSilent )
239 short nBtn = aBox.run();
244 bPrintSelection =
true;
260 OSL_ENSURE(
false,
"wrong dispatcher");
272 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwView"));
276 (void)xmlTextWriterEndElement(pWriter);
300 case svtools::ColorConfigEntry::DOCCOLOR:
302 return pViewOptions->GetDocColor();
313 SAL_WARN(
"sw",
"GetViewOptions() returned nullptr");
323 return pViewOptions->GetThemeName();
327 SAL_WARN(
"sw",
"GetViewOptions() returned nullptr");
342 OSL_ENSURE(pFact,
"No Page Creator");
346 std::unique_ptr<SfxTabPage> xSfxPage = fnCreatePage(pPage, pController, &rOptions);
347 OSL_ENSURE(xSfxPage,
"No page");
354 xSfxPage->PageCreated(aSet);
369 SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
370 SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
371 SID_HTML_MODE, SID_HTML_MODE,
379 aSet.Put(aAddPrinterItem);
382 ? SfxPrinterChangeFlags::CHG_SIZE : SfxPrinterChangeFlags::NONE) |
384 ? SfxPrinterChangeFlags::CHG_ORIENTATION : SfxPrinterChangeFlags::NONE )));
std::unique_ptr< weld::MessageDialog > m_xQueryBox
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
Provides access to the formatting devices of a document.
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
virtual void setPrintData(const SwPrintData &rPrtData)=0
Sets the PrintData.
virtual void setPrinter(SfxPrinter *pP, bool bDeleteOld, bool bCallPrtDataChanged)=0
Set the printer at the document.
virtual const SwPrintData & getPrintData() const =0
Returns the PrintData.
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void SetOptions(const SfxItemSet &rNewOptions)
const SfxItemSet & GetOptions() const
sal_uInt16 GetSlot() const
void RemoveItem(sal_uInt16 nSlotId)
const T * GetArg(sal_uInt16 nSlotId) const
void AppendItem(const SfxPoolItem &)
virtual SfxInterface * GetInterface() const
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
SfxDispatcher * GetDispatcher()
weld::Window * GetFrameWeld() const
SfxViewFrame & GetViewFrame() const
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
static Size GetPaperSize(Paper ePaper, MapUnit eUnit=MapUnit::MapTwip)
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
static SwAbstractDialogFactory * Create()
void StartAllAction()
For all views of this document.
bool IsAnyDatabaseFieldInDoc() const
bool IsGlblDocSaveLinks() const
sfx2::LinkManager & GetLinkManager()
bool IsGlobalDoc() const
Interfaces for GlobalDocument.
bool IsFrameSelected() const
size_t IsObjSelected() const
void SetFaxName(const OUString &rSet)
const OUString & GetFaxName() const
void ChgAllPageOrientation(Orientation eOri)
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
void ChgAllPageSize(Size const &rSz)
const SfxItemPool & GetAttrPool() const
int getPart() const override
See SfxViewShell::getPart().
SwWrtShell & GetWrtShell() const
OUString GetColorConfigName() const override
See SfxViewShell::GetColorConfigName().
std::unique_ptr< SwView_Impl > m_pViewImpl
std::unique_ptr< SwWrtShell > m_pWrtShell
virtual SAL_DLLPRIVATE std::unique_ptr< SfxTabPage > CreatePrintOptionsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet) override
::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) const override
See SfxViewShell::GetColorConfigColor().
virtual sal_uInt16 SetPrinter(SfxPrinter *pNew, SfxPrinterChangeFlags nDiff=SFX_PRINTER_ALL) override
void NotifyCursor(SfxViewShell *pViewShell) const override
See SfxViewShell::NotifyCursor().
void SetRedlineAuthor(const OUString &rAuthor)
void ExecutePrint(SfxRequest &)
virtual SAL_DLLPRIVATE SfxPrinter * GetPrinter(bool bCreate=false) override
virtual SAL_DLLPRIVATE bool HasPrintOptionsPage() const override
const OUString & GetRedlineAuthor() const
void dumpAsXml(xmlTextWriterPtr pWriter) const override
See SfxViewShell::dumpAsXml().
void InvalidateRulerPos()
Used by the UI to modify the document model.
void UpdateAllLinks(bool bAskUpdate, bool bUpdateGrfLinks, weld::Window *pParentWin)
#define FN_PARAM_ADDPRINTER
struct _xmlTextWriter * xmlTextWriterPtr
SVXCORE_DLLPUBLIC OUString SvxResId(TranslateId aId)
#define SAL_WARN(area, stream)
def run(arg=None, arg2=-1)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
OUString VCL_DLLPUBLIC GetStandardText(StandardButtonType eButton)
OUString SwResId(TranslateId aId)
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
std::unique_ptr< SfxTabPage > CreatePrintOptionsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rOptions, bool bPreview)
void SetPrinter(IDocumentDeviceAccess *pIDDA, SfxPrinter const *pNew, bool bWeb)
void SetAppPrintOptions(SwViewShell *pSh, bool bWeb)
#define SFX_PRINTERROR_BUSY