summaryrefslogtreecommitdiff
path: root/vcl/generic
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-03-21 10:03:06 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-03-21 11:23:02 +0000
commit1d81ca98f8d10431ea69eef71d8f633c27648743 (patch)
treea54ab72c2e41bc255b9526ddcae98ed33fa12447 /vcl/generic
parentf6cd982a68528ac1bfd130080cea3f96e6cc7edd (diff)
move remaining padmin dialogs into vcl
and so padmin is no more Change-Id: I554cefa8b38581daad8a78bafa167448b0a0ef61
Diffstat (limited to 'vcl/generic')
-rw-r--r--vcl/generic/print/genprnpsp.cxx38
-rw-r--r--vcl/generic/print/prtsetup.cxx487
-rw-r--r--vcl/generic/print/prtsetup.hxx129
3 files changed, 618 insertions, 36 deletions
diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx
index a60e5b66fa4c..d6e891192e2e 100644
--- a/vcl/generic/print/genprnpsp.cxx
+++ b/vcl/generic/print/genprnpsp.cxx
@@ -39,8 +39,6 @@
#include "rtl/ustring.hxx"
-#include "osl/module.h"
-
#include "vcl/button.hxx"
#include "vcl/dialog.hxx"
#include "vcl/edit.hxx"
@@ -58,6 +56,7 @@
#include "jobset.h"
#include "print.h"
+#include "prtsetup.hxx"
#include "salptype.hxx"
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -69,16 +68,6 @@ using namespace com::sun::star;
/*
* static helpers
*/
-
-#if defined( UNX ) && !( defined( MACOSX ) || defined( IOS ) || defined( ANDROID ) )
-static oslModule driverLib = NULL;
-#endif
-extern "C"
-{
-typedef int(*setupFunction)(PrinterInfo&);
-static setupFunction pSetupFunction = NULL;
-}
-
static OUString getPdfDir( const PrinterInfo& rInfo )
{
OUString aDir;
@@ -153,24 +142,6 @@ namespace
}
}
-static void getPaLib()
-{
-#if defined( UNX ) && !( defined( MACOSX ) || defined( IOS ) || defined( ANDROID ) )
- if( ! driverLib )
- {
- driverLib = osl_loadModuleRelativeAscii( (oslGenericFunction)getPaLib,
- _XSALSET_LIBNAME,
- SAL_LOADMODULE_DEFAULT );
- if ( !driverLib )
- return;
-
- pSetupFunction = (setupFunction)osl_getAsciiFunctionSymbol( driverLib, "Sal_SetupPrinterDriver" );
- if ( !pSetupFunction )
- fprintf( stderr, "could not resolve Sal_SetupPrinterDriver\n" );
- }
-#endif
-}
-
inline int PtTo10Mu( int nPoints ) { return (int)((((double)nPoints)*35.27777778)+0.5); }
inline int TenMuToPt( int nUnits ) { return (int)((((double)nUnits)/35.27777778)+0.5); }
@@ -572,11 +543,6 @@ bool PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
if( ! pFrame || ! pJobSetup )
return false;
- getPaLib();
-
- if( ! pSetupFunction )
- return false;
-
PrinterInfoManager& rManager = PrinterInfoManager::get();
PrinterInfo aInfo( rManager.getPrinterInfo( pJobSetup->maPrinterName ) );
@@ -586,7 +552,7 @@ bool PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aInfo );
}
- if( pSetupFunction( aInfo ) )
+ if (SetupPrinterDriver(aInfo))
{
aInfo.resolveDefaultBackend();
rtl_freeMemory( pJobSetup->mpDriverData );
diff --git a/vcl/generic/print/prtsetup.cxx b/vcl/generic/print/prtsetup.cxx
new file mode 100644
index 000000000000..ce1f65516f7b
--- /dev/null
+++ b/vcl/generic/print/prtsetup.cxx
@@ -0,0 +1,487 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include "prtsetup.hxx"
+#include "svdata.hxx"
+#include "svids.hrc"
+
+#include "osl/thread.h"
+
+#include <officecfg/Office/Common.hxx>
+
+using namespace psp;
+
+void RTSDialog::insertAllPPDValues( ListBox& rBox, const PPDParser* pParser, const PPDKey* pKey )
+{
+ if( ! pKey || ! pParser )
+ return;
+
+ const PPDValue* pValue = NULL;
+ sal_Int32 nPos = 0;
+ OUString aOptionText;
+
+ for( int i = 0; i < pKey->countValues(); i++ )
+ {
+ pValue = pKey->getValue( i );
+ aOptionText = pParser->translateOption( pKey->getKey(), pValue->m_aOption) ;
+
+ if( m_aJobData.m_aContext.checkConstraints( pKey, pValue ) )
+ {
+ if( rBox.GetEntryPos( (void*)pValue ) == LISTBOX_ENTRY_NOTFOUND )
+ {
+ nPos = rBox.InsertEntry( aOptionText, LISTBOX_APPEND );
+ rBox.SetEntryData( nPos, (void*)pValue );
+ }
+ }
+ else
+ {
+ if( ( nPos = rBox.GetEntryPos( (void*)pValue ) ) != LISTBOX_ENTRY_NOTFOUND )
+ rBox.RemoveEntry( nPos );
+ }
+ }
+ pValue = m_aJobData.m_aContext.getValue( pKey );
+ if( pValue )
+ {
+ if( ( nPos = rBox.GetEntryPos( (void*)pValue ) ) != LISTBOX_ENTRY_NOTFOUND )
+ rBox.SelectEntryPos( nPos );
+ }
+ else
+ rBox.SelectEntry( m_aInvalidString );
+}
+
+
+
+/*
+ * RTSDialog
+ */
+
+RTSDialog::RTSDialog(const PrinterInfo& rJobData, const OUString& rPrinter, Window* pParent)
+ : TabDialog(pParent, "PrinterPropertiesDialog", "vcl/ui/printerpropertiesdialog.ui")
+ , m_aJobData(rJobData)
+ , m_aPrinter(rPrinter)
+ , m_pPaperPage(NULL)
+ , m_pDevicePage(NULL)
+ , m_aInvalidString(VclResId(SV_PRINT_INVALID_TXT))
+{
+ get(m_pOKButton, "ok");
+ get(m_pCancelButton, "cancel");
+ get(m_pTabControl, "notebook");
+
+ OUString aTitle(GetText());
+ SetText(aTitle.replaceAll("%s", m_aJobData.m_aPrinterName));
+
+ m_pTabControl->SetActivatePageHdl( LINK( this, RTSDialog, ActivatePage ) );
+ m_pOKButton->SetClickHdl( LINK( this, RTSDialog, ClickButton ) );
+ m_pCancelButton->SetClickHdl( LINK( this, RTSDialog, ClickButton ) );
+ ActivatePage(m_pTabControl);
+}
+
+RTSDialog::~RTSDialog()
+{
+ delete m_pPaperPage;
+ delete m_pDevicePage;
+}
+
+IMPL_LINK( RTSDialog, ActivatePage, TabControl*, pTabCtrl )
+{
+ if( pTabCtrl != m_pTabControl )
+ return 0;
+
+ sal_uInt16 nId = m_pTabControl->GetCurPageId();
+ OString sPage = m_pTabControl->GetPageName(nId);
+ if ( ! m_pTabControl->GetTabPage( nId ) )
+ {
+ TabPage *pPage = NULL;
+ if (sPage == "paper")
+ pPage = m_pPaperPage = new RTSPaperPage( this );
+ else if (sPage == "device")
+ pPage = m_pDevicePage = new RTSDevicePage( this );
+ if( pPage )
+ m_pTabControl->SetTabPage( nId, pPage );
+ }
+ else
+ {
+ if (sPage == "paper")
+ m_pPaperPage->update();
+ else if (sPage == "device")
+ m_pDevicePage->update();
+ }
+
+ return 0;
+}
+
+
+
+IMPL_LINK( RTSDialog, ClickButton, Button*, pButton )
+{
+ if( pButton == m_pOKButton )
+ {
+ // refresh the changed values
+ if( m_pPaperPage )
+ {
+ // orientation
+ m_aJobData.m_eOrientation = m_pPaperPage->getOrientation() == 0 ?
+ orientation::Portrait : orientation::Landscape;
+ }
+ if( m_pDevicePage )
+ {
+ m_aJobData.m_nColorDepth = m_pDevicePage->getDepth();
+ m_aJobData.m_nColorDevice = m_pDevicePage->getColorDevice();
+ m_aJobData.m_nPSLevel = m_pDevicePage->getLevel();
+ m_aJobData.m_nPDFDevice = m_pDevicePage->getPDFDevice();
+ }
+ EndDialog( 1 );
+ }
+ else if( pButton == m_pCancelButton )
+ EndDialog( 0 );
+
+ return 0;
+}
+
+
+
+/*
+ * RTSPaperPage
+ */
+
+RTSPaperPage::RTSPaperPage(RTSDialog* pParent)
+ : TabPage(pParent->m_pTabControl, "PrinterPaperPage", "vcl/ui/printerpaperpage.ui")
+ , m_pParent( pParent )
+{
+ get(m_pPaperText, "paperft");
+ get(m_pPaperBox, "paperlb");
+ get(m_pOrientBox, "orientlb");
+ get(m_pDuplexText, "duplexft");
+ get(m_pDuplexBox, "duplexlb");
+ get(m_pSlotText, "slotft");
+ get(m_pSlotBox, "slotlb");
+
+ m_pPaperBox->SetSelectHdl( LINK( this, RTSPaperPage, SelectHdl ) );
+ m_pOrientBox->SetSelectHdl( LINK( this, RTSPaperPage, SelectHdl ) );
+ m_pDuplexBox->SetSelectHdl( LINK( this, RTSPaperPage, SelectHdl ) );
+ m_pSlotBox->SetSelectHdl( LINK( this, RTSPaperPage, SelectHdl ) );
+
+ sal_Int32 nPos = 0;
+
+ // duplex
+ nPos = m_pDuplexBox->InsertEntry( m_pParent->m_aInvalidString );
+ m_pDuplexBox->SetEntryData( nPos, NULL );
+
+ // paper does not have an invalid entry
+
+ // input slots
+ nPos = m_pSlotBox->InsertEntry( m_pParent->m_aInvalidString );
+ m_pSlotBox->SetEntryData( nPos, NULL );
+
+ update();
+}
+
+
+
+RTSPaperPage::~RTSPaperPage()
+{
+}
+
+
+
+void RTSPaperPage::update()
+{
+ const PPDKey* pKey = NULL;
+
+ // orientation
+ m_pOrientBox->SelectEntryPos(
+ m_pParent->m_aJobData.m_eOrientation == orientation::Portrait ? 0 : 1);
+
+ // duplex
+ if( m_pParent->m_aJobData.m_pParser &&
+ (pKey = m_pParent->m_aJobData.m_pParser->getKey( OUString( "Duplex" ) )) )
+ {
+ m_pParent->insertAllPPDValues( *m_pDuplexBox, m_pParent->m_aJobData.m_pParser, pKey );
+ }
+ else
+ {
+ m_pDuplexText->Enable( false );
+ m_pDuplexBox->Enable( false );
+ }
+
+ // paper
+ if( m_pParent->m_aJobData.m_pParser &&
+ (pKey = m_pParent->m_aJobData.m_pParser->getKey( OUString( "PageSize" ) )) )
+ {
+ m_pParent->insertAllPPDValues( *m_pPaperBox, m_pParent->m_aJobData.m_pParser, pKey );
+ }
+ else
+ {
+ m_pPaperText->Enable( false );
+ m_pPaperBox->Enable( false );
+ }
+
+ // input slots
+ if( m_pParent->m_aJobData.m_pParser &&
+ (pKey = m_pParent->m_aJobData.m_pParser->getKey( OUString("InputSlot") )) )
+ {
+ m_pParent->insertAllPPDValues( *m_pSlotBox, m_pParent->m_aJobData.m_pParser, pKey );
+ }
+ else
+ {
+ m_pSlotText->Enable( false );
+ m_pSlotBox->Enable( false );
+ }
+}
+
+
+
+IMPL_LINK( RTSPaperPage, SelectHdl, ListBox*, pBox )
+{
+ const PPDKey* pKey = NULL;
+ if( pBox == m_pPaperBox )
+ {
+ if( m_pParent->m_aJobData.m_pParser )
+ pKey = m_pParent->m_aJobData.m_pParser->getKey( OUString( "PageSize" ) );
+ }
+ else if( pBox == m_pDuplexBox )
+ {
+ if( m_pParent->m_aJobData.m_pParser )
+ pKey = m_pParent->m_aJobData.m_pParser->getKey( OUString( "Duplex" ) );
+ }
+ else if( pBox == m_pSlotBox )
+ {
+ if( m_pParent->m_aJobData.m_pParser )
+ pKey = m_pParent->m_aJobData.m_pParser->getKey( OUString( "InputSlot" ) );
+ }
+ else if( pBox == m_pOrientBox )
+ {
+ m_pParent->m_aJobData.m_eOrientation = m_pOrientBox->GetSelectEntryPos() == 0 ? orientation::Portrait : orientation::Landscape;
+ }
+ if( pKey )
+ {
+ PPDValue* pValue =
+ (PPDValue*)pBox->GetEntryData( pBox->GetSelectEntryPos() );
+ m_pParent->m_aJobData.m_aContext.setValue( pKey, pValue );
+ update();
+ }
+ return 0;
+}
+
+
+
+/*
+ * RTSDevicePage
+ */
+
+RTSDevicePage::RTSDevicePage( RTSDialog* pParent )
+ : TabPage(pParent->m_pTabControl, "PrinterDevicePage", "vcl/ui/printerdevicepage.ui" )
+ , m_pParent( pParent )
+{
+ get(m_pPPDKeyBox, "options");
+ get(m_pPPDValueBox, "values");
+
+ m_pPPDKeyBox->SetDropDownLineCount(12);
+ m_pPPDValueBox->SetDropDownLineCount(12);
+
+ get(m_pLevelBox, "level");
+ get(m_pSpaceBox, "colorspace");
+ get(m_pDepthBox, "colordepth");
+
+ m_pPPDKeyBox->SetSelectHdl( LINK( this, RTSDevicePage, SelectHdl ) );
+ m_pPPDValueBox->SetSelectHdl( LINK( this, RTSDevicePage, SelectHdl ) );
+
+ switch( m_pParent->m_aJobData.m_nColorDevice )
+ {
+ case 0: m_pSpaceBox->SelectEntryPos(0);break;
+ case 1: m_pSpaceBox->SelectEntryPos(1);break;
+ case -1: m_pSpaceBox->SelectEntryPos(2);break;
+ }
+
+ sal_uLong nLevelEntryData = 0; //automatic
+ if( m_pParent->m_aJobData.m_nPDFDevice == 2 ) //explicitly PDF
+ nLevelEntryData = 10;
+ else if (m_pParent->m_aJobData.m_nPSLevel > 0) //explicit PS Level
+ nLevelEntryData = m_pParent->m_aJobData.m_nPSLevel+1;
+ else if (m_pParent->m_aJobData.m_nPDFDevice == 1) //automatically PDF
+ nLevelEntryData = 0;
+ else if (m_pParent->m_aJobData.m_nPDFDevice == -1) //explicitly PS from driver
+ nLevelEntryData = 1;
+
+ bool bAutoIsPDF = officecfg::Office::Common::Print::Option::Printer::PDFAsStandardPrintJobFormat::get();
+
+ assert(nLevelEntryData != 0
+ || "Generic Printer" == m_pParent->m_aJobData.m_aPrinterName
+ || int(bAutoIsPDF) == m_pParent->m_aJobData.m_nPDFDevice);
+
+ OUString sStr = m_pLevelBox->GetEntry(0);
+ m_pLevelBox->InsertEntry(sStr.replaceAll("%s", bAutoIsPDF ? m_pLevelBox->GetEntry(5) : m_pLevelBox->GetEntry(1)), 0);
+ m_pLevelBox->SetEntryData(0, m_pLevelBox->GetEntryData(1));
+ m_pLevelBox->RemoveEntry(1);
+
+ for( sal_uInt16 i = 0; i < m_pLevelBox->GetEntryCount(); i++ )
+ {
+ if( (sal_uLong)m_pLevelBox->GetEntryData( i ) == nLevelEntryData )
+ {
+ m_pLevelBox->SelectEntryPos( i );
+ break;
+ }
+ }
+
+ if (m_pParent->m_aJobData.m_nColorDepth == 8)
+ m_pDepthBox->SelectEntryPos(0);
+ else if (m_pParent->m_aJobData.m_nColorDepth == 24)
+ m_pDepthBox->SelectEntryPos(1);
+
+ // fill ppd boxes
+ if( m_pParent->m_aJobData.m_pParser )
+ {
+ for( int i = 0; i < m_pParent->m_aJobData.m_pParser->getKeys(); i++ )
+ {
+ const PPDKey* pKey = m_pParent->m_aJobData.m_pParser->getKey( i );
+ if( pKey->isUIKey() &&
+ ! pKey->getKey().equalsAscii( "PageSize" ) &&
+ ! pKey->getKey().equalsAscii( "InputSlot" ) &&
+ ! pKey->getKey().equalsAscii( "PageRegion" ) &&
+ ! pKey->getKey().equalsAscii( "Duplex" )
+ )
+ {
+ OUString aEntry( m_pParent->m_aJobData.m_pParser->translateKey( pKey->getKey() ) );
+ sal_uInt16 nPos = m_pPPDKeyBox->InsertEntry( aEntry );
+ m_pPPDKeyBox->SetEntryData( nPos, (void*)pKey );
+ }
+ }
+ }
+}
+
+
+
+RTSDevicePage::~RTSDevicePage()
+{
+}
+
+
+
+void RTSDevicePage::update()
+{
+}
+
+sal_uLong RTSDevicePage::getDepth()
+{
+ sal_uInt16 nSelectPos = m_pDepthBox->GetSelectEntryPos();
+ if (nSelectPos == 0)
+ return 8;
+ else
+ return 24;
+}
+
+sal_uLong RTSDevicePage::getColorDevice()
+{
+ sal_uInt16 nSelectPos = m_pSpaceBox->GetSelectEntryPos();
+ switch (nSelectPos)
+ {
+ case 0:
+ return 0;
+ case 1:
+ return 1;
+ case 2:
+ return -1;
+ }
+ return 0;
+}
+
+
+
+sal_uLong RTSDevicePage::getLevel()
+{
+ sal_uLong nLevel = (sal_uLong)m_pLevelBox->GetEntryData( m_pLevelBox->GetSelectEntryPos() );
+ if (nLevel == 0)
+ return 0; //automatic
+ return nLevel < 10 ? nLevel-1 : 0;
+}
+
+
+
+sal_uLong RTSDevicePage::getPDFDevice()
+{
+ sal_uLong nLevel = (sal_uLong)m_pLevelBox->GetEntryData( m_pLevelBox->GetSelectEntryPos() );
+ if (nLevel > 9)
+ return 2; //explictly PDF
+ else if (nLevel == 0)
+ return 0; //automatic
+ return -1; //explicitly PS
+}
+
+
+
+IMPL_LINK( RTSDevicePage, SelectHdl, ListBox*, pBox )
+{
+ if( pBox == m_pPPDKeyBox )
+ {
+ const PPDKey* pKey = (PPDKey*)m_pPPDKeyBox->GetEntryData( m_pPPDKeyBox->GetSelectEntryPos() );
+ FillValueBox( pKey );
+ }
+ else if( pBox == m_pPPDValueBox )
+ {
+ const PPDKey* pKey = (PPDKey*)m_pPPDKeyBox->GetEntryData( m_pPPDKeyBox->GetSelectEntryPos() );
+ const PPDValue* pValue = (PPDValue*)m_pPPDValueBox->GetEntryData( m_pPPDValueBox->GetSelectEntryPos() );
+ if( pKey && pValue )
+ {
+ m_pParent->m_aJobData.m_aContext.setValue( pKey, pValue );
+ FillValueBox( pKey );
+ }
+ }
+ return 0;
+}
+
+
+
+void RTSDevicePage::FillValueBox( const PPDKey* pKey )
+{
+ m_pPPDValueBox->Clear();
+
+ if( ! pKey )
+ return;
+
+ const PPDValue* pValue = NULL;
+ for( int i = 0; i < pKey->countValues(); i++ )
+ {
+ pValue = pKey->getValue( i );
+ if( m_pParent->m_aJobData.m_aContext.checkConstraints( pKey, pValue ) &&
+ m_pParent->m_aJobData.m_pParser )
+ {
+ OUString aEntry( m_pParent->m_aJobData.m_pParser->translateOption( pKey->getKey(), pValue->m_aOption ) );
+ sal_uInt16 nPos = m_pPPDValueBox->InsertEntry( aEntry );
+ m_pPPDValueBox->SetEntryData( nPos, (void*)pValue );
+ }
+ }
+ pValue = m_pParent->m_aJobData.m_aContext.getValue( pKey );
+ m_pPPDValueBox->SelectEntryPos( m_pPPDValueBox->GetEntryPos( (void*)pValue ) );
+}
+
+int SetupPrinterDriver(::psp::PrinterInfo& rJobData)
+{
+ int nRet = 0;
+ RTSDialog aDialog( rJobData, rJobData.m_aPrinterName, false );
+
+ if( aDialog.Execute() )
+ {
+ rJobData = aDialog.getSetup();
+ nRet = 1;
+ }
+
+ return nRet;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/generic/print/prtsetup.hxx b/vcl/generic/print/prtsetup.hxx
new file mode 100644
index 000000000000..dd1d1094adaf
--- /dev/null
+++ b/vcl/generic/print/prtsetup.hxx
@@ -0,0 +1,129 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _PAD_PRTSETUP_HXX_
+#define _PAD_PRTSETUP_HXX_
+
+#include "tools/link.hxx"
+
+#include "vcl/tabdlg.hxx"
+#include "vcl/tabpage.hxx"
+#include "vcl/tabctrl.hxx"
+#include "vcl/button.hxx"
+#include "vcl/fixed.hxx"
+#include "vcl/lstbox.hxx"
+#include "vcl/field.hxx"
+#include "vcl/combobox.hxx"
+#include "vcl/ppdparser.hxx"
+#include "vcl/printerinfomanager.hxx"
+
+class RTSPaperPage;
+class RTSDevicePage;
+
+class RTSDialog : public TabDialog
+{
+ friend class RTSPaperPage;
+ friend class RTSDevicePage;
+
+ ::psp::PrinterInfo m_aJobData;
+ OUString m_aPrinter;
+
+ // controls
+ TabControl* m_pTabControl;
+ OKButton* m_pOKButton;
+ CancelButton* m_pCancelButton;
+
+ // pages
+ RTSPaperPage* m_pPaperPage;
+ RTSDevicePage* m_pDevicePage;
+
+ // some resources
+ OUString m_aInvalidString;
+
+ DECL_LINK( ActivatePage, TabControl* );
+ DECL_LINK( ClickButton, Button* );
+
+ // helper functions
+ void insertAllPPDValues( ListBox&, const psp::PPDParser*, const psp::PPDKey* );
+public:
+ RTSDialog(const ::psp::PrinterInfo& rJobData, const OUString& rPrinter, Window* pParent = NULL);
+ ~RTSDialog();
+
+ const ::psp::PrinterInfo& getSetup() const { return m_aJobData; }
+};
+
+class RTSPaperPage : public TabPage
+{
+ RTSDialog* m_pParent;
+
+ FixedText* m_pPaperText;
+ ListBox* m_pPaperBox;
+
+ ListBox* m_pOrientBox;
+
+ FixedText* m_pDuplexText;
+ ListBox* m_pDuplexBox;
+
+ FixedText* m_pSlotText;
+ ListBox* m_pSlotBox;
+
+ DECL_LINK( SelectHdl, ListBox* );
+public:
+ RTSPaperPage( RTSDialog* );
+ ~RTSPaperPage();
+
+ void update();
+
+ sal_uInt16 getOrientation() { return m_pOrientBox->GetSelectEntryPos(); }
+};
+
+class RTSDevicePage : public TabPage
+{
+ RTSDialog* m_pParent;
+
+ OUString m_aSpaceColor;
+ OUString m_aSpaceGray;
+
+ ListBox* m_pPPDKeyBox;
+ ListBox* m_pPPDValueBox;
+
+ ListBox* m_pLevelBox;
+ ListBox* m_pSpaceBox;
+ ListBox* m_pDepthBox;
+
+ void FillValueBox( const ::psp::PPDKey* );
+
+ DECL_LINK( SelectHdl, ListBox* );
+public:
+ RTSDevicePage( RTSDialog* );
+ ~RTSDevicePage();
+
+ void update();
+
+ sal_uLong getLevel();
+ sal_uLong getPDFDevice();
+ sal_uLong getDepth();
+ sal_uLong getColorDevice();
+};
+
+int SetupPrinterDriver(::psp::PrinterInfo& rJobData);
+
+#endif // _PAD_PRTSETUP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */