/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #ifndef INCLUDED_FILTER_SOURCE_PDF_IMPDIALOG_HXX #define INCLUDED_FILTER_SOURCE_PDF_IMPDIALOG_HXX #include #include #include #include #include #include #include #include #include #include #include #include #include "pdffilter.hxx" #include class ImpPDFTabGeneralPage; class ImpPDFTabViewerPage; class ImpPDFTabOpnFtrPage; class ImpPDFTabLinksPage; class PDFFilterResId : public ResId { public: explicit PDFFilterResId( sal_uInt32 nId ); }; class ImplErrorDialog : public MessageDialog { private: VclPtr m_pErrors; VclPtr m_pExplanation; DECL_LINK_TYPED(SelectHdl, ListBox&, void); public: explicit ImplErrorDialog( const std::set< vcl::PDFWriter::ErrorCode >& ); virtual ~ImplErrorDialog() override; virtual void dispose() override; }; class ImpPDFTabSecurityPage; class ImpPDFTabLinksPage; /// Class tabbed dialog class ImpPDFTabDialog : public SfxTabDialog { private: FilterConfigItem maConfigItem; FilterConfigItem maConfigI18N; Any maSelection; DECL_LINK_TYPED(CancelHdl, Button*, void); sal_uInt16 mnSigningPageId; sal_uInt16 mnSecurityPageId; sal_uInt16 mnLinksPage; sal_uInt16 mnInterfacePageId; sal_uInt16 mnViewPageId; sal_uInt16 mnGeneralPageId; protected: // the following data are the configuration used throughout the dialog and pages bool mbIsPresentation; bool mbIsWriter; bool mbSelectionPresent; bool mbUseCTLFont; bool mbUseLosslessCompression; sal_Int32 mnQuality; bool mbReduceImageResolution; sal_Int32 mnMaxImageResolution; bool mbUseTaggedPDF; sal_Int32 mnPDFTypeSelection; bool mbExportNotes; bool mbViewPDF; bool mbExportNotesPages; bool mbExportOnlyNotesPages; bool mbUseTransitionEffects; bool mbIsSkipEmptyPages; bool mbIsExportPlaceholders; bool mbAddStream; sal_Int32 mnFormsType; bool mbExportFormFields; bool mbAllowDuplicateFieldNames; bool mbExportBookmarks; bool mbExportHiddenSlides; sal_Int32 mnOpenBookmarkLevels; bool mbHideViewerToolbar; bool mbHideViewerMenubar; bool mbHideViewerWindowControls; bool mbResizeWinToInit; bool mbCenterWindow; bool mbOpenInFullScreenMode; bool mbDisplayPDFDocumentTitle; sal_Int32 mnMagnification; sal_Int32 mnInitialView; sal_Int32 mnZoom; sal_Int32 mnInitialPage; sal_Int32 mnPageLayout; bool mbFirstPageLeft; bool mbEncrypt; bool mbRestrictPermissions; css::uno::Sequence< css::beans::NamedValue > maPreparedOwnerPassword; sal_Int32 mnPrint; sal_Int32 mnChangesAllowed; bool mbCanCopyOrExtract; bool mbCanExtractForAccessibility; css::uno::Reference< css::beans::XMaterialHolder > mxPreparedPasswords; bool mbIsRangeChecked; OUString msPageRange; bool mbSelectionIsChecked; bool mbExportRelativeFsysLinks; sal_Int32 mnViewPDFMode; bool mbConvertOOoTargets; bool mbExportBmkToPDFDestination; bool mbSignPDF; OUString msSignPassword; OUString msSignLocation; OUString msSignContact; OUString msSignReason; css::uno::Reference< css::security::XCertificate > maSignCertificate; OUString msSignTSA; OUString maWatermarkText; public: friend class ImpPDFTabGeneralPage; friend class ImpPDFTabViewerPage; friend class ImpPDFTabOpnFtrPage; friend class ImpPDFTabSecurityPage; friend class ImpPDFTabLinksPage; friend class ImpPDFTabSigningPage; ImpPDFTabDialog( vcl::Window* pParent, Sequence< PropertyValue >& rFilterData, const css::uno::Reference< XComponent >& rDoc); virtual ~ImpPDFTabDialog() override; virtual void dispose() override; Sequence< PropertyValue > GetFilterData(); ImpPDFTabSecurityPage* getSecurityPage() const; ImpPDFTabLinksPage* getLinksPage() const; ImpPDFTabGeneralPage* getGeneralPage() const; protected: virtual void PageCreated( sal_uInt16 _nId, SfxTabPage& _rPage ) override; virtual short Ok() override; }; /// Class tab page general class ImpPDFTabGeneralPage : public SfxTabPage { friend class ImpPDFTabLinksPage; VclPtr mpRbAll; VclPtr mpRbRange; VclPtr mpRbSelection; VclPtr mpEdPages; VclPtr mpRbLosslessCompression; VclPtr mpRbJPEGCompression; VclPtr mpQualityFrame; VclPtr mpNfQuality; VclPtr mpCbReduceImageResolution; VclPtr mpCoReduceImageResolution; VclPtr mpCbPDFA1b; VclPtr mpCbTaggedPDF; bool mbTaggedPDFUserSelection; VclPtr mpCbExportFormFields; bool mbExportFormFieldsUserSelection; VclPtr mpFormsFrame; VclPtr mpLbFormsFormat; VclPtr mpCbAllowDuplicateFieldNames; VclPtr mpCbExportBookmarks; VclPtr mpCbExportHiddenSlides; VclPtr mpCbExportNotes; VclPtr mpCbViewPDF; VclPtr mpCbExportNotesPages; VclPtr mpCbExportOnlyNotesPages; VclPtr mpCbExportEmptyPages; VclPtr mpCbExportPlaceholders; VclPtr mpCbAddStream; VclPtr mpCbWatermark; VclPtr mpFtWatermark; VclPtr mpEdWatermark; bool mbIsPresentation; bool mbIsWriter; VclPtr mpaParent; DECL_LINK_TYPED( ToggleAllHdl, RadioButton&, void ); DECL_LINK_TYPED( TogglePagesHdl, RadioButton&, void ); DECL_LINK_TYPED( ToggleSelectionHdl, RadioButton&, void ); DECL_LINK_TYPED( ToggleCompressionHdl, RadioButton&, void ); DECL_LINK_TYPED( ToggleReduceImageResolutionHdl, CheckBox&, void ); DECL_LINK_TYPED( ToggleWatermarkHdl, CheckBox&, void ); DECL_LINK_TYPED( ToggleAddStreamHdl, CheckBox&, void ); DECL_LINK_TYPED( ToggleExportFormFieldsHdl, CheckBox&, void ); DECL_LINK_TYPED( ToggleExportNotesPagesHdl, CheckBox&, void ); void TogglePagesHdl(); void EnableExportNotesPages(); public: DECL_LINK_TYPED( ToggleExportPDFAHdl, CheckBox&, void ); ImpPDFTabGeneralPage( vcl::Window* pParent, const SfxItemSet& rSet ); virtual ~ImpPDFTabGeneralPage() override; virtual void dispose() override; static VclPtr Create( vcl::Window* pParent, const SfxItemSet* rAttrSet); void GetFilterConfigItem(ImpPDFTabDialog* paParent); void SetFilterConfigItem(ImpPDFTabDialog* paParent); bool IsPdfaSelected() const { return mpCbPDFA1b->IsChecked(); } }; /// Class tab page viewer class ImpPDFTabOpnFtrPage : public SfxTabPage { VclPtr mpRbOpnPageOnly; VclPtr mpRbOpnOutline; VclPtr mpRbOpnThumbs; VclPtr mpNumInitialPage; VclPtr mpRbMagnDefault; VclPtr mpRbMagnFitWin; VclPtr mpRbMagnFitWidth; VclPtr mpRbMagnFitVisible; VclPtr mpRbMagnZoom; VclPtr mpNumZoom; VclPtr mpRbPgLyDefault; VclPtr mpRbPgLySinglePage; VclPtr mpRbPgLyContinue; VclPtr mpRbPgLyContinueFacing; VclPtr mpCbPgLyFirstOnLeft; bool mbUseCTLFont; DECL_LINK_TYPED( ToggleRbPgLyContinueFacingHdl, RadioButton&, void ); DECL_LINK_TYPED( ToggleRbMagnHdl, RadioButton&, void ); void ToggleRbPgLyContinueFacingHdl(); public: ImpPDFTabOpnFtrPage( vcl::Window* pParent, const SfxItemSet& rSet ); virtual ~ImpPDFTabOpnFtrPage() override; virtual void dispose() override; static VclPtr Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); void GetFilterConfigItem( ImpPDFTabDialog* paParent); void SetFilterConfigItem( const ImpPDFTabDialog* paParent ); }; /// Class tab page viewer class ImpPDFTabViewerPage : public SfxTabPage { VclPtr m_pCbResWinInit; VclPtr m_pCbCenterWindow; VclPtr m_pCbOpenFullScreen; VclPtr m_pCbDispDocTitle; VclPtr m_pCbHideViewerMenubar; VclPtr m_pCbHideViewerToolbar; VclPtr m_pCbHideViewerWindowControls; VclPtr m_pCbTransitionEffects; bool mbIsPresentation; VclPtr m_pRbAllBookmarkLevels; VclPtr m_pRbVisibleBookmarkLevels; VclPtr m_pNumBookmarkLevels; DECL_LINK_TYPED( ToggleRbBookmarksHdl, RadioButton&, void ); public: ImpPDFTabViewerPage( vcl::Window* pParent, const SfxItemSet& rSet ); virtual ~ImpPDFTabViewerPage() override; virtual void dispose() override; static VclPtr Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); void GetFilterConfigItem( ImpPDFTabDialog* paParent); void SetFilterConfigItem( const ImpPDFTabDialog* paParent ); }; /// Class security tab page class ImpPDFTabSecurityPage : public SfxTabPage { VclPtr mpPbSetPwd; OUString msStrSetPwd; VclPtr mpUserPwdSet; VclPtr mpUserPwdUnset; VclPtr mpUserPwdPdfa; VclPtr mpOwnerPwdSet; VclPtr mpOwnerPwdUnset; VclPtr mpOwnerPwdPdfa; VclPtr mpPrintPermissions; VclPtr mpRbPrintNone; VclPtr mpRbPrintLowRes; VclPtr mpRbPrintHighRes; VclPtr mpChangesAllowed; VclPtr mpRbChangesNone; VclPtr mpRbChangesInsDel; VclPtr mpRbChangesFillForm; VclPtr mpRbChangesComment; VclPtr mpRbChangesAnyNoCopy; VclPtr mpContent; VclPtr mpCbEnableCopy; VclPtr mpCbEnableAccessibility; OUString msUserPwdTitle; bool mbHaveOwnerPassword; bool mbHaveUserPassword; css::uno::Sequence< css::beans::NamedValue > maPreparedOwnerPassword; OUString msOwnerPwdTitle; css::uno::Reference< css::beans::XMaterialHolder > mxPreparedPasswords; DECL_LINK_TYPED( ClickmaPbSetPwdHdl, Button*, void ); void enablePermissionControls(); public: ImpPDFTabSecurityPage( vcl::Window* pParent, const SfxItemSet& rSet ); virtual ~ImpPDFTabSecurityPage() override; virtual void dispose() override; static VclPtr Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); void GetFilterConfigItem( ImpPDFTabDialog* paParent); void SetFilterConfigItem( const ImpPDFTabDialog* paParent ); void ImplPDFASecurityControl( bool bEnableSecurity ); bool hasPassword() const { return mbHaveOwnerPassword || mbHaveUserPassword; } }; /// Implements the relative link stuff class ImpPDFTabLinksPage : public SfxTabPage { VclPtr m_pCbExprtBmkrToNmDst; VclPtr m_pCbOOoToPDFTargets; VclPtr m_pCbExportRelativeFsysLinks; VclPtr m_pRbOpnLnksDefault; bool mbOpnLnksDefaultUserState; VclPtr m_pRbOpnLnksLaunch; bool mbOpnLnksLaunchUserState; VclPtr m_pRbOpnLnksBrowser; bool mbOpnLnksBrowserUserState; DECL_LINK_TYPED( ClickRbOpnLnksDefaultHdl, Button*, void ); DECL_LINK_TYPED( ClickRbOpnLnksBrowserHdl, Button*, void ); public: ImpPDFTabLinksPage( vcl::Window* pParent, const SfxItemSet& rSet ); virtual ~ImpPDFTabLinksPage() override; virtual void dispose() override; static VclPtr Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); void GetFilterConfigItem( ImpPDFTabDialog* paParent); void SetFilterConfigItem( const ImpPDFTabDialog* paParent ); void ImplPDFALinkControl( bool bEnableLaunch ); }; //class to implement the digital signing class ImpPDFTabSigningPage : public SfxTabPage { VclPtr mpEdSignCert; VclPtr mpPbSignCertSelect; VclPtr mpPbSignCertClear; VclPtr mpEdSignPassword; VclPtr mpEdSignLocation; VclPtr mpEdSignContactInfo; VclPtr mpEdSignReason; VclPtr mpLBSignTSA; css::uno::Reference< css::security::XCertificate > maSignCertificate; DECL_LINK_TYPED( ClickmaPbSignCertSelect, Button*, void ); DECL_LINK_TYPED( ClickmaPbSignCertClear, Button*, void ); public: ImpPDFTabSigningPage( vcl::Window* pParent, const SfxItemSet& rSet ); virtual ~ImpPDFTabSigningPage() override; virtual void dispose() override; static VclPtr Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); void GetFilterConfigItem( ImpPDFTabDialog* paParent); void SetFilterConfigItem( const ImpPDFTabDialog* paParent ); }; #endif // INCLUDED_FILTER_SOURCE_PDF_IMPDIALOG_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */