Author: arielch
Date: Sat Oct 6 02:44:05 2012
New Revision: 1394904
URL: http://svn.apache.org/viewvc?rev=1394904&view=rev
Log:
Fix line endings
Modified:
incubator/ooo/trunk/main/toolkit/inc/toolkit/awt/vclxprinter.hxx
incubator/ooo/trunk/main/toolkit/source/awt/vclxprinter.cxx
Modified: incubator/ooo/trunk/main/toolkit/inc/toolkit/awt/vclxprinter.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/toolkit/inc/toolkit/awt/vclxprinter.hxx?rev=1394904&r1=1394903&r2=1394904&view=diff
==============================================================================
--- incubator/ooo/trunk/main/toolkit/inc/toolkit/awt/vclxprinter.hxx (original)
+++ incubator/ooo/trunk/main/toolkit/inc/toolkit/awt/vclxprinter.hxx Sat Oct 6 02:44:05 2012
@@ -21,175 +21,175 @@
-#ifndef _TOOLKIT_AWT_VCLXPRINTER_HXX_
-#define _TOOLKIT_AWT_VCLXPRINTER_HXX_
-
-
-#include <com/sun/star/awt/XPrinterPropertySet.hpp>
-#include <com/sun/star/awt/XPrinter.hpp>
-#include <com/sun/star/awt/XPrinterServer.hpp>
-#include <com/sun/star/awt/XInfoPrinter.hpp>
-#include <com/sun/star/lang/XTypeProvider.hpp>
-#include <cppuhelper/weak.hxx>
-#include <osl/mutex.hxx>
-
-#include <toolkit/helper/mutexandbroadcasthelper.hxx>
-#include <cppuhelper/propshlp.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <comphelper/uno3.hxx>
-
-#include "vcl/oldprintadaptor.hxx"
-
-// Fuer den Drucker relevante Properties:
-/*
- sal_Bool Horizontal
- sal_uInt16 CopyCount;
- sal_Bool Collate;
- String FormDescriptor;
- sal_uInt16 Orientation; // PORTRAIT, LANDSCAPE
-*/
-
-// ----------------------------------------------------
-// class VCLXPrinterPropertySet
-// ----------------------------------------------------
-
-typedef ::cppu::WeakImplHelper1 < ::com::sun::star::awt::XPrinterPropertySet
- > VCLXPrinterPropertySet_Base;
-class VCLXPrinterPropertySet :public VCLXPrinterPropertySet_Base
- ,public MutexAndBroadcastHelper
- ,public ::cppu::OPropertySetHelper
-{
-protected:
- boost::shared_ptr<Printer> mpPrinter;
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > mxPrnDevice;
-
- sal_Int16 mnOrientation;
- sal_Bool mbHorizontal;
-public:
- VCLXPrinterPropertySet( const String& rPrinterName );
- virtual ~VCLXPrinterPropertySet();
-
- Printer* GetPrinter() const { return mpPrinter.get(); }
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > GetDevice();
-
- // ::com::sun::star::uno::XInterface
- DECLARE_XINTERFACE();
-
- // ::com::sun::star::lang::XTypeProvider
- DECLARE_XTYPEPROVIDER();
-
- // ::com::sun::star::beans::XPropertySet
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setPropertyValue( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::setPropertyValue( rPropertyName, aValue ); }
- ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& rPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { return OPropertySetHelper::getPropertyValue( rPropertyName ); }
- void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::addPropertyChangeListener( rPropertyName, rxListener ); }
- void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::removePropertyChangeListener( rPropertyName, rxListener ); }
- void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::addVetoableChangeListener( rPropertyName, rxListener ); }
- void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::removeVetoableChangeListener( rPropertyName, rxListener ); }
-
- // ::cppu::OPropertySetHelper
- ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
- sal_Bool SAL_CALL convertFastPropertyValue( ::com::sun::star::uno::Any & rConvertedValue, ::com::sun::star::uno::Any & rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::lang::IllegalArgumentException);
- void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
- using cppu::OPropertySetHelper::getFastPropertyValue;
- void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const;
-
- // ::com::sun::star::awt::XPrinterPropertySet
- void SAL_CALL setHorizontal( sal_Bool bHorizontal ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL selectForm( const ::rtl::OUString& aFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBinarySetup( ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setBinarySetup( const ::com::sun::star::uno::Sequence< sal_Int8 >& data ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
-};
-
-// ----------------------------------------------------
-// class VCLXPrinter
-// ----------------------------------------------------
-
-typedef ::cppu::ImplInheritanceHelper1 < VCLXPrinterPropertySet
- , ::com::sun::star::awt::XPrinter
- > VCLXPrinter_Base;
-class VCLXPrinter: public VCLXPrinter_Base
-{
- boost::shared_ptr<vcl::OldStylePrintAdaptor> mpListener;
- JobSetup maInitJobSetup;
-public:
- VCLXPrinter( const String& rPrinterName );
- ~VCLXPrinter();
-
- // ::com::sun::star::beans::XPropertySet
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertySetInfo(); }
- void SAL_CALL setPropertyValue( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setPropertyValue( rPropertyName, aValue ); }
- ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& rPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertyValue( rPropertyName ); }
- void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addPropertyChangeListener( rPropertyName, rxListener ); }
- void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removePropertyChangeListener( rPropertyName, rxListener ); }
- void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addVetoableChangeListener( rPropertyName, rxListener ); }
- void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removeVetoableChangeListener( rPropertyName, rxListener ); }
-
- // ::com::sun::star::awt::XPrinterPropertySet
- void SAL_CALL setHorizontal( sal_Bool bHorizontal ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setHorizontal( bHorizontal ); }
- ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getFormDescriptions(); }
- void SAL_CALL selectForm( const ::rtl::OUString& aFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::selectForm( aFormDescription ); }
- ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBinarySetup( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getBinarySetup(); }
- void SAL_CALL setBinarySetup( const ::com::sun::star::uno::Sequence< sal_Int8 >& data ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setBinarySetup( data ); }
-
- // ::com::sun::star::awt::XPrinter
- sal_Bool SAL_CALL start( const ::rtl::OUString& nJobName, sal_Int16 nCopies, sal_Bool nCollate ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
- void SAL_CALL end( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException);
- void SAL_CALL terminate( ) throw(::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL startPage( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException);
- void SAL_CALL endPage( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException);
-};
-
-// ----------------------------------------------------
-// class VCLXInfoPrinter
-// ----------------------------------------------------
-
-typedef ::cppu::ImplInheritanceHelper1 < VCLXPrinterPropertySet
- , ::com::sun::star::awt::XInfoPrinter
- > VCLXInfoPrinter_Base;
-class VCLXInfoPrinter: public VCLXInfoPrinter_Base
-{
-public:
- VCLXInfoPrinter( const String& rPrinterName );
- ~VCLXInfoPrinter();
-
- // ::com::sun::star::beans::XPropertySet
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertySetInfo(); }
- void SAL_CALL setPropertyValue( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setPropertyValue( rPropertyName, aValue ); }
- ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& rPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertyValue( rPropertyName ); }
- void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addPropertyChangeListener( rPropertyName, rxListener ); }
- void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removePropertyChangeListener( rPropertyName, rxListener ); }
- void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addVetoableChangeListener( rPropertyName, rxListener ); }
- void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removeVetoableChangeListener( rPropertyName, rxListener ); }
-
- // ::com::sun::star::awt::XPrinterPropertySet
- void SAL_CALL setHorizontal( sal_Bool bHorizontal ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setHorizontal( bHorizontal ); }
- ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getFormDescriptions(); }
- void SAL_CALL selectForm( const ::rtl::OUString& aFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::selectForm( aFormDescription ); }
- ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBinarySetup( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getBinarySetup(); }
- void SAL_CALL setBinarySetup( const ::com::sun::star::uno::Sequence< sal_Int8 >& data ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setBinarySetup( data ); }
-
- // ::com::sun::star::awt::XInfoPrinter
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL createDevice( ) throw(::com::sun::star::uno::RuntimeException);
-};
-
-// ----------------------------------------------------
-// class VCLXPrinterServer
-// ----------------------------------------------------
-
-typedef ::cppu::WeakImplHelper1 < ::com::sun::star::awt::XPrinterServer
- > VCLXPrinterServer_Base;
-class VCLXPrinterServer : public VCLXPrinterServer_Base
-{
-public:
- // ::com::sun::star::awt::XPrinterServer
- ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getPrinterNames( ) throw(::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPrinter > SAL_CALL createPrinter( const ::rtl::OUString& printerName ) throw(::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XInfoPrinter > SAL_CALL createInfoPrinter( const ::rtl::OUString& printerName ) throw(::com::sun::star::uno::RuntimeException);
-};
-
-
-
-
-#endif // _TOOLKIT_AWT_VCLXPRINTER_HXX_
+#ifndef _TOOLKIT_AWT_VCLXPRINTER_HXX_
+#define _TOOLKIT_AWT_VCLXPRINTER_HXX_
+
+
+#include <com/sun/star/awt/XPrinterPropertySet.hpp>
+#include <com/sun/star/awt/XPrinter.hpp>
+#include <com/sun/star/awt/XPrinterServer.hpp>
+#include <com/sun/star/awt/XInfoPrinter.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <cppuhelper/weak.hxx>
+#include <osl/mutex.hxx>
+
+#include <toolkit/helper/mutexandbroadcasthelper.hxx>
+#include <cppuhelper/propshlp.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/uno3.hxx>
+
+#include "vcl/oldprintadaptor.hxx"
+
+// Fuer den Drucker relevante Properties:
+/*
+ sal_Bool Horizontal
+ sal_uInt16 CopyCount;
+ sal_Bool Collate;
+ String FormDescriptor;
+ sal_uInt16 Orientation; // PORTRAIT, LANDSCAPE
+*/
+
+// ----------------------------------------------------
+// class VCLXPrinterPropertySet
+// ----------------------------------------------------
+
+typedef ::cppu::WeakImplHelper1 < ::com::sun::star::awt::XPrinterPropertySet
+ > VCLXPrinterPropertySet_Base;
+class VCLXPrinterPropertySet :public VCLXPrinterPropertySet_Base
+ ,public MutexAndBroadcastHelper
+ ,public ::cppu::OPropertySetHelper
+{
+protected:
+ boost::shared_ptr<Printer> mpPrinter;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > mxPrnDevice;
+
+ sal_Int16 mnOrientation;
+ sal_Bool mbHorizontal;
+public:
+ VCLXPrinterPropertySet( const String& rPrinterName );
+ virtual ~VCLXPrinterPropertySet();
+
+ Printer* GetPrinter() const { return mpPrinter.get(); }
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > GetDevice();
+
+ // ::com::sun::star::uno::XInterface
+ DECLARE_XINTERFACE();
+
+ // ::com::sun::star::lang::XTypeProvider
+ DECLARE_XTYPEPROVIDER();
+
+ // ::com::sun::star::beans::XPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setPropertyValue( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::setPropertyValue( rPropertyName, aValue ); }
+ ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& rPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { return OPropertySetHelper::getPropertyValue( rPropertyName ); }
+ void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::addPropertyChangeListener( rPropertyName, rxListener ); }
+ void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::removePropertyChangeListener( rPropertyName, rxListener ); }
+ void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::addVetoableChangeListener( rPropertyName, rxListener ); }
+ void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::removeVetoableChangeListener( rPropertyName, rxListener ); }
+
+ // ::cppu::OPropertySetHelper
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ sal_Bool SAL_CALL convertFastPropertyValue( ::com::sun::star::uno::Any & rConvertedValue, ::com::sun::star::uno::Any & rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::lang::IllegalArgumentException);
+ void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
+ using cppu::OPropertySetHelper::getFastPropertyValue;
+ void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const;
+
+ // ::com::sun::star::awt::XPrinterPropertySet
+ void SAL_CALL setHorizontal( sal_Bool bHorizontal ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL selectForm( const ::rtl::OUString& aFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBinarySetup( ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setBinarySetup( const ::com::sun::star::uno::Sequence< sal_Int8 >& data ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+};
+
+// ----------------------------------------------------
+// class VCLXPrinter
+// ----------------------------------------------------
+
+typedef ::cppu::ImplInheritanceHelper1 < VCLXPrinterPropertySet
+ , ::com::sun::star::awt::XPrinter
+ > VCLXPrinter_Base;
+class VCLXPrinter: public VCLXPrinter_Base
+{
+ boost::shared_ptr<vcl::OldStylePrintAdaptor> mpListener;
+ JobSetup maInitJobSetup;
+public:
+ VCLXPrinter( const String& rPrinterName );
+ ~VCLXPrinter();
+
+ // ::com::sun::star::beans::XPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertySetInfo(); }
+ void SAL_CALL setPropertyValue( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setPropertyValue( rPropertyName, aValue ); }
+ ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& rPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertyValue( rPropertyName ); }
+ void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addPropertyChangeListener( rPropertyName, rxListener ); }
+ void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removePropertyChangeListener( rPropertyName, rxListener ); }
+ void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addVetoableChangeListener( rPropertyName, rxListener ); }
+ void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removeVetoableChangeListener( rPropertyName, rxListener ); }
+
+ // ::com::sun::star::awt::XPrinterPropertySet
+ void SAL_CALL setHorizontal( sal_Bool bHorizontal ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setHorizontal( bHorizontal ); }
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getFormDescriptions(); }
+ void SAL_CALL selectForm( const ::rtl::OUString& aFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::selectForm( aFormDescription ); }
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBinarySetup( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getBinarySetup(); }
+ void SAL_CALL setBinarySetup( const ::com::sun::star::uno::Sequence< sal_Int8 >& data ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setBinarySetup( data ); }
+
+ // ::com::sun::star::awt::XPrinter
+ sal_Bool SAL_CALL start( const ::rtl::OUString& nJobName, sal_Int16 nCopies, sal_Bool nCollate ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ void SAL_CALL end( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException);
+ void SAL_CALL terminate( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL startPage( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException);
+ void SAL_CALL endPage( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException);
+};
+
+// ----------------------------------------------------
+// class VCLXInfoPrinter
+// ----------------------------------------------------
+
+typedef ::cppu::ImplInheritanceHelper1 < VCLXPrinterPropertySet
+ , ::com::sun::star::awt::XInfoPrinter
+ > VCLXInfoPrinter_Base;
+class VCLXInfoPrinter : public VCLXInfoPrinter_Base
+{
+public:
+ VCLXInfoPrinter( const String& rPrinterName );
+ ~VCLXInfoPrinter();
+
+ // ::com::sun::star::beans::XPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertySetInfo(); }
+ void SAL_CALL setPropertyValue( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setPropertyValue( rPropertyName, aValue ); }
+ ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& rPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertyValue( rPropertyName ); }
+ void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addPropertyChangeListener( rPropertyName, rxListener ); }
+ void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removePropertyChangeListener( rPropertyName, rxListener ); }
+ void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addVetoableChangeListener( rPropertyName, rxListener ); }
+ void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removeVetoableChangeListener( rPropertyName, rxListener ); }
+
+ // ::com::sun::star::awt::XPrinterPropertySet
+ void SAL_CALL setHorizontal( sal_Bool bHorizontal ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setHorizontal( bHorizontal ); }
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getFormDescriptions(); }
+ void SAL_CALL selectForm( const ::rtl::OUString& aFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::selectForm( aFormDescription ); }
+ ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBinarySetup( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getBinarySetup(); }
+ void SAL_CALL setBinarySetup( const ::com::sun::star::uno::Sequence< sal_Int8 >& data ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setBinarySetup( data ); }
+
+ // ::com::sun::star::awt::XInfoPrinter
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL createDevice( ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+// ----------------------------------------------------
+// class VCLXPrinterServer
+// ----------------------------------------------------
+
+typedef ::cppu::WeakImplHelper1 < ::com::sun::star::awt::XPrinterServer
+ > VCLXPrinterServer_Base;
+class VCLXPrinterServer : public VCLXPrinterServer_Base
+{
+public:
+ // ::com::sun::star::awt::XPrinterServer
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getPrinterNames( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPrinter > SAL_CALL createPrinter( const ::rtl::OUString& printerName ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XInfoPrinter > SAL_CALL createInfoPrinter( const ::rtl::OUString& printerName ) throw(::com::sun::star::uno::RuntimeException);
+};
+
+
+
+
+#endif // _TOOLKIT_AWT_VCLXPRINTER_HXX_
Modified: incubator/ooo/trunk/main/toolkit/source/awt/vclxprinter.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/toolkit/source/awt/vclxprinter.cxx?rev=1394904&r1=1394903&r2=1394904&view=diff
==============================================================================
--- incubator/ooo/trunk/main/toolkit/source/awt/vclxprinter.cxx (original)
+++ incubator/ooo/trunk/main/toolkit/source/awt/vclxprinter.cxx Sat Oct 6 02:44:05 2012
@@ -21,372 +21,372 @@
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_toolkit.hxx"
-
-
-#include <toolkit/awt/vclxprinter.hxx>
-#include <toolkit/helper/macros.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <rtl/memory.h>
-#include <rtl/uuid.h>
-
-
-#include <vcl/print.hxx>
-#include <vcl/jobset.hxx>
-#include <vcl/svapp.hxx>
-
-#include <tools/debug.hxx>
-#include <tools/stream.hxx>
-
-#include <toolkit/awt/vclxdevice.hxx>
-
-
-#define BINARYSETUPMARKER 0x23864691
-
-#define PROPERTY_Orientation 0
-#define PROPERTY_Horizontal 1
-
-::com::sun::star::beans::Property* ImplGetProperties( sal_uInt16& rElementCount )
-{
- static ::com::sun::star::beans::Property* pProperties = NULL;
- static sal_uInt16 nElements = 0;
- if( !pProperties )
- {
- ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !pProperties )
- {
- static ::com::sun::star::beans::Property __FAR_DATA aPropTable[] =
- {
- ::com::sun::star::beans::Property( ::rtl::OUString::createFromAscii( "Orientation" ), PROPERTY_Orientation, ::getCppuType((const sal_Int16*)0), 0 ),
- ::com::sun::star::beans::Property( ::rtl::OUString::createFromAscii( "Horizontal" ), PROPERTY_Horizontal, ::getBooleanCppuType(), 0 )
- };
- pProperties = aPropTable;
- nElements = sizeof( aPropTable ) / sizeof( ::com::sun::star::beans::Property );
- }
- }
- rElementCount = nElements;
- return pProperties;
-}
-
-// ----------------------------------------------------
-// class VCLXPrinterPropertySet
-// ----------------------------------------------------
-
-IMPLEMENT_FORWARD_XINTERFACE2( VCLXPrinterPropertySet, VCLXPrinterPropertySet_Base, OPropertySetHelper )
-IMPLEMENT_FORWARD_XTYPEPROVIDER2( VCLXPrinterPropertySet, VCLXPrinterPropertySet_Base, ::cppu::OPropertySetHelper )
-
-VCLXPrinterPropertySet::VCLXPrinterPropertySet( const String& rPrinterName )
- : OPropertySetHelper( BrdcstHelper )
- , mpPrinter( new Printer( rPrinterName ) )
-{
- osl::Guard< vos::IMutex > aSolarGuard( Application::GetSolarMutex() );
-
- mnOrientation = 0;
- mbHorizontal = sal_False;
-}
-
-VCLXPrinterPropertySet::~VCLXPrinterPropertySet()
-{
- osl::Guard< vos::IMutex > aSolarGuard( Application::GetSolarMutex() );
- mpPrinter.reset();
-}
-
-::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > VCLXPrinterPropertySet::GetDevice()
-{
- if ( !mxPrnDevice.is() )
- {
- VCLXDevice* pDev = new VCLXDevice;
- pDev->SetOutputDevice( GetPrinter() );
- mxPrnDevice = pDev;
- }
- return mxPrnDevice;
-}
-
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > VCLXPrinterPropertySet::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
-{
- static ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
- return xInfo;
-}
-
-::cppu::IPropertyArrayHelper& VCLXPrinterPropertySet::getInfoHelper()
-{
- static ::cppu::OPropertyArrayHelper* pPropertyArrayHelper = NULL;
- if ( !pPropertyArrayHelper )
- {
- ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !pPropertyArrayHelper )
- {
- sal_uInt16 nElements;
- ::com::sun::star::beans::Property* pProps = ImplGetProperties( nElements );
- pPropertyArrayHelper = new ::cppu::OPropertyArrayHelper( pProps, nElements, sal_False );
- }
- }
- return *pPropertyArrayHelper ;
-}
-
-sal_Bool VCLXPrinterPropertySet::convertFastPropertyValue( ::com::sun::star::uno::Any & rConvertedValue, ::com::sun::star::uno::Any & rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::lang::IllegalArgumentException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
-
- sal_Bool bDifferent = sal_False;
- switch ( nHandle )
- {
- case PROPERTY_Orientation:
- {
- sal_Int16 n;
- if( ( rValue >>= n ) && ( n != mnOrientation ) )
- {
- rConvertedValue <<= n;
- rOldValue <<= mnOrientation;
- bDifferent = sal_True;
- }
- }
- break;
- case PROPERTY_Horizontal:
- {
- sal_Bool b;
- if( ( rValue >>= b ) && ( b != mbHorizontal ) )
- {
- rConvertedValue <<= b;
- rOldValue <<= mbHorizontal;
- bDifferent = sal_True;
- }
- }
- break;
- default:
- {
- DBG_ERROR( "VCLXPrinterPropertySet_Impl::convertFastPropertyValue - invalid Handle" );
- }
- }
- return bDifferent;
-}
-
-void VCLXPrinterPropertySet::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
-
- switch( nHandle )
- {
- case PROPERTY_Orientation:
- {
- rValue >>= mnOrientation;
- }
- break;
- case PROPERTY_Horizontal:
- {
- rValue >>= mbHorizontal;
- }
- break;
- default:
- {
- DBG_ERROR( "VCLXPrinterPropertySet_Impl::convertFastPropertyValue - invalid Handle" );
- }
- }
-}
-
-void VCLXPrinterPropertySet::getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const
-{
- ::osl::Guard< ::osl::Mutex > aGuard( ((VCLXPrinterPropertySet*)this)->Mutex );
-
- switch( nHandle )
- {
- case PROPERTY_Orientation:
- rValue <<= mnOrientation;
- break;
- case PROPERTY_Horizontal:
- rValue <<= mbHorizontal;
- break;
- default:
- {
- DBG_ERROR( "VCLXPrinterPropertySet_Impl::convertFastPropertyValue - invalid Handle" );
- }
- }
-}
-
-// ::com::sun::star::awt::XPrinterPropertySet
-void VCLXPrinterPropertySet::setHorizontal( sal_Bool bHorizontal ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
-
- ::com::sun::star::uno::Any aValue;
- aValue <<= bHorizontal;
- setFastPropertyValue( PROPERTY_Horizontal, aValue );
-}
-
-::com::sun::star::uno::Sequence< ::rtl::OUString > VCLXPrinterPropertySet::getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
-
- sal_uInt16 nPaperBinCount = GetPrinter()->GetPaperBinCount();
- ::com::sun::star::uno::Sequence< ::rtl::OUString > aDescriptions( nPaperBinCount );
- for ( sal_uInt16 n = 0; n < nPaperBinCount; n++ )
- {
- // Format: <DisplayFormName;FormNameId;DisplayPaperBinName;PaperBinNameId;DisplayPaperName;PaperNameId>
- String aDescr( RTL_CONSTASCII_USTRINGPARAM( "*;*;" ) );
- aDescr += GetPrinter()->GetPaperBinName( n );
- aDescr += ';';
- aDescr += n;
- aDescr.AppendAscii( ";*;*", 4 );
-
- aDescriptions.getArray()[n] = aDescr;
- }
- return aDescriptions;
-}
-
-void VCLXPrinterPropertySet::selectForm( const ::rtl::OUString& rFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
-
- sal_Int32 nIndex = 0;
- sal_uInt16 nPaperBin = sal::static_int_cast< sal_uInt16 >(
- rFormDescription.getToken( 3, ';', nIndex ).toInt32());
- GetPrinter()->SetPaperBin( nPaperBin );
-}
-
-::com::sun::star::uno::Sequence< sal_Int8 > VCLXPrinterPropertySet::getBinarySetup( ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
-
- SvMemoryStream aMem;
- aMem << BINARYSETUPMARKER;
- aMem << GetPrinter()->GetJobSetup();
- return ::com::sun::star::uno::Sequence<sal_Int8>( (sal_Int8*) aMem.GetData(), aMem.Tell() );
-}
-
-void VCLXPrinterPropertySet::setBinarySetup( const ::com::sun::star::uno::Sequence< sal_Int8 >& data ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
-
- SvMemoryStream aMem( (char*) data.getConstArray(), data.getLength(), STREAM_READ );
- sal_uInt32 nMarker;
- aMem >> nMarker;
- DBG_ASSERT( nMarker == BINARYSETUPMARKER, "setBinarySetup - invalid!" );
- if ( nMarker == BINARYSETUPMARKER )
- {
- JobSetup aSetup;
- aMem >> aSetup;
- GetPrinter()->SetJobSetup( aSetup );
- }
-}
-
-
-// ----------------------------------------------------
-// class VCLXPrinter
-// ----------------------------------------------------
-VCLXPrinter::VCLXPrinter( const String& rPrinterName )
- : VCLXPrinter_Base( rPrinterName )
-{
-}
-
-VCLXPrinter::~VCLXPrinter()
-{
-}
-
-sal_Bool VCLXPrinter::start( const ::rtl::OUString& /*rJobName*/, sal_Int16 /*nCopies*/, sal_Bool /*bCollate*/ ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
-
- sal_Bool bDone = sal_True;
- if ( mpListener.get() )
- {
- maInitJobSetup = mpPrinter->GetJobSetup();
- mpListener.reset( new vcl::OldStylePrintAdaptor( mpPrinter ) );
- }
-
- return bDone;
-}
-
-void VCLXPrinter::end( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
-
- if ( mpListener.get() )
- {
- Printer::PrintJob( mpListener, maInitJobSetup );
- mpListener.reset();
- }
-}
-
-void VCLXPrinter::terminate( ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
-
- mpListener.reset();
-}
-
-::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > VCLXPrinter::startPage( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
-
- if ( mpListener.get() )
- {
- mpListener->StartPage();
- }
- return GetDevice();
-}
-
-void VCLXPrinter::endPage( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
-
- if ( mpListener.get() )
- {
- mpListener->EndPage();
- }
-}
-
-
-// ----------------------------------------------------
-// class VCLXInfoPrinter
-// ----------------------------------------------------
-
-VCLXInfoPrinter::VCLXInfoPrinter( const String& rPrinterName )
- : VCLXInfoPrinter_Base( rPrinterName )
-{
-}
-
-VCLXInfoPrinter::~VCLXInfoPrinter()
-{
-}
-
-// ::com::sun::star::awt::XInfoPrinter
-::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > VCLXInfoPrinter::createDevice( ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
-
- return GetDevice();
-}
-
-// ----------------------------------------------------
-// class VCLXPrinterServer
-// ----------------------------------------------------
-
-// ::com::sun::star::awt::XPrinterServer
-::com::sun::star::uno::Sequence< ::rtl::OUString > VCLXPrinterServer::getPrinterNames( ) throw(::com::sun::star::uno::RuntimeException)
-{
- const std::vector<rtl::OUString>& rQueues = Printer::GetPrinterQueues();
- sal_uInt32 nPrinters = rQueues.size();
-
- ::com::sun::star::uno::Sequence< ::rtl::OUString > aNames( nPrinters );
- for ( sal_uInt32 n = 0; n < nPrinters; n++ )
- aNames.getArray()[n] = rQueues[n];
-
- return aNames;
-}
-
-::com::sun::star::uno::Reference< ::com::sun::star::awt::XPrinter > VCLXPrinterServer::createPrinter( const ::rtl::OUString& rPrinterName ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPrinter > xP;
- xP = new VCLXPrinter( rPrinterName );
- return xP;
-}
-
-::com::sun::star::uno::Reference< ::com::sun::star::awt::XInfoPrinter > VCLXPrinterServer::createInfoPrinter( const ::rtl::OUString& rPrinterName ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XInfoPrinter > xP;
- xP = new VCLXInfoPrinter( rPrinterName );
- return xP;
-}
-
-
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_toolkit.hxx"
+
+
+#include <toolkit/awt/vclxprinter.hxx>
+#include <toolkit/helper/macros.hxx>
+#include <cppuhelper/typeprovider.hxx>
+#include <rtl/memory.h>
+#include <rtl/uuid.h>
+
+
+#include <vcl/print.hxx>
+#include <vcl/jobset.hxx>
+#include <vcl/svapp.hxx>
+
+#include <tools/debug.hxx>
+#include <tools/stream.hxx>
+
+#include <toolkit/awt/vclxdevice.hxx>
+
+
+#define BINARYSETUPMARKER 0x23864691
+
+#define PROPERTY_Orientation 0
+#define PROPERTY_Horizontal 1
+
+::com::sun::star::beans::Property* ImplGetProperties( sal_uInt16& rElementCount )
+{
+ static ::com::sun::star::beans::Property* pProperties = NULL;
+ static sal_uInt16 nElements = 0;
+ if( !pProperties )
+ {
+ ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() );
+ if( !pProperties )
+ {
+ static ::com::sun::star::beans::Property __FAR_DATA aPropTable[] =
+ {
+ ::com::sun::star::beans::Property( ::rtl::OUString::createFromAscii( "Orientation" ), PROPERTY_Orientation, ::getCppuType((const sal_Int16*)0), 0 ),
+ ::com::sun::star::beans::Property( ::rtl::OUString::createFromAscii( "Horizontal" ), PROPERTY_Horizontal, ::getBooleanCppuType(), 0 )
+ };
+ pProperties = aPropTable;
+ nElements = sizeof( aPropTable ) / sizeof( ::com::sun::star::beans::Property );
+ }
+ }
+ rElementCount = nElements;
+ return pProperties;
+}
+
+// ----------------------------------------------------
+// class VCLXPrinterPropertySet
+// ----------------------------------------------------
+
+IMPLEMENT_FORWARD_XINTERFACE2( VCLXPrinterPropertySet, VCLXPrinterPropertySet_Base, OPropertySetHelper )
+IMPLEMENT_FORWARD_XTYPEPROVIDER2( VCLXPrinterPropertySet, VCLXPrinterPropertySet_Base, ::cppu::OPropertySetHelper )
+
+VCLXPrinterPropertySet::VCLXPrinterPropertySet( const String& rPrinterName )
+ : OPropertySetHelper( BrdcstHelper )
+ , mpPrinter( new Printer( rPrinterName ) )
+{
+ osl::Guard< vos::IMutex > aSolarGuard( Application::GetSolarMutex() );
+
+ mnOrientation = 0;
+ mbHorizontal = sal_False;
+}
+
+VCLXPrinterPropertySet::~VCLXPrinterPropertySet()
+{
+ osl::Guard< vos::IMutex > aSolarGuard( Application::GetSolarMutex() );
+ mpPrinter.reset();
+}
+
+::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > VCLXPrinterPropertySet::GetDevice()
+{
+ if ( !mxPrnDevice.is() )
+ {
+ VCLXDevice* pDev = new VCLXDevice;
+ pDev->SetOutputDevice( GetPrinter() );
+ mxPrnDevice = pDev;
+ }
+ return mxPrnDevice;
+}
+
+::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > VCLXPrinterPropertySet::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
+{
+ static ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+}
+
+::cppu::IPropertyArrayHelper& VCLXPrinterPropertySet::getInfoHelper()
+{
+ static ::cppu::OPropertyArrayHelper* pPropertyArrayHelper = NULL;
+ if ( !pPropertyArrayHelper )
+ {
+ ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() );
+ if( !pPropertyArrayHelper )
+ {
+ sal_uInt16 nElements;
+ ::com::sun::star::beans::Property* pProps = ImplGetProperties( nElements );
+ pPropertyArrayHelper = new ::cppu::OPropertyArrayHelper( pProps, nElements, sal_False );
+ }
+ }
+ return *pPropertyArrayHelper ;
+}
+
+sal_Bool VCLXPrinterPropertySet::convertFastPropertyValue( ::com::sun::star::uno::Any & rConvertedValue, ::com::sun::star::uno::Any & rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::lang::IllegalArgumentException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
+
+ sal_Bool bDifferent = sal_False;
+ switch ( nHandle )
+ {
+ case PROPERTY_Orientation:
+ {
+ sal_Int16 n;
+ if( ( rValue >>= n ) && ( n != mnOrientation ) )
+ {
+ rConvertedValue <<= n;
+ rOldValue <<= mnOrientation;
+ bDifferent = sal_True;
+ }
+ }
+ break;
+ case PROPERTY_Horizontal:
+ {
+ sal_Bool b;
+ if( ( rValue >>= b ) && ( b != mbHorizontal ) )
+ {
+ rConvertedValue <<= b;
+ rOldValue <<= mbHorizontal;
+ bDifferent = sal_True;
+ }
+ }
+ break;
+ default:
+ {
+ DBG_ERROR( "VCLXPrinterPropertySet_Impl::convertFastPropertyValue - invalid Handle" );
+ }
+ }
+ return bDifferent;
+}
+
+void VCLXPrinterPropertySet::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
+
+ switch( nHandle )
+ {
+ case PROPERTY_Orientation:
+ {
+ rValue >>= mnOrientation;
+ }
+ break;
+ case PROPERTY_Horizontal:
+ {
+ rValue >>= mbHorizontal;
+ }
+ break;
+ default:
+ {
+ DBG_ERROR( "VCLXPrinterPropertySet_Impl::convertFastPropertyValue - invalid Handle" );
+ }
+ }
+}
+
+void VCLXPrinterPropertySet::getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( ((VCLXPrinterPropertySet*)this)->Mutex );
+
+ switch( nHandle )
+ {
+ case PROPERTY_Orientation:
+ rValue <<= mnOrientation;
+ break;
+ case PROPERTY_Horizontal:
+ rValue <<= mbHorizontal;
+ break;
+ default:
+ {
+ DBG_ERROR( "VCLXPrinterPropertySet_Impl::convertFastPropertyValue - invalid Handle" );
+ }
+ }
+}
+
+// ::com::sun::star::awt::XPrinterPropertySet
+void VCLXPrinterPropertySet::setHorizontal( sal_Bool bHorizontal ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
+
+ ::com::sun::star::uno::Any aValue;
+ aValue <<= bHorizontal;
+ setFastPropertyValue( PROPERTY_Horizontal, aValue );
+}
+
+::com::sun::star::uno::Sequence< ::rtl::OUString > VCLXPrinterPropertySet::getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
+
+ sal_uInt16 nPaperBinCount = GetPrinter()->GetPaperBinCount();
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > aDescriptions( nPaperBinCount );
+ for ( sal_uInt16 n = 0; n < nPaperBinCount; n++ )
+ {
+ // Format: <DisplayFormName;FormNameId;DisplayPaperBinName;PaperBinNameId;DisplayPaperName;PaperNameId>
+ String aDescr( RTL_CONSTASCII_USTRINGPARAM( "*;*;" ) );
+ aDescr += GetPrinter()->GetPaperBinName( n );
+ aDescr += ';';
+ aDescr += n;
+ aDescr.AppendAscii( ";*;*", 4 );
+
+ aDescriptions.getArray()[n] = aDescr;
+ }
+ return aDescriptions;
+}
+
+void VCLXPrinterPropertySet::selectForm( const ::rtl::OUString& rFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
+
+ sal_Int32 nIndex = 0;
+ sal_uInt16 nPaperBin = sal::static_int_cast< sal_uInt16 >(
+ rFormDescription.getToken( 3, ';', nIndex ).toInt32());
+ GetPrinter()->SetPaperBin( nPaperBin );
+}
+
+::com::sun::star::uno::Sequence< sal_Int8 > VCLXPrinterPropertySet::getBinarySetup( ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
+
+ SvMemoryStream aMem;
+ aMem << BINARYSETUPMARKER;
+ aMem << GetPrinter()->GetJobSetup();
+ return ::com::sun::star::uno::Sequence<sal_Int8>( (sal_Int8*) aMem.GetData(), aMem.Tell() );
+}
+
+void VCLXPrinterPropertySet::setBinarySetup( const ::com::sun::star::uno::Sequence< sal_Int8 >& data ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
+
+ SvMemoryStream aMem( (char*) data.getConstArray(), data.getLength(), STREAM_READ );
+ sal_uInt32 nMarker;
+ aMem >> nMarker;
+ DBG_ASSERT( nMarker == BINARYSETUPMARKER, "setBinarySetup - invalid!" );
+ if ( nMarker == BINARYSETUPMARKER )
+ {
+ JobSetup aSetup;
+ aMem >> aSetup;
+ GetPrinter()->SetJobSetup( aSetup );
+ }
+}
+
+
+// ----------------------------------------------------
+// class VCLXPrinter
+// ----------------------------------------------------
+VCLXPrinter::VCLXPrinter( const String& rPrinterName )
+ : VCLXPrinter_Base( rPrinterName )
+{
+}
+
+VCLXPrinter::~VCLXPrinter()
+{
+}
+
+sal_Bool VCLXPrinter::start( const ::rtl::OUString& /*rJobName*/, sal_Int16 /*nCopies*/, sal_Bool /*bCollate*/ ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
+
+ sal_Bool bDone = sal_True;
+ if ( mpListener.get() )
+ {
+ maInitJobSetup = mpPrinter->GetJobSetup();
+ mpListener.reset( new vcl::OldStylePrintAdaptor( mpPrinter ) );
+ }
+
+ return bDone;
+}
+
+void VCLXPrinter::end( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
+
+ if ( mpListener.get() )
+ {
+ Printer::PrintJob( mpListener, maInitJobSetup );
+ mpListener.reset();
+ }
+}
+
+void VCLXPrinter::terminate( ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
+
+ mpListener.reset();
+}
+
+::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > VCLXPrinter::startPage( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
+
+ if ( mpListener.get() )
+ {
+ mpListener->StartPage();
+ }
+ return GetDevice();
+}
+
+void VCLXPrinter::endPage( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
+
+ if ( mpListener.get() )
+ {
+ mpListener->EndPage();
+ }
+}
+
+
+// ----------------------------------------------------
+// class VCLXInfoPrinter
+// ----------------------------------------------------
+
+VCLXInfoPrinter::VCLXInfoPrinter( const String& rPrinterName )
+ : VCLXInfoPrinter_Base( rPrinterName )
+{
+}
+
+VCLXInfoPrinter::~VCLXInfoPrinter()
+{
+}
+
+// ::com::sun::star::awt::XInfoPrinter
+::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > VCLXInfoPrinter::createDevice( ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( Mutex );
+
+ return GetDevice();
+}
+
+// ----------------------------------------------------
+// class VCLXPrinterServer
+// ----------------------------------------------------
+
+// ::com::sun::star::awt::XPrinterServer
+::com::sun::star::uno::Sequence< ::rtl::OUString > VCLXPrinterServer::getPrinterNames( ) throw(::com::sun::star::uno::RuntimeException)
+{
+ const std::vector<rtl::OUString>& rQueues = Printer::GetPrinterQueues();
+ sal_uInt32 nPrinters = rQueues.size();
+
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > aNames( nPrinters );
+ for ( sal_uInt32 n = 0; n < nPrinters; n++ )
+ aNames.getArray()[n] = rQueues[n];
+
+ return aNames;
+}
+
+::com::sun::star::uno::Reference< ::com::sun::star::awt::XPrinter > VCLXPrinterServer::createPrinter( const ::rtl::OUString& rPrinterName ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPrinter > xP;
+ xP = new VCLXPrinter( rPrinterName );
+ return xP;
+}
+
+::com::sun::star::uno::Reference< ::com::sun::star::awt::XInfoPrinter > VCLXPrinterServer::createInfoPrinter( const ::rtl::OUString& rPrinterName ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XInfoPrinter > xP;
+ xP = new VCLXInfoPrinter( rPrinterName );
+ return xP;
+}
+
+
|