1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 29*cdf0e10cSrcweir #include "precompiled_sw.hxx" 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir 32*cdf0e10cSrcweir #include <swtypes.hxx> 33*cdf0e10cSrcweir #include <tools/debug.hxx> 34*cdf0e10cSrcweir #include <unomod.hxx> 35*cdf0e10cSrcweir #include <unomid.h> 36*cdf0e10cSrcweir #include <unoprnms.hxx> 37*cdf0e10cSrcweir #include <unomap.hxx> 38*cdf0e10cSrcweir #include <prtopt.hxx> 39*cdf0e10cSrcweir #include <tools/shl.hxx> 40*cdf0e10cSrcweir #include <swmodule.hxx> 41*cdf0e10cSrcweir #include <view.hxx> 42*cdf0e10cSrcweir #include <docsh.hxx> 43*cdf0e10cSrcweir #include <wrtsh.hxx> 44*cdf0e10cSrcweir #include <viewopt.hxx> 45*cdf0e10cSrcweir #include <vos/mutex.hxx> 46*cdf0e10cSrcweir #include <vcl/svapp.hxx> 47*cdf0e10cSrcweir #include <com/sun/star/text/NotePrintMode.hpp> 48*cdf0e10cSrcweir #include <doc.hxx> 49*cdf0e10cSrcweir #include <comphelper/TypeGeneration.hxx> 50*cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp> 51*cdf0e10cSrcweir #include <com/sun/star/view/DocumentZoomType.hpp> 52*cdf0e10cSrcweir #include <comphelper/ChainablePropertySetInfo.hxx> 53*cdf0e10cSrcweir #include <edtwin.hxx> 54*cdf0e10cSrcweir #include <rtl/ustrbuf.hxx> 55*cdf0e10cSrcweir #include <tools/urlobj.hxx> 56*cdf0e10cSrcweir 57*cdf0e10cSrcweir using namespace ::com::sun::star; 58*cdf0e10cSrcweir using namespace ::com::sun::star::uno; 59*cdf0e10cSrcweir using namespace ::com::sun::star::beans; 60*cdf0e10cSrcweir using namespace ::com::sun::star::lang; 61*cdf0e10cSrcweir using namespace ::comphelper; 62*cdf0e10cSrcweir using ::rtl::OUString; 63*cdf0e10cSrcweir using ::rtl::OUStringBuffer; 64*cdf0e10cSrcweir 65*cdf0e10cSrcweir enum SwViewSettingsPropertyHandles 66*cdf0e10cSrcweir { 67*cdf0e10cSrcweir HANDLE_VIEWSET_ANNOTATIONS, 68*cdf0e10cSrcweir HANDLE_VIEWSET_BREAKS, 69*cdf0e10cSrcweir HANDLE_VIEWSET_DRAWINGS, 70*cdf0e10cSrcweir HANDLE_VIEWSET_FIELD_COMMANDS, 71*cdf0e10cSrcweir HANDLE_VIEWSET_FOOTNOTE_BACKGROUND, 72*cdf0e10cSrcweir HANDLE_VIEWSET_GRAPHICS, 73*cdf0e10cSrcweir HANDLE_VIEWSET_HIDDEN_CHARACTERS, 74*cdf0e10cSrcweir HANDLE_VIEWSET_HIDDEN_PARAGRAPHS, 75*cdf0e10cSrcweir HANDLE_VIEWSET_HIDDEN_TEXT, 76*cdf0e10cSrcweir HANDLE_VIEWSET_HRULER, 77*cdf0e10cSrcweir HANDLE_VIEWSET_HSCROLL, 78*cdf0e10cSrcweir HANDLE_VIEWSET_INDEX_MARK_BACKGROUND, 79*cdf0e10cSrcweir HANDLE_VIEWSET_NONPRINTING_CHARACTERS, 80*cdf0e10cSrcweir HANDLE_VIEWSET_ONLINE_LAYOUT, 81*cdf0e10cSrcweir HANDLE_VIEWSET_PARA_BREAKS, 82*cdf0e10cSrcweir HANDLE_VIEWSET_PROTECTED_SPACES, 83*cdf0e10cSrcweir HANDLE_VIEWSET_SOFT_HYPHENS, 84*cdf0e10cSrcweir HANDLE_VIEWSET_SPACES, 85*cdf0e10cSrcweir HANDLE_VIEWSET_TABLE_BOUNDARIES, 86*cdf0e10cSrcweir HANDLE_VIEWSET_TABLES, 87*cdf0e10cSrcweir HANDLE_VIEWSET_TABSTOPS, 88*cdf0e10cSrcweir HANDLE_VIEWSET_TEXT_BOUNDARIES, 89*cdf0e10cSrcweir HANDLE_VIEWSET_TEXT_FIELD_BACKGROUND, 90*cdf0e10cSrcweir HANDLE_VIEWSET_VRULER, 91*cdf0e10cSrcweir HANDLE_VIEWSET_VSCROLL, 92*cdf0e10cSrcweir HANDLE_VIEWSET_SMOOTH_SCROLLING, 93*cdf0e10cSrcweir HANDLE_VIEWSET_SOLID_MARK_HANDLES, 94*cdf0e10cSrcweir HANDLE_VIEWSET_ZOOM_TYPE, 95*cdf0e10cSrcweir HANDLE_VIEWSET_ZOOM, 96*cdf0e10cSrcweir HANDLE_VIEWSET_PREVENT_TIPS, 97*cdf0e10cSrcweir HANDLE_VIEWSET_HELP_URL, 98*cdf0e10cSrcweir HANDLE_VIEWSET_VRULER_RIGHT, 99*cdf0e10cSrcweir HANDLE_VIEWSET_SHOW_RULER, 100*cdf0e10cSrcweir HANDLE_VIEWSET_IS_RASTER_VISIBLE, 101*cdf0e10cSrcweir HANDLE_VIEWSET_IS_SNAP_TO_RASTER, 102*cdf0e10cSrcweir HANDLE_VIEWSET_RASTER_RESOLUTION_X, 103*cdf0e10cSrcweir HANDLE_VIEWSET_RASTER_RESOLUTION_Y, 104*cdf0e10cSrcweir HANDLE_VIEWSET_RASTER_SUBDIVISION_X, 105*cdf0e10cSrcweir HANDLE_VIEWSET_RASTER_SUBDIVISION_Y, 106*cdf0e10cSrcweir HANDLE_VIEWSET_HORI_RULER_METRIC, 107*cdf0e10cSrcweir HANDLE_VIEWSET_VERT_RULER_METRIC 108*cdf0e10cSrcweir }; 109*cdf0e10cSrcweir enum SwPrintSettingsPropertyHandles 110*cdf0e10cSrcweir { 111*cdf0e10cSrcweir HANDLE_PRINTSET_ANNOTATION_MODE, 112*cdf0e10cSrcweir HANDLE_PRINTSET_BLACK_FONTS, 113*cdf0e10cSrcweir HANDLE_PRINTSET_CONTROLS, 114*cdf0e10cSrcweir HANDLE_PRINTSET_DRAWINGS, 115*cdf0e10cSrcweir HANDLE_PRINTSET_GRAPHICS, 116*cdf0e10cSrcweir HANDLE_PRINTSET_LEFT_PAGES, 117*cdf0e10cSrcweir HANDLE_PRINTSET_PAGE_BACKGROUND, 118*cdf0e10cSrcweir HANDLE_PRINTSET_PROSPECT, 119*cdf0e10cSrcweir HANDLE_PRINTSET_REVERSED, 120*cdf0e10cSrcweir HANDLE_PRINTSET_RIGHT_PAGES, 121*cdf0e10cSrcweir HANDLE_PRINTSET_FAX_NAME, 122*cdf0e10cSrcweir HANDLE_PRINTSET_PAPER_FROM_SETUP, 123*cdf0e10cSrcweir HANDLE_PRINTSET_TABLES, 124*cdf0e10cSrcweir HANDLE_PRINTSET_SINGLE_JOBS, 125*cdf0e10cSrcweir HANDLE_PRINTSET_EMPTY_PAGES, 126*cdf0e10cSrcweir HANDLE_PRINTSET_PROSPECT_RTL, 127*cdf0e10cSrcweir HANDLE_PRINTSET_PLACEHOLDER, 128*cdf0e10cSrcweir HANDLE_PRINTSET_HIDDEN_TEXT 129*cdf0e10cSrcweir }; 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir static ChainablePropertySetInfo * lcl_createViewSettingsInfo() 132*cdf0e10cSrcweir { 133*cdf0e10cSrcweir static PropertyInfo aViewSettingsMap_Impl[] = 134*cdf0e10cSrcweir { 135*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "HelpURL" ), HANDLE_VIEWSET_HELP_URL , CPPUTYPE_OUSTRING, PROPERTY_NONE, 0}, 136*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "HorizontalRulerMetric"),HANDLE_VIEWSET_HORI_RULER_METRIC , CPPUTYPE_INT32, PROPERTY_NONE, 0}, 137*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "IsRasterVisible"), HANDLE_VIEWSET_IS_RASTER_VISIBLE, CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 138*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "IsSnapToRaster"), HANDLE_VIEWSET_IS_SNAP_TO_RASTER, CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 139*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "IsVertRulerRightAligned"),HANDLE_VIEWSET_VRULER_RIGHT , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 140*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PreventHelpTips" ), HANDLE_VIEWSET_PREVENT_TIPS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 141*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "RasterResolutionX"), HANDLE_VIEWSET_RASTER_RESOLUTION_X, CPPUTYPE_INT32, PROPERTY_NONE, 0}, 142*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "RasterResolutionY"), HANDLE_VIEWSET_RASTER_RESOLUTION_Y, CPPUTYPE_INT32, PROPERTY_NONE, 0}, 143*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "RasterSubdivisionX"), HANDLE_VIEWSET_RASTER_SUBDIVISION_X, CPPUTYPE_INT32, PROPERTY_NONE, 0}, 144*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "RasterSubdivisionY"), HANDLE_VIEWSET_RASTER_SUBDIVISION_Y, CPPUTYPE_INT32, PROPERTY_NONE, 0}, 145*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowAnnotations" ), HANDLE_VIEWSET_ANNOTATIONS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 146*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowBreaks"), HANDLE_VIEWSET_BREAKS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 147*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowDrawings"), HANDLE_VIEWSET_DRAWINGS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 148*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowFieldCommands"), HANDLE_VIEWSET_FIELD_COMMANDS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 149*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowFootnoteBackground"),HANDLE_VIEWSET_FOOTNOTE_BACKGROUND , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 150*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowGraphics"), HANDLE_VIEWSET_GRAPHICS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 151*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowHiddenCharacters"), HANDLE_VIEWSET_HIDDEN_CHARACTERS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 152*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowHiddenParagraphs"), HANDLE_VIEWSET_HIDDEN_PARAGRAPHS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 153*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowHiddenText"), HANDLE_VIEWSET_HIDDEN_TEXT , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 154*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowHoriRuler"), HANDLE_VIEWSET_HRULER , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 155*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowHoriScrollBar"), HANDLE_VIEWSET_HSCROLL , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 156*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowIndexMarkBackground"),HANDLE_VIEWSET_INDEX_MARK_BACKGROUND, CPPUTYPE_BOOLEAN,PROPERTY_NONE, 0}, 157*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowNonprintingCharacters"),HANDLE_VIEWSET_NONPRINTING_CHARACTERS, CPPUTYPE_BOOLEAN,PROPERTY_NONE, 0}, 158*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowOnlineLayout"), HANDLE_VIEWSET_ONLINE_LAYOUT , CPPUTYPE_BOOLEAN, PropertyAttribute::MAYBEVOID, 0}, 159*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowParaBreaks"), HANDLE_VIEWSET_PARA_BREAKS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 160*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowProtectedSpaces"), HANDLE_VIEWSET_PROTECTED_SPACES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 161*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowRulers"), HANDLE_VIEWSET_SHOW_RULER , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 162*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowSoftHyphens"), HANDLE_VIEWSET_SOFT_HYPHENS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 163*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowSpaces"), HANDLE_VIEWSET_SPACES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 164*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowTableBoundaries"), HANDLE_VIEWSET_TABLE_BOUNDARIES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 165*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowTables"), HANDLE_VIEWSET_TABLES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 166*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowTabstops"), HANDLE_VIEWSET_TABSTOPS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 167*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowTextBoundaries"), HANDLE_VIEWSET_TEXT_BOUNDARIES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 168*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowTextFieldBackground"),HANDLE_VIEWSET_TEXT_FIELD_BACKGROUND, CPPUTYPE_BOOLEAN,PROPERTY_NONE, 0}, 169*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowVertRuler"), HANDLE_VIEWSET_VRULER , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 170*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ShowVertScrollBar"), HANDLE_VIEWSET_VSCROLL , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 171*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "SmoothScrolling"), HANDLE_VIEWSET_SMOOTH_SCROLLING , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 172*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "SolidMarkHandles"), HANDLE_VIEWSET_SOLID_MARK_HANDLES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 173*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "VerticalRulerMetric"), HANDLE_VIEWSET_VERT_RULER_METRIC , CPPUTYPE_INT32, PROPERTY_NONE, 0}, 174*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ZoomType"), HANDLE_VIEWSET_ZOOM_TYPE , CPPUTYPE_INT16, PROPERTY_NONE, 0}, 175*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "ZoomValue"), HANDLE_VIEWSET_ZOOM , CPPUTYPE_INT16, PROPERTY_NONE, 0}, 176*cdf0e10cSrcweir { 0, 0, 0, CPPUTYPE_UNKNOWN, 0, 0 } 177*cdf0e10cSrcweir }; 178*cdf0e10cSrcweir return new ChainablePropertySetInfo ( aViewSettingsMap_Impl ); 179*cdf0e10cSrcweir } 180*cdf0e10cSrcweir static ChainablePropertySetInfo * lcl_createPrintSettingsInfo() 181*cdf0e10cSrcweir { 182*cdf0e10cSrcweir static PropertyInfo aPrintSettingsMap_Impl[] = 183*cdf0e10cSrcweir { 184*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PrintAnnotationMode" ), HANDLE_PRINTSET_ANNOTATION_MODE , CPPUTYPE_INT16, PROPERTY_NONE, 0}, 185*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PrintBlackFonts" ), HANDLE_PRINTSET_BLACK_FONTS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 186*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PrintControls" ), HANDLE_PRINTSET_CONTROLS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 187*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PrintDrawings" ), HANDLE_PRINTSET_DRAWINGS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 188*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PrintGraphics" ), HANDLE_PRINTSET_GRAPHICS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 189*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PrintHiddenText"), HANDLE_PRINTSET_HIDDEN_TEXT , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 190*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PrintLeftPages" ), HANDLE_PRINTSET_LEFT_PAGES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 191*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PrintPageBackground" ), HANDLE_PRINTSET_PAGE_BACKGROUND , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 192*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PrintProspect" ), HANDLE_PRINTSET_PROSPECT , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 193*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PrintProspectRTL" ), HANDLE_PRINTSET_PROSPECT_RTL , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 194*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PrintReversed" ), HANDLE_PRINTSET_REVERSED , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 195*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PrintRightPages" ), HANDLE_PRINTSET_RIGHT_PAGES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 196*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PrintFaxName" ), HANDLE_PRINTSET_FAX_NAME , CPPUTYPE_OUSTRING, PROPERTY_NONE, 0}, 197*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PrintPaperFromSetup" ), HANDLE_PRINTSET_PAPER_FROM_SETUP , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 198*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PrintTables" ), HANDLE_PRINTSET_TABLES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 199*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PrintTextPlaceholder"), HANDLE_PRINTSET_PLACEHOLDER , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 200*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PrintSingleJobs" ), HANDLE_PRINTSET_SINGLE_JOBS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 201*cdf0e10cSrcweir { RTL_CONSTASCII_STRINGPARAM ( "PrintEmptyPages" ), HANDLE_PRINTSET_EMPTY_PAGES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, 202*cdf0e10cSrcweir { 0, 0, 0, CPPUTYPE_UNKNOWN, 0, 0 } 203*cdf0e10cSrcweir }; 204*cdf0e10cSrcweir return new ChainablePropertySetInfo ( aPrintSettingsMap_Impl ); 205*cdf0e10cSrcweir } 206*cdf0e10cSrcweir 207*cdf0e10cSrcweir /****************************************************************** 208*cdf0e10cSrcweir * SwXModule 209*cdf0e10cSrcweir ******************************************************************/ 210*cdf0e10cSrcweir /* -----------------30.03.99 15:10------------------- 211*cdf0e10cSrcweir * 212*cdf0e10cSrcweir * --------------------------------------------------*/ 213*cdf0e10cSrcweir Reference< uno::XInterface > SAL_CALL SwXModule_createInstance( 214*cdf0e10cSrcweir const Reference< XMultiServiceFactory > & /*rSMgr*/) throw( Exception ) 215*cdf0e10cSrcweir { 216*cdf0e10cSrcweir static Reference< uno::XInterface > xModule = (cppu::OWeakObject*)new SwXModule();; 217*cdf0e10cSrcweir return xModule; 218*cdf0e10cSrcweir } 219*cdf0e10cSrcweir /* -----------------------------17.04.01 13:11-------------------------------- 220*cdf0e10cSrcweir 221*cdf0e10cSrcweir ---------------------------------------------------------------------------*/ 222*cdf0e10cSrcweir Sequence< OUString > SAL_CALL SwXModule_getSupportedServiceNames() throw() 223*cdf0e10cSrcweir { 224*cdf0e10cSrcweir OUString sService( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.GlobalSettings")); 225*cdf0e10cSrcweir const Sequence< OUString > aSeq( &sService, 1 ); 226*cdf0e10cSrcweir return aSeq; 227*cdf0e10cSrcweir } 228*cdf0e10cSrcweir /* -----------------------------17.04.01 13:11-------------------------------- 229*cdf0e10cSrcweir 230*cdf0e10cSrcweir ---------------------------------------------------------------------------*/ 231*cdf0e10cSrcweir OUString SAL_CALL SwXModule_getImplementationName() throw() 232*cdf0e10cSrcweir { 233*cdf0e10cSrcweir return OUString( RTL_CONSTASCII_USTRINGPARAM("SwXModule" ) ); 234*cdf0e10cSrcweir } 235*cdf0e10cSrcweir /*-- 17.12.98 12:19:01--------------------------------------------------- 236*cdf0e10cSrcweir 237*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 238*cdf0e10cSrcweir SwXModule::SwXModule() : 239*cdf0e10cSrcweir pxViewSettings(0), 240*cdf0e10cSrcweir pxPrintSettings(0) 241*cdf0e10cSrcweir { 242*cdf0e10cSrcweir } 243*cdf0e10cSrcweir /*-- 17.12.98 12:19:02--------------------------------------------------- 244*cdf0e10cSrcweir 245*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 246*cdf0e10cSrcweir SwXModule::~SwXModule() 247*cdf0e10cSrcweir { 248*cdf0e10cSrcweir delete pxViewSettings; 249*cdf0e10cSrcweir delete pxPrintSettings; 250*cdf0e10cSrcweir } 251*cdf0e10cSrcweir /*-- 17.12.98 12:19:03--------------------------------------------------- 252*cdf0e10cSrcweir 253*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 254*cdf0e10cSrcweir Reference< XPropertySet > SwXModule::getViewSettings(void) throw( uno::RuntimeException ) 255*cdf0e10cSrcweir { 256*cdf0e10cSrcweir ::vos::OGuard aGuard(Application::GetSolarMutex()); 257*cdf0e10cSrcweir if(!pxViewSettings) 258*cdf0e10cSrcweir { 259*cdf0e10cSrcweir ((SwXModule*)this)->pxViewSettings = new Reference< XPropertySet > ; 260*cdf0e10cSrcweir DBG_ERROR("Web oder Text?"); 261*cdf0e10cSrcweir *pxViewSettings = static_cast < HelperBaseNoState * > ( new SwXViewSettings( sal_False, 0 ) ); 262*cdf0e10cSrcweir } 263*cdf0e10cSrcweir return *pxViewSettings; 264*cdf0e10cSrcweir } 265*cdf0e10cSrcweir /*-- 17.12.98 12:19:03--------------------------------------------------- 266*cdf0e10cSrcweir 267*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 268*cdf0e10cSrcweir Reference< XPropertySet > SwXModule::getPrintSettings(void) throw( uno::RuntimeException ) 269*cdf0e10cSrcweir { 270*cdf0e10cSrcweir ::vos::OGuard aGuard(Application::GetSolarMutex()); 271*cdf0e10cSrcweir if(!pxPrintSettings) 272*cdf0e10cSrcweir { 273*cdf0e10cSrcweir ((SwXModule*)this)->pxPrintSettings = new Reference< XPropertySet > ; 274*cdf0e10cSrcweir DBG_ERROR("Web oder Text?"); 275*cdf0e10cSrcweir *pxPrintSettings = static_cast < HelperBaseNoState * > ( new SwXPrintSettings ( PRINT_SETTINGS_MODULE ) ); 276*cdf0e10cSrcweir } 277*cdf0e10cSrcweir return *pxPrintSettings; 278*cdf0e10cSrcweir } 279*cdf0e10cSrcweir /* -----------------------------06.04.00 10:59-------------------------------- 280*cdf0e10cSrcweir 281*cdf0e10cSrcweir ---------------------------------------------------------------------------*/ 282*cdf0e10cSrcweir OUString SwXModule::getImplementationName(void) throw( RuntimeException ) 283*cdf0e10cSrcweir { 284*cdf0e10cSrcweir return SwXModule_getImplementationName(); 285*cdf0e10cSrcweir } 286*cdf0e10cSrcweir /* -----------------------------06.04.00 10:59-------------------------------- 287*cdf0e10cSrcweir 288*cdf0e10cSrcweir ---------------------------------------------------------------------------*/ 289*cdf0e10cSrcweir sal_Bool SwXModule::supportsService(const OUString& rServiceName) throw( RuntimeException ) 290*cdf0e10cSrcweir { 291*cdf0e10cSrcweir const Sequence< OUString > aNames = SwXModule_getSupportedServiceNames(); 292*cdf0e10cSrcweir for(sal_Int32 nService = 0; nService < aNames.getLength(); nService++) 293*cdf0e10cSrcweir { 294*cdf0e10cSrcweir if(aNames.getConstArray()[nService] == rServiceName) 295*cdf0e10cSrcweir return sal_True; 296*cdf0e10cSrcweir } 297*cdf0e10cSrcweir return sal_False; 298*cdf0e10cSrcweir } 299*cdf0e10cSrcweir /* -----------------------------06.04.00 10:59-------------------------------- 300*cdf0e10cSrcweir 301*cdf0e10cSrcweir ---------------------------------------------------------------------------*/ 302*cdf0e10cSrcweir Sequence< OUString > SwXModule::getSupportedServiceNames(void) throw( RuntimeException ) 303*cdf0e10cSrcweir { 304*cdf0e10cSrcweir return SwXModule_getSupportedServiceNames(); 305*cdf0e10cSrcweir } 306*cdf0e10cSrcweir 307*cdf0e10cSrcweir /****************************************************************** 308*cdf0e10cSrcweir * SwXPrintSettings 309*cdf0e10cSrcweir ******************************************************************/ 310*cdf0e10cSrcweir /*-- 17.12.98 12:54:04--------------------------------------------------- 311*cdf0e10cSrcweir 312*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 313*cdf0e10cSrcweir SwXPrintSettings::SwXPrintSettings(SwXPrintSettingsType eType, SwDoc* pDoc) 314*cdf0e10cSrcweir : ChainableHelperNoState ( lcl_createPrintSettingsInfo (), &Application::GetSolarMutex() ) 315*cdf0e10cSrcweir , meType(eType) 316*cdf0e10cSrcweir , mpPrtOpt ( NULL ) 317*cdf0e10cSrcweir , mpDoc ( pDoc ) 318*cdf0e10cSrcweir { 319*cdf0e10cSrcweir } 320*cdf0e10cSrcweir /*-- 17.12.98 12:54:05--------------------------------------------------- 321*cdf0e10cSrcweir 322*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 323*cdf0e10cSrcweir SwXPrintSettings::~SwXPrintSettings() 324*cdf0e10cSrcweir throw() 325*cdf0e10cSrcweir { 326*cdf0e10cSrcweir } 327*cdf0e10cSrcweir 328*cdf0e10cSrcweir void SwXPrintSettings::_preSetValues () 329*cdf0e10cSrcweir throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) 330*cdf0e10cSrcweir { 331*cdf0e10cSrcweir switch (meType) 332*cdf0e10cSrcweir { 333*cdf0e10cSrcweir case PRINT_SETTINGS_MODULE: 334*cdf0e10cSrcweir mpPrtOpt = SW_MOD()->GetPrtOptions( sal_False ); 335*cdf0e10cSrcweir break; 336*cdf0e10cSrcweir case PRINT_SETTINGS_WEB: 337*cdf0e10cSrcweir mpPrtOpt = SW_MOD()->GetPrtOptions( sal_True ); 338*cdf0e10cSrcweir break; 339*cdf0e10cSrcweir case PRINT_SETTINGS_DOCUMENT: 340*cdf0e10cSrcweir { 341*cdf0e10cSrcweir if (!mpDoc) 342*cdf0e10cSrcweir throw IllegalArgumentException (); 343*cdf0e10cSrcweir mpPrtOpt = const_cast< SwPrintData * >(&mpDoc->getPrintData()); 344*cdf0e10cSrcweir } 345*cdf0e10cSrcweir break; 346*cdf0e10cSrcweir } 347*cdf0e10cSrcweir } 348*cdf0e10cSrcweir 349*cdf0e10cSrcweir void SwXPrintSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, const uno::Any &rValue ) 350*cdf0e10cSrcweir throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) 351*cdf0e10cSrcweir { 352*cdf0e10cSrcweir sal_Bool bVal; 353*cdf0e10cSrcweir if ( rInfo.mnHandle != HANDLE_PRINTSET_ANNOTATION_MODE && 354*cdf0e10cSrcweir rInfo.mnHandle != HANDLE_PRINTSET_FAX_NAME ) 355*cdf0e10cSrcweir bVal = *(sal_Bool*)rValue.getValue(); 356*cdf0e10cSrcweir 357*cdf0e10cSrcweir switch( rInfo.mnHandle ) 358*cdf0e10cSrcweir { 359*cdf0e10cSrcweir case HANDLE_PRINTSET_LEFT_PAGES: 360*cdf0e10cSrcweir { 361*cdf0e10cSrcweir bVal = *(sal_Bool*)rValue.getValue(); 362*cdf0e10cSrcweir mpPrtOpt->SetPrintLeftPage(bVal); 363*cdf0e10cSrcweir } 364*cdf0e10cSrcweir break; 365*cdf0e10cSrcweir case HANDLE_PRINTSET_RIGHT_PAGES: 366*cdf0e10cSrcweir { 367*cdf0e10cSrcweir bVal = *(sal_Bool*)rValue.getValue(); 368*cdf0e10cSrcweir mpPrtOpt->SetPrintRightPage(bVal); 369*cdf0e10cSrcweir } 370*cdf0e10cSrcweir break; 371*cdf0e10cSrcweir case HANDLE_PRINTSET_REVERSED: 372*cdf0e10cSrcweir { 373*cdf0e10cSrcweir bVal = *(sal_Bool*)rValue.getValue(); 374*cdf0e10cSrcweir mpPrtOpt->SetPrintReverse(bVal); 375*cdf0e10cSrcweir } 376*cdf0e10cSrcweir break; 377*cdf0e10cSrcweir case HANDLE_PRINTSET_PROSPECT: 378*cdf0e10cSrcweir { 379*cdf0e10cSrcweir bVal = *(sal_Bool*)rValue.getValue(); 380*cdf0e10cSrcweir mpPrtOpt->SetPrintProspect(bVal); 381*cdf0e10cSrcweir } 382*cdf0e10cSrcweir break; 383*cdf0e10cSrcweir case HANDLE_PRINTSET_GRAPHICS: 384*cdf0e10cSrcweir { 385*cdf0e10cSrcweir bVal = *(sal_Bool*)rValue.getValue(); 386*cdf0e10cSrcweir mpPrtOpt->SetPrintGraphic(bVal); 387*cdf0e10cSrcweir } 388*cdf0e10cSrcweir break; 389*cdf0e10cSrcweir case HANDLE_PRINTSET_TABLES: 390*cdf0e10cSrcweir { 391*cdf0e10cSrcweir bVal = *(sal_Bool*)rValue.getValue(); 392*cdf0e10cSrcweir mpPrtOpt->SetPrintTable(bVal); 393*cdf0e10cSrcweir } 394*cdf0e10cSrcweir break; 395*cdf0e10cSrcweir case HANDLE_PRINTSET_DRAWINGS: 396*cdf0e10cSrcweir { 397*cdf0e10cSrcweir bVal = *(sal_Bool*)rValue.getValue(); 398*cdf0e10cSrcweir mpPrtOpt->SetPrintDraw(bVal); 399*cdf0e10cSrcweir } 400*cdf0e10cSrcweir break; 401*cdf0e10cSrcweir case HANDLE_PRINTSET_CONTROLS: 402*cdf0e10cSrcweir { 403*cdf0e10cSrcweir bVal = *(sal_Bool*)rValue.getValue(); 404*cdf0e10cSrcweir mpPrtOpt->SetPrintControl(bVal); 405*cdf0e10cSrcweir } 406*cdf0e10cSrcweir break; 407*cdf0e10cSrcweir case HANDLE_PRINTSET_PAGE_BACKGROUND: 408*cdf0e10cSrcweir { 409*cdf0e10cSrcweir bVal = *(sal_Bool*)rValue.getValue(); 410*cdf0e10cSrcweir mpPrtOpt->SetPrintPageBackground(bVal); 411*cdf0e10cSrcweir } 412*cdf0e10cSrcweir break; 413*cdf0e10cSrcweir case HANDLE_PRINTSET_BLACK_FONTS: 414*cdf0e10cSrcweir { 415*cdf0e10cSrcweir bVal = *(sal_Bool*)rValue.getValue(); 416*cdf0e10cSrcweir mpPrtOpt->SetPrintBlackFont(bVal); 417*cdf0e10cSrcweir } 418*cdf0e10cSrcweir break; 419*cdf0e10cSrcweir case HANDLE_PRINTSET_SINGLE_JOBS: 420*cdf0e10cSrcweir { 421*cdf0e10cSrcweir bVal = *(sal_Bool*)rValue.getValue(); 422*cdf0e10cSrcweir mpPrtOpt->SetPrintSingleJobs(bVal); 423*cdf0e10cSrcweir } 424*cdf0e10cSrcweir break; 425*cdf0e10cSrcweir case HANDLE_PRINTSET_PAPER_FROM_SETUP: 426*cdf0e10cSrcweir { 427*cdf0e10cSrcweir bVal = *(sal_Bool*)rValue.getValue(); 428*cdf0e10cSrcweir mpPrtOpt->SetPaperFromSetup(bVal); 429*cdf0e10cSrcweir } 430*cdf0e10cSrcweir break; 431*cdf0e10cSrcweir case HANDLE_PRINTSET_ANNOTATION_MODE: 432*cdf0e10cSrcweir { 433*cdf0e10cSrcweir sal_Int16 nVal = 0; 434*cdf0e10cSrcweir rValue >>= nVal; 435*cdf0e10cSrcweir if(nVal <= text::NotePrintMode_PAGE_END) 436*cdf0e10cSrcweir mpPrtOpt->SetPrintPostIts(nVal); 437*cdf0e10cSrcweir else 438*cdf0e10cSrcweir throw lang::IllegalArgumentException(); 439*cdf0e10cSrcweir } 440*cdf0e10cSrcweir break; 441*cdf0e10cSrcweir case HANDLE_PRINTSET_EMPTY_PAGES: 442*cdf0e10cSrcweir { 443*cdf0e10cSrcweir bVal = *(sal_Bool*)rValue.getValue(); 444*cdf0e10cSrcweir mpPrtOpt->SetPrintEmptyPages(bVal); 445*cdf0e10cSrcweir } 446*cdf0e10cSrcweir break; 447*cdf0e10cSrcweir case HANDLE_PRINTSET_FAX_NAME: 448*cdf0e10cSrcweir { 449*cdf0e10cSrcweir OUString sString; 450*cdf0e10cSrcweir if ( rValue >>= sString) 451*cdf0e10cSrcweir mpPrtOpt->SetFaxName(sString); 452*cdf0e10cSrcweir else 453*cdf0e10cSrcweir throw lang::IllegalArgumentException(); 454*cdf0e10cSrcweir } 455*cdf0e10cSrcweir break; 456*cdf0e10cSrcweir case HANDLE_PRINTSET_PROSPECT_RTL: 457*cdf0e10cSrcweir { 458*cdf0e10cSrcweir bVal = *(sal_Bool*)rValue.getValue(); 459*cdf0e10cSrcweir mpPrtOpt->SetPrintProspect_RTL(bVal); 460*cdf0e10cSrcweir } 461*cdf0e10cSrcweir break; 462*cdf0e10cSrcweir case HANDLE_PRINTSET_PLACEHOLDER: 463*cdf0e10cSrcweir { 464*cdf0e10cSrcweir bVal = *(sal_Bool*)rValue.getValue(); 465*cdf0e10cSrcweir mpPrtOpt->SetPrintTextPlaceholder(bVal); 466*cdf0e10cSrcweir } 467*cdf0e10cSrcweir break; 468*cdf0e10cSrcweir case HANDLE_PRINTSET_HIDDEN_TEXT: 469*cdf0e10cSrcweir { 470*cdf0e10cSrcweir bVal = *(sal_Bool*)rValue.getValue(); 471*cdf0e10cSrcweir mpPrtOpt->SetPrintHiddenText(bVal); 472*cdf0e10cSrcweir } 473*cdf0e10cSrcweir break; 474*cdf0e10cSrcweir default: 475*cdf0e10cSrcweir throw UnknownPropertyException(); 476*cdf0e10cSrcweir } 477*cdf0e10cSrcweir } 478*cdf0e10cSrcweir void SwXPrintSettings::_postSetValues () 479*cdf0e10cSrcweir throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) 480*cdf0e10cSrcweir { 481*cdf0e10cSrcweir mpPrtOpt = NULL; 482*cdf0e10cSrcweir } 483*cdf0e10cSrcweir 484*cdf0e10cSrcweir void SwXPrintSettings::_preGetValues () 485*cdf0e10cSrcweir throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) 486*cdf0e10cSrcweir { 487*cdf0e10cSrcweir switch (meType) 488*cdf0e10cSrcweir { 489*cdf0e10cSrcweir case PRINT_SETTINGS_MODULE: 490*cdf0e10cSrcweir mpPrtOpt = SW_MOD()->GetPrtOptions( sal_False ); 491*cdf0e10cSrcweir break; 492*cdf0e10cSrcweir case PRINT_SETTINGS_WEB: 493*cdf0e10cSrcweir mpPrtOpt = SW_MOD()->GetPrtOptions( sal_True ); 494*cdf0e10cSrcweir break; 495*cdf0e10cSrcweir case PRINT_SETTINGS_DOCUMENT: 496*cdf0e10cSrcweir { 497*cdf0e10cSrcweir if (!mpDoc) 498*cdf0e10cSrcweir throw IllegalArgumentException (); 499*cdf0e10cSrcweir mpPrtOpt = const_cast< SwPrintData * >(&mpDoc->getPrintData()); 500*cdf0e10cSrcweir } 501*cdf0e10cSrcweir break; 502*cdf0e10cSrcweir } 503*cdf0e10cSrcweir } 504*cdf0e10cSrcweir void SwXPrintSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, uno::Any & rValue ) 505*cdf0e10cSrcweir throw(UnknownPropertyException, WrappedTargetException ) 506*cdf0e10cSrcweir { 507*cdf0e10cSrcweir switch( rInfo.mnHandle ) 508*cdf0e10cSrcweir { 509*cdf0e10cSrcweir case HANDLE_PRINTSET_LEFT_PAGES: 510*cdf0e10cSrcweir rValue <<= mpPrtOpt->IsPrintLeftPage(); 511*cdf0e10cSrcweir break; 512*cdf0e10cSrcweir case HANDLE_PRINTSET_RIGHT_PAGES: 513*cdf0e10cSrcweir rValue <<= mpPrtOpt->IsPrintRightPage(); 514*cdf0e10cSrcweir break; 515*cdf0e10cSrcweir case HANDLE_PRINTSET_REVERSED: 516*cdf0e10cSrcweir rValue <<= mpPrtOpt->IsPrintReverse(); 517*cdf0e10cSrcweir break; 518*cdf0e10cSrcweir case HANDLE_PRINTSET_PROSPECT: 519*cdf0e10cSrcweir rValue <<= mpPrtOpt->IsPrintProspect(); 520*cdf0e10cSrcweir break; 521*cdf0e10cSrcweir case HANDLE_PRINTSET_GRAPHICS: 522*cdf0e10cSrcweir rValue <<= mpPrtOpt->IsPrintGraphic(); 523*cdf0e10cSrcweir break; 524*cdf0e10cSrcweir case HANDLE_PRINTSET_TABLES: 525*cdf0e10cSrcweir rValue <<= mpPrtOpt->IsPrintTable(); 526*cdf0e10cSrcweir break; 527*cdf0e10cSrcweir case HANDLE_PRINTSET_DRAWINGS: 528*cdf0e10cSrcweir rValue <<= mpPrtOpt->IsPrintDraw(); 529*cdf0e10cSrcweir break; 530*cdf0e10cSrcweir case HANDLE_PRINTSET_CONTROLS: 531*cdf0e10cSrcweir rValue <<= mpPrtOpt->IsPrintControl(); 532*cdf0e10cSrcweir break; 533*cdf0e10cSrcweir case HANDLE_PRINTSET_PAGE_BACKGROUND: 534*cdf0e10cSrcweir rValue <<= mpPrtOpt->IsPrintPageBackground(); 535*cdf0e10cSrcweir break; 536*cdf0e10cSrcweir case HANDLE_PRINTSET_BLACK_FONTS: 537*cdf0e10cSrcweir rValue <<= mpPrtOpt->IsPrintBlackFont(); 538*cdf0e10cSrcweir break; 539*cdf0e10cSrcweir case HANDLE_PRINTSET_SINGLE_JOBS: 540*cdf0e10cSrcweir rValue <<= mpPrtOpt->IsPrintSingleJobs(); 541*cdf0e10cSrcweir break; 542*cdf0e10cSrcweir case HANDLE_PRINTSET_EMPTY_PAGES: 543*cdf0e10cSrcweir rValue <<= mpPrtOpt->IsPrintEmptyPages(); 544*cdf0e10cSrcweir break; 545*cdf0e10cSrcweir case HANDLE_PRINTSET_PAPER_FROM_SETUP: 546*cdf0e10cSrcweir rValue <<= mpPrtOpt->IsPaperFromSetup(); 547*cdf0e10cSrcweir break; 548*cdf0e10cSrcweir case HANDLE_PRINTSET_ANNOTATION_MODE: 549*cdf0e10cSrcweir { 550*cdf0e10cSrcweir rValue <<= static_cast < sal_Int16 > ( mpPrtOpt->GetPrintPostIts() ); 551*cdf0e10cSrcweir } 552*cdf0e10cSrcweir break; 553*cdf0e10cSrcweir case HANDLE_PRINTSET_FAX_NAME : 554*cdf0e10cSrcweir { 555*cdf0e10cSrcweir rValue <<= mpPrtOpt->GetFaxName(); 556*cdf0e10cSrcweir } 557*cdf0e10cSrcweir break; 558*cdf0e10cSrcweir case HANDLE_PRINTSET_PROSPECT_RTL: 559*cdf0e10cSrcweir { 560*cdf0e10cSrcweir rValue <<= mpPrtOpt->IsPrintProspectRTL(); 561*cdf0e10cSrcweir } 562*cdf0e10cSrcweir break; 563*cdf0e10cSrcweir case HANDLE_PRINTSET_PLACEHOLDER: 564*cdf0e10cSrcweir { 565*cdf0e10cSrcweir rValue <<= mpPrtOpt->IsPrintTextPlaceholder(); 566*cdf0e10cSrcweir } 567*cdf0e10cSrcweir break; 568*cdf0e10cSrcweir case HANDLE_PRINTSET_HIDDEN_TEXT: 569*cdf0e10cSrcweir { 570*cdf0e10cSrcweir rValue <<= mpPrtOpt->IsPrintHiddenText(); 571*cdf0e10cSrcweir } 572*cdf0e10cSrcweir break; 573*cdf0e10cSrcweir default: 574*cdf0e10cSrcweir throw UnknownPropertyException(); 575*cdf0e10cSrcweir } 576*cdf0e10cSrcweir } 577*cdf0e10cSrcweir void SwXPrintSettings::_postGetValues () 578*cdf0e10cSrcweir throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) 579*cdf0e10cSrcweir { 580*cdf0e10cSrcweir mpPrtOpt = NULL; 581*cdf0e10cSrcweir } 582*cdf0e10cSrcweir /* -----------------------------06.04.00 11:02-------------------------------- 583*cdf0e10cSrcweir 584*cdf0e10cSrcweir ---------------------------------------------------------------------------*/ 585*cdf0e10cSrcweir OUString SwXPrintSettings::getImplementationName(void) throw( RuntimeException ) 586*cdf0e10cSrcweir { 587*cdf0e10cSrcweir return C2U("SwXPrintSettings"); 588*cdf0e10cSrcweir } 589*cdf0e10cSrcweir /* -----------------------------06.04.00 11:02-------------------------------- 590*cdf0e10cSrcweir 591*cdf0e10cSrcweir ---------------------------------------------------------------------------*/ 592*cdf0e10cSrcweir sal_Bool SwXPrintSettings::supportsService(const OUString& rServiceName) throw( RuntimeException ) 593*cdf0e10cSrcweir { 594*cdf0e10cSrcweir return C2U("com.sun.star.text.PrintSettings") == rServiceName; 595*cdf0e10cSrcweir } 596*cdf0e10cSrcweir /* -----------------------------06.04.00 11:02-------------------------------- 597*cdf0e10cSrcweir 598*cdf0e10cSrcweir ---------------------------------------------------------------------------*/ 599*cdf0e10cSrcweir Sequence< OUString > SwXPrintSettings::getSupportedServiceNames(void) throw( RuntimeException ) 600*cdf0e10cSrcweir { 601*cdf0e10cSrcweir Sequence< OUString > aRet(1); 602*cdf0e10cSrcweir OUString* pArray = aRet.getArray(); 603*cdf0e10cSrcweir pArray[0] = C2U("com.sun.star.text.PrintSettings"); 604*cdf0e10cSrcweir return aRet; 605*cdf0e10cSrcweir } 606*cdf0e10cSrcweir 607*cdf0e10cSrcweir 608*cdf0e10cSrcweir /****************************************************************** 609*cdf0e10cSrcweir * 610*cdf0e10cSrcweir ******************************************************************/ 611*cdf0e10cSrcweir /*-- 18.12.98 11:01:10--------------------------------------------------- 612*cdf0e10cSrcweir 613*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 614*cdf0e10cSrcweir SwXViewSettings::SwXViewSettings(sal_Bool bWebView, SwView* pVw) 615*cdf0e10cSrcweir : ChainableHelperNoState( lcl_createViewSettingsInfo (), &Application::GetSolarMutex() ) 616*cdf0e10cSrcweir , pView(pVw) 617*cdf0e10cSrcweir , mpViewOption ( NULL ) 618*cdf0e10cSrcweir , mpConstViewOption ( NULL ) 619*cdf0e10cSrcweir , bObjectValid(sal_True) 620*cdf0e10cSrcweir , bWeb(bWebView) 621*cdf0e10cSrcweir , eHRulerUnit( FUNIT_CM ) 622*cdf0e10cSrcweir , mbApplyHRulerMetric( sal_False ) 623*cdf0e10cSrcweir , eVRulerUnit( FUNIT_CM ) 624*cdf0e10cSrcweir , mbApplyVRulerMetric( sal_False ) 625*cdf0e10cSrcweir { 626*cdf0e10cSrcweir // This property only exists if we have a view (ie, not at the module ) 627*cdf0e10cSrcweir if ( !pView ) 628*cdf0e10cSrcweir mpInfo->remove ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "HelpURL" ) ) ); 629*cdf0e10cSrcweir 630*cdf0e10cSrcweir } 631*cdf0e10cSrcweir /*-- 18.12.98 11:01:10--------------------------------------------------- 632*cdf0e10cSrcweir 633*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 634*cdf0e10cSrcweir SwXViewSettings::~SwXViewSettings() 635*cdf0e10cSrcweir throw() 636*cdf0e10cSrcweir { 637*cdf0e10cSrcweir 638*cdf0e10cSrcweir } 639*cdf0e10cSrcweir void SwXViewSettings::_preSetValues () 640*cdf0e10cSrcweir throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) 641*cdf0e10cSrcweir { 642*cdf0e10cSrcweir const SwViewOption* pVOpt = 0; 643*cdf0e10cSrcweir if(pView) 644*cdf0e10cSrcweir { 645*cdf0e10cSrcweir if(!IsValid()) 646*cdf0e10cSrcweir return; 647*cdf0e10cSrcweir pVOpt = pView->GetWrtShell().GetViewOptions(); 648*cdf0e10cSrcweir } 649*cdf0e10cSrcweir else 650*cdf0e10cSrcweir pVOpt = SW_MOD()->GetViewOption(bWeb); 651*cdf0e10cSrcweir 652*cdf0e10cSrcweir mpViewOption = new SwViewOption (*pVOpt); 653*cdf0e10cSrcweir mbApplyZoom = sal_False; 654*cdf0e10cSrcweir if(pView) 655*cdf0e10cSrcweir mpViewOption->SetStarOneSetting(sal_True); 656*cdf0e10cSrcweir } 657*cdf0e10cSrcweir void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, const uno::Any &rValue ) 658*cdf0e10cSrcweir throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) 659*cdf0e10cSrcweir { 660*cdf0e10cSrcweir sal_Bool bVal = HANDLE_VIEWSET_ZOOM != rInfo.mnHandle ? 661*cdf0e10cSrcweir *(sal_Bool*)rValue.getValue() : sal_False; 662*cdf0e10cSrcweir // the API flag should not be set to the application's view settings 663*cdf0e10cSrcweir switch( rInfo.mnHandle ) 664*cdf0e10cSrcweir { 665*cdf0e10cSrcweir case HANDLE_VIEWSET_SHOW_RULER : mpViewOption->SetViewAnyRuler(bVal); break; 666*cdf0e10cSrcweir case HANDLE_VIEWSET_HRULER : mpViewOption->SetViewHRuler(bVal); break; 667*cdf0e10cSrcweir case HANDLE_VIEWSET_VRULER : mpViewOption->SetViewVRuler(bVal);break; 668*cdf0e10cSrcweir case HANDLE_VIEWSET_VRULER_RIGHT : mpViewOption->SetVRulerRight(bVal);break; 669*cdf0e10cSrcweir case HANDLE_VIEWSET_HSCROLL : mpViewOption->SetViewHScrollBar(bVal);break; 670*cdf0e10cSrcweir case HANDLE_VIEWSET_VSCROLL : mpViewOption->SetViewVScrollBar(bVal);break; 671*cdf0e10cSrcweir case HANDLE_VIEWSET_GRAPHICS : mpViewOption->SetGraphic(bVal);break; 672*cdf0e10cSrcweir case HANDLE_VIEWSET_TABLES : mpViewOption->SetTable(bVal); break; 673*cdf0e10cSrcweir case HANDLE_VIEWSET_DRAWINGS : mpViewOption->SetDraw(bVal); break; 674*cdf0e10cSrcweir case HANDLE_VIEWSET_FIELD_COMMANDS : mpViewOption->SetFldName(bVal); break; 675*cdf0e10cSrcweir case HANDLE_VIEWSET_ANNOTATIONS : mpViewOption->SetPostIts(bVal); break; 676*cdf0e10cSrcweir case HANDLE_VIEWSET_INDEX_MARK_BACKGROUND : mpViewOption->SetAppearanceFlag(VIEWOPT_FIELD_SHADINGS, bVal, sal_True); break; 677*cdf0e10cSrcweir case HANDLE_VIEWSET_NONPRINTING_CHARACTERS: mpViewOption->SetViewMetaChars( bVal ); break; 678*cdf0e10cSrcweir case HANDLE_VIEWSET_FOOTNOTE_BACKGROUND : mpViewOption->SetAppearanceFlag(VIEWOPT_FIELD_SHADINGS, bVal, sal_True); break; 679*cdf0e10cSrcweir case HANDLE_VIEWSET_TEXT_FIELD_BACKGROUND : mpViewOption->SetAppearanceFlag(VIEWOPT_FIELD_SHADINGS, bVal, sal_True); break; 680*cdf0e10cSrcweir case HANDLE_VIEWSET_PARA_BREAKS : mpViewOption->SetParagraph(bVal); break; 681*cdf0e10cSrcweir case HANDLE_VIEWSET_SOFT_HYPHENS : mpViewOption->SetSoftHyph(bVal); break; 682*cdf0e10cSrcweir case HANDLE_VIEWSET_SPACES : mpViewOption->SetBlank(bVal); break; 683*cdf0e10cSrcweir case HANDLE_VIEWSET_PROTECTED_SPACES : mpViewOption->SetHardBlank(bVal); break; 684*cdf0e10cSrcweir case HANDLE_VIEWSET_TABSTOPS : mpViewOption->SetTab(bVal); break; 685*cdf0e10cSrcweir case HANDLE_VIEWSET_BREAKS : mpViewOption->SetLineBreak(bVal); break; 686*cdf0e10cSrcweir case HANDLE_VIEWSET_HIDDEN_TEXT : mpViewOption->SetShowHiddenField(bVal); break; 687*cdf0e10cSrcweir case HANDLE_VIEWSET_HIDDEN_CHARACTERS : mpViewOption->SetShowHiddenChar(bVal); break; 688*cdf0e10cSrcweir case HANDLE_VIEWSET_HIDDEN_PARAGRAPHS : mpViewOption->SetShowHiddenPara(bVal); break; 689*cdf0e10cSrcweir case HANDLE_VIEWSET_TABLE_BOUNDARIES : mpViewOption->SetAppearanceFlag(VIEWOPT_TABLE_BOUNDARIES, bVal, sal_True); break; 690*cdf0e10cSrcweir case HANDLE_VIEWSET_TEXT_BOUNDARIES : mpViewOption->SetDocBoundaries(bVal); break; 691*cdf0e10cSrcweir case HANDLE_VIEWSET_SMOOTH_SCROLLING : mpViewOption->SetSmoothScroll(bVal); break; 692*cdf0e10cSrcweir case HANDLE_VIEWSET_SOLID_MARK_HANDLES : mpViewOption->SetSolidMarkHdl(bVal); break; 693*cdf0e10cSrcweir case HANDLE_VIEWSET_PREVENT_TIPS : mpViewOption->SetPreventTips(bVal); break; 694*cdf0e10cSrcweir case HANDLE_VIEWSET_IS_RASTER_VISIBLE : mpViewOption->SetGridVisible(bVal); break; 695*cdf0e10cSrcweir case HANDLE_VIEWSET_IS_SNAP_TO_RASTER : mpViewOption->SetSnap(bVal); break; 696*cdf0e10cSrcweir case HANDLE_VIEWSET_RASTER_RESOLUTION_X : 697*cdf0e10cSrcweir { 698*cdf0e10cSrcweir sal_Int32 nTmp = 0; 699*cdf0e10cSrcweir if(!(rValue >>= nTmp) || nTmp < 10) 700*cdf0e10cSrcweir throw IllegalArgumentException(); 701*cdf0e10cSrcweir Size aSize( mpViewOption->GetSnapSize() ); 702*cdf0e10cSrcweir aSize.Width() = MM100_TO_TWIP( nTmp ); 703*cdf0e10cSrcweir mpViewOption->SetSnapSize( aSize ); 704*cdf0e10cSrcweir } 705*cdf0e10cSrcweir break; 706*cdf0e10cSrcweir case HANDLE_VIEWSET_RASTER_RESOLUTION_Y : 707*cdf0e10cSrcweir { 708*cdf0e10cSrcweir sal_Int32 nTmp = 0; 709*cdf0e10cSrcweir if(!(rValue >>= nTmp) || nTmp < 10) 710*cdf0e10cSrcweir throw IllegalArgumentException(); 711*cdf0e10cSrcweir Size aSize( mpViewOption->GetSnapSize() ); 712*cdf0e10cSrcweir aSize.Height() = MM100_TO_TWIP( nTmp ); 713*cdf0e10cSrcweir mpViewOption->SetSnapSize( aSize ); 714*cdf0e10cSrcweir } 715*cdf0e10cSrcweir break; 716*cdf0e10cSrcweir case HANDLE_VIEWSET_RASTER_SUBDIVISION_X : 717*cdf0e10cSrcweir { 718*cdf0e10cSrcweir sal_Int32 nTmp = 0; 719*cdf0e10cSrcweir if(!(rValue >>= nTmp) || !(0 <= nTmp && nTmp < 100)) 720*cdf0e10cSrcweir throw IllegalArgumentException(); 721*cdf0e10cSrcweir mpViewOption->SetDivisionX( (short) nTmp ); 722*cdf0e10cSrcweir } 723*cdf0e10cSrcweir break; 724*cdf0e10cSrcweir case HANDLE_VIEWSET_RASTER_SUBDIVISION_Y : 725*cdf0e10cSrcweir { 726*cdf0e10cSrcweir sal_Int32 nTmp = 0; 727*cdf0e10cSrcweir if(!(rValue >>= nTmp) || !(0 <= nTmp && nTmp < 100)) 728*cdf0e10cSrcweir throw IllegalArgumentException(); 729*cdf0e10cSrcweir mpViewOption->SetDivisionY( (short) nTmp ); 730*cdf0e10cSrcweir } 731*cdf0e10cSrcweir break; 732*cdf0e10cSrcweir case HANDLE_VIEWSET_ZOOM : 733*cdf0e10cSrcweir { 734*cdf0e10cSrcweir sal_Int16 nZoom = 0; 735*cdf0e10cSrcweir if(!(rValue >>= nZoom) || nZoom > 1000 || nZoom < 5) 736*cdf0e10cSrcweir throw lang::IllegalArgumentException(); 737*cdf0e10cSrcweir mpViewOption->SetZoom((sal_uInt16)nZoom); 738*cdf0e10cSrcweir mbApplyZoom = sal_True; 739*cdf0e10cSrcweir } 740*cdf0e10cSrcweir break; 741*cdf0e10cSrcweir case HANDLE_VIEWSET_ZOOM_TYPE: 742*cdf0e10cSrcweir { 743*cdf0e10cSrcweir sal_Int16 nZoom = 0; 744*cdf0e10cSrcweir if(!(rValue >>= nZoom)) 745*cdf0e10cSrcweir throw IllegalArgumentException(); 746*cdf0e10cSrcweir SvxZoomType eZoom = (SvxZoomType)USHRT_MAX; 747*cdf0e10cSrcweir switch (nZoom) 748*cdf0e10cSrcweir { 749*cdf0e10cSrcweir case view::DocumentZoomType::OPTIMAL: 750*cdf0e10cSrcweir eZoom = SVX_ZOOM_OPTIMAL; 751*cdf0e10cSrcweir break; 752*cdf0e10cSrcweir case view::DocumentZoomType::PAGE_WIDTH: 753*cdf0e10cSrcweir eZoom = SVX_ZOOM_PAGEWIDTH; 754*cdf0e10cSrcweir break; 755*cdf0e10cSrcweir case view::DocumentZoomType::ENTIRE_PAGE: 756*cdf0e10cSrcweir eZoom = SVX_ZOOM_WHOLEPAGE; 757*cdf0e10cSrcweir break; 758*cdf0e10cSrcweir case view::DocumentZoomType::BY_VALUE: 759*cdf0e10cSrcweir eZoom = SVX_ZOOM_PERCENT; 760*cdf0e10cSrcweir break; 761*cdf0e10cSrcweir case view::DocumentZoomType::PAGE_WIDTH_EXACT: 762*cdf0e10cSrcweir eZoom = SVX_ZOOM_PAGEWIDTH_NOBORDER; 763*cdf0e10cSrcweir break; 764*cdf0e10cSrcweir default: 765*cdf0e10cSrcweir throw IllegalArgumentException( 766*cdf0e10cSrcweir ::rtl::OUString::createFromAscii( 767*cdf0e10cSrcweir "SwXViewSettings: invalid zoom type"), 0, 0); 768*cdf0e10cSrcweir break; 769*cdf0e10cSrcweir } 770*cdf0e10cSrcweir if(eZoom < USHRT_MAX) 771*cdf0e10cSrcweir { 772*cdf0e10cSrcweir mpViewOption->SetZoomType( eZoom ); 773*cdf0e10cSrcweir mbApplyZoom = sal_True; 774*cdf0e10cSrcweir } 775*cdf0e10cSrcweir } 776*cdf0e10cSrcweir break; 777*cdf0e10cSrcweir case HANDLE_VIEWSET_ONLINE_LAYOUT : 778*cdf0e10cSrcweir { 779*cdf0e10cSrcweir if( pView && !bVal != !pView->GetWrtShell().GetViewOptions()->getBrowseMode() ) 780*cdf0e10cSrcweir { 781*cdf0e10cSrcweir SwViewOption aOpt( *pView->GetWrtShell().GetViewOptions() ); 782*cdf0e10cSrcweir aOpt.setBrowseMode( bVal ); 783*cdf0e10cSrcweir pView->GetWrtShell().ApplyViewOptions( aOpt ); 784*cdf0e10cSrcweir pView->RecheckBrowseMode(); 785*cdf0e10cSrcweir 786*cdf0e10cSrcweir // must be set in mpViewOption as this will overwrite settings in _post! 787*cdf0e10cSrcweir mpViewOption->setBrowseMode( bVal ); 788*cdf0e10cSrcweir 789*cdf0e10cSrcweir // disable multiple layout 790*cdf0e10cSrcweir pView->GetDocShell()->ToggleBrowserMode(bVal, pView ); 791*cdf0e10cSrcweir } 792*cdf0e10cSrcweir } 793*cdf0e10cSrcweir break; 794*cdf0e10cSrcweir case HANDLE_VIEWSET_HELP_URL : 795*cdf0e10cSrcweir { 796*cdf0e10cSrcweir if ( pView ) 797*cdf0e10cSrcweir { 798*cdf0e10cSrcweir OUString sHelpURL; 799*cdf0e10cSrcweir if ( ! ( rValue >>= sHelpURL ) ) 800*cdf0e10cSrcweir throw IllegalArgumentException(); 801*cdf0e10cSrcweir 802*cdf0e10cSrcweir INetURLObject aHID( sHelpURL ); 803*cdf0e10cSrcweir if ( aHID.GetProtocol() == INET_PROT_HID ) 804*cdf0e10cSrcweir pView->GetEditWin().SetHelpId( rtl::OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 ) ); 805*cdf0e10cSrcweir else 806*cdf0e10cSrcweir throw IllegalArgumentException (); 807*cdf0e10cSrcweir } 808*cdf0e10cSrcweir else 809*cdf0e10cSrcweir throw UnknownPropertyException(); 810*cdf0e10cSrcweir } 811*cdf0e10cSrcweir break; 812*cdf0e10cSrcweir case HANDLE_VIEWSET_HORI_RULER_METRIC: 813*cdf0e10cSrcweir case HANDLE_VIEWSET_VERT_RULER_METRIC: 814*cdf0e10cSrcweir { 815*cdf0e10cSrcweir sal_Int32 nUnit = -1; 816*cdf0e10cSrcweir if( rValue >>= nUnit ) 817*cdf0e10cSrcweir switch( nUnit ) 818*cdf0e10cSrcweir { 819*cdf0e10cSrcweir case FUNIT_MM: 820*cdf0e10cSrcweir case FUNIT_CM: 821*cdf0e10cSrcweir case FUNIT_POINT: 822*cdf0e10cSrcweir case FUNIT_PICA: 823*cdf0e10cSrcweir case FUNIT_INCH: 824*cdf0e10cSrcweir if( rInfo.mnHandle == HANDLE_VIEWSET_HORI_RULER_METRIC ) 825*cdf0e10cSrcweir { 826*cdf0e10cSrcweir eHRulerUnit = nUnit; 827*cdf0e10cSrcweir mbApplyHRulerMetric = sal_True; 828*cdf0e10cSrcweir } 829*cdf0e10cSrcweir else 830*cdf0e10cSrcweir { 831*cdf0e10cSrcweir eVRulerUnit = nUnit; 832*cdf0e10cSrcweir mbApplyVRulerMetric = sal_True; 833*cdf0e10cSrcweir } 834*cdf0e10cSrcweir break; 835*cdf0e10cSrcweir default: 836*cdf0e10cSrcweir throw IllegalArgumentException(); 837*cdf0e10cSrcweir } 838*cdf0e10cSrcweir } 839*cdf0e10cSrcweir break; 840*cdf0e10cSrcweir default: 841*cdf0e10cSrcweir throw UnknownPropertyException(); 842*cdf0e10cSrcweir } 843*cdf0e10cSrcweir } 844*cdf0e10cSrcweir 845*cdf0e10cSrcweir void SwXViewSettings::_postSetValues () 846*cdf0e10cSrcweir throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) 847*cdf0e10cSrcweir { 848*cdf0e10cSrcweir if( pView ) 849*cdf0e10cSrcweir { 850*cdf0e10cSrcweir if(mbApplyZoom ) 851*cdf0e10cSrcweir pView->SetZoom( (SvxZoomType)mpViewOption->GetZoomType(), 852*cdf0e10cSrcweir mpViewOption->GetZoom(), sal_True ); 853*cdf0e10cSrcweir if(mbApplyHRulerMetric) 854*cdf0e10cSrcweir pView->ChangeTabMetric((FieldUnit)eHRulerUnit); 855*cdf0e10cSrcweir if(mbApplyVRulerMetric) 856*cdf0e10cSrcweir pView->ChangeVLinealMetric((FieldUnit)eVRulerUnit); 857*cdf0e10cSrcweir 858*cdf0e10cSrcweir } 859*cdf0e10cSrcweir else 860*cdf0e10cSrcweir { 861*cdf0e10cSrcweir if(mbApplyHRulerMetric) 862*cdf0e10cSrcweir SW_MOD()->ApplyRulerMetric( (FieldUnit)eHRulerUnit, sal_True, bWeb ); 863*cdf0e10cSrcweir if(mbApplyVRulerMetric) 864*cdf0e10cSrcweir SW_MOD()->ApplyRulerMetric( (FieldUnit)eVRulerUnit, sal_False, bWeb ); 865*cdf0e10cSrcweir } 866*cdf0e10cSrcweir 867*cdf0e10cSrcweir 868*cdf0e10cSrcweir SW_MOD()->ApplyUsrPref( *mpViewOption, pView, pView ? VIEWOPT_DEST_VIEW_ONLY 869*cdf0e10cSrcweir : bWeb ? VIEWOPT_DEST_WEB 870*cdf0e10cSrcweir : VIEWOPT_DEST_TEXT ); 871*cdf0e10cSrcweir 872*cdf0e10cSrcweir 873*cdf0e10cSrcweir delete mpViewOption; 874*cdf0e10cSrcweir mpViewOption = NULL; 875*cdf0e10cSrcweir } 876*cdf0e10cSrcweir 877*cdf0e10cSrcweir void SwXViewSettings::_preGetValues () 878*cdf0e10cSrcweir throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) 879*cdf0e10cSrcweir { 880*cdf0e10cSrcweir if(pView) 881*cdf0e10cSrcweir { 882*cdf0e10cSrcweir if(!IsValid()) 883*cdf0e10cSrcweir return; 884*cdf0e10cSrcweir mpConstViewOption = pView->GetWrtShell().GetViewOptions(); 885*cdf0e10cSrcweir } 886*cdf0e10cSrcweir else 887*cdf0e10cSrcweir mpConstViewOption = SW_MOD()->GetViewOption(bWeb); 888*cdf0e10cSrcweir } 889*cdf0e10cSrcweir void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, uno::Any & rValue ) 890*cdf0e10cSrcweir throw(UnknownPropertyException, WrappedTargetException ) 891*cdf0e10cSrcweir { 892*cdf0e10cSrcweir sal_Bool bBool = sal_True; 893*cdf0e10cSrcweir sal_Bool bBoolVal; 894*cdf0e10cSrcweir switch( rInfo.mnHandle ) 895*cdf0e10cSrcweir { 896*cdf0e10cSrcweir case HANDLE_VIEWSET_SHOW_RULER: bBoolVal = mpConstViewOption->IsViewAnyRuler(); break; 897*cdf0e10cSrcweir case HANDLE_VIEWSET_HRULER : bBoolVal = mpConstViewOption->IsViewHRuler(sal_True); break; 898*cdf0e10cSrcweir case HANDLE_VIEWSET_VRULER : bBoolVal = mpConstViewOption->IsViewVRuler(sal_True);break; 899*cdf0e10cSrcweir case HANDLE_VIEWSET_VRULER_RIGHT : bBoolVal = mpConstViewOption->IsVRulerRight();break; 900*cdf0e10cSrcweir case HANDLE_VIEWSET_HSCROLL: bBoolVal = mpConstViewOption->IsViewHScrollBar();break; 901*cdf0e10cSrcweir case HANDLE_VIEWSET_VSCROLL: bBoolVal = mpConstViewOption->IsViewVScrollBar();break; 902*cdf0e10cSrcweir case HANDLE_VIEWSET_GRAPHICS : bBoolVal = mpConstViewOption->IsGraphic();break; 903*cdf0e10cSrcweir case HANDLE_VIEWSET_TABLES : bBoolVal = mpConstViewOption->IsTable(); break; 904*cdf0e10cSrcweir case HANDLE_VIEWSET_DRAWINGS : bBoolVal = mpConstViewOption->IsDraw(); break; 905*cdf0e10cSrcweir case HANDLE_VIEWSET_FIELD_COMMANDS : bBoolVal = mpConstViewOption->IsFldName(); break; 906*cdf0e10cSrcweir case HANDLE_VIEWSET_ANNOTATIONS : bBoolVal = mpConstViewOption->IsPostIts(); break; 907*cdf0e10cSrcweir case HANDLE_VIEWSET_INDEX_MARK_BACKGROUND : bBoolVal = SwViewOption::IsFieldShadings(); break; 908*cdf0e10cSrcweir case HANDLE_VIEWSET_NONPRINTING_CHARACTERS: bBoolVal = mpConstViewOption->IsViewMetaChars(); break; 909*cdf0e10cSrcweir case HANDLE_VIEWSET_FOOTNOTE_BACKGROUND : bBoolVal = SwViewOption::IsFieldShadings(); break; 910*cdf0e10cSrcweir case HANDLE_VIEWSET_TEXT_FIELD_BACKGROUND : bBoolVal = SwViewOption::IsFieldShadings(); break; 911*cdf0e10cSrcweir case HANDLE_VIEWSET_PARA_BREAKS : bBoolVal = mpConstViewOption->IsParagraph(sal_True); break; 912*cdf0e10cSrcweir case HANDLE_VIEWSET_SOFT_HYPHENS : bBoolVal = mpConstViewOption->IsSoftHyph(); break; 913*cdf0e10cSrcweir case HANDLE_VIEWSET_SPACES : bBoolVal = mpConstViewOption->IsBlank(sal_True); break; 914*cdf0e10cSrcweir case HANDLE_VIEWSET_PROTECTED_SPACES : bBoolVal = mpConstViewOption->IsHardBlank(); break; 915*cdf0e10cSrcweir case HANDLE_VIEWSET_TABSTOPS : bBoolVal = mpConstViewOption->IsTab(sal_True); break; 916*cdf0e10cSrcweir case HANDLE_VIEWSET_BREAKS : bBoolVal = mpConstViewOption->IsLineBreak(sal_True); break; 917*cdf0e10cSrcweir case HANDLE_VIEWSET_HIDDEN_TEXT : bBoolVal = mpConstViewOption->IsShowHiddenField(); break; 918*cdf0e10cSrcweir case HANDLE_VIEWSET_HIDDEN_CHARACTERS : bBoolVal = mpConstViewOption->IsShowHiddenChar(sal_True); break; 919*cdf0e10cSrcweir case HANDLE_VIEWSET_HIDDEN_PARAGRAPHS : bBoolVal = mpConstViewOption->IsShowHiddenPara(); break; 920*cdf0e10cSrcweir case HANDLE_VIEWSET_TABLE_BOUNDARIES : bBoolVal = SwViewOption::IsTableBoundaries(); break; 921*cdf0e10cSrcweir case HANDLE_VIEWSET_TEXT_BOUNDARIES : bBoolVal = SwViewOption::IsDocBoundaries(); break; 922*cdf0e10cSrcweir case HANDLE_VIEWSET_SMOOTH_SCROLLING : bBoolVal = mpConstViewOption->IsSmoothScroll(); break; 923*cdf0e10cSrcweir case HANDLE_VIEWSET_SOLID_MARK_HANDLES : bBoolVal = mpConstViewOption->IsSolidMarkHdl(); break; 924*cdf0e10cSrcweir case HANDLE_VIEWSET_PREVENT_TIPS : bBoolVal = mpConstViewOption->IsPreventTips(); break; 925*cdf0e10cSrcweir case HANDLE_VIEWSET_IS_RASTER_VISIBLE : bBoolVal = mpConstViewOption->IsGridVisible(); break; 926*cdf0e10cSrcweir case HANDLE_VIEWSET_IS_SNAP_TO_RASTER : bBoolVal = mpConstViewOption->IsSnap(); break; 927*cdf0e10cSrcweir case HANDLE_VIEWSET_RASTER_RESOLUTION_X : 928*cdf0e10cSrcweir bBool = sal_False; 929*cdf0e10cSrcweir rValue <<= (sal_Int32) TWIP_TO_MM100(mpConstViewOption->GetSnapSize().Width()); 930*cdf0e10cSrcweir break; 931*cdf0e10cSrcweir case HANDLE_VIEWSET_RASTER_RESOLUTION_Y : 932*cdf0e10cSrcweir bBool = sal_False; 933*cdf0e10cSrcweir rValue <<= (sal_Int32) TWIP_TO_MM100(mpConstViewOption->GetSnapSize().Height()); 934*cdf0e10cSrcweir break; 935*cdf0e10cSrcweir case HANDLE_VIEWSET_RASTER_SUBDIVISION_X : 936*cdf0e10cSrcweir bBool = sal_False; 937*cdf0e10cSrcweir rValue <<= (sal_Int32) mpConstViewOption->GetDivisionX(); 938*cdf0e10cSrcweir break; 939*cdf0e10cSrcweir case HANDLE_VIEWSET_RASTER_SUBDIVISION_Y : 940*cdf0e10cSrcweir bBool = sal_False; 941*cdf0e10cSrcweir rValue <<= (sal_Int32) mpConstViewOption->GetDivisionY(); 942*cdf0e10cSrcweir break; 943*cdf0e10cSrcweir case HANDLE_VIEWSET_ZOOM : 944*cdf0e10cSrcweir bBool = sal_False; 945*cdf0e10cSrcweir rValue <<= (sal_Int16)mpConstViewOption->GetZoom(); 946*cdf0e10cSrcweir break; 947*cdf0e10cSrcweir case HANDLE_VIEWSET_ZOOM_TYPE: 948*cdf0e10cSrcweir { 949*cdf0e10cSrcweir bBool = sal_False; 950*cdf0e10cSrcweir sal_Int16 nRet(0); 951*cdf0e10cSrcweir switch (mpConstViewOption->GetZoomType()) 952*cdf0e10cSrcweir { 953*cdf0e10cSrcweir case SVX_ZOOM_OPTIMAL: 954*cdf0e10cSrcweir nRet = view::DocumentZoomType::OPTIMAL; 955*cdf0e10cSrcweir break; 956*cdf0e10cSrcweir case SVX_ZOOM_PAGEWIDTH: 957*cdf0e10cSrcweir nRet = view::DocumentZoomType::PAGE_WIDTH; 958*cdf0e10cSrcweir break; 959*cdf0e10cSrcweir case SVX_ZOOM_WHOLEPAGE: 960*cdf0e10cSrcweir nRet = view::DocumentZoomType::ENTIRE_PAGE; 961*cdf0e10cSrcweir break; 962*cdf0e10cSrcweir case SVX_ZOOM_PERCENT: 963*cdf0e10cSrcweir nRet = view::DocumentZoomType::BY_VALUE; 964*cdf0e10cSrcweir break; 965*cdf0e10cSrcweir case SVX_ZOOM_PAGEWIDTH_NOBORDER: 966*cdf0e10cSrcweir nRet = view::DocumentZoomType::PAGE_WIDTH_EXACT; 967*cdf0e10cSrcweir break; 968*cdf0e10cSrcweir default: 969*cdf0e10cSrcweir OSL_ENSURE(false, "SwXViewSettings: invalid zoom type"); 970*cdf0e10cSrcweir break; 971*cdf0e10cSrcweir } 972*cdf0e10cSrcweir rValue <<= nRet; 973*cdf0e10cSrcweir } 974*cdf0e10cSrcweir break; 975*cdf0e10cSrcweir case HANDLE_VIEWSET_ONLINE_LAYOUT: 976*cdf0e10cSrcweir if(pView) 977*cdf0e10cSrcweir bBoolVal = pView->GetWrtShell().GetViewOptions()->getBrowseMode(); 978*cdf0e10cSrcweir break; 979*cdf0e10cSrcweir case HANDLE_VIEWSET_HELP_URL : 980*cdf0e10cSrcweir { 981*cdf0e10cSrcweir if ( pView ) 982*cdf0e10cSrcweir { 983*cdf0e10cSrcweir bBool = sal_False; 984*cdf0e10cSrcweir OUStringBuffer sHelpURL; 985*cdf0e10cSrcweir sHelpURL.appendAscii ( INET_HID_SCHEME ); 986*cdf0e10cSrcweir SwEditWin &rEditWin = pView->GetEditWin(); 987*cdf0e10cSrcweir sHelpURL.append( rtl::OStringToOUString( rEditWin.GetHelpId(), RTL_TEXTENCODING_UTF8 ) ); 988*cdf0e10cSrcweir rValue <<= sHelpURL.makeStringAndClear(); 989*cdf0e10cSrcweir } 990*cdf0e10cSrcweir else 991*cdf0e10cSrcweir throw UnknownPropertyException(); 992*cdf0e10cSrcweir } 993*cdf0e10cSrcweir break; 994*cdf0e10cSrcweir case HANDLE_VIEWSET_HORI_RULER_METRIC: 995*cdf0e10cSrcweir { 996*cdf0e10cSrcweir if ( pView ) 997*cdf0e10cSrcweir { 998*cdf0e10cSrcweir FieldUnit eUnit; 999*cdf0e10cSrcweir pView->GetHLinealMetric( eUnit ); 1000*cdf0e10cSrcweir rValue <<= (sal_Int32)eUnit; 1001*cdf0e10cSrcweir } 1002*cdf0e10cSrcweir else 1003*cdf0e10cSrcweir { 1004*cdf0e10cSrcweir const SwMasterUsrPref* pUsrPref = SW_MOD()->GetUsrPref( bWeb ); 1005*cdf0e10cSrcweir rValue <<= (sal_Int32)pUsrPref->GetHScrollMetric(); 1006*cdf0e10cSrcweir } 1007*cdf0e10cSrcweir bBool = sal_False; 1008*cdf0e10cSrcweir } 1009*cdf0e10cSrcweir break; 1010*cdf0e10cSrcweir case HANDLE_VIEWSET_VERT_RULER_METRIC: 1011*cdf0e10cSrcweir { 1012*cdf0e10cSrcweir if ( pView ) 1013*cdf0e10cSrcweir { 1014*cdf0e10cSrcweir FieldUnit eUnit; 1015*cdf0e10cSrcweir pView->GetVLinealMetric( eUnit ); 1016*cdf0e10cSrcweir rValue <<= (sal_Int32)eUnit; 1017*cdf0e10cSrcweir } 1018*cdf0e10cSrcweir else 1019*cdf0e10cSrcweir { 1020*cdf0e10cSrcweir const SwMasterUsrPref* pUsrPref = SW_MOD()->GetUsrPref( bWeb ); 1021*cdf0e10cSrcweir rValue <<= (sal_Int32)pUsrPref->GetVScrollMetric(); 1022*cdf0e10cSrcweir } 1023*cdf0e10cSrcweir bBool = sal_False; 1024*cdf0e10cSrcweir } 1025*cdf0e10cSrcweir break; 1026*cdf0e10cSrcweir default: DBG_ERROR("Diese Id gibt's nicht!"); 1027*cdf0e10cSrcweir } 1028*cdf0e10cSrcweir if( bBool ) 1029*cdf0e10cSrcweir rValue.setValue(&bBoolVal, ::getBooleanCppuType()); 1030*cdf0e10cSrcweir } 1031*cdf0e10cSrcweir void SwXViewSettings::_postGetValues () 1032*cdf0e10cSrcweir throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) 1033*cdf0e10cSrcweir { 1034*cdf0e10cSrcweir mpConstViewOption = NULL; 1035*cdf0e10cSrcweir } 1036*cdf0e10cSrcweir 1037*cdf0e10cSrcweir OUString SwXViewSettings::getImplementationName(void) throw( RuntimeException ) 1038*cdf0e10cSrcweir { 1039*cdf0e10cSrcweir return C2U("SwXViewSettings"); 1040*cdf0e10cSrcweir } 1041*cdf0e10cSrcweir 1042*cdf0e10cSrcweir sal_Bool SwXViewSettings::supportsService(const OUString& rServiceName) throw( RuntimeException ) 1043*cdf0e10cSrcweir { 1044*cdf0e10cSrcweir return C2U("com.sun.star.text.ViewSettings") == rServiceName; 1045*cdf0e10cSrcweir } 1046*cdf0e10cSrcweir 1047*cdf0e10cSrcweir Sequence< OUString > SwXViewSettings::getSupportedServiceNames(void) throw( RuntimeException ) 1048*cdf0e10cSrcweir { 1049*cdf0e10cSrcweir Sequence< OUString > aRet(1); 1050*cdf0e10cSrcweir OUString* pArray = aRet.getArray(); 1051*cdf0e10cSrcweir pArray[0] = C2U("com.sun.star.text.ViewSettings"); 1052*cdf0e10cSrcweir return aRet; 1053*cdf0e10cSrcweir } 1054*cdf0e10cSrcweir 1055