1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef UNOMODEL_HXX 24 #define UNOMODEL_HXX 25 26 #include <com/sun/star/beans/XPropertySet.hpp> 27 #include <com/sun/star/beans/XMultiPropertySet.hpp> 28 #include <com/sun/star/beans/XPropertyState.hpp> 29 #include <com/sun/star/lang/XServiceInfo.hpp> 30 #include <com/sun/star/view/XRenderable.hpp> 31 32 #include <sfx2/sfxbasemodel.hxx> 33 #include <comphelper/propertysethelper.hxx> 34 #include <vcl/print.hxx> 35 36 class SmFormat; 37 38 //////////////////////////////////////////////////////////// 39 40 #define PRTUIOPT_TITLE_ROW "TitleRow" 41 #define PRTUIOPT_FORMULA_TEXT "FormulaText" 42 #define PRTUIOPT_BORDER "Border" 43 #define PRTUIOPT_PRINT_FORMAT "PrintFormat" 44 #define PRTUIOPT_PRINT_SCALE "PrintScale" 45 46 class SmPrintUIOptions : public vcl::PrinterOptionsHelper 47 { 48 public: 49 SmPrintUIOptions(); 50 }; 51 52 53 //////////////////////////////////////////////////////////// 54 55 #define A2OU(pText) rtl::OUString::createFromAscii(pText) 56 57 //----------------------------------------------------------------------------- 58 class SmModel : public SfxBaseModel, 59 public comphelper::PropertySetHelper, 60 public com::sun::star::lang::XServiceInfo, 61 public com::sun::star::view::XRenderable 62 { 63 SmPrintUIOptions* m_pPrintUIOptions; 64 protected: 65 virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const ::com::sun::star::uno::Any* pValues ) 66 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); 67 virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::uno::Any* pValue ) 68 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException ); 69 public: 70 SmModel( SfxObjectShell *pObjSh = 0 ); 71 virtual ~SmModel() throw (); 72 73 //XInterface 74 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); 75 virtual void SAL_CALL acquire( ) throw(); 76 virtual void SAL_CALL release( ) throw(); 77 78 //XTypeProvider 79 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); 80 81 static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); 82 83 //XUnoTunnel 84 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); 85 86 //XRenderable 87 virtual sal_Int32 SAL_CALL getRendererCount( const ::com::sun::star::uno::Any& rSelection, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rxOptions ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 88 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getRenderer( sal_Int32 nRenderer, const ::com::sun::star::uno::Any& rSelection, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rxOptions ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 89 virtual void SAL_CALL render( sal_Int32 nRenderer, const ::com::sun::star::uno::Any& rSelection, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rxOptions ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 90 91 //XServiceInfo 92 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); 93 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); 94 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); 95 96 virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xParent ) throw( ::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException ); 97 98 static ::com::sun::star::uno::Sequence< rtl::OUString > getSupportedServiceNames_Static(); 99 static ::rtl::OUString getImplementationName_Static(); 100 }; 101 102 //////////////////////////////////////////////////////////// 103 104 #endif 105 106