/* -*- 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 "pdffilter.hxx" #include "vcl/dialog.hxx" #include "vcl/button.hxx" #include "vcl/fixed.hxx" #include "vcl/field.hxx" #include "vcl/edit.hxx" #include "vcl/layout.hxx" #include "vcl/lstbox.hxx" #include "vcl/combobox.hxx" #include "vcl/group.hxx" #include "vcl/pdfwriter.hxx" #include #include "sfx2/tabdlg.hxx" #include "com/sun/star/beans/NamedValue.hpp" // - ImpPDFDialog - class ImpPDFTabGeneralPage; class ImpPDFTabViewerPage; class ImpPDFTabOpnFtrPage; class ImpPDFTabLinksPage; class PDFFilterResId : public ResId { public: PDFFilterResId( sal_uInt32 nId ); }; class ImplErrorDialog : public MessageDialog { VclPtr m_pErrors; VclPtr m_pExplanation; DECL_LINK(SelectHdl, void *); public: ImplErrorDialog( const std::set< vcl::PDFWriter::ErrorCode >& ); virtual ~ImplErrorDialog(); virtual void dispose() SAL_OVERRIDE; }; class ImpPDFTabSecurityPage; class ImpPDFTabLinksPage; //class tabbed dialog class ImpPDFTabDialog : public SfxTabDialog { private: com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext> mxContext; FilterConfigItem maConfigItem; FilterConfigItem maConfigI18N; Any maSelection; DECL_LINK(CancelHdl, 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 mbUseTransitionEffects; bool mbIsSkipEmptyPages; 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; com::sun::star::uno::Sequence< com::sun::star::beans::NamedValue > maPreparedOwnerPassword; sal_Int32 mnPrint; sal_Int32 mnChangesAllowed; bool mbCanCopyOrExtract; bool mbCanExtractForAccessibility; com::sun::star::uno::Reference< com::sun::star::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; com::sun::star::uno::Reference< com::sun::star::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(); virtual void dispose() SAL_OVERRIDE; Sequence< PropertyValue > GetFilterData(); ImpPDFTabSecurityPage* getSecurityPage() const; ImpPDFTabLinksPage* getLinksPage() const; ImpPDFTabGeneralPage* getGeneralPage() const; protected: virtual void PageCreated( sal_uInt16 _nId, SfxTabPage& _rPage ) SAL_OVERRIDE; virtual short Ok() SAL_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 mpCbExportEmptyPages; VclPtr mpCbAddStream; VclPtr mpCbWatermark; VclPtr mpFtWatermark; VclPtr mpEdWatermark; bool mbIsPresentation; bool mbIsWriter; VclPtr mpaParent; DECL_LINK( TogglePagesHdl, void* ); DECL_LINK( ToggleCompressionHdl, void* ); DECL_LINK( ToggleReduceImageResolutionHdl, void* ); DECL_LINK( ToggleWatermarkHdl, void* ); DECL_LINK( ToggleAddStreamHdl, void* ); DECL_LINK( ToggleExportFormFieldsHdl, void* ); public: DECL_LINK( ToggleExportPDFAHdl, void* ); ImpPDFTabGeneralPage( vcl::Window* pParent, const SfxItemSet& rSet ); virtual ~ImpPDFTabGeneralPage(); virtual void dispose() SAL_OVERRIDE; static SfxTabPage* 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( ToggleRbPgLyContinueFacingHdl, void* ); DECL_LINK( ToggleRbMagnHdl, void* ); public: ImpPDFTabOpnFtrPage( vcl::Window* pParent, const SfxItemSet& rSet ); virtual ~ImpPDFTabOpnFtrPage(); virtual void dispose() SAL_OVERRIDE; static SfxTabPage* 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( ToggleRbBookmarksHdl, void* ); public: ImpPDFTabViewerPage( vcl::Window* pParent, const SfxItemSet& rSet ); virtual ~ImpPDFTabViewerPage(); virtual void dispose() SAL_OVERRIDE; static SfxTabPage* 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; com::sun::star::uno::Sequence< com::sun::star::beans::NamedValue > maPreparedOwnerPassword; OUString msOwnerPwdTitle; com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder > mxPreparedPasswords; DECL_LINK( ClickmaPbSetPwdHdl, void* ); void enablePermissionControls(); public: ImpPDFTabSecurityPage( vcl::Window* pParent, const SfxItemSet& rSet ); virtual ~ImpPDFTabSecurityPage(); virtual void dispose() SAL_OVERRIDE; static SfxTabPage* 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; } }; //class to implement 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( ClickRbOpnLnksDefaultHdl, void* ); DECL_LINK( ClickRbOpnLnksBrowserHdl, void* ); public: ImpPDFTabLinksPage( vcl::Window* pParent, const SfxItemSet& rSet ); virtual ~ImpPDFTabLinksPage(); virtual void dispose() SAL_OVERRIDE; static SfxTabPage* 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; com::sun::star::uno::Reference< com::sun::star::security::XCertificate > maSignCertificate; DECL_LINK( ClickmaPbSignCertSelect, void* ); DECL_LINK( ClickmaPbSignCertClear, void* ); DECL_LINK( SelectLBSignTSA, void* ); public: ImpPDFTabSigningPage( vcl::Window* pParent, const SfxItemSet& rSet ); virtual ~ImpPDFTabSigningPage(); virtual void dispose() SAL_OVERRIDE; static SfxTabPage* 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: */