Index: filter/inc/filter.hrc =================================================================== RCS file: /cvs/framework/filter/inc/filter.hrc,v retrieving revision 1.6 diff -u -p -u -r1.6 filter.hrc --- filter/inc/filter.hrc 8 Sep 2005 21:24:26 -0000 1.6 +++ filter/inc/filter.hrc 21 Feb 2006 21:38:44 -0000 @@ -45,10 +45,11 @@ // Help-Ids -------------------------------------------------------------- -#define RID_PDF_EXPORT_DLG (RID_FILTER_START + 0) -#define RID_XSLT_DIALOG_START (RID_FILTER_START + 1) -#define RID_XSLT_DIALOG_END (RID_FILTER_START + 49) -#define RID_PDF_OLD_EXPORT_DLG (RID_FILTER_START + 50) +#define RID_PDF_DIALOG_START (RID_FILTER_START + 0) +#define RID_PDF_DIALOG_END (RID_FILTER_START + 9) +#define RID_XSLT_DIALOG_START (RID_FILTER_START + 10) +#define RID_XSLT_DIALOG_END (RID_FILTER_START + 59) +#define RID_PDF_OLD_EXPORT_DLG (RID_FILTER_START + 60) // warning, next range is RID_FILTER_START + 100 ! Index: filter/source/pdf/impdialog.cxx =================================================================== RCS file: /cvs/framework/filter/source/pdf/impdialog.cxx,v retrieving revision 1.14 diff -u -p -u -r1.14 impdialog.cxx --- filter/source/pdf/impdialog.cxx 21 Dec 2005 15:00:47 -0000 1.14 +++ filter/source/pdf/impdialog.cxx 21 Feb 2006 21:38:45 -0000 @@ -33,9 +33,17 @@ * ************************************************************************/ +///================= debug +#include +//==================== + #include "impdialog.hxx" #include "impdialog.hrc" +#ifndef _SV_MSGBOX_HXX +#include +#endif + #ifndef _COM_SUN_STAR_UNO_SEQUENCE_H_ #include #endif @@ -264,3 +272,611 @@ IMPL_LINK( ImpPDFDialog, ToggleReduceIma maCoReduceImageResolution.Enable( maCbReduceImageResolution.IsChecked() ); return 0; } + +////////////////////////////////////////////////////////////////////////////////////////////////////// +// tabbed PDF dialog implementation +// ----------------------------------------------------------------------------- +ImpPDFTabDialog::ImpPDFTabDialog( Window* pParent, ResMgr& rResMgr, Sequence< PropertyValue >& rFilterData, const Reference< XComponent >& rxDoc ) : + SfxTabDialog( pParent, ResId( RID_PDF_EXPORT_TDLG, &rResMgr ), 0, FALSE, 0 ), + + maFlPages( this, ResId( 1 ) ), + + maConfigItem( String( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/PDF/Export/" ) ), &rFilterData ), + mbIsPresentation( sal_False ), + mbIsWriter( sal_False ), + + mbSelectionPresent( sal_False ), + mbUseLosslessCompression( sal_True ), + mnQuality( 90 ), + mbReduceImageResolution( sal_False ), + mnMaxImageResolution( 300 ), + mbUseTaggedPDF( sal_False ), + mbExportNotesBoth( sal_True ), + mbUseTransitionEffects( sal_False ), + mbIsSkipEmptyPages( sal_False ), + mnFormsType( 0 ), + + mbHideViewerToolbar( sal_False ), + mbHideViewerMenubar( sal_False ), + mbHideViewerWindowControls( sal_False ), + mbFitWindow( sal_False ), + mbCenterWindow( sal_False ), + mbDisplayPDFDocumentTitle( sal_False ), + mbDirectionR2L( sal_False ), + mnOpenPDFDocumentMode( 0 ), + mnOpenPDFDocumentAction( 0 ), + mnNonFullScreenPageMode( 0 ), + + mbIsRangeChecked( sal_False ), + msPageRange( ' ' ), + + mbSelectionIsChecked( sal_False ) +{ + FreeResource(); + // check for selection + try + { + Reference< frame::XController > xController( Reference< frame::XModel >( rxDoc, UNO_QUERY )->getCurrentController() ); + if( xController.is() ) + { + Reference< view::XSelectionSupplier > xView( xController, UNO_QUERY ); + if( xView.is() ) + xView->getSelection() >>= maSelection; + } + } + catch( RuntimeException ) + { + } + mbSelectionPresent = maSelection.hasValue(); + if ( mbSelectionPresent ) + { + Reference< drawing::XShapes > xShapes; + if ( ( maSelection >>= xShapes ) == sal_False ) // XShapes is always a selection + { + // even if nothing is selected in writer the selection is not empty + Reference< container::XIndexAccess > xIndexAccess; + if ( maSelection >>= xIndexAccess ) + { + sal_Int32 nLen = xIndexAccess->getCount(); + if ( !nLen ) + mbSelectionPresent = sal_False; + else if ( nLen == 1 ) + { + Reference< text::XTextRange > xTextRange( xIndexAccess->getByIndex( 0 ), UNO_QUERY ); + if ( xTextRange.is() && ( xTextRange->getString().getLength() == 0 ) ) + mbSelectionPresent = sal_False; + } + } + } + } + + // check if source document is a presentation + try + { + Reference< XServiceInfo > xInfo( rxDoc, UNO_QUERY ); + if ( xInfo.is() ) + { + if ( xInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) ) ) + mbIsPresentation = sal_True; + if ( xInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ) ) ) + mbIsWriter = sal_True; + } + } + catch( RuntimeException ) + { + } + + mbUseLosslessCompression = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), sal_False ); + mnQuality = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), 90 ); + mbReduceImageResolution = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), sal_False ); + mnMaxImageResolution = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), 300 ); + + mbUseTaggedPDF = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), sal_False ); + if ( mbIsPresentation ) + mbExportNotesBoth = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), sal_False ); + else + mbExportNotesBoth = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), sal_True ); + + mbUseTransitionEffects = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), sal_True ); + mbIsSkipEmptyPages = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), sal_False ); + + mnFormsType = maConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), 0 ); + if ( ( mnFormsType < 0 ) || ( mnFormsType > 3 ) ) + mnFormsType = 0; + +//queue the tab page for later creation (created when first shown) + AddTabPage( RID_PDF_TAB_GENER, ImpPDFTabGeneralPage::Create, 0 ); + +//prepare values for the Viewer tab page + mbHideViewerToolbar = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerToolbar" ) ), sal_False ); + mbHideViewerMenubar = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerMenubar" ) ), sal_False ); + mbHideViewerWindowControls = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerWindowControls" ) ), sal_False ); + mbFitWindow = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "FitWindow" ) ), sal_False ); + mbCenterWindow = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "CenterWindow" ) ), sal_False ); + mbDisplayPDFDocumentTitle = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DisplayPDFDocumentTitle" ) ), sal_False ); + mbDirectionR2L = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DirectionR2L" ) ), sal_False ); + mnOpenPDFDocumentMode = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentMode" ) ), 0 ); + mnOpenPDFDocumentAction = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentAction" ) ), 0 ); + mnNonFullScreenPageMode = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "NonFullScreenPageMode" ) ), 0 ); + + AddTabPage( RID_PDF_TAB_VPREFER, ImpPDFTabViewerPage::Create, 0 ); +//change test on the Ok button: get the relevant string from resources, update it on the button +//FIXME: check if the string operation is Unicode compliant + GetOKButton().SetText( OUString( String( ResId( STR_PDF_EXPORT ) ) ) ); +//force page creation + +//FIXME +//very, very ugly hack: I don't know how to have the tab pages displayed correctly without this... + maFlPages.Hide(); +///////////////// +} + +// ----------------------------------------------------------------------------- +ImpPDFTabDialog::~ImpPDFTabDialog() +{ +//delete the pages, needed because otherwise the child tab pages +//don't get destroyed + RemoveTabPage( RID_PDF_TAB_GENER ); + RemoveTabPage( RID_PDF_TAB_VPREFER ); +} + +// ----------------------------------------------------------------------------- +void ImpPDFTabDialog::PageCreated( USHORT _nId, SfxTabPage& _rPage ) +{ +//the PageCreated methos of the TabPage cannot be used becasu we need to pass +//the aConfigItem from the parent tabbed dialog + switch( _nId ) + { + case RID_PDF_TAB_GENER: + ( ( ImpPDFTabGeneralPage* )&_rPage )->SetFilterConfigItem( this ); + break; + case RID_PDF_TAB_VPREFER: + ( ( ImpPDFTabViewerPage* )&_rPage )->SetFilterConfigItem( this ); + break; + } +} + +// ----------------------------------------------------------------------------- +short ImpPDFTabDialog::Ok( ) +{ +//here the whole mechanism of the base class is not used +//when Ok is hit, the user means 'convert to PDF', so simply close with ok + return RET_OK; +} + +// ----------------------------------------------------------------------------- +Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() +{ +// updating the FilterData sequence and storing FilterData to configuration + if( GetTabPage( RID_PDF_TAB_GENER ) ) + ( ( ImpPDFTabGeneralPage* )GetTabPage( RID_PDF_TAB_GENER ) )->GetFilterConfigItem( this ); + +//prepare the items to be returned + maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), mbUseLosslessCompression ); + maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), mnQuality ); + maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), mbReduceImageResolution ); + maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), mnMaxImageResolution ); + + maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), mbUseTaggedPDF ); + if ( mbIsPresentation ) + maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), mbExportNotesBoth ); + else + maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), mbExportNotesBoth ); + maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), mbUseTransitionEffects ); + maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), mbIsSkipEmptyPages ); + + /* + * FIXME: the entries are only implicitly defined by the resource file. Should there + * ever be an additional form submit format this could get invalid. + */ + maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), mnFormsType ); + + if( GetTabPage( RID_PDF_TAB_VPREFER ) ) + ( ( ImpPDFTabViewerPage* )GetTabPage( RID_PDF_TAB_VPREFER ) )->GetFilterConfigItem( this ); + + maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerToolbar" ) ), mbHideViewerToolbar ); + maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerMenubar" ) ), mbHideViewerMenubar ); + maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerWindowControls" ) ), mbHideViewerWindowControls ); + maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "FitWindow" ) ), mbFitWindow ); + maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "CenterWindow" ) ), mbCenterWindow ); + maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DisplayPDFDocumentTitle" ) ), mbDisplayPDFDocumentTitle ); + maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DirectionR2L" ) ), mbDirectionR2L ); + maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentMode" ) ), mnOpenPDFDocumentMode ); + maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentAction" ) ), mnOpenPDFDocumentAction ); + maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "NonFullScreenPageMode" ) ), mnNonFullScreenPageMode ); + + Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() ); + + aRet.realloc( aRet.getLength() + 1 ); + + if( mbIsRangeChecked ) + { + aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ); + aRet[ aRet.getLength() - 1 ].Value <<= OUString( msPageRange ); + } + else if( mbSelectionIsChecked ) + { + aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Selection" ) ); + aRet[ aRet.getLength() - 1 ].Value <<= maSelection; + } + return aRet; +} + +// ----------------------------------------------------------------------------- +ImpPDFTabGeneralPage::ImpPDFTabGeneralPage( Window* pParent, const SfxItemSet& rCoreSet ) : + SfxTabPage( pParent, ResId( RID_PDF_TAB_GENER ), rCoreSet ), + maFlPages( this, ResId( FL_PAGES ) ), + maRbAll( this, ResId( RB_ALL ) ), + maRbRange( this, ResId( RB_RANGE ) ), + maRbSelection( this, ResId( RB_SELECTION ) ), + maEdPages( this, ResId( ED_PAGES ) ), + maFlCompression( this, ResId( FL_IMAGES ) ), + maRbLosslessCompression( this, ResId( RB_LOSSLESSCOMPRESSION ) ), + maRbJPEGCompression( this, ResId( RB_JPEGCOMPRESSION ) ), + maFtQuality( this, ResId( FT_QUALITY ) ), + maNfQuality( this, ResId( NF_QUALITY ) ), + maCbReduceImageResolution( this, ResId( CB_REDUCEIMAGERESOLUTION ) ), + maCoReduceImageResolution( this, ResId( CO_REDUCEIMAGERESOLUTION ) ), + maFlGeneral( this, ResId( FL_GENERAL ) ), + maCbTaggedPDF( this, ResId( CB_TAGGEDPDF ) ), + maCbExportNotes( this, ResId( CB_EXPORTNOTES ) ), + maCbTransitionEffects( this, ResId( CB_TRANSITIONEFFECTS ) ), + maFtFormsFormat( this, ResId( FT_FORMSFORMAT ) ), + maLbFormsFormat( this, ResId( LB_FORMSFORMAT ) ), + maCbExportEmptyPages( this, ResId( CB_EXPORTEMPTYPAGES ) ), + mbIsPresentation( sal_False ), + + mbResetAlreadyCalled( sal_False ) +{ + FreeResource(); +} + +// ----------------------------------------------------------------------------- +ImpPDFTabGeneralPage::~ImpPDFTabGeneralPage() +{ +} + +// ----------------------------------------------------------------------------- +void ImpPDFTabGeneralPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent ) +{ +//init this class data + maRbRange.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, TogglePagesHdl ) ); + + maRbAll.Check(); + TogglePagesHdl( NULL ); + + maNfQuality.SetUnit( FUNIT_PERCENT ); + maNfQuality.SetMin( 1, FUNIT_PERCENT ); + maNfQuality.SetMax( 100, FUNIT_PERCENT ); + + + maRbSelection.Enable( paParent->mbSelectionPresent ); + mbIsPresentation = paParent->mbIsPresentation; + mbIsWriter = paParent->mbIsWriter; + + maCbTransitionEffects.Enable( mbIsPresentation ); + maCbExportEmptyPages.Enable( mbIsWriter ); + +// SJ: Dont know if there are Notes available also for writer. +// maCbExportNotes.Enable( paParent->mbIsPresentation ); + + maRbLosslessCompression.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleCompressionHdl ) ); + const sal_Bool bUseLosslessCompression = paParent->mbUseLosslessCompression; + if ( bUseLosslessCompression ) + maRbLosslessCompression.Check(); + else + maRbJPEGCompression.Check(); + + maNfQuality.SetValue( paParent->mnQuality, FUNIT_PERCENT ); + maNfQuality.Enable( bUseLosslessCompression == sal_False ); + + maCbReduceImageResolution.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleReduceImageResolutionHdl ) ); + const sal_Bool bReduceImageResolution = paParent->mbReduceImageResolution; + maCbReduceImageResolution.Check( bReduceImageResolution ); + String aStrRes( String::CreateFromInt32( paParent->mnMaxImageResolution ) ); + aStrRes.Append( String( RTL_CONSTASCII_USTRINGPARAM( " DPI" ) ) ); + maCoReduceImageResolution.SetText( aStrRes ); + maCoReduceImageResolution.Enable( bReduceImageResolution ); + + maCbTaggedPDF.Check( paParent->mbUseTaggedPDF ); + + if ( mbIsPresentation ) + maCbExportNotes.Check( paParent->mbExportNotesBoth ); + else + maCbExportNotes.Check( paParent->mbExportNotesBoth ); + + maCbTransitionEffects.Check( paParent->mbUseTransitionEffects ); + maCbExportEmptyPages.Check( !paParent->mbIsSkipEmptyPages ); + + maLbFormsFormat.SelectEntryPos( (sal_uInt16)paParent->mnFormsType ); +} + +// ----------------------------------------------------------------------------- +void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* paParent ) +{ +// updating the FilterData sequence and storing FilterData to configuration + paParent->mbUseLosslessCompression = maRbLosslessCompression.IsChecked(); + paParent->mnQuality = maNfQuality.GetValue(); + paParent->mbReduceImageResolution = maCbReduceImageResolution.IsChecked(); + paParent->mnMaxImageResolution = maCoReduceImageResolution.GetText().ToInt32(); + paParent->mbUseTaggedPDF = maCbTaggedPDF.IsChecked(); + paParent->mbExportNotesBoth = maCbExportNotes.IsChecked(); + + paParent->mbUseTransitionEffects = maCbTransitionEffects.IsChecked(); + paParent->mbIsSkipEmptyPages = !maCbExportEmptyPages.IsChecked(); + + paParent->mbIsRangeChecked = sal_False; + if( maRbRange.IsChecked() ) + { + paParent->mbIsRangeChecked = sal_True; + paParent->msPageRange = String( maEdPages.GetText() ); //FIXME all right on other languages ? + } + else if( maRbSelection.IsChecked() ) + { + paParent->mbSelectionIsChecked = maRbSelection.IsChecked(); + } + /* + * FIXME: the entries are only implicitly defined by the resource file. Should there + * ever be an additional form submit format this could get invalid. + */ + paParent->mnFormsType = (sal_Int32) maLbFormsFormat.GetSelectEntryPos(); +} + +// ----------------------------------------------------------------------------- +SfxTabPage* ImpPDFTabGeneralPage::Create( Window* pParent, + const SfxItemSet& rAttrSet) +{ + return ( new ImpPDFTabGeneralPage( pParent, rAttrSet ) ); +} + +// ----------------------------------------------------------------------------- +void ImpPDFTabGeneralPage::Reset( const SfxItemSet& ignored) +{ +//set the controls to default values +//since this is called just after the data are set from the parent tab dialog +//a bool is needed to enable reset only the second time (user pressing it) + if( mbResetAlreadyCalled ) + { + maCbTransitionEffects.Enable( mbIsPresentation ); + maCbExportEmptyPages.Enable( mbIsWriter ); + maRbAll.Check(); + TogglePagesHdl( NULL ); + maRbLosslessCompression.Check( FALSE ); + maRbJPEGCompression.Check(); + maNfQuality.SetValue( 90 , FUNIT_PERCENT ); + maNfQuality.Enable(); +// maCoReduceImageResolution.Enable(FALSE); + maCbReduceImageResolution.Check( FALSE ); + maCbTaggedPDF.Check( FALSE ); + if ( mbIsPresentation ) + maCbExportNotes.Check( FALSE ); + else + maCbExportNotes.Check(); + maCbTransitionEffects.Check(); + maCbExportEmptyPages.Check(); + + maLbFormsFormat.SelectEntryPos( 0 ); + } + mbResetAlreadyCalled = sal_True; +} + +// ----------------------------------------------------------------------------- +IMPL_LINK( ImpPDFTabGeneralPage, TogglePagesHdl, void*, p ) +{ + maEdPages.Enable( maRbRange.IsChecked() ); + maEdPages.SetReadOnly( !maRbRange.IsChecked() ); + return 0; +} + +// ----------------------------------------------------------------------------- +IMPL_LINK( ImpPDFTabGeneralPage, ToggleCompressionHdl, void*, p ) +{ + maNfQuality.Enable( maRbJPEGCompression.IsChecked() ); + return 0; +} + +// ----------------------------------------------------------------------------- +IMPL_LINK( ImpPDFTabGeneralPage, ToggleReduceImageResolutionHdl, void*, p ) +{ + maCoReduceImageResolution.Enable( maCbReduceImageResolution.IsChecked() ); + return 0; +} + +//////////////////////////////////////////////////////// +// ----------------------------------------------------------------------------- +ImpPDFTabViewerPage::ImpPDFTabViewerPage( Window* pParent, const SfxItemSet& rCoreSet ) : + SfxTabPage( pParent, ResId( RID_PDF_TAB_VPREFER ), rCoreSet ), + + maFlDefOpen( this, ResId( FL_DEFOPEN ) ), + + maGrpOpenMd( this, ResId( GRP_OPENM ) ), + maRbOpnDefault( this, ResId( RB_OPNMODE_DEFAULT ) ), + maRbOpnOutline( this, ResId( RB_OPNMODE_OUTLINE ) ), + maRbOpnThumbs( this, ResId( RB_OPNMODE_THUMBS ) ), + maRbOpnFull( this, ResId( RB_OPNMODE_FULL ) ), + + maGrpOAct( this, ResId( GRP_OPENACT ) ), + maRbOActDefault( this, ResId( RB_OPNACTION_DEFAULT ) ), + maRbOActPage( this, ResId( RB_OPNACTION_PAGE ) ), + maRbOActWidth( this, ResId( RB_OPNACTION_WIDTH ) ), + maRbOActVisible( this, ResId( RB_OPNACTION_VISIBLE ) ), + maFlViewPref( this, ResId( FL_VIEWERPREF ) ), + + maGrpNonFullScreen( this, ResId( GRP_NONFULLSC ) ), + maRbNFSDefault( this, ResId( RB_NFULLS_DEFAULT ) ), + maRbNFSOutline( this, ResId( RB_NFULLS_OUTLINE ) ), + maRbNFSThumbs( this, ResId( RB_NFULLS_THUMBS ) ), + + maGrpDirContrl( this, ResId( GRP_DIRCONTR ) ), + maRbL2R( this, ResId( RB_LEFTRIGHT ) ), + maRbR2L( this, ResId( RB_RIGHTLEFT ) ), + + maGrpViewWinCtrl( this, ResId( GRP_VIEWWINCTRL ) ), + maCbHideViewerToolbar( this, ResId( CB_HIDEVTOOLBAR ) ), + maCbHideViewerMenubar( this, ResId( CB_HIDEVMENUBAR ) ), + maCbHideViewerWindowControls( this, ResId( CB_HIDEVWINCTRL ) ), + maCbFitWindow( this, ResId( CB_FITWINDOW ) ), + maCbCenterWindow( this, ResId( CB_CENTWINDOW ) ), + maCbDispDocTitle( this, ResId( CB_DISPDOCTITLE ) ), + + mbResetAlreadyCalled( sal_False ) +{ + FreeResource(); +} + +// ----------------------------------------------------------------------------- +ImpPDFTabViewerPage::~ImpPDFTabViewerPage() +{ +} + +// ----------------------------------------------------------------------------- +SfxTabPage* ImpPDFTabViewerPage::Create( Window* pParent, + const SfxItemSet& rAttrSet) +{ + return ( new ImpPDFTabViewerPage( pParent, rAttrSet ) ); +} + +// ----------------------------------------------------------------------------- +void ImpPDFTabViewerPage::GetFilterConfigItem( ImpPDFTabDialog* paParent ) +{ + paParent->mbHideViewerToolbar = maCbHideViewerToolbar.IsChecked( ); + paParent->mbHideViewerMenubar = maCbHideViewerMenubar.IsChecked(); + paParent->mbHideViewerWindowControls = maCbHideViewerWindowControls.IsChecked(); + paParent->mbFitWindow = maCbFitWindow.IsChecked(); + paParent->mbCenterWindow = maCbCenterWindow.IsChecked(); + paParent->mbDisplayPDFDocumentTitle = maCbDispDocTitle.IsChecked(); + paParent->mbDirectionR2L = maRbR2L.IsChecked(); + + paParent->mnNonFullScreenPageMode = 0; + if( maRbNFSOutline.IsChecked() ) + paParent->mnNonFullScreenPageMode = 1; + else if( maRbNFSThumbs.IsChecked() ) + paParent->mnNonFullScreenPageMode = 2; + + paParent->mnOpenPDFDocumentMode = 0; + if( maRbOpnOutline.IsChecked() ) + paParent->mnOpenPDFDocumentMode = 1; + else if( maRbOpnThumbs.IsChecked() ) + paParent->mnOpenPDFDocumentMode = 2; + else if( maRbOpnFull.IsChecked() ) + paParent->mnOpenPDFDocumentMode = 3; + + paParent->mnOpenPDFDocumentAction = 0; + if( maRbOActPage.IsChecked() ) + paParent->mnOpenPDFDocumentAction = 1; + else if( maRbOActWidth.IsChecked() ) + paParent->mnOpenPDFDocumentAction = 2; + else if( maRbOActVisible.IsChecked() ) + paParent->mnOpenPDFDocumentAction = 3; +} + +// ----------------------------------------------------------------------------- +void ImpPDFTabViewerPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent ) +{ + maCbHideViewerToolbar.Check( paParent->mbHideViewerToolbar ); + maCbHideViewerMenubar.Check( paParent->mbHideViewerMenubar ); + maCbHideViewerWindowControls.Check( paParent->mbHideViewerWindowControls ); + maCbFitWindow.Check( paParent->mbFitWindow ); + maCbCenterWindow.Check( paParent->mbCenterWindow ); + maCbDispDocTitle.Check( paParent->mbDisplayPDFDocumentTitle ); + + switch( paParent->mnNonFullScreenPageMode ) + { + default: + case 0: + maRbNFSDefault.Check( ); + break; + case 1: + maRbNFSOutline.Check( ); + break; + case 2: + maRbNFSThumbs.Check( ); + break; + } + + maRbR2L.Check( paParent->mbDirectionR2L ); + maRbL2R.Check( !paParent->mbDirectionR2L ); + maRbOpnFull.SetToggleHdl( LINK( this, ImpPDFTabViewerPage, ToggleFullScreenHdl ) ); + + switch( paParent->mnOpenPDFDocumentMode ) + { + default: + case 0: + maRbOpnDefault.Check(); + break; + case 1: + maRbOpnOutline.Check(); + break; + case 2: + maRbOpnThumbs.Check(); + break; + case 3: + maRbOpnFull.Check(); + break; + }; + ToggleFullScreenHdl( NULL ); + + switch( paParent->mnOpenPDFDocumentAction ) + { + default: + case 0: + maRbOActDefault.Check(); + break; + case 1: + maRbOActPage.Check(); + break; + case 2: + maRbOActWidth.Check(); + break; + case 3: + maRbOActVisible.Check(); + break; + }; +} + +// ----------------------------------------------------------------------------- +void ImpPDFTabViewerPage::Reset( const SfxItemSet& ignored) +{ +//set the controls to default values +// since this is called just after the data are set from the parent tab dialog +// a bool is needed to enable reset only the second time (user pressing it) + if( mbResetAlreadyCalled ) + { + maRbOpnDefault.Check(); + maRbOpnOutline.Check(FALSE); + maRbOpnThumbs.Check(FALSE); + maRbOpnFull.Check(FALSE); + + maRbOActDefault.Check(); + maRbOActPage.Check(FALSE); + maRbOActWidth.Check(FALSE); + maRbOActVisible.Check(FALSE); + + maRbNFSDefault.Check(); + maRbNFSOutline.Check(FALSE); + maRbNFSThumbs.Check(FALSE); + + maRbL2R.Check(); + maRbR2L.Check(FALSE); + + maCbHideViewerToolbar.Check( FALSE ); + maCbHideViewerMenubar.Check( FALSE ); + maCbHideViewerWindowControls.Check( FALSE ); + maCbFitWindow.Check( FALSE ); + maCbCenterWindow.Check( FALSE ); + maCbDispDocTitle.Check(); + + ToggleFullScreenHdl( NULL ); + } + mbResetAlreadyCalled = sal_True; +} + +// ----------------------------------------------------------------------------- +IMPL_LINK( ImpPDFTabViewerPage, ToggleFullScreenHdl, void*, p ) +{ + maRbNFSDefault.Enable( maRbOpnFull.IsChecked() ); + maRbNFSOutline.Enable( maRbOpnFull.IsChecked() ); + maRbNFSThumbs.Enable( maRbOpnFull.IsChecked() ); + return 0; +} + Index: filter/source/pdf/impdialog.hrc =================================================================== RCS file: /cvs/framework/filter/source/pdf/impdialog.hrc,v retrieving revision 1.8 diff -u -p -u -r1.8 impdialog.hrc --- filter/source/pdf/impdialog.hrc 21 Dec 2005 15:00:58 -0000 1.8 +++ filter/source/pdf/impdialog.hrc 21 Feb 2006 21:38:45 -0000 @@ -35,6 +35,13 @@ #include +#define RID_PDF_EXPORT_DLG (RID_PDF_DIALOG_START + 0) +#define RID_PDF_EXPORT_TDLG (RID_PDF_DIALOG_START + 1) +#define RID_PDF_TAB_GENER (RID_PDF_DIALOG_START + 2) +#define RID_PDF_TAB_VPREFER (RID_PDF_DIALOG_START + 3) +#define STR_PDF_EXPORT (RID_PDF_DIALOG_START + 4) + +//controls for General tab page #define FL_PAGES 1 #define RB_ALL 2 #define RB_RANGE 3 @@ -70,3 +77,37 @@ #define RB_OLD_SCREEN 60 #define RB_OLD_PRINT 61 #define RB_OLD_PRESS 62 + +//controls for viewer preferences tab page +#define FL_DEFOPEN 80 +#define GRP_OPENM 81 + +#define RB_OPNMODE_DEFAULT 82 +#define RB_OPNMODE_OUTLINE 83 +#define RB_OPNMODE_THUMBS 84 +#define RB_OPNMODE_FULL 85 + +#define GRP_OPENACT 86 +#define RB_OPNACTION_DEFAULT 87 +#define RB_OPNACTION_PAGE 88 +#define RB_OPNACTION_WIDTH 89 +#define RB_OPNACTION_VISIBLE 90 + +#define FL_VIEWERPREF 91 + +#define GRP_NONFULLSC 92 +#define RB_NFULLS_DEFAULT 93 +#define RB_NFULLS_OUTLINE 94 +#define RB_NFULLS_THUMBS 95 + +#define GRP_DIRCONTR 96 +#define RB_LEFTRIGHT 97 +#define RB_RIGHTLEFT 98 + +#define GRP_VIEWWINCTRL 99 +#define CB_HIDEVTOOLBAR 100 +#define CB_HIDEVMENUBAR 101 +#define CB_HIDEVWINCTRL 102 +#define CB_FITWINDOW 103 +#define CB_CENTWINDOW 104 +#define CB_DISPDOCTITLE 105 Index: filter/source/pdf/impdialog.hxx =================================================================== RCS file: /cvs/framework/filter/source/pdf/impdialog.hxx,v retrieving revision 1.12 diff -u -p -u -r1.12 impdialog.hxx --- filter/source/pdf/impdialog.hxx 21 Dec 2005 15:01:13 -0000 1.12 +++ filter/source/pdf/impdialog.hxx 21 Feb 2006 21:38:45 -0000 @@ -44,8 +44,15 @@ #include #include #include +#ifndef _GROUP_HXX //autogen +#include +#endif #include +#ifndef _SFXTABDLG_HXX +#include +#endif + // ---------------- // - ImpPDFDialog - // ---------------- @@ -99,4 +106,167 @@ public: Sequence< PropertyValue > GetFilterData(); }; +//////////////////////////////////////////////////////////////////////// +class ImpPDFTabGeneralPage; +class ImpPDFTabViewerPage; + +//class tabbed dialog +class ImpPDFTabDialog : public SfxTabDialog +{ +private: + + FixedLine maFlPages; //ugly hack: It seems the dialog is not resizable in any way + + FilterConfigItem maConfigItem; + + Any maSelection; + +protected: + +//the following data are the configuration used throughout the dialog and pages + + sal_Bool mbIsPresentation; + sal_Bool mbIsWriter; + sal_Bool mbSelectionPresent; + sal_Bool mbUseLosslessCompression; + sal_Int32 mnQuality; + sal_Bool mbReduceImageResolution; + sal_Int32 mnMaxImageResolution; + sal_Bool mbUseTaggedPDF; + sal_Bool mbExportNotesBoth; + sal_Bool mbUseTransitionEffects; + sal_Bool mbIsSkipEmptyPages; + sal_Int32 mnFormsType; + + sal_Bool mbHideViewerToolbar; + sal_Bool mbHideViewerMenubar; + sal_Bool mbHideViewerWindowControls; + sal_Bool mbFitWindow; + sal_Bool mbCenterWindow; + sal_Bool mbDisplayPDFDocumentTitle; + sal_Bool mbDirectionR2L; + sal_Int32 mnOpenPDFDocumentMode; + sal_Int32 mnOpenPDFDocumentAction; + + sal_Int32 mnNonFullScreenPageMode; + + sal_Bool mbIsRangeChecked; + String msPageRange; + sal_Bool mbSelectionIsChecked; + + +public: + + friend class ImpPDFTabGeneralPage; + friend class ImpPDFTabViewerPage; + + ImpPDFTabDialog( Window* pParent, ResMgr& rResMgr, + Sequence< PropertyValue >& rFilterData, + const Reference< XComponent >& rDoc ); + ~ImpPDFTabDialog(); + + Sequence< PropertyValue > GetFilterData(); + +protected: + virtual void PageCreated( USHORT _nId, SfxTabPage& _rPage ); + virtual short Ok(); +}; + +//class tab page general +class ImpPDFTabGeneralPage : public SfxTabPage +{ + FixedLine maFlPages; + RadioButton maRbAll; + RadioButton maRbRange; + RadioButton maRbSelection; + Edit maEdPages; + FixedLine maFlCompression; + RadioButton maRbLosslessCompression; + RadioButton maRbJPEGCompression; + FixedText maFtQuality; + MetricField maNfQuality; + CheckBox maCbReduceImageResolution; + ComboBox maCoReduceImageResolution; + FixedLine maFlGeneral; + CheckBox maCbTaggedPDF; + CheckBox maCbExportNotes; + CheckBox maCbTransitionEffects; + FixedText maFtFormsFormat; + ListBox maLbFormsFormat; + CheckBox maCbExportEmptyPages; + + sal_Bool mbIsPresentation; + sal_Bool mbIsWriter; + + sal_Bool mbResetAlreadyCalled; + + DECL_LINK( TogglePagesHdl, void* ); + DECL_LINK( ToggleCompressionHdl, void* ); + DECL_LINK( ToggleReduceImageResolutionHdl, void* ); +protected: + + +public: + ImpPDFTabGeneralPage( Window* pParent, const SfxItemSet& rSet ); + + ~ImpPDFTabGeneralPage(); + static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet); + + void GetFilterConfigItem( ImpPDFTabDialog* paParent ); + void SetFilterConfigItem( const ImpPDFTabDialog* paParent ); +//this will set the default + virtual void Reset( const SfxItemSet& ignored); +}; + +//class tab page viewer +class ImpPDFTabViewerPage : public SfxTabPage +{ + FixedLine maFlDefOpen; + GroupBox maGrpOpenMd; + RadioButton maRbOpnDefault; + RadioButton maRbOpnOutline; + RadioButton maRbOpnThumbs; + RadioButton maRbOpnFull; + + GroupBox maGrpOAct; + RadioButton maRbOActDefault; + RadioButton maRbOActPage; + RadioButton maRbOActWidth; + RadioButton maRbOActVisible; + + FixedLine maFlViewPref; + + GroupBox maGrpNonFullScreen; + RadioButton maRbNFSDefault; + RadioButton maRbNFSOutline; + RadioButton maRbNFSThumbs; + + GroupBox maGrpDirContrl; + RadioButton maRbL2R; + RadioButton maRbR2L; + + GroupBox maGrpViewWinCtrl; + CheckBox maCbHideViewerToolbar; + CheckBox maCbHideViewerMenubar; + CheckBox maCbHideViewerWindowControls; + CheckBox maCbFitWindow; + CheckBox maCbCenterWindow; + CheckBox maCbDispDocTitle; + + sal_Bool mbResetAlreadyCalled; + + DECL_LINK( ToggleFullScreenHdl, void* ); + +public: + ImpPDFTabViewerPage( Window* pParent, const SfxItemSet& rSet ); + + ~ImpPDFTabViewerPage(); + static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet ); + + void GetFilterConfigItem( ImpPDFTabDialog* paParent); + void SetFilterConfigItem( const ImpPDFTabDialog* paParent ); +//this will set the default + virtual void Reset( const SfxItemSet& ignored); +}; + #endif // IMPDIALOG_HXX Index: filter/source/pdf/impdialog.src =================================================================== RCS file: /cvs/framework/filter/source/pdf/impdialog.src,v retrieving revision 1.26 diff -u -p -u -r1.26 impdialog.src --- filter/source/pdf/impdialog.src 21 Dec 2005 15:01:24 -0000 1.26 +++ filter/source/pdf/impdialog.src 21 Feb 2006 21:38:45 -0000 @@ -230,3 +230,416 @@ ModalDialog RID_PDF_EXPORT_DLG DefButton = TRUE ; }; }; + +//string for TabDialog standard buttons +String STR_PDF_EXPORT +{ + Text[ de ] = "E~xportieren" ; + Text[ en-US ] = "E~xport"; +}; + +////////////////////////////////////////////////////////////// +//tab page for PDF Export, general preferences +TabPage RID_PDF_TAB_GENER +{ + HelpId = HID_FILTER_PDF_OPTIONS ; + Hide = TRUE ; + Text[ de ] = "Allgemein"; + Text[ en-US ] = "General"; + Size = MAP_APPFONT ( 176, 200 ) ; + + FixedLine FL_PAGES + { + Pos = MAP_APPFONT ( 6 , 3 ) ; + Size = MAP_APPFONT ( 162 , 8 ) ; + Text[ de ] = "Bereich" ; + Text[ en-US ] = "Range"; + }; + RadioButton RB_ALL + { + Pos = MAP_APPFONT ( 12 , 14 ) ; + Size = MAP_APPFONT ( 86 , 10 ) ; + Text[ de ] = "~Alle" ; + Text[ en-US ] = "~All"; + }; + RadioButton RB_RANGE + { + Pos = MAP_APPFONT ( 12 , 26 ) ; + Size = MAP_APPFONT ( 86, 10 ) ; + Text[ de ] = "~Seiten" ; + Text[ en-US ] = "~Pages"; + }; + RadioButton RB_SELECTION + { + Pos = MAP_APPFONT ( 12 , 38 ) ; + Size = MAP_APPFONT ( 86, 10 ) ; + Text[ de ] = "A~uswahl" ; + Text[ en-US ] = "~Selection"; + }; + Edit ED_PAGES + { + Border = TRUE ; + Pos = MAP_APPFONT ( 114, 25 ) ; + Size = MAP_APPFONT ( 48 , 12 ) ; + }; + FixedLine FL_IMAGES + { + Pos = MAP_APPFONT ( 6 , 52 ) ; + Size = MAP_APPFONT ( 162 , 8 ) ; + Text[ de ] = "Grafiken"; + Text[ en-US ] = "Images"; + }; + RadioButton RB_LOSSLESSCOMPRESSION + { + Pos = MAP_APPFONT ( 12 , 64 ) ; + Size = MAP_APPFONT ( 156 , 10 ) ; + Text[ de ] = "~Verlustfreie Komprimierung" ; + Text[ en-US ] = "~Lossless compression"; + }; + RadioButton RB_JPEGCOMPRESSION + { + Pos = MAP_APPFONT ( 12 , 76 ) ; + Size = MAP_APPFONT ( 156, 10 ) ; + Text[ de ] = "Optimiert für ~JPEG Komprimierung" ; + Text[ en-US ] = "~JPEG compression"; + }; + FixedText FT_QUALITY + { + Pos = MAP_APPFONT ( 30 , 89 ) ; + Size = MAP_APPFONT ( 70, 10 ) ; + Text[ de ] = "~Qualität" ; + Text[ en-US ] = "~Quality"; + }; + MetricField NF_QUALITY + { + Border = TRUE ; + Pos = MAP_APPFONT ( 114, 87 ) ; + Size = MAP_APPFONT ( 48, 12 ) ; + TabStop = TRUE ; + Spin = TRUE ; + StrictFormat = TRUE ; + Last = 100 ; + Repeat = TRUE ; + }; + CheckBox CB_REDUCEIMAGERESOLUTION + { + Pos = MAP_APPFONT ( 12 , 104 ) ; + Size = MAP_APPFONT ( 103 , 10 ) ; + TabStop = TRUE ; + Text[ de ] = "~Grafikauflösung verringern" ; + Text[ en-US ] = "~Reduce image resolution"; + }; + ComboBox CO_REDUCEIMAGERESOLUTION + { + Pos = MAP_APPFONT ( 114 , 101 ) ; + Size = MAP_APPFONT ( 48 , 50 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + StringList = + { + "75 DPI" ; + "150 DPI" ; + "300 DPI" ; + "600 DPI" ; + "1200 DPI" ; + }; + }; + FixedLine FL_GENERAL + { + Pos = MAP_APPFONT ( 6 , 117 ) ; + Size = MAP_APPFONT ( 162 , 8 ) ; + Text[ de ] = "Allgemein"; + Text[ en-US ] = "General"; + }; + CheckBox CB_TAGGEDPDF + { + Pos = MAP_APPFONT ( 12 , 129 ) ; + Size = MAP_APPFONT ( 153 , 10 ) ; + TabStop = TRUE ; + Text[ de ] = "~Tagged PDF" ; + Text[ en-US ] = "~Tagged PDF"; + }; + CheckBox CB_EXPORTNOTES + { + Pos = MAP_APPFONT ( 12 , 143 ) ; + Size = MAP_APPFONT ( 153 , 10 ) ; + TabStop = TRUE ; + Text[ de ] = "~Notizen exportieren" ; + Text[ en-US ] = "Export ~notes"; + }; + CheckBox CB_TRANSITIONEFFECTS + { + Pos = MAP_APPFONT ( 12 , 157 ) ; + Size = MAP_APPFONT ( 153 , 10 ) ; + TabStop = TRUE ; + Text[ de ] = "~Übergangseffekte benutzen" ; + Text[ en-US ] = "~Use transition effects"; + }; + FixedText FT_FORMSFORMAT + { + Pos = MAP_APPFONT ( 12 , 171 ) ; + Size = MAP_APPFONT ( 116, 10 ) ; + Text[ de ] = "~Format für Formularübermittlung:" ; + Text[ en-US ] = "Submit forms in ~format:"; + }; + ListBox LB_FORMSFORMAT + { + Border = TRUE ; + Pos = MAP_APPFONT ( 124, 168 ) ; + Size = MAP_APPFONT ( 38, 48 ) ; + DeltaLang = < Default ; Default ; Default ; Default ; > ; + TabStop = TRUE ; + DropDown = TRUE ; + StringList = + { + < "FDF" ; Default; > ; + < "PDF" ; > ; + < "HTML" ; > ; + < "XML" ; > ; + }; + }; + CheckBox CB_EXPORTEMPTYPAGES + { + Pos = MAP_APPFONT ( 12 , 185 ) ; + Size = MAP_APPFONT ( 153 , 10 ) ; + TabStop = TRUE ; + Text[ de ] = "Automatisch eingefügte ~Leerseiten exportieren" ; + Text[ en-US ] = "Export automatically inserted ~blank pages"; + }; +}; + +////////////////////////////////////////////////////////////// +//tab page for PDF Export, general preferences +TabPage RID_PDF_TAB_VPREFER +{ + HelpId = HID_FILTER_PDF_OPTIONS ; + Text[ de ] = "Viewer Preferences" ; + Text[ en-US ] = "Viever Preferences" ; + Size = MAP_APPFONT ( 176, 200 ) ; + Hide = TRUE ; + FixedLine FL_DEFOPEN + { + Pos = MAP_APPFONT ( 6 , 3 ) ; + Size = MAP_APPFONT ( 162 , 8 ) ; + Text[ de ] = "Document Opening Features" ; + Text[ en-US ] = "Document Opening Features" ; + }; + + GroupBox GRP_OPENM + { + Pos = MAP_APPFONT ( 6 , 14 ) ; + Size = MAP_APPFONT (77 , 65 ) ; + Text[ de ] = "Opening Mode" ; + Text[ en-US ] = "Opening Mode" ; + }; + RadioButton RB_OPNMODE_DEFAULT + { + Pos = MAP_APPFONT ( 12 , 25 ) ; + Size = MAP_APPFONT ( 75 , 10 ) ; + Text[ de ] = "~Default" ; + Text[ en-US ] = "~Default" ; + }; + RadioButton RB_OPNMODE_OUTLINE + { + Pos = MAP_APPFONT ( 12 , 37 ) ; + Size = MAP_APPFONT ( 75 , 10 ) ; + Text[ de ] = "Out~line Visible" ; + Text[ en-US ] = "Out~line Visible" ; + }; + RadioButton RB_OPNMODE_THUMBS + { + Pos = MAP_APPFONT ( 12 , 49 ) ; + Size = MAP_APPFONT ( 75 , 10 ) ; + Text[ de ] = "~Thumbnails Visible" ; + Text[ en-US ] = "~Thumbnails Visible" ; + }; + RadioButton RB_OPNMODE_FULL + { + Pos = MAP_APPFONT ( 12 , 61 ) ; + Size = MAP_APPFONT ( 75 , 10 ) ; + Text[ de ] = "Full ~Screen" ; + Text[ en-US ] = "Full ~Screen" ; + }; + + GroupBox GRP_OPENACT + { + Pos = MAP_APPFONT ( 88 , 14 ) ; + Size = MAP_APPFONT (77 , 65 ) ; + Text[ de ] = "Opening Action" ; + Text[ en-US ] = "Opening Action" ; + }; + RadioButton RB_OPNACTION_DEFAULT + { + Pos = MAP_APPFONT ( 95 , 25 ) ; + Size = MAP_APPFONT ( 75 , 10 ) ; + Text[ de ] = "~Default" ; + Text[ en-US ] = "~Default" ; + }; + RadioButton RB_OPNACTION_PAGE + { + Pos = MAP_APPFONT ( 95 , 37 ) ; + Size = MAP_APPFONT ( 75 , 10 ) ; + Text[ de ] = "Fit Page ~Heigt" ; + Text[ en-US ] = "Fit Page ~Heigt" ; + }; + RadioButton RB_OPNACTION_WIDTH + { + Pos = MAP_APPFONT ( 95 , 49 ) ; + Size = MAP_APPFONT ( 75 , 10 ) ; + Text[ de ] = "Fit Page ~Widht" ; + Text[ en-US ] = "Fit Page ~Width" ; + }; + RadioButton RB_OPNACTION_VISIBLE + { + Pos = MAP_APPFONT ( 95 , 61 ) ; + Size = MAP_APPFONT ( 75 , 10 ) ; + Text[ de ] = "Fit ~Visible" ; + Text[ en-US ] = "Fit ~Visible" ; + }; + FixedLine FL_VIEWERPREF + { + Pos = MAP_APPFONT ( 6 , 81 ) ; + Size = MAP_APPFONT ( 162 , 8 ) ; + Text[ de ] = "Viewer Preferences" ; + Text[ en-US ] = "Viewer Preferences" ; + }; + +//////////////////////////////////////// + GroupBox GRP_NONFULLSC + { + Pos = MAP_APPFONT ( 6 , 92 ) ; + Size = MAP_APPFONT (77 , 51 ) ; + Text[ de ] = "Non Full Screen Mode" ; + Text[ en-US ] = "Non Full Screen Mode" ; + }; + RadioButton RB_NFULLS_DEFAULT + { + Pos = MAP_APPFONT ( 12 , 103 ) ; + Size = MAP_APPFONT ( 75 , 10 ) ; + Text[ de ] = "~Default" ; + Text[ en-US ] = "~Default" ; + }; + RadioButton RB_NFULLS_OUTLINE + { + Pos = MAP_APPFONT ( 12 , 115 ) ; + Size = MAP_APPFONT ( 75 , 10 ) ; + Text[ de ] = "Out~line Visible" ; + Text[ en-US ] = "Out~line Visible" ; + }; + RadioButton RB_NFULLS_THUMBS + { + Pos = MAP_APPFONT ( 12 , 127 ) ; + Size = MAP_APPFONT ( 75 , 10 ) ; + Text[ de ] = "~Thumbnails Visible" ; + Text[ en-US ] = "~Thumbnails Visible" ; + }; + + GroupBox GRP_DIRCONTR + { + Pos = MAP_APPFONT ( 6 , 149 ) ; + Size = MAP_APPFONT (77 , 40 ) ; + Text[ de ] = "Direction Control" ; + Text[ en-US ] = "Direction Control" ; + }; + RadioButton RB_LEFTRIGHT + { + Pos = MAP_APPFONT ( 12 , 160 ) ; + Size = MAP_APPFONT ( 75 , 10 ) ; + Text[ de ] = "Left to ~Right" ; + Text[ en-US ] = "Left to ~Right" ; + }; + RadioButton RB_RIGHTLEFT + { + Pos = MAP_APPFONT ( 12 , 172 ) ; + Size = MAP_APPFONT ( 75 , 10 ) ; + Text[ de ] = "Right to ~Left" ; + Text[ en-US ] = "Right to ~Left" ; + }; + + GroupBox GRP_VIEWWINCTRL + { + Pos = MAP_APPFONT ( 88 , 92 ) ; + Size = MAP_APPFONT (77 , 97 ) ; + Text[ de ] = "Viewer Window Control" ; + Text[ en-US ] = "Viewer Window Control" ; + }; + CheckBox CB_HIDEVTOOLBAR + { + Pos = MAP_APPFONT ( 95 , 103 ) ; + Size = MAP_APPFONT ( 77 , 10 ) ; + TabStop = TRUE ; + Text[ de ] = "Hide Tool Bar" ; + Text[ en-US ] = "Hide Tool Bar"; + }; + CheckBox CB_HIDEVMENUBAR + { + Pos = MAP_APPFONT ( 95 , 117 ) ; + Size = MAP_APPFONT ( 77 , 10 ) ; + TabStop = TRUE ; + Text[ de ] = "Hide Menu Bar" ; + Text[ en-US ] = "Hide Menu Bar"; + }; + CheckBox CB_HIDEVWINCTRL + { + Pos = MAP_APPFONT ( 95 , 131 ) ; + Size = MAP_APPFONT ( 77 , 10 ) ; + TabStop = TRUE ; + Text[ de ] = "Hide Window Controls" ; + Text[ en-US ] = "Hide Window Controls"; + }; + CheckBox CB_FITWINDOW + { + Pos = MAP_APPFONT ( 95 , 145 ) ; + Size = MAP_APPFONT ( 77 , 10 ) ; + TabStop = TRUE ; + Text[ de ] = "Fit Window" ; + Text[ en-US ] = "Fit Window"; + }; + CheckBox CB_CENTWINDOW + { + Pos = MAP_APPFONT ( 95 , 159 ) ; + Size = MAP_APPFONT ( 77 , 10 ) ; + TabStop = TRUE ; + Text[ de ] = "Center Window" ; + Text[ en-US ] = "Center Window"; + }; + CheckBox CB_DISPDOCTITLE + { + Pos = MAP_APPFONT ( 95 , 173 ) ; + Size = MAP_APPFONT ( 77 , 10 ) ; + TabStop = TRUE ; + Text[ de ] = "Display Document Title" ; + Text[ en-US ] = "Display Document Title"; + }; + +}; + +TabDialog RID_PDF_EXPORT_TDLG +{ + HelpId = HID_FILTER_PDF_OPTIONS ; + OutputSize = TRUE; + SVLook = TRUE; + Moveable = TRUE; + Text [ de ] = "PDF Export"; + Text [ en-US ] = "PDF Export"; + + TabControl 1 + { + OutputSize = TRUE; + PageList = + { + PageItem + { + Identifier = RID_PDF_TAB_GENER; + Text [ de ] = "Allgemein"; + Text [ en-US ] = "General"; + }; + PageItem + { + Identifier = RID_PDF_TAB_VPREFER; + Text [ de ] = "Viewer Preferences"; + Text [ en-US ] = "Viewer Preferences"; + }; + }; + }; +}; Index: filter/source/pdf/makefile.mk =================================================================== RCS file: /cvs/framework/filter/source/pdf/makefile.mk,v retrieving revision 1.11 diff -u -p -u -r1.11 makefile.mk --- filter/source/pdf/makefile.mk 8 Sep 2005 21:48:41 -0000 1.11 +++ filter/source/pdf/makefile.mk 21 Feb 2006 21:38:45 -0000 @@ -68,6 +68,7 @@ SHL1STDLIBS=\ $(TKLIB) \ $(VCLLIB) \ $(SVLLIB) \ + $(SFX2LIB) \ $(UNOTOOLSLIB) \ $(TOOLSLIB) \ $(COMPHELPERLIB) \ Index: filter/source/pdf/pdfdialog.cxx =================================================================== RCS file: /cvs/framework/filter/source/pdf/pdfdialog.cxx,v retrieving revision 1.8 diff -u -p -u -r1.8 pdfdialog.cxx --- filter/source/pdf/pdfdialog.cxx 8 Sep 2005 21:49:22 -0000 1.8 +++ filter/source/pdf/pdfdialog.cxx 21 Feb 2006 21:38:45 -0000 @@ -50,6 +50,9 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; +//uncomment this to use the Tabbed PDF dialog (under development !) +#define DUSE_PDF_TABDLG + // ----------------------- // - PDFDialog functions - // ----------------------- @@ -179,7 +182,11 @@ Dialog* PDFDialog::createDialog( Window* if( mpResMgr && mxSrcDoc.is() ) { +#ifdef DUSE_PDF_TABDLG + ImpPDFTabDialog* pDlg = new ImpPDFTabDialog( pParent, *mpResMgr, maFilterData, mxSrcDoc ); +#else ImpPDFDialog* pDlg = new ImpPDFDialog( pParent, *mpResMgr, maFilterData, mxSrcDoc ); +#endif pRet = pDlg; } @@ -191,7 +198,11 @@ Dialog* PDFDialog::createDialog( Window* void PDFDialog::executedDialog( sal_Int16 nExecutionResult ) { if( nExecutionResult && m_pDialog ) +#ifdef DUSE_PDF_TABDLG + maFilterData = static_cast< ImpPDFTabDialog* >( m_pDialog )->GetFilterData(); +#else maFilterData = static_cast< ImpPDFDialog* >( m_pDialog )->GetFilterData(); +#endif destroyDialog(); } Index: filter/source/pdf/pdfexport.cxx =================================================================== RCS file: /cvs/framework/filter/source/pdf/pdfexport.cxx,v retrieving revision 1.44 diff -u -p -u -r1.44 pdfexport.cxx --- filter/source/pdf/pdfexport.cxx 1 Nov 2005 10:20:43 -0000 1.44 +++ filter/source/pdf/pdfexport.cxx 21 Feb 2006 21:38:45 -0000 @@ -281,6 +281,9 @@ sal_Bool PDFExport::Export( const OUStri aCreator.AppendAscii( "Math" ); } + PDFWriter::PDFWriterContext aContext; + sal_Int32 nPDFDocumentMode = 0, nPDFDocumentAction = 0, nPDFNonFullScreen = 0; + for( sal_Int32 nData = 0, nDataCount = rFilterData.getLength(); nData < nDataCount; ++nData ) { if( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ) ) @@ -307,11 +310,80 @@ sal_Bool PDFExport::Export( const OUStri rFilterData[ nData ].Value >>= mbUseTransitionEffects; else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ) ) rFilterData[ nData ].Value >>= mnFormsFormat; +//--> i61139 + else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerToolbar" ) ) ) + rFilterData[ nData ].Value >>= aContext.HideViewerToolbar; + else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerMenubar" ) ) ) + rFilterData[ nData ].Value >>= aContext.HideViewerMenubar; + else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerWindowControls" ) ) ) + rFilterData[ nData ].Value >>= aContext.HideViewerWindowControls; + else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "FitWindow" ) ) ) + rFilterData[ nData ].Value >>= aContext.FitWindow; + else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "CenterWindow" ) ) ) + rFilterData[ nData ].Value >>= aContext.CenterWindow; + else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "DisplayPDFDocumentTitle" ) ) ) + rFilterData[ nData ].Value >>= aContext.DisplayPDFDocumentTitle; + else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "DirectionR2L" ) ) ) + rFilterData[ nData ].Value >>= aContext.DirectionR2L; + else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentMode" ) ) ) + rFilterData[ nData ].Value >>= nPDFDocumentMode; + else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentAction" ) ) ) + rFilterData[ nData ].Value >>= nPDFDocumentAction; + else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "NonFullScreenPageMode" ) ) ) + rFilterData[ nData ].Value >>= nPDFNonFullScreen; +//<---- } - PDFWriter::PDFWriterContext aContext; aContext.URL = aURL.GetMainURL(INetURLObject::DECODE_TO_IURI); aContext.Version = PDFWriter::PDF_1_4; aContext.Tagged = mbUseTaggedPDF; + + switch( nPDFDocumentMode ) + { + default: + case 0: + aContext.PDFDocumentMode = PDFWriter::ModeDefault; + break; + case 1: + aContext.PDFDocumentMode = PDFWriter::UseOutlines; + break; + case 2: + aContext.PDFDocumentMode = PDFWriter::UseThumbs; + break; + case 3: + aContext.PDFDocumentMode = PDFWriter::FullScreen; + break; + } + switch( nPDFDocumentAction ) + { + default: + case 0: + aContext.PDFDocumentAction = PDFWriter::ActionDefault; + break; + case 1: + aContext.PDFDocumentAction = PDFWriter::FitHeight; + break; + case 2: + aContext.PDFDocumentAction = PDFWriter::FitWidth; + break; + case 3: + aContext.PDFDocumentAction = PDFWriter::FitVisible; + break; + } + + switch( nPDFNonFullScreen ) + { + default: + case 0: + aContext.NonFullScreenPageMode = PDFWriter::ModeDefault; + break; + case 1: + aContext.NonFullScreenPageMode = PDFWriter::UseOutlines; + break; + case 2: + aContext.NonFullScreenPageMode = PDFWriter::UseThumbs; + break; + } + /* * FIXME: the entries are only implicitly defined by the resource file. Should there * ever be an additional form submit format this could get invalid. Index: filter/source/pdf/pdffilter.cxx =================================================================== RCS file: /cvs/framework/filter/source/pdf/pdffilter.cxx,v retrieving revision 1.7 diff -u -p -u -r1.7 pdffilter.cxx --- filter/source/pdf/pdffilter.cxx 21 Dec 2005 15:01:37 -0000 1.7 +++ filter/source/pdf/pdffilter.cxx 21 Feb 2006 21:38:46 -0000 @@ -90,6 +90,15 @@ sal_Bool PDFFilter::implExport( const Se aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), sal_True ); aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), sal_False ); aCfgItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), 0 ); + aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "HideViewerToolbar" ) ), sal_False ); + aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "HideViewerMenubar" ) ), sal_False ); + aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "HideViewerWindowControls" ) ), sal_False ); + aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "FitWindow" ) ), sal_False ); + aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "CenterWindow" ) ), sal_False ); + aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "DisplayPDFDocumentTitle" ) ), sal_False ); + aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "DirectionR2L" ) ), sal_False ); + aCfgItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentMode" ) ), 0 ); + aCfgItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "OpenPDFDocumentAction" ) ), 0 ); aFilterData = aCfgItem.GetFilterData(); } if( mxSrcDoc.is() && xOStm.is() ) Index: vcl/inc/pdfwriter.hxx =================================================================== RCS file: /cvs/gsl/vcl/inc/pdfwriter.hxx,v retrieving revision 1.15 diff -u -p -u -r1.15 pdfwriter.hxx --- vcl/inc/pdfwriter.hxx 19 Oct 2005 11:48:53 -0000 1.15 +++ vcl/inc/pdfwriter.hxx 21 Feb 2006 21:38:46 -0000 @@ -419,6 +419,23 @@ public: }; enum ExportDataFormat { HTML, XML, FDF, PDF }; +//see 3.6.1 of PDF 1.4 ref for details, used for 8.1 PDF v 1.4 ref also + enum PDFViewerPageMode + { + ModeDefault, + UseOutlines, + UseThumbs, + FullScreen + }; + + enum PDFViewerAction + { + ActionDefault, + FitHeight, + FitWidth, + FitVisible + }; + struct PDFWriterContext { /* must be a valid file: URL usable by osl */ @@ -433,11 +450,40 @@ public: will be submitted. */ PDFWriter::ExportDataFormat SubmitFormat; + /* the following data members are used to customize the PDF viewer + preferences + */ + /* see 3.6.1 PDF v 1.4 ref*/ + PDFWriter::PDFViewerPageMode PDFDocumentMode; + PDFWriter::PDFViewerAction PDFDocumentAction; + + /* see 8.6 PDF v 1.4 ref + specifies whether to hide the viewer tool + bars when the document is active. + */ + bool HideViewerToolbar; + bool HideViewerMenubar; + bool HideViewerWindowControls; + bool FitWindow; + bool CenterWindow; + bool DisplayPDFDocumentTitle; + bool DirectionR2L; + PDFViewerPageMode NonFullScreenPageMode; PDFWriterContext() : Version( PDFWriter::PDF_1_4 ), Tagged( false ), - SubmitFormat( PDFWriter::FDF ) + SubmitFormat( PDFWriter::FDF ), + PDFDocumentMode( PDFWriter::ModeDefault ), + PDFDocumentAction( PDFWriter::ActionDefault ), + HideViewerToolbar( false ), + HideViewerMenubar( false ), + HideViewerWindowControls( false ), + FitWindow( false ), + CenterWindow( false ), + DisplayPDFDocumentTitle( false ), + DirectionR2L( false ), + NonFullScreenPageMode( PDFWriter::ModeDefault ) {} }; Index: vcl/source/gdi/pdfwriter_impl.cxx =================================================================== RCS file: /cvs/gsl/vcl/source/gdi/pdfwriter_impl.cxx,v retrieving revision 1.86 diff -u -p -u -r1.86 pdfwriter_impl.cxx --- vcl/source/gdi/pdfwriter_impl.cxx 25 Nov 2005 10:02:34 -0000 1.86 +++ vcl/source/gdi/pdfwriter_impl.cxx 21 Feb 2006 21:38:48 -0000 @@ -3412,11 +3412,11 @@ bool PDFWriterImpl::emitLinkAnnotations( " /Border [0 0 0]\r\n" " /Rect [" ); - appendFixedInt( rLink.m_aRect.Left(), aLine ); + appendFixedInt( rLink.m_aRect.Left()-7, aLine );//the +7 to have a better shape of the border rectangle aLine.append( ' ' ); appendFixedInt( rLink.m_aRect.Top(), aLine ); aLine.append( ' ' ); - appendFixedInt( rLink.m_aRect.Right(), aLine ); + appendFixedInt( rLink.m_aRect.Right()+7, aLine );//the +7 to have a better shape of the border rectangle aLine.append( ' ' ); appendFixedInt( rLink.m_aRect.Bottom(), aLine ); aLine.append( "]\r\n" ); @@ -4293,7 +4293,7 @@ bool PDFWriterImpl::emitCatalog() return false; // emit tree node - OStringBuffer aLine( 1024 ); + OStringBuffer aLine( 2048 ); aLine.append( nTreeNode ); aLine.append( " 0 obj\r\n" ); aLine.append( "<< /Type /Pages\r\n" ); @@ -4345,6 +4345,93 @@ bool PDFWriterImpl::emitCatalog() " /Pages " ); aLine.append( nTreeNode ); aLine.append( " 0 R\r\n" ); + if( m_aContext.PDFDocumentMode != PDFWriter::ModeDefault ) + { + switch( m_aContext.PDFDocumentMode ) + { + case PDFWriter::UseOutlines : + default : + aLine.append( "/PageMode/UseOutlines\n" ); //document is opened with outline pane open + break; + case PDFWriter::UseThumbs : + aLine.append( "/PageMode/UseThumbs\n" ); //document is opened with thumbnails pane open + break; + case PDFWriter::FullScreen : + aLine.append( "/PageMode/FullScreen\n" ); //document is opened full screen + break; + } + } + switch( m_aContext.PDFDocumentAction ) + { + case PDFWriter::ActionDefault : + default: + aLine.append( "/OpenAction [0 /XYZ null null null" ); //page 0 (first) open Default, leave without it + break; + case PDFWriter::FitHeight : + aLine.append( "/OpenAction [0 /Fit" ); //Open fit page + break; + case PDFWriter::FitWidth : + aLine.append( "/OpenAction [0 /FitH " ); + aLine.append( m_nInheritedPageHeight );//Open fit width + break; + case PDFWriter::FitVisible : + aLine.append( "/OpenAction [0 /FitBH " ); + aLine.append( m_nInheritedPageHeight );//Open fit visible 5 pica more (max top) + break; + } + aLine.append( "]\n" ); +// viewer preferences, if we had some, then emit + if( m_aContext.HideViewerToolbar || + ( m_aContext.Version > PDFWriter::PDF_1_3 && m_aDocInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle ) || + m_aContext.HideViewerMenubar || + m_aContext.HideViewerWindowControls || + m_aContext.FitWindow || + m_aContext.CenterWindow || + m_aContext.DirectionR2L || + ( m_aContext.NonFullScreenPageMode != PDFWriter::ModeDefault && + m_aContext.PDFDocumentMode == PDFWriter::FullScreen ) ) + { + aLine.append( "/ViewerPreferences<<" ); + if( m_aContext.HideViewerToolbar ) + aLine.append( "/HideToolbar true\n" ); + if( m_aContext.HideViewerMenubar ) + aLine.append( "/HideMenubar true\n" ); + if( m_aContext.HideViewerWindowControls ) + aLine.append( "/HideWindowUI true\n" ); + if( m_aContext.FitWindow ) + aLine.append("/FitWindow true\n"); + if( m_aContext.CenterWindow ) + aLine.append("/CenterWindow true\n"); + if( m_aContext.Version > PDFWriter::PDF_1_3 && m_aDocInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle ) + aLine.append( "/DisplayDocTitle true\n" ); + if( m_aContext.DirectionR2L ) + aLine.append("/Direction /R2L\n"); + if( m_aContext.NonFullScreenPageMode != PDFWriter::ModeDefault && + m_aContext.PDFDocumentMode == PDFWriter::FullScreen ) + { + switch( m_aContext.NonFullScreenPageMode ) + { + default : + case PDFWriter::ModeDefault : + { + aLine.append("/NonFullScreenPageMode/UseNone\n"); + } + break; + case PDFWriter::UseOutlines : + { + aLine.append("/NonFullScreenPageMode/UseOutlines\n"); + } + break; + case PDFWriter::UseThumbs : + { + aLine.append("/NonFullScreenPageMode/UseThumbs\n"); + } + break; + } + } + aLine.append( ">>\n" ); + } + if( nOutlineDict ) { aLine.append( " /Outlines " );