Back to index

scribus-ng  1.3.4.dfsg+svn20071115
tabpdfoptions.cpp
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /***************************************************************************
00008  *                                                                         *
00009  *   This program is free software; you can redistribute it and/or modify  *
00010  *   it under the terms of the GNU General Public License as published by  *
00011  *   the Free Software Foundation; either version 2 of the License, or     *
00012  *   (at your option) any later version.                                   *
00013  *                                                                         *
00014  ***************************************************************************/
00015 #include "tabpdfoptions.h"
00016 #include "tabpdfoptions.moc"
00017 
00018 #include <qpainter.h>
00019 #include "createrange.h"
00020 #include "pdfoptions.h"
00021 #include "prefsmanager.h"
00022 #include "scribuscore.h"
00023 #include "scconfig.h"
00024 #include "units.h"
00025 #include "usertaskstructs.h"
00026 
00027 extern QPixmap loadIcon(QString nam);
00028 #include "scribuscore.h"
00029 
00030 TabPDFOptions::TabPDFOptions(   QWidget* parent, PDFOptions & Optionen,
00031                                 const SCFonts &AllFonts,
00032                                 const ProfilesL & PDFXProfiles,
00033                                 const QMap<QString, int> & DocFonts,
00034                                 const QValueList<PDFPresentationData> & Eff,
00035                                 int unitIndex, double PageH, double PageB,
00036                                 ScribusDoc * mdoc, bool exporting )
00037        : QTabWidget( parent, "pdf" ),
00038        // Initialize all those darn pointer members so we catch unitialized
00039        // accesses. I (CR) use the following command to generate these based on
00040        // the header excerpt:
00041        //    !cut -d \* -f 2 | sed -r 's/ ?(.*);/\t\1\(0\),/g'
00042        // Public GUI member pointers:
00043        AddSec(0),
00044        Article(0),
00045        BleedBottom(0),
00046        BleedLeft(0),
00047        BleedRight(0),
00048        BleedTop(0),
00049        CheckBM(0),
00050        CheckBox1(0),
00051        CMethod(0),
00052        ClipMarg(0),
00053        ComboBind(0),
00054        Compression(0),
00055        continuousPages(0),
00056        CopySec(0),
00057        CQuality(0),
00058        doublePageLeft(0),
00059        doublePageRight(0),
00060        DSColor(0),
00061        EmbedProfs(0),
00062        EmbedProfs2(0),
00063        Encry(0),
00064        ImageP(0),
00065        IntendI(0),
00066        IntendS(0),
00067        MirrorH(0),
00068        MirrorV(0),
00069        ModifySec(0),
00070        NoEmbedded(0),
00071        OutCombo(0),
00072        Pages(0),
00073        PassOwner(0),
00074        PassUser(0),
00075        PDFVersionCombo(0),
00076        PrintProfC(0),
00077        PrintSec(0),
00078        Resolution(0),
00079        RotateDeg(0),
00080        singlePage(0),
00081        SolidPr(0),
00082        useBookmarks(0),
00083        useFullScreen(0),
00084        useLayers(0),
00085        useLayers2(0),
00086        UseLPI(0),
00087        useSpot(0),
00088        overprintMode(0),
00089        useThumbnails(0),
00090        ValC(0),
00091        // Protected members other than GUI member pointers
00092        // End GUI member pointers
00093        // Protected non-gui members
00094        PgSel(0),
00095        EffVal(Eff),
00096        // Protected GUI member pointers
00097        actionCombo(0),
00098        AllPages(0),
00099        CheckBox10(0),
00100        EDirection(0),
00101        EDirection_2(0),
00102        EDirection_2_2(0),
00103        EffectTime(0),
00104        EffectType(0),
00105        fitWindow(0),
00106        hideMenuBar(0),
00107        hideToolBar(0),
00108        InfoString(0),
00109        LPIangle(0),
00110        LPIfreq(0),
00111        LPIfunc(0),
00112        PageNr(0),
00113        PageTime(0),
00114        // End protected gui member pointers
00115        // Private member gui pointers
00116        actionLabel(0),
00117        AvailFlist(0),
00118        BleedGroup(0),
00119        BleedGroupLayout(0),
00120 //     BleedIcon(0),
00121        CBox(0),
00122        CBoxLayout(0),
00123        ColorGroup(0),
00124        ColorGroupLayout(0),
00125        ColorText1(0),
00126        Effects(0),
00127        EffectsLayout(0),
00128        EmbedFonts(0),
00129        EmbedList(0),
00130        EonAllPg(0),
00131        FromEmbed(0),
00132        FromOutline(0),
00133        GroupBox1(0),
00134        GroupBox1Layout(0),
00135        GroupBox2Layout(0),
00136        GroupBox9(0),
00137        GroupBox9Layout(0),
00138        groupDisplay(0),
00139        groupDisplayLayout(0),
00140        GroupFont(0),
00141        GroupFontLayout(0),
00142        groupJava(0),
00143        groupJavaLayout(0),
00144        groupNavigation(0),
00145        groupNavigationLayout(0),
00146        GroupPass(0),
00147        GroupPassLayout(0),
00148        GroupSecSet(0),
00149        GroupSecSetLayout(0),
00150        Layout11(0),
00151        pageNumberSelectorLayout(0),
00152        Layout11a(0),
00153        Layout13(0),
00154        Layout2(0),
00155        Layout3(0),
00156        Layout4_2(0),
00157        Layout5_2(0),
00158        Layout5_2a(0),
00159        Layout6(0),
00160        LayoutSpecial(0),
00161        LPIcolor(0),
00162        LPIgroup(0),
00163        LPIgroupLayout(0),
00164        OnlySome(0),
00165        pageLayout(0),
00166        pageLayoutLayout(0),
00167        PagePrev(0),
00168        PDFX1(0),
00169        PDFX2(0),
00170        PrintSec2(0),
00171        ProfsGroup(0),
00172        ProfsGroupLayout(0),
00173        ProfsTxt1(0),
00174        ProfsTxt2(0),
00175        ProfsTxt3(0),
00176        ProfsTxt4(0),
00177        RangeGroup(0),
00178        RangeGroupLayout(0),
00179        OutlineFonts(0),
00180        OutlineList(0),
00181        tabColor(0),
00182        tabColorLayout(0),
00183        tabFonts(0),
00184        tabGeneral(0),
00185        tabLayout(0),
00186        tabLayout_3(0),
00187        tabLayout_5(0),
00188        tabOptionsGridLayout(0),
00189        tabPDFX(0),
00190        tabPDFXLayout(0),
00191        tabPresentation(0),
00192        tabSecurity(0),
00193        tabSecurityLayout(0),
00194        tabSpecial(0),
00195        tabSpecialLayout(0),
00196        TextCom1(0),
00197        TextCom2(0),
00198        TextFont1(0),
00199        TextFont1_2(0),
00200        TextFont1_2a(0),
00201        TextLabel1(0),
00202        TextLabel1e(0),
00203        TextLabel1x(0),
00204        TextLabel2(0),
00205        TextLabel2e(0),
00206        TextLabel3(0),
00207        TextLabel3e(0),
00208        TextLabel4e(0),
00209        TextLabel5e(0),
00210        TextLabel6e(0),
00211        textLPI1(0),
00212        textLPI2(0),
00213        textLPI3(0),
00214        TextSec1(0),
00215        TextSec2(0),
00216        pageNrButton(0),
00217        ToEmbed(0),
00218        ToOutline(0),
00219        useViewDefault(0),
00220        X3Group(0),
00221        X3GroupLayout(0),
00222        // end protected member gui pointers
00223        // Private members
00224        unit(unitGetSuffixFromIndex(unitIndex)),
00225        precision(unitGetPrecisionFromIndex(unitIndex)),
00226        unitRatio(unitGetRatioFromIndex(unitIndex)),
00227        pdfExport(exporting),
00228        doc(mdoc),
00229        AllFonts(AllFonts),
00230        Opts(Optionen),
00231        pageH(PageH),
00232        pageB(PageB),
00233        cms(false)
00234 {
00235 
00236        tabGeneral = new QWidget( this, "tabGeneral" );
00237        tabLayout = new QVBoxLayout( tabGeneral );
00238        tabLayout->setSpacing( 5 );
00239        tabLayout->setMargin( 11 );
00240        Layout13 = new QHBoxLayout( 0, 0, 5, "Layout13");
00241        RangeGroup = new QButtonGroup( tabGeneral, "RangeGroup" );
00242        RangeGroup->setTitle( tr( "Export Range" ) );
00243        RangeGroup->setColumnLayout(0, Qt::Vertical );
00244        RangeGroup->layout()->setSpacing( 5 );
00245        RangeGroup->layout()->setMargin( 10 );
00246        RangeGroupLayout = new QVBoxLayout( RangeGroup->layout() );
00247        RangeGroupLayout->setAlignment( Qt::AlignTop );
00248        AllPages = new QRadioButton( tr( "&All Pages" ), RangeGroup, "AllPages" );
00249        RangeGroupLayout->addWidget( AllPages );
00250        Layout11 = new QGridLayout( 0, 1, 1, 0, 5, "Layout11");
00251        OnlySome = new QRadioButton( tr( "C&hoose Pages" ), RangeGroup, "OnlySome" );
00252        Layout11->addWidget( OnlySome, 0, 0 );
00253        pageNumberSelectorLayout = new QHBoxLayout( 0, 0, 5, "pageNumberSelectorLayout" );
00254        PageNr = new QLineEdit( RangeGroup, "PageNr" );
00255        pageNumberSelectorLayout->addWidget( PageNr );
00256        pageNrButton = new QPushButton( QString::fromUtf8("…"), RangeGroup, "PageNrButton" );
00257        pageNrButton->setPixmap(loadIcon("ellipsis.png"));
00258        pageNumberSelectorLayout->addWidget( pageNrButton );
00259        Layout11->addLayout( pageNumberSelectorLayout, 1, 0 );
00260        RangeGroupLayout->addLayout( Layout11 );
00261        RotationLayout = new QHBoxLayout( 0, 0, 5, "RotationLayout" );
00262        TextLabel3 = new QLabel( tr( "&Rotation:" ), RangeGroup, "TextLabel3" );
00263        RotationLayout->addWidget( TextLabel3 );
00264        RotateDeg = new QComboBox( true, RangeGroup, "RotateDeg" );
00265        RotateDeg->insertItem(QString::fromUtf8("0 °"));
00266        RotateDeg->insertItem(QString::fromUtf8("90 °"));
00267        RotateDeg->insertItem(QString::fromUtf8("180 °"));
00268        RotateDeg->insertItem(QString::fromUtf8("270 °"));
00269        RotateDeg->setEditable(false);
00270        TextLabel3->setBuddy(RotateDeg);
00271        RotationLayout->addWidget( RotateDeg );
00272        RangeGroupLayout->addLayout(RotationLayout);
00273        Layout11a = new QGridLayout( 0, 1, 1, 0, 5, "Layout11a");
00274        MirrorH = new QToolButton( RangeGroup, "MirrorH" );
00275        MirrorH->setPixmap(loadIcon("16/flip-object-horizontal.png"));
00276        MirrorH->setToggleButton( true );
00277        Layout11a->addWidget( MirrorH, 0, 0 );
00278        MirrorV = new QToolButton( RangeGroup, "MirrorH" );
00279        MirrorV->setPixmap(loadIcon("16/flip-object-vertical.png"));
00280        MirrorV->setToggleButton( true );
00281        Layout11a->addWidget( MirrorV, 0, 1 );
00282        RangeGroupLayout->addLayout( Layout11a );
00283        ClipMarg = new QCheckBox( tr( "Clip to Page Margins" ), RangeGroup, "ClipMarg" );
00284        RangeGroupLayout->addWidget( ClipMarg );
00285        Layout13->addWidget( RangeGroup );
00286 
00287        GroupBox1 = new QGroupBox( tr( "File Options" ), tabGeneral, "GroupBox1" );
00288        GroupBox1->setColumnLayout(0, Qt::Vertical );
00289        GroupBox1->layout()->setSpacing( 0 );
00290        GroupBox1->layout()->setMargin( 0 );
00291        GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
00292        GroupBox1Layout->setAlignment( Qt::AlignTop );
00293        GroupBox1Layout->setSpacing( 5 );
00294        GroupBox1Layout->setMargin( 10 );
00295        TextLabel1 = new QLabel( tr( "Compatibilit&y:" ), GroupBox1, "TextLabel1" );
00296        TextLabel1->setAlignment( static_cast<int>( QLabel::AlignVCenter | QLabel::AlignLeft ) );
00297        GroupBox1Layout->addWidget( TextLabel1, 0, 0 );
00298        PDFVersionCombo = new QComboBox( true, GroupBox1, "PDFVersionCombo" );
00299        PDFVersionCombo->setEditable(false);
00300        TextLabel1->setBuddy(PDFVersionCombo);
00301        PDFVersionCombo->insertItem("PDF 1.3 (Acrobat 4)");
00302        PDFVersionCombo->insertItem("PDF 1.4 (Acrobat 5)");
00303        PDFVersionCombo->insertItem("PDF 1.5 (Acrobat 6)");
00304        cms = doc ? (ScCore->haveCMS() && doc->HasCMS) : false;
00305        if (cms && (!PDFXProfiles.isEmpty()))
00306               PDFVersionCombo->insertItem("PDF/X-3");
00307        GroupBox1Layout->addMultiCellWidget( PDFVersionCombo, 0, 0, 1, 2 );
00308        TextLabel1x = new QLabel( tr( "&Binding:" ), GroupBox1, "TextLabel1" );
00309        TextLabel1x->setAlignment( static_cast<int>( QLabel::AlignVCenter | QLabel::AlignLeft ) );
00310        GroupBox1Layout->addWidget( TextLabel1x, 1, 0 );
00311        ComboBind = new QComboBox( true, GroupBox1, "ComboBind" );
00312        ComboBind->insertItem( tr("Left Margin"));
00313        ComboBind->insertItem( tr("Right Margin"));
00314        ComboBind->setEditable(false);
00315        TextLabel1x->setBuddy(ComboBind);
00316        GroupBox1Layout->addMultiCellWidget( ComboBind, 1, 1, 1, 2 );
00317        CheckBox1 = new QCheckBox( tr( "Generate &Thumbnails" ), GroupBox1, "CheckBox1" );
00318        GroupBox1Layout->addMultiCellWidget( CheckBox1, 2, 2, 0, 2 );
00319        Article = new QCheckBox( tr( "Save &Linked Text Frames as PDF Articles" ), GroupBox1, "CheckBox1" );
00320        GroupBox1Layout->addMultiCellWidget( Article, 3, 3, 0, 2 );
00321        CheckBM = new QCheckBox( tr( "&Include Bookmarks" ), GroupBox1, "E" );
00322        GroupBox1Layout->addMultiCellWidget( CheckBM, 4, 4, 0, 2 );
00323        useLayers = new QCheckBox( tr( "Include La&yers" ), GroupBox1, "LI" );
00324        GroupBox1Layout->addMultiCellWidget( useLayers, 5, 5, 0, 2 );
00325        Resolution = new QSpinBox( GroupBox1, "Resolution" );
00326        Resolution->setMaxValue( 4000 );
00327        Resolution->setMinValue( 35 );
00328        Resolution->setSuffix( tr( " dpi" ) );
00329        TextLabel2 = new QLabel( Resolution, tr( "&Resolution for EPS Graphics:" ), GroupBox1, "TextLabel2" );
00330        TextLabel2->setAlignment( static_cast<int>( QLabel::AlignVCenter | QLabel::AlignLeft ) );
00331        GroupBox1Layout->addWidget( TextLabel2, 6, 0 );
00332        GroupBox1Layout->addWidget( Resolution, 6, 1, AlignLeft );
00333        Layout13->addWidget( GroupBox1 );
00334        tabLayout->addLayout( Layout13 );
00335        Compression = new QCheckBox( tr( "Com&press Text and Vector Graphics" ), tabGeneral, "Compression" );
00336        tabLayout->addWidget( Compression );
00337        CBox = new QGroupBox( tr( "Image Compression Method" ), tabGeneral, "CBox" );
00338        CBox->setColumnLayout(0, Qt::Vertical );
00339        CBox->layout()->setSpacing( 5 );
00340        CBox->layout()->setMargin( 11 );
00341        CBoxLayout = new QGridLayout( CBox->layout() );
00342        CBoxLayout->setAlignment( Qt::AlignTop );
00343        CMethod = new QComboBox( true, CBox, "CMethod" );
00344        CMethod->clear();
00345        CMethod->insertItem( tr( "Automatic" ) );
00346        CMethod->insertItem( tr( "Lossy - JPEG" ) );
00347        CMethod->insertItem( tr( "Lossless - Zip" ) );
00348        CMethod->insertItem( tr( "None" ) );
00349        CMethod->setEditable(false);
00350        TextCom1 = new QLabel( CMethod, tr( "Compression Metho&d:" ), CBox, "TextCom1" );
00351        CBoxLayout->addWidget( TextCom1, 0, 0 );
00352        CBoxLayout->addWidget( CMethod, 0, 1 );
00353        CQuality = new QComboBox( true, CBox, "CQuality" );
00354        CQuality->clear();
00355        CQuality->insertItem( tr( "Maximum" ) );
00356        CQuality->insertItem( tr( "High" ) );
00357        CQuality->insertItem( tr( "Medium" ) );
00358        CQuality->insertItem( tr( "Low" ) );
00359        CQuality->insertItem( tr( "Minimum" ) );
00360        CQuality->setEditable(false);
00361        TextCom2 = new QLabel( CQuality, tr( "Compression &Quality:" ), CBox, "TextCom2" );
00362        CBoxLayout->addWidget( TextCom2, 1, 0 );
00363        CBoxLayout->addWidget( CQuality, 1, 1 );
00364        DSColor = new QCheckBox( tr( "Maximum Image Resolution:" ), CBox, "DSColor" );
00365        CBoxLayout->addWidget( DSColor, 2, 0 );
00366        ValC = new QSpinBox( CBox, "ValC" );
00367        ValC->setSuffix( tr( " dpi" ) );
00368        ValC->setMaxValue( 4000 );
00369        ValC->setMinValue( 35 );
00370        CBoxLayout->addWidget( ValC, 2, 1, AlignLeft );
00371        tabLayout->addWidget( CBox );
00372        insertTab( tabGeneral, tr( "&General" ) );
00373        if (doc != 0 && exporting)
00374        {
00375               tabFonts = new QWidget( this, "tabFonts" );
00376               tabLayout_3 = new QVBoxLayout( tabFonts );
00377               tabLayout_3->setSpacing( 5 );
00378               tabLayout_3->setMargin( 10 );
00379               GroupFont = new QGroupBox( tr( "Embedding" ), tabFonts, "GroupFont" );
00380               GroupFont->setColumnLayout(0, Qt::Vertical );
00381               GroupFont->layout()->setSpacing( 0 );
00382               GroupFont->layout()->setMargin( 0 );
00383               GroupFontLayout = new QHBoxLayout( GroupFont->layout() );
00384               GroupFontLayout->setAlignment( Qt::AlignTop );
00385               GroupFontLayout->setSpacing( 5 );
00386               GroupFontLayout->setMargin( 10 );
00387               Layout4_2 = new QVBoxLayout;
00388               Layout4_2->setSpacing( 5 );
00389               Layout4_2->setMargin( 0 );
00390               TextFont1 = new QLabel( tr( "Available Fonts:" ), GroupFont, "TextFont1" );
00391               Layout4_2->addWidget( TextFont1 );
00392               AvailFlist = new QListBox( GroupFont, "AvailFlist" );
00393               AvailFlist->setMinimumSize(QSize(150, 140));
00394               Layout4_2->addWidget( AvailFlist );
00395               GroupFontLayout->addLayout( Layout4_2 );
00396               Layout5_2 = new QVBoxLayout;
00397               Layout5_2->setSpacing( 5 );
00398               Layout5_2->setMargin( 0 );
00399               QSpacerItem* spacerS3a = new QSpacerItem( 20, 30, QSizePolicy::Minimum, QSizePolicy::Minimum );
00400               Layout5_2->addItem( spacerS3a );
00401               ToEmbed = new QPushButton( "", GroupFont, "ToEmbed" );
00402               ToEmbed->setPixmap(loadIcon("22/go-next.png"));
00403               Layout5_2->addWidget( ToEmbed );
00404               FromEmbed = new QPushButton( "", GroupFont, "FromEmbed" );
00405               FromEmbed->setPixmap(loadIcon("22/go-previous.png"));
00406               Layout5_2->addWidget( FromEmbed );
00407               QSpacerItem* spacerS3 = new QSpacerItem( 20, 30, QSizePolicy::Minimum, QSizePolicy::Expanding );
00408               Layout5_2->addItem( spacerS3 );
00409               GroupFontLayout->addLayout( Layout5_2 );
00410               Layout6 = new QVBoxLayout;
00411               Layout6->setSpacing( 5 );
00412               Layout6->setMargin( 0 );
00413               TextFont1_2 = new QLabel( tr( "Fonts to embed:" ), GroupFont, "TextFont1_2" );
00414               Layout6->addWidget( TextFont1_2 );
00415               EmbedList = new QListBox( GroupFont, "EmbedList" );
00416               EmbedList->setMinimumSize(QSize(150, 40));
00417               Layout6->addWidget( EmbedList );
00418 
00419               Layout5_2a = new QHBoxLayout;
00420               Layout5_2a->setSpacing( 5 );
00421               Layout5_2a->setMargin( 0 );
00422               EmbedFonts = new QPushButton( tr( "&Embed all" ), GroupFont, "EmbedFonts" );
00423               Layout5_2a->addWidget( EmbedFonts );
00424               QSpacerItem* spacerS1 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
00425               Layout5_2a->addItem( spacerS1 );
00426               ToOutline = new QPushButton( "", GroupFont, "ToOutline" );
00427               ToOutline->setPixmap(loadIcon("22/go-down.png"));
00428               Layout5_2a->addWidget( ToOutline );
00429               FromOutline = new QPushButton( "", GroupFont, "FromOutline" );
00430               FromOutline->setPixmap(loadIcon("22/go-up.png"));
00431               Layout5_2a->addWidget( FromOutline );
00432               QSpacerItem* spacerS2 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
00433               Layout5_2a->addItem( spacerS2 );
00434               Layout6->addLayout( Layout5_2a );
00435               TextFont1_2a = new QLabel( tr( "Fonts to outline:" ), GroupFont, "TextFont1_2a" );
00436               Layout6->addWidget( TextFont1_2a );
00437               OutlineList = new QListBox( GroupFont, "OutlineList" );
00438               OutlineList->setMinimumSize(QSize(150, 40));
00439               Layout6->addWidget( OutlineList );
00440               OutlineFonts = new QPushButton( tr( "&Outline all" ), GroupFont, "OutlineFonts" );
00441               Layout6->addWidget( OutlineFonts );
00442               GroupFontLayout->addLayout( Layout6 );
00443               tabLayout_3->addWidget( GroupFont );
00444               insertTab( tabFonts, tr( "&Fonts" ) );
00445               tabPresentation = new QWidget( this, "tabPresentation" );
00446               tabLayout_5 = new QGridLayout( tabPresentation );
00447               tabLayout_5->setSpacing( 5 );
00448               tabLayout_5->setMargin( 11 );
00449               CheckBox10 = new QCheckBox( tr( "Enable &Presentation Effects" ), tabPresentation, "CheckBox10" );
00450               tabLayout_5->addMultiCellWidget( CheckBox10, 0, 0, 0, 1 );
00451               Pages = new QListBox( tabPresentation, "Pages" );
00452               Pages->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, Pages->sizePolicy().hasHeightForWidth() ) );
00453               tabLayout_5->addWidget( Pages, 1, 0 );
00454               PagePrev = new QCheckBox( tr( "Show Page Pre&views" ), tabPresentation, "CheckBox10" );
00455               tabLayout_5->addWidget( PagePrev, 2, 0 );
00456               Effects = new QGroupBox( tr( "Effects" ), tabPresentation, "Effects" );
00457               Effects->setColumnLayout(0, Qt::Vertical );
00458               Effects->layout()->setSpacing( 0 );
00459               Effects->layout()->setMargin( 0 );
00460               EffectsLayout = new QGridLayout( Effects->layout() );
00461               EffectsLayout->setAlignment( Qt::AlignTop );
00462               EffectsLayout->setSpacing( 5 );
00463               EffectsLayout->setMargin( 11 );
00464               TextLabel1e = new QLabel( tr( "&Display Duration:" ), Effects, "TextLabel1_2" );
00465               EffectsLayout->addWidget( TextLabel1e, 0, 0 );
00466               TextLabel2e = new QLabel( tr( "Effec&t Duration:" ), Effects, "TextLabel2_2" );
00467               EffectsLayout->addWidget( TextLabel2e, 1, 0 );
00468               TextLabel3e = new QLabel( tr( "Effect T&ype:" ), Effects, "TextLabel3_2" );
00469               EffectsLayout->addWidget( TextLabel3e, 2, 0 );
00470               TextLabel4e = new QLabel( tr( "&Moving Lines:" ), Effects, "TextLabel4_2" );
00471               EffectsLayout->addWidget( TextLabel4e, 3, 0 );
00472               TextLabel5e = new QLabel( tr( "F&rom the:" ), Effects, "TextLabel6" );
00473               EffectsLayout->addWidget( TextLabel5e, 4, 0 );
00474               TextLabel6e = new QLabel( tr( "D&irection:" ), Effects, "TextLabel5" );
00475               EffectsLayout->addWidget( TextLabel6e, 5, 0 );
00476               PageTime = new QSpinBox( Effects, "PageTime" );
00477               PageTime->setSuffix( tr( " sec" ) );
00478               PageTime->setMaxValue( 3600 );
00479               PageTime->setMinValue( 0 );
00480               TextLabel1e->setBuddy(PageTime);
00481               EffectsLayout->addWidget( PageTime, 0, 1 );
00482               EffectTime = new QSpinBox( Effects, "EffectTime" );
00483               EffectTime->setSuffix( tr( " sec" ) );
00484               EffectTime->setMaxValue( 3600 );
00485               EffectTime->setMinValue( 1 );
00486               TextLabel2e->setBuddy(EffectTime);
00487               EffectsLayout->addWidget( EffectTime, 1, 1 );
00488               EffectType = new QComboBox( true, Effects, "EffectType" );
00489               QString tmpc[] = { tr("No Effect"), tr("Blinds"), tr("Box"), tr("Dissolve"), tr("Glitter"), tr("Split"), tr("Wipe")};
00490               size_t ar = sizeof(tmpc) / sizeof(*tmpc);
00491               for (uint a = 0; a < ar; ++a)
00492                      EffectType->insertItem(tmpc[a]);
00493               EffectType->setEditable(false);
00494               TextLabel3e->setBuddy(EffectType);
00495               EffectsLayout->addWidget( EffectType, 2, 1 );
00496               EDirection = new QComboBox( true, Effects, "EDirection" );
00497               EDirection->insertItem( tr( "Horizontal" ) );
00498               EDirection->insertItem( tr( "Vertical" ) );
00499               EDirection->setEditable(false);
00500               TextLabel4e->setBuddy(EDirection);
00501               EffectsLayout->addWidget( EDirection, 3, 1 );
00502               EDirection_2 = new QComboBox( true, Effects, "EDirection_2" );
00503               EDirection_2->insertItem( tr( "Inside" ) );
00504               EDirection_2->insertItem( tr( "Outside" ) );
00505               EDirection_2->setEditable(false);
00506               TextLabel5e->setBuddy(EDirection_2);
00507               EffectsLayout->addWidget( EDirection_2, 4, 1 );
00508               EDirection_2_2 = new QComboBox( true, Effects, "EDirection_2_2" );
00509               QString tmp_ed[] = { tr("Left to Right"), tr("Top to Bottom"), tr("Bottom to Top"), tr("Right to Left"),
00510                                    tr("Top-left to Bottom-Right")};
00511               size_t ar_ed = sizeof(tmp_ed) / sizeof(*tmp_ed);
00512               for (uint a = 0; a < ar_ed; ++a)
00513                      EDirection_2_2->insertItem(tmp_ed[a]);
00514               EDirection_2_2->setEditable(false);
00515               TextLabel6e->setBuddy(EDirection_2_2);
00516               EffectsLayout->addWidget( EDirection_2_2, 5, 1 );
00517               EonAllPg = new QPushButton( tr( "&Apply Effect on all Pages" ), Effects, "Eon" );
00518               EffectsLayout->addMultiCellWidget( EonAllPg, 6, 6, 0, 1 );
00519               tabLayout_5->addMultiCellWidget( Effects, 1, 2, 1, 1 );
00520               insertTab( tabPresentation, tr( "E&xtras" ) );
00521               tabSpecial = new QWidget( this, "tabSpecial" );
00522               tabSpecialLayout = new QVBoxLayout( tabSpecial, 11, 6, "tabSpecialLayout");
00523               groupDisplay = new QGroupBox( tabSpecial, "groupDisplay" );
00524               groupDisplay->setTitle( tr( "Display Settings" ) );
00525               groupDisplay->setColumnLayout(0, Qt::Vertical );
00526               groupDisplay->layout()->setSpacing( 5 );
00527               groupDisplay->layout()->setMargin( 10 );
00528               groupDisplayLayout = new QVBoxLayout( groupDisplay->layout() );
00529               groupDisplayLayout->setAlignment( Qt::AlignTop );
00530               LayoutSpecial = new QHBoxLayout( 0, 0, 5, "LayoutSpecial");
00531               pageLayout = new QButtonGroup( groupDisplay, "pageLayout" );
00532               pageLayout->setTitle( tr( "Document Layout" ) );
00533               pageLayout->setColumnLayout(0, Qt::Vertical );
00534               pageLayout->layout()->setSpacing( 5 );
00535               pageLayout->layout()->setMargin( 10 );
00536               pageLayoutLayout = new QVBoxLayout( pageLayout->layout() );
00537               pageLayoutLayout->setAlignment( Qt::AlignTop );
00538               singlePage = new QRadioButton( pageLayout, "singlePage" );
00539               singlePage->setText( tr( "Single Page" ) );
00540               pageLayoutLayout->addWidget( singlePage );
00541               continuousPages = new QRadioButton( pageLayout, "continuousPages" );
00542               continuousPages->setText( tr( "Continuous" ) );
00543               pageLayoutLayout->addWidget( continuousPages );
00544               doublePageLeft = new QRadioButton( pageLayout, "doublePageLeft" );
00545               doublePageLeft->setText( tr( "Double Page Left" ) );
00546               pageLayoutLayout->addWidget( doublePageLeft );
00547               doublePageRight = new QRadioButton( pageLayout, "doublePageRight" );
00548               doublePageRight->setText( tr( "Double Page Right" ) );
00549               pageLayoutLayout->addWidget( doublePageRight );
00550               LayoutSpecial->addWidget( pageLayout );
00551               groupNavigation = new QButtonGroup( groupDisplay, "groupNavigation" );
00552               groupNavigation->setRadioButtonExclusive(true);
00553               groupNavigation->setTitle( tr( "Visual Appearance" ) );
00554               groupNavigation->setColumnLayout(0, Qt::Vertical );
00555               groupNavigation->layout()->setSpacing( 5 );
00556               groupNavigation->layout()->setMargin( 10 );
00557               groupNavigationLayout = new QVBoxLayout( groupNavigation->layout() );
00558               groupNavigationLayout->setAlignment( Qt::AlignTop );
00559               useViewDefault = new QRadioButton( groupNavigation, "useViewDefault" );
00560               useViewDefault->setText( tr( "Use Viewers Defaults" ) );
00561               groupNavigationLayout->addWidget( useViewDefault );
00562               useFullScreen = new QRadioButton( groupNavigation, "useFullScreen" );
00563               useFullScreen->setText( tr( "Use Full Screen Mode" ) );
00564               groupNavigationLayout->addWidget( useFullScreen );
00565               useBookmarks = new QRadioButton( groupNavigation, "useBookmarks" );
00566               useBookmarks->setText( tr( "Display Bookmarks Tab" ) );
00567               groupNavigationLayout->addWidget( useBookmarks );
00568               useThumbnails = new QRadioButton( groupNavigation, "useThumbnails" );
00569               useThumbnails->setText( tr( "Display Thumbnails" ) );
00570               groupNavigationLayout->addWidget( useThumbnails );
00571               useLayers2 = new QRadioButton( groupNavigation, "useLayers" );
00572               useLayers2->setText( tr( "Display Layers Tab" ) );
00573               groupNavigationLayout->addWidget( useLayers2 );
00574               hideToolBar = new QCheckBox( tr( "Hide Viewers Toolbar" ), groupNavigation, "hideToolBar" );
00575               groupNavigationLayout->addWidget( hideToolBar );
00576               hideMenuBar = new QCheckBox( tr( "Hide Viewers Menubar" ), groupNavigation, "hideMenuBar" );
00577               groupNavigationLayout->addWidget( hideMenuBar );
00578               fitWindow = new QCheckBox( tr( "Zoom Pages to fit Viewer Window" ), groupNavigation, "fitWindow" );
00579               groupNavigationLayout->addWidget( fitWindow );
00580               groupNavigation->setRadioButtonExclusive(true);
00581               LayoutSpecial->addWidget( groupNavigation );
00582               groupDisplayLayout->addLayout( LayoutSpecial );
00583               tabSpecialLayout->addWidget( groupDisplay );
00584               groupJava = new QGroupBox( tabSpecial, "groupJava" );
00585               groupJava->setTitle( tr( "Special Actions" ) );
00586               groupJava->setColumnLayout(0, Qt::Vertical );
00587               groupJava->layout()->setSpacing( 5 );
00588               groupJava->layout()->setMargin( 10 );
00589               groupJavaLayout = new QHBoxLayout( groupJava->layout() );
00590               groupJavaLayout->setAlignment( Qt::AlignTop );
00591               actionLabel = new QLabel( groupJava, "actionLabel" );
00592               actionLabel->setText( tr( "Javascript to be executed\nwhen PDF document is opened:" ) );
00593               groupJavaLayout->addWidget( actionLabel );
00594               actionCombo = new QComboBox( true, groupJava, "actionCombo" );
00595               actionCombo->setEditable(false);
00596               actionCombo->insertItem( tr("No Script"));
00597               groupJavaLayout->addWidget( actionCombo );
00598               tabSpecialLayout->addWidget( groupJava );
00599               insertTab( tabSpecial, tr("Viewer") );
00600        }
00601 
00602        tabSecurity = new QWidget( this, "tabSecurity" );
00603        tabSecurityLayout = new QVBoxLayout( tabSecurity, 11, 5, "tabSecurityLayout");
00604        Encry = new QCheckBox( tr( "&Use Encryption" ), tabSecurity, "Enc" );
00605        tabSecurityLayout->addWidget( Encry );
00606        GroupPass = new QGroupBox( tr( "Passwords" ), tabSecurity, "GroupPass" );
00607        GroupPass->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, 0, 0,
00608                                               GroupPass->sizePolicy().hasHeightForWidth() ) );
00609        GroupPass->setColumnLayout(0, Qt::Vertical );
00610        GroupPass->layout()->setSpacing( 5 );
00611        GroupPass->layout()->setMargin( 10 );
00612        GroupPassLayout = new QGridLayout( GroupPass->layout() );
00613        GroupPassLayout->setAlignment( Qt::AlignTop );
00614        TextSec2 = new QLabel( tr( "&User:" ), GroupPass, "TextSec2" );
00615        GroupPassLayout->addWidget( TextSec2, 1, 0 );
00616        TextSec1 = new QLabel( tr( "&Owner:" ), GroupPass, "TextSec1" );
00617        GroupPassLayout->addWidget( TextSec1, 0, 0 );
00618        PassOwner = new QLineEdit( GroupPass, "PassOwner" );
00619        PassOwner->setEchoMode( QLineEdit::Password );
00620        TextSec1->setBuddy(PassOwner);
00621        GroupPassLayout->addWidget( PassOwner, 0, 1 );
00622        PassUser = new QLineEdit( GroupPass, "PassUser" );
00623        PassUser->setEchoMode( QLineEdit::Password );
00624        TextSec2->setBuddy(PassUser);
00625        GroupPassLayout->addWidget( PassUser, 1, 1 );
00626        tabSecurityLayout->addWidget( GroupPass );
00627 
00628        GroupSecSet = new QGroupBox( tr( "Settings" ), tabSecurity, "GroupSecSet" );
00629        GroupSecSet->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0,
00630                                    GroupSecSet->sizePolicy().hasHeightForWidth() ) );
00631        GroupSecSet->setColumnLayout(0, Qt::Vertical );
00632        GroupSecSet->layout()->setSpacing( 5 );
00633        GroupSecSet->layout()->setMargin( 10 );
00634        GroupSecSetLayout = new QVBoxLayout( GroupSecSet->layout() );
00635        GroupSecSetLayout->setAlignment( Qt::AlignTop );
00636        PrintSec = new QCheckBox( tr( "Allow &Printing the Document" ), GroupSecSet, "PrintSec" );
00637        GroupSecSetLayout->addWidget( PrintSec );
00638        ModifySec = new QCheckBox( tr( "Allow &Changing the Document" ), GroupSecSet, "ModifySec" );
00639        GroupSecSetLayout->addWidget( ModifySec );
00640        CopySec = new QCheckBox( tr( "Allow Cop&ying Text and Graphics" ), GroupSecSet, "CopySec" );
00641        GroupSecSetLayout->addWidget( CopySec );
00642        AddSec = new QCheckBox( tr( "Allow Adding &Annotations and Fields" ), GroupSecSet, "AddSec" );
00643        GroupSecSetLayout->addWidget( AddSec );
00644        tabSecurityLayout->addWidget( GroupSecSet );
00645        insertTab( tabSecurity, tr( "S&ecurity" ) );
00646 
00647        tabColor = new QWidget( this, "tabColor" );
00648        tabColorLayout = new QVBoxLayout( tabColor, 11, 5, "tabColorLayout");
00649        ColorGroup = new QGroupBox( tr( "General" ), tabColor, "ColorGroup" );
00650        ColorGroup->setColumnLayout(0, Qt::Vertical );
00651        ColorGroup->layout()->setSpacing( 5 );
00652        ColorGroup->layout()->setMargin( 10 );
00653        ColorGroupLayout = new QHBoxLayout( ColorGroup->layout() );
00654        ColorGroupLayout->setAlignment( Qt::AlignTop );
00655        ColorText1 = new QLabel( tr( "Output &Intended For:" ), ColorGroup, "ColorText1" );
00656        ColorGroupLayout->addWidget( ColorText1 );
00657        OutCombo = new QComboBox( true, ColorGroup, "OutCombo" );
00658        OutCombo->insertItem( tr( "Screen / Web" ) );
00659        OutCombo->insertItem( tr( "Printer" ) );
00660        OutCombo->insertItem( tr( "Grayscale" ) );
00661        OutCombo->setEditable(false);
00662        ColorText1->setBuddy(OutCombo);
00663        ColorGroupLayout->addWidget( OutCombo );
00664        tabColorLayout->addWidget( ColorGroup );
00665 
00666        useSpot = new QCheckBox( tr( "Convert Spot Colors to Process Colors" ), tabColor, "useSpot" );
00667        tabColorLayout->addWidget( useSpot );
00668 
00669        overprintMode = new QCheckBox( tr( "Force Overprint Mode" ), tabColor, "overprintMode" );
00670        tabColorLayout->addWidget( overprintMode );
00671 
00672        UseLPI = new QCheckBox( tr( "&Use Custom Rendering Settings" ), tabColor, "UseLPI" );
00673        tabColorLayout->addWidget( UseLPI );
00674        LPIgroup = new QGroupBox( tr( "Rendering Settings" ), tabColor, "LPIgroup" );
00675        LPIgroup->setColumnLayout(0, Qt::Vertical );
00676        LPIgroup->layout()->setSpacing( 5 );
00677        LPIgroup->layout()->setMargin( 10 );
00678        LPIgroupLayout = new QGridLayout( LPIgroup->layout() );
00679        LPIgroupLayout->setAlignment( Qt::AlignTop );
00680        LPIcolor = new QComboBox( true, LPIgroup, "LPIcolor" );
00681        LPIcolor->setEditable(false);
00682        LPIgroupLayout->addWidget( LPIcolor, 0, 0 );
00683        textLPI1 = new QLabel( tr( "Fre&quency:" ), LPIgroup, "textLPI1" );
00684        LPIgroupLayout->addWidget( textLPI1, 0, 1 );
00685        LPIfreq = new QSpinBox( LPIgroup, "LPIfreq" );
00686        LPIfreq->setMinValue(10);
00687        LPIfreq->setMaxValue(1000);
00688        textLPI1->setBuddy(LPIfreq);
00689        LPIgroupLayout->addWidget( LPIfreq, 0, 2 );
00690        textLPI2 = new QLabel( tr( "&Angle:" ), LPIgroup, "textLPI2" );
00691        LPIgroupLayout->addWidget( textLPI2, 1, 1 );
00692        LPIangle = new QSpinBox( LPIgroup, "LPIangle" );
00693        LPIangle->setSuffix( QString::fromUtf8(" °"));
00694        LPIangle->setMinValue(-180);
00695        LPIangle->setMaxValue(180);
00696        textLPI2->setBuddy(LPIangle);
00697        LPIgroupLayout->addWidget( LPIangle, 1, 2 );
00698        textLPI3 = new QLabel( tr( "S&pot Function:" ), LPIgroup, "textLPI3" );
00699        LPIgroupLayout->addWidget( textLPI3, 2, 1 );
00700        LPIfunc = new QComboBox( true, LPIgroup, "LPIfunc" );
00701        LPIfunc->setEditable(false);
00702        LPIfunc->insertItem( tr( "Simple Dot" ) );
00703        LPIfunc->insertItem( tr( "Line" ) );
00704        LPIfunc->insertItem( tr( "Round" ) );
00705        LPIfunc->insertItem( tr( "Ellipse" ) );
00706        textLPI3->setBuddy(LPIfunc);
00707        LPIgroupLayout->addWidget( LPIfunc, 2, 2 );
00708        tabColorLayout->addWidget( LPIgroup );
00709        SelLPIcolor = LPIcolor->currentText();
00710 
00711        GroupBox9 = new QGroupBox( tr( "Solid Colors:" ), tabColor, "GroupBox9" );
00712        GroupBox9->setColumnLayout(0, Qt::Vertical );
00713        GroupBox9->layout()->setSpacing( 5 );
00714        GroupBox9->layout()->setMargin( 10 );
00715        GroupBox9Layout = new QGridLayout( GroupBox9->layout() );
00716        GroupBox9Layout->setAlignment( Qt::AlignTop );
00717        EmbedProfs = new QCheckBox( GroupBox9, "EmbedProfs" );
00718        EmbedProfs->setText( tr( "Use ICC Profile" ) );
00719        GroupBox9Layout->addMultiCellWidget( EmbedProfs, 0, 0, 0, 1 );
00720        ProfsTxt1 = new QLabel(GroupBox9, "ProfsTxt1");
00721        ProfsTxt1->setText( tr( "Profile:" ) );
00722        GroupBox9Layout->addWidget( ProfsTxt1, 1, 0 );
00723        ProfsTxt2 = new QLabel( GroupBox9, "ProfsTxt2_2" );
00724        ProfsTxt2->setText( tr( "Rendering-Intent:" ) );
00725        GroupBox9Layout->addWidget( ProfsTxt2, 1, 1 );
00726        SolidPr = new QComboBox(true, GroupBox9, "SolidPr" );
00727        SolidPr->setEditable(false);
00728        GroupBox9Layout->addWidget( SolidPr, 2, 0 );
00729        IntendS = new QComboBox( true, GroupBox9, "IntendS" );
00730        QString tmp_ip[] = { tr("Perceptual"), tr("Relative Colorimetric"), tr("Saturation"), tr("Absolute Colorimetric")};
00731        size_t ar_ip = sizeof(tmp_ip) / sizeof(*tmp_ip);
00732        for (uint a = 0; a < ar_ip; ++a)
00733               IntendS->insertItem(tmp_ip[a]);
00734        IntendS->setEditable(false);
00735        GroupBox9Layout->addWidget( IntendS, 2, 1 );
00736        tabColorLayout->addWidget( GroupBox9 );
00737        ProfsGroup = new QGroupBox( tr( "Images:" ), tabColor, "ProfsGroup" );
00738        ProfsGroup->setColumnLayout(0, Qt::Vertical );
00739        ProfsGroup->layout()->setSpacing( 5 );
00740        ProfsGroup->layout()->setMargin( 10 );
00741        ProfsGroupLayout = new QGridLayout( ProfsGroup->layout() );
00742        ProfsGroupLayout->setAlignment( Qt::AlignTop );
00743        EmbedProfs2 = new QCheckBox( tr( "Use ICC Profile" ), ProfsGroup, "EmbedProfs" );
00744        ProfsGroupLayout->addMultiCellWidget( EmbedProfs2, 0, 0, 0, 1 );
00745        NoEmbedded = new QCheckBox( ProfsGroup, "NoEmbedded" );
00746        NoEmbedded->setText( tr( "Don't use embedded ICC profiles" ) );
00747        ProfsGroupLayout->addMultiCellWidget( NoEmbedded, 1, 1, 0, 1 );
00748        ProfsTxt3 = new QLabel( ProfsGroup, "ProfsTxt3" );
00749        ProfsTxt3->setText( tr( "Profile:" ) );
00750        ProfsGroupLayout->addWidget( ProfsTxt3, 2, 0 );
00751        ProfsTxt4 = new QLabel( ProfsGroup, "ProfsTxt2_2" );
00752        ProfsTxt4->setText( tr( "Rendering-Intent:" ) );
00753        ProfsGroupLayout->addWidget( ProfsTxt4, 2, 1 );
00754        ImageP = new QComboBox( true, ProfsGroup, "ImageP" );
00755        ImageP->setEditable(false);
00756        ProfsGroupLayout->addWidget( ImageP, 3, 0 );
00757        IntendI = new QComboBox( true, ProfsGroup, "IntendS" );
00758        for (uint a = 0; a < ar_ip; ++a)
00759               IntendI->insertItem(tmp_ip[a]);
00760        IntendI->setEditable(false);
00761        ProfsGroupLayout->addWidget( IntendI, 3, 1 );
00762        tabColorLayout->addWidget( ProfsGroup );
00763 
00764        QSpacerItem* spacerCG = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
00765        tabColorLayout->addItem( spacerCG );
00766        insertTab( tabColor, tr( "C&olor" ) );
00767 
00768        tabPDFX = new QWidget( this, "tabPDFX" );
00769        tabPDFXLayout = new QVBoxLayout( tabPDFX, 10, 5, "tabPDFXLayout");
00770 
00771        MarkGroup = new QGroupBox( tabPDFX, "MarkGroup" );
00772        MarkGroup->setTitle( tr( "Printer Marks" ) );
00773        MarkGroup->setColumnLayout(0, Qt::Vertical );
00774        MarkGroup->layout()->setSpacing( 5 );
00775        MarkGroup->layout()->setMargin( 10 );
00776        MarkGroupLayout = new QGridLayout( MarkGroup->layout() );
00777        MarkGroupLayout->setAlignment( Qt::AlignTop );
00778        cropMarks = new QCheckBox( tr( "Crop Marks" ), MarkGroup, "cropMarks" );
00779        MarkGroupLayout->addWidget( cropMarks, 0, 0 );
00780        bleedMarks = new QCheckBox( tr( "Bleed Marks" ), MarkGroup, "bleedMarks" );
00781        MarkGroupLayout->addWidget( bleedMarks, 1, 0 );
00782        registrationMarks = new QCheckBox( tr( "Registration Marks" ), MarkGroup, "registrationMarks" );
00783        MarkGroupLayout->addWidget( registrationMarks, 2, 0 );
00784        colorMarks = new QCheckBox( tr( "Color Bars" ), MarkGroup, "colorMarks" );
00785        MarkGroupLayout->addMultiCellWidget( colorMarks, 0, 0, 1, 2 );
00786        docInfoMarks = new QCheckBox( tr( "Page Information" ), MarkGroup, "docInfoMarks" );
00787        MarkGroupLayout->addMultiCellWidget( docInfoMarks, 1, 1, 1, 2 );
00788        MarkTxt1 = new QLabel( MarkGroup, "MarkTxt1" );
00789        MarkTxt1->setText( tr( "Offset:" ) );
00790        MarkGroupLayout->addWidget( MarkTxt1, 2, 1 );
00791        markOffset = new MSpinBox( MarkGroup, precision );
00792        MarkGroupLayout->addWidget( markOffset, 2, 2 );
00793        markOffset->setSuffix( unit );
00794        markOffset->setMinValue(0);
00795        markOffset->setMaxValue(3000 * unitRatio);
00796        tabPDFXLayout->addWidget( MarkGroup );
00797 
00798        BleedGroup = new QGroupBox( tabPDFX, "BleedGroup" );
00799        BleedGroup->setTitle( tr( "Bleed Settings" ) );
00800        BleedGroup->setColumnLayout(0, Qt::Vertical );
00801        BleedGroup->layout()->setSpacing( 5 );
00802        BleedGroup->layout()->setMargin( 10 );
00803        BleedGroupLayout = new QGridLayout( BleedGroup->layout() );
00804        BleedGroupLayout->setAlignment( Qt::AlignTop );
00805        BleedTxt1 = new QLabel( BleedGroup, "BleedTxt1" );
00806        BleedTxt1->setText( tr( "Top:" ) );
00807        BleedGroupLayout->addWidget( BleedTxt1, 0, 0 );
00808        BleedTop = new MSpinBox( BleedGroup, precision );
00809        BleedGroupLayout->addWidget( BleedTop, 0, 1 );
00810        BleedTxt2 = new QLabel( BleedGroup, "BleedTxt2" );
00811        BleedTxt2->setText( tr( "Bottom:" ) );
00812        BleedGroupLayout->addWidget( BleedTxt2, 1, 0 );
00813        BleedBottom = new MSpinBox( BleedGroup, precision );
00814        BleedGroupLayout->addWidget( BleedBottom, 1, 1 );
00815        BleedTxt3 = new QLabel( BleedGroup, "BleedTxt3" );
00816        BleedTxt3->setText( tr( "Left:" ) );
00817        BleedGroupLayout->addWidget( BleedTxt3, 0, 2 );
00818        BleedLeft = new MSpinBox( BleedGroup, precision );
00819        BleedGroupLayout->addWidget( BleedLeft, 0, 3 );
00820        BleedTxt4 = new QLabel( BleedGroup, "BleedTxt4" );
00821        BleedTxt4->setText( tr( "Right:" ) );
00822        BleedGroupLayout->addWidget( BleedTxt4, 1, 2 );
00823        BleedRight = new MSpinBox( BleedGroup, precision );
00824        BleedGroupLayout->addWidget( BleedRight, 1, 3 );
00825        docBleeds = new QCheckBox( tr( "Use Document Bleeds" ), BleedGroup, "docBleeds" );
00826        BleedGroupLayout->addMultiCellWidget( docBleeds, 2, 2, 0, 3 );
00827        tabPDFXLayout->addWidget( BleedGroup );
00828 
00829        X3Group = new QGroupBox( tabPDFX, "X3Group" );
00830        X3Group->setTitle( tr( "PDF/X-3 Output Intent" ) );
00831        X3Group->setColumnLayout(0, Qt::Vertical );
00832        X3Group->layout()->setSpacing( 5 );
00833        X3Group->layout()->setMargin( 10 );
00834        X3GroupLayout = new QGridLayout( X3Group->layout() );
00835        X3GroupLayout->setAlignment( Qt::AlignTop );
00836        PrintProfC = new QComboBox( true, X3Group, "PrintProfC" );
00837        PrintProfC->setEditable(false);
00838        X3GroupLayout->addWidget( PrintProfC, 0, 1 );
00839        InfoString = new QLineEdit( X3Group, "InfoString" );
00840        X3GroupLayout->addWidget( InfoString, 1, 1 );
00841        PDFX2 = new QLabel( InfoString, tr( "&Info String:" ), X3Group, "PDFX2" );
00842        X3GroupLayout->addWidget( PDFX2, 1, 0 );
00843        PDFX1 = new QLabel( PrintProfC, tr( "Output &Profile:" ), X3Group, "PDFX1" );
00844        X3GroupLayout->addWidget( PDFX1, 0, 0 );
00845        tabPDFXLayout->addWidget( X3Group );
00846 
00847        QSpacerItem* spacerPX2 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
00848        tabPDFXLayout->addItem( spacerPX2 );
00849 
00850        insertTab( tabPDFX, tr( "Pre-Press" ) );
00851        BleedTop->setSuffix( unit );
00852        BleedTop->setMinValue(0);
00853        BleedTop->setMaxValue(3000*unitRatio);
00854        BleedBottom->setSuffix( unit );
00855        BleedBottom->setMinValue(0);
00856        BleedBottom->setMaxValue(3000*unitRatio);
00857        BleedRight->setSuffix( unit );
00858        BleedRight->setMinValue(0);
00859        BleedRight->setMaxValue(3000*unitRatio);
00860        BleedLeft->setSuffix( unit );
00861        BleedLeft->setMinValue(0);
00862        BleedLeft->setMaxValue(3000*unitRatio);
00863 
00864        restoreDefaults(Optionen, AllFonts, PDFXProfiles, DocFonts, Eff, unitIndex, PageH, PageB, doc, pdfExport);
00865 
00866        if (doc != 0 && exporting)
00867        {
00868               connect(EmbedFonts, SIGNAL(clicked()), this, SLOT(EmbedAll()));
00869               connect(AvailFlist, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SelAFont(QListBoxItem*)));
00870               connect(EmbedList, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SelEFont(QListBoxItem*)));
00871               connect(ToEmbed, SIGNAL(clicked()), this, SLOT(PutToEmbed()));
00872               connect(FromEmbed, SIGNAL(clicked()), this, SLOT(RemoveEmbed()));
00873               connect(OutlineFonts, SIGNAL(clicked()), this, SLOT(OutlineAll()));
00874               connect(OutlineList, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SelSFont(QListBoxItem*)));
00875               connect(ToOutline, SIGNAL(clicked()), this, SLOT(PutToOutline()));
00876               connect(FromOutline, SIGNAL(clicked()), this, SLOT(RemoveOutline()));
00877               connect(PagePrev, SIGNAL(clicked()), this, SLOT(PagePr()));
00878               connect(Pages, SIGNAL(highlighted(int)), this, SLOT(SetPgEff(int)));
00879               connect(EffectType, SIGNAL(activated(int)), this, SLOT(SetEffOpts(int)));
00880               connect(EDirection_2_2, SIGNAL(activated(int)), this, SLOT(ValidDI(int)));
00881               connect(CheckBox10, SIGNAL(clicked()), this, SLOT(DoEffects()));
00882               connect(EonAllPg, SIGNAL(clicked()), this, SLOT(EffectOnAll()));
00883               connect(InfoString, SIGNAL(textChanged(const QString &)), this, SLOT(checkInfo()));
00884               connect(InfoString, SIGNAL(returnPressed()), this, SLOT(checkInfo()));
00885               connect(InfoString, SIGNAL(lostFocus()), this, SLOT(checkInfo()));
00886               connect(docBleeds, SIGNAL(clicked()), this, SLOT(doDocBleeds()));
00887               QToolTip::add( EmbedFonts, "<qt>" + tr( "Embed fonts into the PDF. Embedding the fonts will preserve the layout and appearance of your document." ) + "</qt>");
00888               QToolTip::add( CheckBox10, "<qt>" + tr( "Enables presentation effects when using Adobe&#174; Reader&#174; and other PDF viewers which support this in full screen mode." ) + "</qt>");
00889               QToolTip::add( PagePrev, "<qt>" + tr( "Show page previews of each page listed above." ) + "</qt>");
00890               QToolTip::add( PageTime, "<qt>" + tr( "Length of time the page is shown before the presentation starts on the selected page. Setting 0 will disable automatic page transition." ) + "</qt>" );
00891               QToolTip::add( EffectTime, "<qt>" + tr( "Length of time the effect runs. A shorter time will speed up the effect, a longer one will slow it down." ) + "</qt>" );
00892               QToolTip::add( EffectType, "<qt>" + tr( "Type of the display effect." ) + "</qt>" );
00893               QToolTip::add( EDirection, "<qt>" + tr( "Direction of the effect of moving lines for the split and blind effects." ) + "</qt>" );
00894               QToolTip::add( EDirection_2, "<qt>" + tr( "Starting position for the box and split effects." ) + "</qt>" );
00895               QToolTip::add( EDirection_2_2, "<qt>" + tr( "Direction of the glitter or wipe effects." ) + "</qt>" );
00896               QToolTip::add( EonAllPg, "<qt>" + tr( "Apply the selected effect to all pages." ) + "</qt>" );
00897               QToolTip::add(OutlineFonts, "<qt>" + tr("Convert all glyphs in the document to outlines.") + "</qt>");
00898               //Viewer tab
00899               // FIXME QToolTip::add( tabSpecial, "<qt>" + tr( "These options include instructions on how the PDF viewer should display when opening the document. They may not be supported in all viewers, nor for all versions of PDF." ) + "</qt>" );
00900               QToolTip::add( singlePage, "<qt>" + tr( "Show the document in single page mode" ) + "</qt>" );
00901               QToolTip::add( continuousPages, "<qt>" + tr( "Show the document in single page mode with the pages displayed continuously end to end like a scroll" ) + "</qt>" );
00902               QToolTip::add( doublePageLeft, "<qt>" + tr( "Show the document with facing pages, starting with the first page displayed on the left" ) + "</qt>" );
00903               QToolTip::add( doublePageRight, "<qt>" + tr( "Show the document with facing pages, starting with the first page displayed on the right" ) + "</qt>" );
00904               QToolTip::add( useViewDefault, "<qt>" + tr( "Use the viewer's defaults or the user's preferences if set differently from the viewer defaults" ) + "</qt>" );
00905               QToolTip::add( useFullScreen, "<qt>" + tr( "Enables viewing the document in full screen" ) + "</qt>" );
00906               QToolTip::add( useBookmarks, "<qt>" + tr( "Display the bookmarks upon opening" ) + "</qt>" );
00907               QToolTip::add( useThumbnails, "<qt>" + tr( "Display the page thumbnails upon opening" ) + "</qt>" );
00908               QToolTip::add( useLayers2, "<qt>" + tr( "Forces the displaying of layers. Useful only for PDF 1.5+." ) + "</qt>" );
00909               QToolTip::add( hideToolBar, "<qt>" + tr( "Hides the Tool Bar which has selection and other editing capabilities" ) + "</qt>" );
00910               QToolTip::add( hideMenuBar, "<qt>" + tr( "Hides the Menu Bar for the viewer, the PDF will display in a plain window. " ) + "</qt>" );
00911               QToolTip::add( fitWindow, "<qt>" + tr( "Fit the document page or pages to the available space in the viewer window." ) + "</qt>" );
00912        }
00913        else
00914               docBleeds->hide();
00915        connect(AllPages, SIGNAL(toggled(bool)), this, SLOT(SelRange(bool)));
00916        connect(pageNrButton, SIGNAL(clicked()), this, SLOT(createPageNumberRange()));
00917        connect(DSColor, SIGNAL(clicked()), this, SLOT(DoDownsample()));
00918        connect(MirrorH, SIGNAL(clicked()), this, SLOT(PDFMirror()));
00919        connect(MirrorV, SIGNAL(clicked()), this, SLOT(PDFMirror()));
00920        connect(RotateDeg, SIGNAL(activated(int)), this, SLOT(Rotation(int)));
00921        connect(OutCombo, SIGNAL(activated(int)), this, SLOT(EnablePr(int)));
00922        connect(EmbedProfs, SIGNAL(clicked()), this, SLOT(EnablePG()));
00923        connect(EmbedProfs2, SIGNAL(clicked()), this, SLOT(EnablePGI()));
00924        connect(NoEmbedded, SIGNAL(clicked()), this, SLOT(EnablePGI2()));
00925        connect(PDFVersionCombo, SIGNAL(activated(int)), this, SLOT(EnablePDFX(int)));
00926        connect(Encry, SIGNAL(clicked()), this, SLOT(ToggleEncr()));
00927        connect(UseLPI, SIGNAL(clicked()), this, SLOT(EnableLPI2()));
00928        connect(LPIcolor, SIGNAL(activated(int)), this, SLOT(SelLPIcol(int)));
00929        //tooltips the ones commented out do work ar desired FIXME
00930        //QToolTip::add( tabColor,"<qt>" + tr( "This tab controls the color model choices and color management options for export." ) + "</qt>" );
00931        //QToolTip::add( tabSecurity,"<qt>" + tr( "This tab controls the encryption options for export." ) + "</qt>" );
00932        //QToolTip::add( tabGeneral,"<qt>" + tr( "This tab controls the basic options for export including PDF level and compression." ) + "</qt>" );
00933        //QToolTip::add( tabFonts,"<qt>" + tr( "This tab controls the font embedding options for export including options to convert fonts to vector outlines." ) + "</qt>" );
00934        
00935        QToolTip::add( AllPages, "<qt>" + tr( "Export all pages to PDF" ) + "</qt>" );
00936        QToolTip::add( OnlySome, "<qt>" + tr( "Export a range of pages to PDF" ) );
00937        QToolTip::add( PageNr, "<qt>" + tr( "Insert a comma separated list of tokens where "
00938                                                   "a token can be * for all the pages, 1-5 for "
00939                                                   "a range of pages or a single page number.") + "</qt>" );
00940 
00941        QToolTip::add( PDFVersionCombo, "<qt>" + tr( "Determines the PDF compatibility.<br/>The default is <b>PDF 1.3</b> which gives the widest compatibility.<br/>Choose <b>PDF 1.4</b> if your file uses features such as transparency or you require 128 bit encryption.<br/><b>PDF 1.5</b> is necessary when you wish to preserve objects in separate layers within the PDF.<br/><b>PDF/X-3</b> is for exporting the PDF when you want color managed RGB for commercial printing and is selectable when you have activated color management. Use only when advised by your printer or in some cases printing to a 4 color digital color laser printer." ) + "</qt>");
00942        QToolTip::add( ComboBind, "<qt>" + tr( "Determines the binding of pages in the PDF. Unless you know you need to change it leave the default choice - Left." ) + "</qt>" );
00943        QToolTip::add( CheckBox1, "<qt>" + tr( "Generates thumbnails of each page in the PDF. Some viewers can use the thumbnails for navigation." ) + "</qt>" );
00944        QToolTip::add( Article, "<qt>" + tr( "Generate PDF Articles, which is useful for navigating linked articles in a PDF." ) + "</qt>" );
00945        QToolTip::add( useLayers, "<qt>" + tr( "Layers in your document are exported to the PDF Only available if PDF 1.5 is chosen." ) + "</qt>" );
00946        QToolTip::add( CheckBM, "<qt>" + tr( "Embed the bookmarks you created in your document. These are useful for navigating long PDF documents." ) + "</qt>" );
00947        QToolTip::add( Resolution, "<qt>" + tr( "Export resolution of text and vector graphics. This does not affect the resolution of bitmap images like photos." ) + "</qt>" );
00948        QToolTip::add( Compression, "<qt>" + tr( "Enables lossless compression of text and graphics. Unless you have a reason, leave this checked. This reduces PDF file size." ) + "</qt>" );
00949        QToolTip::add( CMethod, "<qt>" + tr( "Method of compression to use for images. Automatic allows Scribus to choose the best method. ZIP is lossless and good for images with solid colors. JPEG is better at creating smaller PDF files which have many photos (with slight image quality loss possible). Leave it set to Automatic unless you have a need for special compression options." ) + "</qt>");
00950        QToolTip::add( CQuality, "<qt>" + tr( "Compression quality levels for lossy compression methods: Minimum (25%), Low (50%), Medium (75%), High (85%), Maximum (95%). Note that a quality level does not directly determine the size of the resulting image - both size and quality loss vary from image to image at any given quality level. Even with Maximum selected, there is always some quality loss with jpeg." ) + "</qt>");
00951        QToolTip::add( DSColor, "<qt>" + tr( "Limits the resolution of your bitmap images to the selected DPI. Images with a lower resolution will be left untouched. Leaving this unchecked will render them at their native resolution. Enabling this will increase memory usage and slow down export." ) + "</qt>" );
00952        QToolTip::add( ValC, "<qt>" + tr( "DPI (Dots Per Inch) for image export.") + "</qt>" );
00953        QToolTip::add( Encry, "<qt>" + tr( "Enable the security features in your exported PDF. If you selected PDF 1.3, the PDF will be protected by 40 bit encryption. If you selected PDF 1.4, the PDF will be protected by 128 bit encryption. Disclaimer: PDF encryption is not as reliable as GPG or PGP encryption and does have some limitations." ) + "</qt>" );
00954        QToolTip::add( PassOwner, "<qt>" + tr( "Choose a master password which enables or disables all the security features in your exported PDF" ) + "</qt>" );
00955        QToolTip::add( PassUser, "<qt>" + tr( "Choose a password for users to be able to read your PDF." ) + "</qt>" );
00956        QToolTip::add( PrintSec, "<qt>" + tr( "Allow printing of the PDF. If un-checked, printing is prevented. " ) + "</qt>" );
00957        QToolTip::add( ModifySec, "<qt>" + tr( "Allow modifying of the PDF. If un-checked, modifying the PDF is prevented." ) + "</qt>" );
00958        QToolTip::add( CopySec, "<qt>" + tr( "Allow copying of text or graphics from the PDF. If unchecked, text and graphics cannot be copied." ) + "</qt>" );
00959        QToolTip::add( AddSec, "<qt>" + tr( "Allow adding annotations and fields to the PDF. If unchecked, editing annotations and fields is prevented." ) + "</qt>" );
00960        QToolTip::add( OutCombo, "<qt>" + tr( "Color model for the output of your PDF. Choose Screen/Web for PDFs which are used for screen display and for printing on typical inkjets. Choose Printer when printing to a true 4 color CMYK printer. Choose Grayscale when you want a grey scale PDF." ) + "</qt>" );
00961        QToolTip::add( UseLPI, "<qt>" + tr( "This is an advanced setting which is not enabled by default. This should only be enabled when specifically requested by your printer and they have given you the exact details needed. Otherwise, your exported PDF may not print properly and is truly not portable across systems." ) + "</qt>" );
00962        QToolTip::add( EmbedProfs, "<qt>" + tr( "Embed a color profile for solid colors" ) + "</qt>" );
00963        QToolTip::add( SolidPr, "<qt>" + tr( "Color profile for solid colors" ) + "</qt>" );
00964        QToolTip::add( IntendS, "<qt>" + tr( "Rendering intent for solid colors" ) + "</qt>" );
00965        QToolTip::add( EmbedProfs2, "<qt>" + tr( "Embed a color profile for images" ) + "</qt>" );
00966        QToolTip::add( NoEmbedded, "<qt>" + tr( "Do not use color profiles that are embedded in source images" ) + "</qt>" );
00967        QToolTip::add( ImageP, "<qt>" + tr( "Color profile for images" ) + "</qt>" );
00968        QToolTip::add( IntendI, "<qt>" + tr( "Rendering intent for images" ) + "</qt>" );
00969        QToolTip::add( MirrorH, "<qt>" + tr( "Mirror Page(s) horizontally" ) + "</qt>" );
00970        QToolTip::add( MirrorV, "<qt>" + tr( "Mirror Page(s) vertically" ) + "</qt>" );
00971        QToolTip::add(overprintMode, "<qt>"+ tr("Enables global Overprint Mode for this document, overrides object settings") + "<qt>");
00972        QToolTip::add( useSpot,"<qt>" + tr( "Enables Spot Colors to be converted to composite colors. Unless you are planning to print spot colors at a commercial printer, this is probably best left enabled." ) + "</qt>");
00973        QToolTip::add( ClipMarg, "<qt>" + tr( "Do not show objects outside the margins in the exported file" ) + "</qt>" );
00974        //PrePress tab 
00975        QToolTip::add( cropMarks, "<qt>" + tr( "This creates crop marks in the PDF indicating where the paper should be cut or trimmed after printing." ) + "</qt>" );
00976        QToolTip::add( bleedMarks, "<qt>" + tr( "This creates bleed marks which are indicated by  _ . _ and show the bleed limit" ) + "</qt>" );
00977        QToolTip::add( registrationMarks, "<qt>" + tr( "Add registration marks which are added to each separation" ) + "</qt>" );
00978        QToolTip::add( colorMarks, "<qt>" + tr( "Add color calibration bars" ) + "</qt>" );
00979        QToolTip::add( docInfoMarks, "<qt>" + tr( "Add document information which includes the document title and page numbers" ) + "</qt>" );
00980        QToolTip::add( markOffset, "<qt>" + tr( "Indicate the distance offset for the registration marks" ) + "</qt>" );
00981        QToolTip::add( BleedTop, "<qt>" + tr( "Distance for bleed from the top of the physical page" ) + "</qt>" );
00982        QToolTip::add( BleedBottom, "<qt>" + tr( "Distance for bleed from the bottom of the physical page" ) + "</qt>" );
00983        QToolTip::add( BleedLeft, "<qt>" + tr( "Distance for bleed from the left of the physical page" ) + "</qt>" );
00984        QToolTip::add( BleedRight, "<qt>" + tr( "Distance for bleed from the right of the physical page" )  + "</qt>");
00985        QToolTip::add( docBleeds, "<qt>" + tr( "Use the existing bleed settings from the document preferences" ) + "</qt>" );
00986        QToolTip::add( PrintProfC, "<qt>" + tr( "Output profile for printing. If possible, get some guidance from your printer on profile selection." ) + "</qt>" );
00987        QToolTip::add( InfoString, "<qt>" + tr( "Mandatory string for PDF/X-3 or the PDF will fail PDF/X-3 conformance. We recommend you use the title of the document." ) + "</qt>" );
00988 }
00989 
00990 void TabPDFOptions::restoreDefaults(PDFOptions & Optionen,
00991                                                                const SCFonts &AllFonts,
00992                                                                const ProfilesL & PDFXProfiles,
00993                                                                const QMap<QString, int> & DocFonts,
00994                                                                const QValueList<PDFPresentationData> & Eff,
00995                                                                int unitIndex, double PageH, double PageB,
00996                                                                ScribusDoc * mdoc, bool exporting)
00997 {
00998        AllPages->setChecked( true );
00999        PageNr->setEnabled(false);
01000        pageNrButton->setEnabled(false);
01001        RotateDeg->setCurrentItem(Opts.RotateDeg / 90);
01002        MirrorH->setOn(Opts.MirrorH);
01003        MirrorV->setOn(Opts.MirrorV);
01004        ClipMarg->setChecked(Opts.doClip);
01005        bool cmsUse = mdoc ? (ScCore->haveCMS() && mdoc->HasCMS) : false;
01006        if (cmsUse)
01007        {
01008               if (Opts.Version == PDFOptions::PDFVersion_X3)
01009                      PDFVersionCombo->setCurrentItem(3);
01010        }
01011        else
01012               PDFVersionCombo->setCurrentItem(0);
01013        if (Opts.Version == PDFOptions::PDFVersion_13)
01014               PDFVersionCombo->setCurrentItem(0);
01015        if (Opts.Version == PDFOptions::PDFVersion_14)
01016               PDFVersionCombo->setCurrentItem(1);
01017        if (Opts.Version == PDFOptions::PDFVersion_15)
01018               PDFVersionCombo->setCurrentItem(2);
01019        ComboBind->setCurrentItem(Opts.Binding);
01020        CheckBox1->setChecked(Opts.Thumbnails);
01021        Article->setChecked(Opts.Articles);
01022        CheckBM->setChecked(Opts.Bookmarks);
01023        useLayers->setChecked(Opts.useLayers);
01024        if (Opts.Version == 15)
01025               useLayers->setEnabled(true);
01026        else
01027               useLayers->setEnabled(false);
01028        Resolution->setValue(Opts.Resolution);
01029        Compression->setChecked( Opts.Compress );
01030        CMethod->setCurrentItem(Opts.CompressMethod);
01031        CQuality->setCurrentItem(Opts.Quality);
01032        DSColor->setChecked(Opts.RecalcPic);
01033        ValC->setValue(Opts.PicRes);
01034        ValC->setEnabled(DSColor->isChecked() ? true : false);
01035        if (mdoc != 0 && exporting)
01036        {
01037 //     Build a list of all Fonts used in Annotations;
01038               PageItem *pgit;
01039               for (uint c = 0; c < doc->FrameItems.count(); ++c)
01040               {
01041                      pgit = doc->FrameItems.at(c);
01042                      if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()))
01043                             AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
01044               }
01045               for (uint c = 0; c < doc->MasterItems.count(); ++c)
01046               {
01047                      pgit = doc->MasterItems.at(c);
01048                      if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()))
01049                             AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
01050               }
01051               for (uint c = 0; c < doc->DocItems.count(); ++c)
01052               {
01053                      pgit = doc->DocItems.at(c);
01054                      if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()))
01055                             AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
01056               }
01057               QMap<QString,int>::const_iterator it;
01058               AvailFlist->clear();
01059               for (it = DocFonts.constBegin(); it != DocFonts.constEnd(); ++it)
01060               {
01061                      if (AllFonts[it.key()].isReplacement())
01062                             AvailFlist->insertItem(loadIcon("font_subst16.png"), it.key());
01063                      else if (AllFonts[it.key()].type() == ScFace::TYPE1)
01064                             AvailFlist->insertItem(loadIcon("font_type1_16.png"), it.key());
01065                      else if (AllFonts[it.key()].type() == ScFace::TTF)
01066                             AvailFlist->insertItem(loadIcon("font_truetype16.png"), it.key());
01067                      else if (AllFonts[it.key()].type() == ScFace::OTF)
01068                             AvailFlist->insertItem(loadIcon("font_otf16.png"), it.key());
01069               }
01070               ToEmbed->setEnabled(false);
01071               FromEmbed->setEnabled(false);
01072               ToOutline->setEnabled(false);
01073               FromOutline->setEnabled(false);
01074               if ((Opts.EmbedList.count() == 0) && (Opts.SubsetList.count() == 0) && (Opts.firstUse))
01075                      EmbedAll();
01076               else
01077               {
01078                      EmbedList->clear();
01079                      FontsToEmbed.clear();
01080                      for (uint fe = 0; fe < Opts.EmbedList.count(); ++fe)
01081                      {
01082                             EmbedList->insertItem(Opts.EmbedList[fe]);
01083                             FontsToEmbed.append(Opts.EmbedList[fe]);
01084                      }
01085                      if (Opts.SubsetList.count() != 0)
01086                      {
01087                             OutlineList->clear();
01088                             FontsToOutline.clear();
01089                             for (uint fe = 0; fe < Opts.SubsetList.count(); ++fe)
01090                             {
01091                                    OutlineList->insertItem(Opts.SubsetList[fe]);
01092                                    FontsToOutline.append(Opts.SubsetList[fe]);
01093                             }
01094                      }
01095                      QMap<QString, QString>::Iterator itAnn;
01096                      for (itAnn = AnnotationFonts.begin(); itAnn != AnnotationFonts.end(); ++itAnn)
01097                      {
01098                             if (FontsToEmbed.contains(itAnn.key()) == 0)
01099                             {
01100                                    EmbedList->insertItem(itAnn.key());
01101                                    EmbedList->item(EmbedList->count()-1)->setSelectable(false);
01102                                    FontsToEmbed.append(itAnn.key());
01103                             }
01104                             if (FontsToOutline.contains(itAnn.key()) != 0)
01105                             {
01106                                    FontsToOutline.remove(itAnn.key());
01107                                    OutlineList->removeItem(OutlineList->index(OutlineList->findItem(itAnn.key())));
01108                             }
01109                      }
01110               }
01111               CheckBox10->setChecked(Opts.PresentMode);
01112               QString tmp;
01113               struct PDFPresentationData ef;
01114               Pages->clear();
01115               EffVal.clear();
01116               if (EffVal.count() != 0)
01117               {
01118                      for (uint pg2 = 0; pg2 < doc->Pages->count(); ++pg2)
01119                      {
01120                             Pages->insertItem( tr("Page")+" "+tmp.setNum(pg2+1));
01121                             if (EffVal.count()-1 < pg2)
01122                             {
01123                                    ef.pageEffectDuration = 1;
01124                                    ef.pageViewDuration = 1;
01125                                    ef.effectType = 0;
01126                                    ef.Dm = 0;
01127                                    ef.M = 0;
01128                                    ef.Di = 0;
01129                                    EffVal.append(ef);
01130                             }
01131                      }
01132               }
01133               else
01134               {
01135                      for (uint pg = 0; pg < doc->Pages->count(); ++pg)
01136                      {
01137                             Pages->insertItem( tr("Page")+" "+tmp.setNum(pg+1));
01138                             ef.pageEffectDuration = 1;
01139                             ef.pageViewDuration = 1;
01140                             ef.effectType = 0;
01141                             ef.Dm = 0;
01142                             ef.M = 0;
01143                             ef.Di = 0;
01144                             EffVal.append(ef);
01145                      }
01146               }
01147               PagePrev->setChecked(false);
01148               PageTime->setValue(EffVal[0].pageViewDuration);
01149               EffectTime->setValue(EffVal[0].pageEffectDuration);
01150               bool df = true;
01151               if ((Opts.displayBookmarks) || (Opts.displayFullscreen) || (Opts.displayLayers) || (Opts.displayThumbs))
01152                      df = false;
01153               if (df)
01154                      useViewDefault->setChecked(df);
01155               useFullScreen->setChecked(Opts.displayFullscreen);
01156               useBookmarks->setChecked(Opts.displayBookmarks);
01157               useThumbnails->setChecked(Opts.displayThumbs);
01158               useLayers2->setChecked(Opts.displayLayers);
01159               hideToolBar->setChecked(Opts.hideToolBar);
01160               hideMenuBar->setChecked(Opts.hideMenuBar);
01161               fitWindow->setChecked(Opts.fitWindow);
01162               QMap<QString,QString>::Iterator itja;
01163               actionCombo->clear();
01164               actionCombo->insertItem( tr("No Script"));
01165               for (itja = doc->JavaScripts.begin(); itja != doc->JavaScripts.end(); ++itja)
01166                      actionCombo->insertItem(itja.key());
01167               if (doc->JavaScripts.contains(Opts.openAction))
01168                      actionCombo->setCurrentText(Opts.openAction);
01169               if (Opts.PageLayout == PDFOptions::SinglePage)
01170                      singlePage->setChecked(true);
01171               else if (Opts.PageLayout == PDFOptions::OneColumn)
01172                      continuousPages->setChecked(true);
01173               else if (Opts.PageLayout == PDFOptions::TwoColumnLeft)
01174                      doublePageLeft->setChecked(true);
01175               else if (Opts.PageLayout == PDFOptions::TwoColumnRight)
01176                      doublePageRight->setChecked(true);
01177               if (Opts.Version == 15)
01178                      useLayers2->setEnabled(true);
01179               else
01180                      useLayers2->setEnabled(false);
01181        }
01182 
01183        Encry->setChecked( Opts.Encrypt );
01184        PassOwner->setText(Opts.PassOwner);
01185        PassUser->setText(Opts.PassUser);
01186        PrintSec->setChecked( Opts.Permissions & 4 );
01187        ModifySec->setChecked( Opts.Permissions & 8 );
01188        CopySec->setChecked( Opts.Permissions & 16 );
01189        AddSec->setChecked( Opts.Permissions & 32 );
01190        if (!Encry->isChecked())
01191        {
01192               GroupSecSet->setEnabled(false);
01193               GroupPass->setEnabled(false);
01194        }
01195 
01196        if (Opts.UseRGB)
01197               OutCombo->setCurrentItem(0);
01198        else
01199        {
01200               if (Opts.isGrayscale)
01201                      OutCombo->setCurrentItem(2);
01202               else
01203                      OutCombo->setCurrentItem(1);
01204        }
01205        useSpot->setChecked(!Opts.UseSpotColors);
01206        overprintMode->setChecked(Opts.doOverprint);
01207        UseLPI->setChecked(Opts.UseLPI);
01208        QMap<QString,LPIData>::Iterator itlp;
01209        LPIcolor->clear();
01210        for (itlp = Opts.LPISettings.begin(); itlp != Opts.LPISettings.end(); ++itlp)
01211               LPIcolor->insertItem( itlp.key() );
01212        LPIcolor->setCurrentItem(0);
01213 
01214        LPIfreq->setValue(Opts.LPISettings[LPIcolor->currentText()].Frequency);
01215        LPIangle->setValue(Opts.LPISettings[LPIcolor->currentText()].Angle);
01216        LPIfunc->setCurrentItem(Opts.LPISettings[LPIcolor->currentText()].SpotFunc);
01217        EmbedProfs->setChecked(Opts.UseProfiles);
01218        EmbedProfs2->setChecked(Opts.UseProfiles2);
01219        NoEmbedded->setChecked(Opts.EmbeddedI);
01220        if ((Opts.UseRGB) || (Opts.isGrayscale))
01221        {
01222               ProfsGroup->setEnabled(false);
01223               GroupBox9->setEnabled(false);
01224               EnablePr(0);
01225        }
01226        else
01227               EnablePr(1);
01228        EnablePG();
01229        EnablePGI();
01230        QString tp = Opts.SolidProf;
01231        if (!ScCore->InputProfiles.contains(tp))
01232        {
01233               if (mdoc != 0 && exporting)
01234                      tp = mdoc->CMSSettings.DefaultSolidColorRGBProfile;
01235               else
01236                      tp = PrefsManager::instance()->appPrefs.DCMSset.DefaultSolidColorRGBProfile;
01237        }
01238        ProfilesL::Iterator itp;
01239        ProfilesL::Iterator itpend=ScCore->InputProfiles.end();
01240        SolidPr->clear();
01241        for (itp = ScCore->InputProfiles.begin(); itp != itpend; ++itp)
01242        {
01243               SolidPr->insertItem(itp.key());
01244               if (itp.key() == tp)
01245               {
01246                      if (cmsUse)
01247                             SolidPr->setCurrentItem(SolidPr->count()-1);
01248               }
01249        }
01250        if (cmsUse)
01251               IntendS->setCurrentItem(Opts.Intent);
01252        QString tp1 = Opts.ImageProf;
01253        if (!ScCore->InputProfiles.contains(tp1))
01254        {
01255               if (mdoc != 0 && exporting)
01256                      tp1 = mdoc->CMSSettings.DefaultSolidColorRGBProfile;
01257               else
01258                      tp1 = PrefsManager::instance()->appPrefs.DCMSset.DefaultSolidColorRGBProfile;
01259        }
01260        ProfilesL::Iterator itp2;
01261        ProfilesL::Iterator itp2end=ScCore->InputProfiles.end();
01262        ImageP->clear();
01263        for (itp2 = ScCore->InputProfiles.begin(); itp2 != itp2end; ++itp2)
01264        {
01265               ImageP->insertItem(itp2.key());
01266               if (itp2.key() == tp1)
01267               {
01268                      if (cmsUse)
01269                             ImageP->setCurrentItem(ImageP->count()-1);
01270               }
01271        }
01272        if (cmsUse)
01273               IntendI->setCurrentItem(Opts.Intent2);
01274        if (!cmsUse)
01275        {
01276               GroupBox9->hide();
01277               ProfsGroup->hide();
01278        }
01279 
01280        ProfilesL::const_iterator itp3;
01281        QString tp3 = Opts.PrintProf;
01282        if (!PDFXProfiles.contains(tp3))
01283        {
01284               if (mdoc != 0 && exporting)
01285                      tp3 = mdoc->CMSSettings.DefaultPrinterProfile;
01286               else
01287                      tp3 = PrefsManager::instance()->appPrefs.DCMSset.DefaultPrinterProfile;
01288        }
01289        PrintProfC->clear();
01290        for (itp3 = PDFXProfiles.constBegin(); itp3 != PDFXProfiles.constEnd(); ++itp3)
01291        {
01292               PrintProfC->insertItem(itp3.key());
01293               if (itp3.key() == tp3)
01294                      PrintProfC->setCurrentItem(PrintProfC->count()-1);
01295        }
01296        InfoString->setText(Opts.Info);
01297        BleedTop->setValue(Opts.bleeds.Top*unitRatio);
01298        BleedBottom->setValue(Opts.bleeds.Bottom*unitRatio);
01299        BleedRight->setValue(Opts.bleeds.Right*unitRatio);
01300        BleedLeft->setValue(Opts.bleeds.Left*unitRatio);
01301        if (mdoc != 0 && exporting)
01302        {
01303               docBleeds->setChecked(Opts.useDocBleeds);
01304               doDocBleeds();
01305        }
01306        markOffset->setValue(Opts.markOffset*unitRatio);
01307        cropMarks->setChecked(Opts.cropMarks);
01308        bleedMarks->setChecked(Opts.bleedMarks);
01309        registrationMarks->setChecked(Opts.registrationMarks);
01310        colorMarks->setChecked(Opts.colorMarks);
01311        docInfoMarks->setChecked(Opts.docInfoMarks);
01312        if (!cmsUse)
01313               X3Group->setEnabled(false);
01314        if (cmsUse && (Opts.Version == 12) && (!PDFXProfiles.isEmpty()))
01315               EnablePDFX(3);
01316        else
01317               X3Group->setEnabled(false);
01318        if (mdoc != 0  && exporting)
01319        {
01320               PgSel = 0;
01321               Pages->setCurrentItem(0);
01322               SetEffOpts(0);
01323               Pages->setEnabled(false);
01324               Effects->setEnabled(false);
01325               PagePrev->setEnabled(false);
01326               DoEffects();
01327               if (CheckBox10->isChecked())
01328               {
01329                      PageTime->setValue(EffVal[0].pageViewDuration);
01330                      EffectTime->setValue(EffVal[0].pageEffectDuration);
01331                      EffectType->setCurrentItem(EffVal[0].effectType);
01332                      EDirection->setCurrentItem(EffVal[0].Dm);
01333                      EDirection_2->setCurrentItem(EffVal[0].M);
01334                      EDirection_2_2->setCurrentItem(EffVal[0].Di);
01335                      SetEffOpts(EffectType->currentItem());
01336               }
01337               if (mdoc->currentPageLayout != 0)
01338               {
01339                      BleedTxt3->setText( tr( "Inside:" ) );
01340                      BleedTxt4->setText( tr( "Outside:" ) );
01341               }
01342               
01343        }
01344 }
01345 
01346 void TabPDFOptions::doDocBleeds()
01347 {
01348        if (docBleeds->isChecked())
01349        {
01350               Opts.bleeds.Top = BleedTop->value() / unitRatio;
01351               Opts.bleeds.Bottom = BleedBottom->value() / unitRatio;
01352               Opts.bleeds.Right = BleedRight->value() / unitRatio;
01353               Opts.bleeds.Left = BleedLeft->value() / unitRatio;
01354               BleedTop->setValue(doc->bleeds.Top*unitRatio);
01355               BleedBottom->setValue(doc->bleeds.Bottom*unitRatio);
01356               BleedRight->setValue(doc->bleeds.Right*unitRatio);
01357               BleedLeft->setValue(doc->bleeds.Left*unitRatio);
01358               BleedTop->setEnabled(false);
01359               BleedBottom->setEnabled(false);
01360               BleedRight->setEnabled(false);
01361               BleedLeft->setEnabled(false);
01362        }
01363        else
01364        {
01365               BleedTop->setValue(Opts.bleeds.Top*unitRatio);
01366               BleedBottom->setValue(Opts.bleeds.Bottom*unitRatio);
01367               BleedRight->setValue(Opts.bleeds.Right*unitRatio);
01368               BleedLeft->setValue(Opts.bleeds.Left*unitRatio);
01369               BleedTop->setEnabled(true);
01370               BleedBottom->setEnabled(true);
01371               BleedRight->setEnabled(true);
01372               BleedLeft->setEnabled(true);
01373        }
01374 }
01375 
01376 void TabPDFOptions::checkInfo()
01377 {
01378        if ((PDFVersionCombo->currentItem() == 3) && (InfoString->text().isEmpty()))
01379               emit noInfo();
01380        else
01381               emit hasInfo();
01382 }
01383 
01384 void TabPDFOptions::ToggleEncr()
01385 {
01386        bool setter = Encry->isChecked() ? true : false;
01387        GroupSecSet->setEnabled(setter);
01388        GroupPass->setEnabled(setter);
01389 }
01390 
01391 void TabPDFOptions::enableCMS(bool enable)
01392 {
01393        disconnect(PDFVersionCombo, SIGNAL(activated(int)), this, SLOT(EnablePDFX(int)));
01394        int a = PDFVersionCombo->currentItem();
01395        PDFVersionCombo->clear();
01396        PDFVersionCombo->insertItem("PDF 1.3 (Acrobat 4)");
01397        PDFVersionCombo->insertItem("PDF 1.4 (Acrobat 5)");
01398        PDFVersionCombo->insertItem("PDF 1.5 (Acrobat 6)");
01399        cms=enable;
01400        if (enable)
01401               PDFVersionCombo->insertItem("PDF/X-3");
01402        else
01403               a = QMIN(a, 3);
01404        PDFVersionCombo->setCurrentItem(a);
01405        EnablePr(1);
01406        connect(PDFVersionCombo, SIGNAL(activated(int)), this, SLOT(EnablePDFX(int)));
01407 }
01408 
01409 void TabPDFOptions::EnablePDFX(int a)
01410 {
01411        useLayers->setEnabled(a == 2);
01412        if (useLayers2)
01413               useLayers2->setEnabled(a == 2);
01414        if (a != 3)
01415        {
01416               X3Group->setEnabled(false);
01417               setTabEnabled(tabSecurity, true);
01418               OutCombo->setEnabled(true);
01419               EmbedProfs2->setEnabled(true);
01420               emit hasInfo();
01421               if (doc != 0 && pdfExport)
01422               {
01423                      CheckBox10->setEnabled(true);
01424                      EmbedFonts->setEnabled(true);
01425                      if (EmbedList->count() != 0)
01426                             FromEmbed->setEnabled(true);
01427                      ToEmbed->setEnabled(true);
01428               }
01429               return;
01430        }
01431        disconnect(OutCombo, SIGNAL(activated(int)), this, SLOT(EnablePr(int)));
01432        OutCombo->setCurrentItem(1);
01433        OutCombo->setEnabled(false);
01434        EnablePr(1);
01435        EmbedProfs2->setChecked(true);
01436        EmbedProfs2->setEnabled(false);
01437        if (doc != 0 && pdfExport)
01438        {
01439 //            EmbedFonts->setChecked(true);
01440               EmbedAll();
01441               CheckBox10->setChecked(false);
01442               CheckBox10->setEnabled(false);
01443 //            EmbedFonts->setEnabled(false);
01444               FromEmbed->setEnabled(false);
01445               ToEmbed->setEnabled(false);
01446               if (InfoString->text().isEmpty())
01447                      emit noInfo();
01448               else
01449                      emit hasInfo();
01450        }
01451        EnablePGI();
01452        X3Group->setEnabled(true);
01453        setTabEnabled(tabSecurity, false);
01454        connect(OutCombo, SIGNAL(activated(int)), this, SLOT(EnablePr(int)));
01455 }
01456 
01457 void TabPDFOptions::EnablePGI()
01458 {
01459        if (EmbedProfs2->isChecked())
01460        {
01461               NoEmbedded->setEnabled(true);
01462               bool setter = NoEmbedded->isChecked() ? true : false;
01463               ProfsTxt3->setEnabled(setter);
01464               ProfsTxt4->setEnabled(setter);
01465               ImageP->setEnabled(setter);
01466               IntendI->setEnabled(setter);
01467        }
01468        else
01469        {
01470               ProfsTxt3->setEnabled(false);
01471               ProfsTxt4->setEnabled(false);
01472               ImageP->setEnabled(false);
01473               IntendI->setEnabled(false);
01474               NoEmbedded->setEnabled(false);
01475        }
01476 }
01477 
01478 void TabPDFOptions::EnablePGI2()
01479 {
01480        bool setter = NoEmbedded->isChecked() ? true : false;
01481        ProfsTxt3->setEnabled(setter);
01482        ProfsTxt4->setEnabled(setter);
01483        ImageP->setEnabled(setter);
01484        IntendI->setEnabled(setter);
01485 }
01486 
01487 void TabPDFOptions::EnablePG()
01488 {
01489        bool setter = EmbedProfs->isChecked() ? true : false;
01490        ProfsTxt1->setEnabled(setter);
01491        ProfsTxt2->setEnabled(setter);
01492        SolidPr->setEnabled(setter);
01493        IntendS->setEnabled(setter);
01494 }
01495 
01496 void TabPDFOptions::EnablePr(int a)
01497 {
01498        EnableLPI(a);
01499        bool setter = a == 1 ? true : false;
01500        GroupBox9->setEnabled(setter);
01501        ProfsGroup->setEnabled(setter);
01502 }
01503 
01504 void TabPDFOptions::EnableLPI(int a)
01505 {
01506        if (a == 1)
01507        {
01508               QString tp = Opts.SolidProf;
01509               if (!ScCore->InputProfiles.contains(tp))
01510               {
01511                      if (doc != 0)
01512                             tp = doc->CMSSettings.DefaultSolidColorRGBProfile;
01513                      else
01514                             tp = PrefsManager::instance()->appPrefs.DCMSset.DefaultSolidColorRGBProfile;
01515               }
01516               SolidPr->clear();
01517               ProfilesL::Iterator itp;
01518               ProfilesL::Iterator itpend=ScCore->InputProfiles.end();
01519               for (itp = ScCore->InputProfiles.begin(); itp != itpend; ++itp)
01520               {
01521                      SolidPr->insertItem(itp.key());
01522                      if (itp.key() == tp)
01523                      {
01524                             if (cms)
01525                                    SolidPr->setCurrentItem(SolidPr->count()-1);
01526                      }
01527               }
01528               if (cms)
01529                      IntendS->setCurrentItem(Opts.Intent);
01530               QString tp1 = Opts.ImageProf;
01531               if (!ScCore->InputProfiles.contains(tp1))
01532               {
01533                      if (doc != 0)
01534                             tp1 = doc->CMSSettings.DefaultSolidColorRGBProfile;
01535                      else
01536                             tp1 = PrefsManager::instance()->appPrefs.DCMSset.DefaultSolidColorRGBProfile;
01537               }
01538               ImageP->clear();
01539               ProfilesL::Iterator itp2;
01540               ProfilesL::Iterator itp2end=ScCore->InputProfiles.end();
01541               for (itp2 = ScCore->InputProfiles.begin(); itp2 != itp2end; ++itp2)
01542               {
01543                      ImageP->insertItem(itp2.key());
01544                      if (itp2.key() == tp1)
01545                      {
01546                             if (cms)
01547                                    ImageP->setCurrentItem(ImageP->count()-1);
01548                      }
01549               }
01550               if (cms)
01551                      IntendI->setCurrentItem(Opts.Intent2);
01552               if (cms)
01553               {
01554                      GroupBox9->show();
01555                      ProfsGroup->show();
01556               }
01557               else
01558               {
01559                      GroupBox9->hide();
01560                      ProfsGroup->hide();
01561               }
01562               useSpot->show();
01563               overprintMode->show();
01564               UseLPI->show();
01565               if (UseLPI->isChecked())
01566                      LPIgroup->show();
01567               else
01568                      LPIgroup->hide();
01569        }
01570        else
01571        {
01572               useSpot->hide();
01573               overprintMode->hide();
01574               UseLPI->hide();
01575               LPIgroup->hide();
01576        }
01577 }
01578 
01579 void TabPDFOptions::EnableLPI2()
01580 {
01581        if (UseLPI->isChecked())
01582               LPIgroup->show();
01583        else
01584               LPIgroup->hide();
01585 }
01586 
01587 void TabPDFOptions::SelLPIcol(int c)
01588 {
01589        // XXX Optionen or Opts changed here
01590        Opts.LPISettings[SelLPIcolor].Frequency = LPIfreq->value();
01591        Opts.LPISettings[SelLPIcolor].Angle = LPIangle->value();
01592        Opts.LPISettings[SelLPIcolor].SpotFunc = LPIfunc->currentItem();
01593        LPIfreq->setValue(Opts.LPISettings[LPIcolor->text(c)].Frequency);
01594        LPIangle->setValue(Opts.LPISettings[LPIcolor->text(c)].Angle);
01595        LPIfunc->setCurrentItem(Opts.LPISettings[LPIcolor->text(c)].SpotFunc);
01596        SelLPIcolor = LPIcolor->text(c);
01597 }
01598 
01599 void TabPDFOptions::SelRange(bool e)
01600 {
01601        bool setter = e ? false : true;
01602        PageNr->setEnabled( setter );
01603        pageNrButton->setEnabled( setter );
01604        if (setter == false)
01605               CheckBM->setChecked(false);
01606 }
01607 
01608 void TabPDFOptions::EffectOnAll()
01609 {
01610        for (uint pg = 0; pg < doc->Pages->count(); ++pg)
01611        {
01612               EffVal[pg].pageViewDuration = PageTime->value();
01613               EffVal[pg].pageEffectDuration = EffectTime->value();
01614               EffVal[pg].effectType = EffectType->currentItem();
01615               EffVal[pg].Dm = EDirection->currentItem();
01616               EffVal[pg].M = EDirection_2->currentItem();
01617               EffVal[pg].Di = EDirection_2_2->currentItem();
01618        }
01619 }
01620 
01621 void TabPDFOptions::PDFMirror()
01622 {
01623        // XXX Optionen or Opts changed here
01624        Opts.MirrorH = MirrorH->isOn();
01625        Opts.MirrorV = MirrorV->isOn();
01626 }
01627 
01628 void TabPDFOptions::Rotation( int value )
01629 {
01630        Opts.RotateDeg = value * 90;
01631 }
01632 
01633 void TabPDFOptions::DoEffects()
01634 {
01635        bool setter = CheckBox10->isChecked() ? true : false;
01636        Pages->setEnabled(setter);
01637        Effects->setEnabled(setter);
01638        PagePrev->setEnabled(setter);
01639 }
01640 
01641 void TabPDFOptions::ValidDI(int nr)
01642 {
01643        if (!EDirection_2_2->listBox()->item(nr)->isSelectable())
01644               EDirection_2_2->setCurrentItem(0);
01645 }
01646 
01647 void TabPDFOptions::SetPgEff(int nr)
01648 {
01649        if (nr < 0)
01650               return;
01651        EffVal[PgSel].pageViewDuration = PageTime->value();
01652        EffVal[PgSel].pageEffectDuration = EffectTime->value();
01653        EffVal[PgSel].effectType = EffectType->currentItem();
01654        EffVal[PgSel].Dm = EDirection->currentItem();
01655        EffVal[PgSel].M = EDirection_2->currentItem();
01656        EffVal[PgSel].Di = EDirection_2_2->currentItem();
01657        SetEffOpts(EffVal[nr].effectType);
01658        PageTime->setValue(EffVal[nr].pageViewDuration);
01659        EffectTime->setValue(EffVal[nr].pageEffectDuration);
01660        EffectType->setCurrentItem(EffVal[nr].effectType);
01661        EDirection->setCurrentItem(EffVal[nr].Dm);
01662        EDirection_2->setCurrentItem(EffVal[nr].M);
01663        EDirection_2_2->setCurrentItem(EffVal[nr].Di);
01664        PgSel = nr;
01665 }
01666 
01667 void TabPDFOptions::SetEffOpts(int nr)
01668 {
01669        EDirection_2_2->listBox()->item(2)->setSelectable(false);
01670        EDirection_2_2->listBox()->item(3)->setSelectable(false);
01671        EDirection_2_2->listBox()->item(4)->setSelectable(false);
01672        switch (nr)
01673        {
01674        case 0:
01675        case 3:
01676               EDirection->setEnabled(false);
01677               EDirection_2->setEnabled(false);
01678               EDirection_2_2->setEnabled(false);
01679               break;
01680        case 1:
01681               EDirection->setEnabled(true);
01682               EDirection_2->setEnabled(false);
01683               EDirection_2_2->setEnabled(false);
01684               break;
01685        case 2:
01686               EDirection->setEnabled(false);
01687               EDirection_2->setEnabled(true);
01688               EDirection_2_2->setEnabled(false);
01689               break;
01690        case 4:
01691        case 6:
01692               EDirection->setEnabled(false);
01693               EDirection_2->setEnabled(false);
01694               EDirection_2_2->setEnabled(true);
01695               if (nr == 6)
01696               {
01697                      EDirection_2_2->listBox()->item(2)->setSelectable(true);
01698                      EDirection_2_2->listBox()->item(3)->setSelectable(true);
01699               }
01700               else
01701                      EDirection_2_2->listBox()->item(4)->setSelectable(true);
01702               break;
01703        case 5:
01704               EDirection->setEnabled(true);
01705               EDirection_2->setEnabled(true);
01706               EDirection_2_2->setEnabled(false);
01707               break;
01708        }
01709 }
01710 
01711 void TabPDFOptions::PagePr()
01712 {
01713        disconnect(Pages, SIGNAL(highlighted(int)), this, SLOT(SetPgEff(int)));
01714        QString tmp;
01715        QPixmap pm;
01716        int ci = Pages->currentItem();
01717        if (PagePrev->isChecked())
01718        {
01719               for (uint pg = 0; pg < doc->Pages->count(); ++pg)
01720               {
01721                      pm.convertFromImage(doc->view()->PageToPixmap(pg, 70));
01722                      Pages->changeItem(pm, tr("Page")+" "+tmp.setNum(pg+1), pg);
01723               }
01724        }
01725        else
01726        {
01727               for (uint pg = 0; pg < doc->Pages->count(); ++pg)
01728                      Pages->changeItem( tr("Page")+" "+tmp.setNum(pg+1), pg);
01729        }
01730        if (ci != -1)
01731        {
01732               PgSel = ci;
01733               Pages->setCurrentItem(ci);
01734        }
01735        else
01736        {
01737               PgSel = 0;
01738               Pages->clearSelection();
01739        }
01740        connect(Pages, SIGNAL(highlighted(int)), this, SLOT(SetPgEff(int)));
01741 }
01742 
01743 void TabPDFOptions::DoDownsample()
01744 {
01745        if (DSColor->isChecked())
01746        {
01747               ValC->setEnabled(true);
01748               if (ValC->value() > Resolution->value())
01749                      ValC->setValue(Resolution->value());
01750               ValC->setMaxValue(Resolution->value());
01751               ValC->setMinValue(35);
01752        }
01753        else
01754               ValC->setEnabled(false);
01755 }
01756 
01757 void TabPDFOptions::RemoveEmbed()
01758 {
01759        FontsToEmbed.remove(EmbedList->currentText());
01760        EmbedList->removeItem(EmbedList->currentItem());
01761        EmbedList->clearSelection();
01762        if (EmbedList->count() == 0)
01763        {
01764               FromEmbed->setEnabled(false);
01765               ToOutline->setEnabled(false);
01766        }
01767        else
01768        {
01769               if (!EmbedList->item(EmbedList->currentItem())->isSelectable())
01770               {
01771                      FromEmbed->setEnabled(false);
01772                      ToOutline->setEnabled(false);
01773               }
01774        }
01775 }
01776 
01777 void TabPDFOptions::PutToEmbed()
01778 {
01779        if (EmbedList->count() != 0)
01780        {
01781               if (!AllFonts[AvailFlist->currentText()].subset())
01782               {
01783                      if (EmbedList->findItem(AvailFlist->currentText()) == NULL)
01784                      {
01785                             FontsToEmbed.append(AvailFlist->currentText());
01786                             EmbedList->insertItem(AvailFlist->currentText());
01787                             if (AnnotationFonts.contains(AvailFlist->currentText()))
01788                                    EmbedList->item(EmbedList->count()-1)->setSelectable(false);
01789                      }
01790               }
01791               else
01792               {
01793                      if (OutlineList->count() != 0)
01794                      {
01795                             if (OutlineList->findItem(AvailFlist->currentText()) == NULL)
01796                             {
01797                                    FontsToOutline.append(AvailFlist->currentText());
01798                                    OutlineList->insertItem(AvailFlist->currentText());
01799                             }
01800                      }
01801                      else
01802                      {
01803                             FontsToOutline.append(AvailFlist->currentText());
01804                             OutlineList->insertItem(AvailFlist->currentText());
01805                      }
01806               }
01807        }
01808        else
01809        {
01810               if ((AllFonts[AvailFlist->currentText()].type() != ScFace::OTF) && (!AllFonts[AvailFlist->currentText()].subset()))
01811               {
01812                      FontsToEmbed.append(AvailFlist->currentText());
01813                      EmbedList->insertItem(AvailFlist->currentText());
01814                      if (AnnotationFonts.contains(AvailFlist->currentText()))
01815                             EmbedList->item(EmbedList->count()-1)->setSelectable(false);
01816               }
01817               else
01818               {
01819                      if (OutlineList->count() != 0)
01820                      {
01821                             if (OutlineList->findItem(AvailFlist->currentText()) == NULL)
01822                             {
01823                                    FontsToOutline.append(AvailFlist->currentText());
01824                                    OutlineList->insertItem(AvailFlist->currentText());
01825                             }
01826                      }
01827                      else
01828                      {
01829                             FontsToOutline.append(AvailFlist->currentText());
01830                             OutlineList->insertItem(AvailFlist->currentText());
01831                      }
01832               }
01833        }
01834 }
01835 
01836 void TabPDFOptions::RemoveOutline()
01837 {
01838        FontsToOutline.remove(OutlineList->currentText());
01839        if ((AllFonts[OutlineList->currentText()].type() != ScFace::OTF) && (!AllFonts[OutlineList->currentText()].subset()))
01840        {
01841               FontsToEmbed.append(OutlineList->currentText());
01842               EmbedList->insertItem(OutlineList->currentText());
01843        }
01844        OutlineList->removeItem(OutlineList->currentItem());
01845        OutlineList->clearSelection();
01846        if (OutlineList->count() == 0)
01847               FromOutline->setEnabled(false);
01848 }
01849 
01850 void TabPDFOptions::PutToOutline()
01851 {
01852        if (OutlineList->count() != 0)
01853        {
01854               if (OutlineList->findItem(EmbedList->currentText()) == NULL)
01855               {
01856                      FontsToOutline.append(EmbedList->currentText());
01857                      OutlineList->insertItem(EmbedList->currentText());
01858               }
01859        }
01860        else
01861        {
01862               FontsToOutline.append(EmbedList->currentText());
01863               OutlineList->insertItem(EmbedList->currentText());
01864        }
01865        FontsToEmbed.remove(EmbedList->currentText());
01866        EmbedList->removeItem(EmbedList->currentItem());
01867        EmbedList->clearSelection();
01868        if (EmbedList->count() == 0)
01869        {
01870               FromEmbed->setEnabled(false);
01871               ToOutline->setEnabled(false);
01872        }
01873        else
01874        {
01875               if (!EmbedList->item(EmbedList->currentItem())->isSelectable())
01876               {
01877                      FromEmbed->setEnabled(false);
01878                      ToOutline->setEnabled(false);
01879               }
01880        }
01881 }
01882 
01883 void TabPDFOptions::SelAFont(QListBoxItem *c)
01884 {
01885        if (c != NULL)
01886        {
01887               FromEmbed->setEnabled(false);
01888               if (c->isSelectable())
01889                      ToEmbed->setEnabled(true);
01890               ToOutline->setEnabled(false);
01891               FromOutline->setEnabled(false);
01892               EmbedList->clearSelection();
01893               OutlineList->clearSelection();
01894        }
01895 }
01896 
01897 void TabPDFOptions::SelEFont(QListBoxItem *c)
01898 {
01899        if (c != NULL)
01900        {
01901               if ((PDFVersionCombo->currentItem() != 3) && (c->isSelectable()))
01902                      FromEmbed->setEnabled(true);
01903               else
01904                      FromEmbed->setEnabled(false);
01905               ToEmbed->setEnabled(false);
01906               if (c->isSelectable())
01907                      ToOutline->setEnabled(true);
01908               FromOutline->setEnabled(false);
01909               AvailFlist->clearSelection();
01910               OutlineList->clearSelection();
01911        }
01912 }
01913 
01914 void TabPDFOptions::SelSFont(QListBoxItem *c)
01915 {
01916        if (c != NULL)
01917        {
01918               if (PDFVersionCombo->currentItem() == 3)
01919               {
01920                      if ((AllFonts[c->text()].type() == ScFace::OTF) || (AllFonts[c->text()].subset()))
01921                             FromOutline->setEnabled(false);
01922                      else
01923                             FromOutline->setEnabled(true);
01924               }
01925               else
01926                      FromOutline->setEnabled(true);
01927               ToOutline->setEnabled(false);
01928               ToEmbed->setEnabled(false);
01929               FromEmbed->setEnabled(false);
01930               EmbedList->clearSelection();
01931               AvailFlist->clearSelection();
01932        }
01933 }
01934 
01935 void TabPDFOptions::EmbedAll()
01936 {
01937        EmbedList->clear();
01938        FontsToEmbed.clear();
01939        OutlineList->clear();
01940        FontsToOutline.clear();
01941        FromEmbed->setEnabled(false);
01942        ToEmbed->setEnabled(false);
01943        ToOutline->setEnabled(false);
01944        FromOutline->setEnabled(false);
01945        for (uint a=0; a < AvailFlist->count(); ++a)
01946        {
01947               if (AvailFlist->item(a)->isSelectable())
01948               {
01949                      if (!AllFonts[AvailFlist->item(a)->text()].subset())
01950                      {
01951                             FontsToEmbed.append(AvailFlist->item(a)->text());
01952                             EmbedList->insertItem(AvailFlist->item(a)->text());
01953                             if (AnnotationFonts.contains(AvailFlist->item(a)->text()))
01954                                    EmbedList->item(EmbedList->count()-1)->setSelectable(false);
01955                      }
01956                      else
01957                      {
01958                             if (AnnotationFonts.contains(AvailFlist->item(a)->text()))
01959                             {
01960                                    FontsToEmbed.append(AvailFlist->item(a)->text());
01961                                    EmbedList->insertItem(AvailFlist->item(a)->text());
01962                                    EmbedList->item(EmbedList->count()-1)->setSelectable(false);
01963                             }
01964                             else
01965                             {
01966                                    FontsToOutline.append(AvailFlist->item(a)->text());
01967                                    OutlineList->insertItem(AvailFlist->item(a)->text());
01968                             }
01969                      }
01970               }
01971        }
01972 }
01973 
01974 void TabPDFOptions::OutlineAll()
01975 {
01976        EmbedList->clear();
01977        FontsToEmbed.clear();
01978        OutlineList->clear();
01979        FontsToOutline.clear();
01980        FromEmbed->setEnabled(false);
01981        ToEmbed->setEnabled(false);
01982        ToOutline->setEnabled(false);
01983        FromOutline->setEnabled(false);
01984        for (uint a=0; a < AvailFlist->count(); ++a)
01985        {
01986               if (AvailFlist->item(a)->isSelectable())
01987               {
01988                      if (AnnotationFonts.contains(AvailFlist->item(a)->text()))
01989                      {
01990                             FontsToEmbed.append(AvailFlist->item(a)->text());
01991                             EmbedList->insertItem(AvailFlist->item(a)->text());
01992                             EmbedList->item(EmbedList->count()-1)->setSelectable(false);
01993                      }
01994                      else
01995                      {
01996                             FontsToOutline.append(AvailFlist->item(a)->text());
01997                             OutlineList->insertItem(AvailFlist->item(a)->text());
01998                      }
01999               }
02000        }
02001 }
02002 
02003 void TabPDFOptions::unitChange(QString unit, int docUnitIndex, int decimals, double invUnitConversion)
02004 {
02005        double oldMin = -1, oldMax = -1, val = -1;
02006        int decimalsOld = -1;
02007 
02008        BleedBottom->setSuffix(unit);
02009        BleedTop->setSuffix(unit);
02010        BleedRight->setSuffix(unit);
02011        BleedLeft->setSuffix(unit);
02012        markOffset->setSuffix(unit);
02013 
02014        BleedBottom->getValues(&oldMin, &oldMax, &decimalsOld, &val);
02015        BleedBottom->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
02016        BleedTop->getValues(&oldMin, &oldMax, &decimalsOld, &val);
02017        BleedTop->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
02018        BleedRight->getValues(&oldMin, &oldMax, &decimalsOld, &val);
02019        BleedRight->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
02020        BleedLeft->getValues(&oldMin, &oldMax, &decimalsOld, &val);
02021        BleedLeft->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
02022        markOffset->getValues(&oldMin, &oldMax, &decimalsOld, &val);
02023        markOffset->setValues(oldMin * invUnitConversion, oldMax * invUnitConversion, decimals, val * invUnitConversion);
02024 }
02025 
02026 void TabPDFOptions::createPageNumberRange( )
02027 {
02028        if (doc!=0)
02029        {
02030               CreateRange cr(PageNr->text(), doc->DocPages.count(), this);
02031               if (cr.exec())
02032               {
02033                      CreateRangeData crData;
02034                      cr.getCreateRangeData(crData);
02035                      PageNr->setText(crData.pageRange);
02036                      return;
02037               }
02038        }
02039        PageNr->setText(QString::null);
02040 }