20 #include <libxml/xmlwriter.h>
22 #include <officecfg/Office/Common.hxx>
32 #include <svx/strings.hrc>
38 #include <osl/diagnose.h>
52 #include <globals.hrc>
53 #include <strings.hrc>
69 bool bWeb =
dynamic_cast<SwWebView*
>(
this) !=
nullptr;
101 if ( pOld && pOld->IsPrinting() )
104 if ( (SfxPrinterChangeFlags::JOBSETUP | SfxPrinterChangeFlags::PRINTER) & nDiffFlags )
107 if ( nDiffFlags & SfxPrinterChangeFlags::PRINTER )
110 bool bWeb =
dynamic_cast< const SwWebView *
>( this ) !=
nullptr;
111 if ( nDiffFlags & SfxPrinterChangeFlags::OPTIONS )
114 const bool bChgOri = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_ORIENTATION);
115 const bool bChgSize = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_SIZE);
116 if ( bChgOri || bChgSize )
148 m_xQueryBox->set_title(
SvxResId(RID_SVXSTR_QRY_PRINT_TITLE));
150 m_xQueryBox->add_button(
SvxResId(RID_SVXSTR_QRY_PRINT_SELECTION), RET_OK);
151 m_xQueryBox->add_button(
SvxResId(RID_SVXSTR_QRY_PRINT_ALL), 2);
152 m_xQueryBox->add_button(
GetStandardText(StandardButtonType::Cancel), RET_CANCEL);
153 m_xQueryBox->set_default_response(RET_OK);
155 short run() {
return m_xQueryBox->run(); }
171 bool bWeb =
dynamic_cast<SwWebView*
>( this ) !=
nullptr;
178 const OUString& sFaxName(pPrintOptions->
GetFaxName());
179 if (!sFaxName.isEmpty())
184 SfxCallMode::SYNCHRON|SfxCallMode::RECORD,
185 { &aPrinterName, &aSilent });
190 VclMessageType::Info, VclButtonsType::Ok,
192 TranslateId pResId = bWeb ? STR_WEBOPTIONS : STR_TEXTOPTIONS;
193 xInfoBox->set_primary_text(xInfoBox->get_primary_text().replaceFirst(
"%1",
SwResId(pResId)));
195 SfxUInt16Item aDefPage(SID_SW_EDITOPTIONS, TP_OPTPRINT_PAGE);
197 SfxCallMode::SYNCHRON|SfxCallMode::RECORD,
203 case SID_PRINTDOCDIRECT:
207 bool bSilent = pSilentItem && pSilentItem->
GetValue();
209 if(pPrintFromMergeItem)
211 bool bFromMerge = pPrintFromMergeItem && pPrintFromMergeItem->
GetValue();
212 bool bPrintSelection =
false;
213 if(!bSilent && !bFromMerge &&
217 std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog(
"PrintMergeDialog"));
218 short nRet = xBox->run();
232 else if( rReq.
GetSlot() == SID_PRINTDOCDIRECT && ! bSilent )
237 short nBtn = aBox.run();
242 bPrintSelection =
true;
258 OSL_ENSURE(
false,
"wrong dispatcher");
270 (
void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwView"));
274 (
void)xmlTextWriterEndElement(pWriter);
301 OSL_ENSURE(pFact,
"No Page Creator");
305 std::unique_ptr<SfxTabPage> xSfxPage = fnCreatePage(pPage, pController, &rOptions);
306 OSL_ENSURE(xSfxPage,
"No page");
313 xSfxPage->PageCreated(aSet);
328 SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
329 SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
330 SID_HTML_MODE, SID_HTML_MODE,
335 ::
GetHtmlMode(static_cast<SwWrtShell*>(pSh)->GetView().GetDocShell())));
338 aSet.Put(aAddPrinterItem);
341 ? SfxPrinterChangeFlags::CHG_SIZE : SfxPrinterChangeFlags::NONE) |
343 ? SfxPrinterChangeFlags::CHG_ORIENTATION : SfxPrinterChangeFlags::NONE )));
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
SfxViewFrame * GetViewFrame() const
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 * >())
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
void NotifyCursor(SfxViewShell *pViewShell) const override
See SfxViewShell::NotifyCursor().
sfx2::LinkManager & GetLinkManager()
std::unique_ptr< SwWrtShell > m_pWrtShell
OUString GetStandardText(StandardButtonType eButton)
SfxDispatcher * GetDispatcher()
void SetRedlineAuthor(const OUString &rAuthor)
void SetPrinter(IDocumentDeviceAccess *pIDDA, SfxPrinter const *pNew, bool bWeb)
const OUString & GetRedlineAuthor() const
void SetAppPrintOptions(SwViewShell *pSh, bool bWeb)
#define FN_PARAM_ADDPRINTER
SwWrtShell & GetWrtShell() const
Used by the UI to modify the document model.
OUString SwResId(TranslateId aId)
const OUString & GetFaxName() const
#define SFX_PRINTERROR_BUSY
bool IsGlblDocSaveLinks() const
OUString SvxResId(TranslateId aId)
std::unique_ptr< SfxTabPage > CreatePrintOptionsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rOptions, bool bPreview)
void SetFaxName(const OUString &rSet)
const SfxItemSet & GetOptions() const
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
void ChgAllPageOrientation(Orientation eOri)
const SfxItemPool & GetAttrPool() const
void ExecutePrint(SfxRequest &)
void dumpAsXml(xmlTextWriterPtr pWriter) const override
See SfxViewShell::dumpAsXml().
virtual const SwPrintData & getPrintData() const =0
Returns the PrintData.
virtual SAL_DLLPRIVATE bool HasPrintOptionsPage() const override
std::unique_ptr< weld::MessageDialog > m_xQueryBox
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
const T * GetArg(sal_uInt16 nSlotId) const
static SwAbstractDialogFactory * Create()
static Size GetPaperSize(Paper ePaper, MapUnit eUnit=MapUnit::MapTwip)
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
SfxItemPool * GetPool() const
virtual SAL_DLLPRIVATE std::unique_ptr< SfxTabPage > CreatePrintOptionsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet) override
virtual void setPrinter(SfxPrinter *pP, bool bDeleteOld, bool bCallPrtDataChanged)=0
Set the printer at the document.
virtual sal_uInt16 SetPrinter(SfxPrinter *pNew, SfxPrinterChangeFlags nDiff=SFX_PRINTER_ALL) override
Provides access to the formatting devices of a document.
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
void ChgAllPageSize(Size const &rSz)
bool IsAnyDatabaseFieldInDoc() const
weld::Window * GetFrameWeld() const
std::unique_ptr< SwView_Impl > m_pViewImpl
void UpdateAllLinks(bool bAskUpdate, bool bUpdateGrfLinks, weld::Window *pParentWin)
virtual void setPrintData(const SwPrintData &rPrtData)=0
Sets the PrintData.
size_t IsObjSelected() const
void InvalidateRulerPos()
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
virtual SfxInterface * GetInterface() const
void AppendItem(const SfxPoolItem &)
virtual SAL_DLLPRIVATE SfxPrinter * GetPrinter(bool bCreate=false) override
struct _xmlTextWriter * xmlTextWriterPtr
void StartAllAction()
For all views of this document.
void RemoveItem(sal_uInt16 nSlotId)
bool IsFrameSelected() const
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
void SetOptions(const SfxItemSet &rNewOptions)
int getPart() const override
See SfxViewShell::getPart().
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
bool IsGlobalDoc() const
Interfaces for GlobalDocument.