LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/xmloff/source/draw - ximpstyl.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 18 20 90.0 %
Date: 2013-07-09 Functions: 18 21 85.7 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef _XIMPSTYLE_HXX
      21             : #define _XIMPSTYLE_HXX
      22             : 
      23             : #include <xmloff/xmlictxt.hxx>
      24             : #include "sdxmlimp_impl.hxx"
      25             : #include "ximppage.hxx"
      26             : #include <xmloff/xmlstyle.hxx>
      27             : #include <com/sun/star/view/PaperOrientation.hpp>
      28             : #include <vector>
      29             : 
      30             : class SvNumberFormatter;
      31             : class SvXMLNumFmtHelper;
      32             : 
      33             : //////////////////////////////////////////////////////////////////////////////
      34             : // special style:style context inside style:page-master context
      35             : 
      36             : class SdXMLPageMasterStyleContext: public SvXMLStyleContext
      37             : {
      38             :     sal_Int32                   mnBorderBottom;
      39             :     sal_Int32                   mnBorderLeft;
      40             :     sal_Int32                   mnBorderRight;
      41             :     sal_Int32                   mnBorderTop;
      42             :     sal_Int32                   mnWidth;
      43             :     sal_Int32                   mnHeight;
      44             :     com::sun::star::view::PaperOrientation meOrientation;
      45             : 
      46             :     const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
      47         231 :     SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
      48             : 
      49             : public:
      50             :     TYPEINFO();
      51             : 
      52             :     SdXMLPageMasterStyleContext(
      53             :         SdXMLImport& rImport,
      54             :         sal_uInt16 nPrfx,
      55             :         const OUString& rLName,
      56             :         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList);
      57             :     virtual ~SdXMLPageMasterStyleContext();
      58             : 
      59          15 :     sal_Int32 GetBorderBottom() const { return mnBorderBottom; }
      60          15 :     sal_Int32 GetBorderLeft() const { return mnBorderLeft; }
      61          15 :     sal_Int32 GetBorderRight() const { return mnBorderRight; }
      62          15 :     sal_Int32 GetBorderTop() const { return mnBorderTop; }
      63          15 :     sal_Int32 GetWidth() const { return mnWidth; }
      64          15 :     sal_Int32 GetHeight() const { return mnHeight; }
      65          15 :     com::sun::star::view::PaperOrientation GetOrientation() const { return meOrientation; }
      66             : };
      67             : 
      68             : //////////////////////////////////////////////////////////////////////////////
      69             : // style:page-master context
      70             : 
      71             : class SdXMLPageMasterContext: public SvXMLStyleContext
      72             : {
      73             :     OUString               msName;
      74             :     SdXMLPageMasterStyleContext*mpPageMasterStyle;
      75             : 
      76             :     const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
      77          33 :     SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
      78             : 
      79             : public:
      80             :     TYPEINFO();
      81             : 
      82             :     SdXMLPageMasterContext(
      83             :         SdXMLImport& rImport,
      84             :         sal_uInt16 nPrfx,
      85             :         const OUString& rLName,
      86             :         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList);
      87             :     virtual ~SdXMLPageMasterContext();
      88             : 
      89             :     virtual SvXMLImportContext *CreateChildContext(
      90             :         sal_uInt16 nPrefix, const OUString& rLocalName,
      91             :         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
      92             : 
      93             :     const OUString& GetName() const { return msName; }
      94          15 :     const SdXMLPageMasterStyleContext* GetPageMasterStyle() const { return mpPageMasterStyle; }
      95             : };
      96             : 
      97             : //////////////////////////////////////////////////////////////////////////////
      98             : // style:masterpage context
      99             : 
     100             : class SdXMLMasterPageContext: public SdXMLGenericPageContext
     101             : {
     102             :     OUString               msPageMasterName;
     103             :     OUString               msName;
     104             :     OUString               msDisplayName;
     105             :     OUString               msStyleName;
     106             : 
     107             : public:
     108             :     TYPEINFO();
     109             : 
     110             :     SdXMLMasterPageContext(
     111             :         SdXMLImport& rImport,
     112             :         sal_uInt16 nPrfx,
     113             :         const OUString& rLName,
     114             :         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList,
     115             :         com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes);
     116             :     virtual ~SdXMLMasterPageContext();
     117             : 
     118             :     virtual SvXMLImportContext *CreateChildContext(
     119             :         sal_uInt16 nPrefix, const OUString& rLocalName,
     120             :         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
     121             : 
     122             :     virtual void EndElement();
     123             : 
     124             :     const OUString& GetPageMasterName() const { return msPageMasterName; }
     125             :     const OUString& GetEncodedName() const { return msName; }
     126          21 :     const OUString& GetDisplayName() const { return msDisplayName; }
     127             : 
     128             : };
     129             : typedef ::std::vector< SdXMLMasterPageContext* > ImpMasterPageList;
     130             : 
     131             : //////////////////////////////////////////////////////////////////////////////
     132             : // presentation:placeholder context
     133             : 
     134             : class SdXMLPresentationPlaceholderContext: public SvXMLImportContext
     135             : {
     136             :     OUString               msName;
     137             :     sal_Int32                   mnX;
     138             :     sal_Int32                   mnY;
     139             :     sal_Int32                   mnWidth;
     140             :     sal_Int32                   mnHeight;
     141             : 
     142             :     const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
     143         448 :     SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
     144             : 
     145             : public:
     146             :     SdXMLPresentationPlaceholderContext(
     147             :         SdXMLImport& rImport,
     148             :         sal_uInt16 nPrfx,
     149             :         const OUString& rLName,
     150             :         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList);
     151             :     virtual ~SdXMLPresentationPlaceholderContext();
     152             : 
     153          13 :     const OUString& GetName() const { return msName; }
     154           0 :     sal_Int32 GetX() const { return mnX; }
     155             :     sal_Int32 GetY() const { return mnY; }
     156             :     sal_Int32 GetWidth() const { return mnWidth; }
     157             :     sal_Int32 GetHeight() const { return mnHeight; }
     158             : };
     159             : typedef ::std::vector< SdXMLPresentationPlaceholderContext* > ImpPlaceholderList;
     160             : 
     161             : //////////////////////////////////////////////////////////////////////////////
     162             : // style:presentation-page-layout context
     163             : 
     164             : class SdXMLPresentationPageLayoutContext: public SvXMLStyleContext
     165             : {
     166             :     OUString               msName;
     167             :     ImpPlaceholderList          maList;
     168             :     sal_uInt16                  mnTypeId;
     169             : 
     170             :     const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
     171          32 :     SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
     172             : 
     173             : public:
     174             :     TYPEINFO();
     175             : 
     176             :     SdXMLPresentationPageLayoutContext(
     177             :         SdXMLImport& rImport,
     178             :         sal_uInt16 nPrfx,
     179             :         const OUString& rLName,
     180             :         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList);
     181             :     virtual ~SdXMLPresentationPageLayoutContext();
     182             : 
     183             :     virtual SvXMLImportContext *CreateChildContext(
     184             :         sal_uInt16 nPrefix, const OUString& rLocalName,
     185             :         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
     186             : 
     187             :     virtual void EndElement();
     188          12 :     sal_uInt16 GetTypeId() const { return mnTypeId; }
     189             : };
     190             : 
     191             : //////////////////////////////////////////////////////////////////////////////
     192             : // office:styles context
     193             : 
     194             : class SdXMLStylesContext : public SvXMLStylesContext
     195             : {
     196             :     UniReference< SvXMLImportPropertyMapper > xPresImpPropMapper;
     197             :     sal_Bool                    mbIsAutoStyle;
     198             :     SvXMLNumFmtHelper*          mpNumFmtHelper;
     199             :     SvNumberFormatter*          mpNumFormatter;
     200             : 
     201          35 :     const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
     202         488 :     SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
     203             : 
     204             :     void ImpSetGraphicStyles() const;
     205             :     void ImpSetCellStyles() const;
     206             :     void ImpSetGraphicStyles( com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& xPageStyles,
     207             :         sal_uInt16 nFamily, const OUString& rPrefix) const;
     208             : 
     209             : protected:
     210             :     virtual SvXMLStyleContext* CreateStyleChildContext(
     211             :         sal_uInt16 nPrefix,
     212             :         const OUString& rLocalName,
     213             :         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList);
     214             : 
     215             :     virtual SvXMLStyleContext *CreateStyleStyleChildContext(
     216             :         sal_uInt16 nFamily,
     217             :         sal_uInt16 nPrefix,
     218             :         const OUString& rLocalName,
     219             :         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList);
     220             : 
     221             :     virtual SvXMLStyleContext *CreateDefaultStyleStyleChildContext(
     222             :         sal_uInt16 nFamily, sal_uInt16 nPrefix,
     223             :         const OUString& rLocalName,
     224             :         const ::com::sun::star::uno::Reference<
     225             :             ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
     226             : public:
     227             :     TYPEINFO();
     228             : 
     229             :     SdXMLStylesContext(
     230             :         SdXMLImport& rImport,
     231             :         sal_uInt16 nPrfx,
     232             :         const OUString& rLName,
     233             :         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList,
     234             :         sal_Bool bIsAutoStyle);
     235             :     virtual ~SdXMLStylesContext();
     236             : 
     237             :     virtual sal_uInt16 GetFamily( const OUString& rFamily ) const;
     238             :     virtual void EndElement();
     239             :     virtual UniReference< SvXMLImportPropertyMapper > GetImportPropertyMapper(sal_uInt16 nFamily) const;
     240             : 
     241             :     void SetMasterPageStyles(SdXMLMasterPageContext& rMaster) const;
     242             : 
     243             :     ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > getPageLayouts() const;
     244             : };
     245             : 
     246             : //////////////////////////////////////////////////////////////////////////////
     247             : // office:master-styles context
     248             : //
     249             : class SdXMLMasterStylesContext : public SvXMLImportContext
     250             : {
     251             :     ImpMasterPageList           maMasterPageList;
     252             : 
     253             :     const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
     254          54 :     SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
     255             : 
     256             : public:
     257             :     TYPEINFO();
     258             : 
     259             :     SdXMLMasterStylesContext(
     260             :         SdXMLImport& rImport,
     261             :         sal_uInt16 nPrfx,
     262             :         const OUString& rLName);
     263             :     virtual ~SdXMLMasterStylesContext();
     264             : 
     265             :     virtual SvXMLImportContext* CreateChildContext(
     266             :         sal_uInt16 nPrefix,
     267             :         const OUString& rLocalName,
     268             :         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
     269             : 
     270             :     const ImpMasterPageList& GetMasterPageList() const { return maMasterPageList; }
     271             : };
     272             : 
     273             : //////////////////////////////////////////////////////////////////////////////
     274             : // <pres:header-decl>, <pres:footer-decl> and <pres:date-time-decl>
     275             : 
     276           0 : class SdXMLHeaderFooterDeclContext : public SvXMLStyleContext
     277             : {
     278             : public:
     279             :     SdXMLHeaderFooterDeclContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
     280             :         const OUString& rLName,
     281             :         const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
     282             : 
     283             :     virtual sal_Bool IsTransient() const;
     284             :     virtual void EndElement();
     285             :     virtual void Characters( const OUString& rChars );
     286             : 
     287             : private:
     288             :     OUString maStrName;
     289             :     OUString maStrText;
     290             :     OUString maStrDateTimeFormat;
     291             :     sal_Bool        mbFixed;
     292             : };
     293             : 
     294             : 
     295             : #endif  //  _XIMPSTYLE_HXX
     296             : 
     297             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10