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 virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::uno::Any* pValue ); 67 public: 68 SmModel( SfxObjectShell *pObjSh = 0 ); 69 virtual ~SmModel() throw (); 70 71 //XInterface 72 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ); 73 virtual void SAL_CALL acquire( ) throw(); 74 virtual void SAL_CALL release( ) throw(); 75 76 //XTypeProvider 77 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ); 78 79 static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); 80 81 //XUnoTunnel 82 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ); 83 84 //XRenderable 85 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 ); 86 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 ); 87 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 ); 88 89 //XServiceInfo 90 virtual rtl::OUString SAL_CALL getImplementationName(void); 91 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName); 92 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void); 93 94 virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xParent ); 95 96 static ::com::sun::star::uno::Sequence< rtl::OUString > getSupportedServiceNames_Static(); 97 static ::rtl::OUString getImplementationName_Static(); 98 }; 99 100 //////////////////////////////////////////////////////////// 101 102 #endif 103