LCOV - code coverage report
Current view: top level - libreoffice/unoxml/source/dom - attr.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 40 2.5 %
Date: 2012-12-17 Functions: 2 21 9.5 %
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 DOM_ATTR_HXX
      21             : #define DOM_ATTR_HXX
      22             : 
      23             : #include <memory>
      24             : 
      25             : #include <libxml/tree.h>
      26             : 
      27             : #include <cppuhelper/implbase1.hxx>
      28             : 
      29             : #include <com/sun/star/uno/Reference.h>
      30             : #include <com/sun/star/xml/dom/XNode.hpp>
      31             : #include <com/sun/star/xml/dom/XAttr.hpp>
      32             : 
      33             : #include <node.hxx>
      34             : 
      35             : using ::rtl::OUString;
      36             : using namespace com::sun::star::uno;
      37             : using namespace com::sun::star::xml::dom;
      38             : 
      39             : namespace DOM
      40             : {
      41             :     typedef ::std::pair< ::rtl::OString, ::rtl::OString > stringpair_t;
      42             : 
      43             :     typedef ::cppu::ImplInheritanceHelper1< CNode, XAttr > CAttr_Base;
      44             : 
      45       17556 :     class CAttr
      46             :         : public CAttr_Base
      47             :     {
      48             :     private:
      49             :         friend class CDocument;
      50             : 
      51             :     private:
      52             :         xmlAttrPtr m_aAttrPtr;
      53             :         ::std::auto_ptr< stringpair_t > m_pNamespace;
      54             : 
      55             :     protected:
      56             :         CAttr(CDocument const& rDocument, ::osl::Mutex const& rMutex,
      57             :                 xmlAttrPtr const pAttr);
      58             : 
      59             :     public:
      60             :         /// return the libxml namespace corresponding to m_pNamespace on pNode
      61             :         xmlNsPtr GetNamespace(xmlNodePtr const pNode);
      62             : 
      63             :         virtual bool IsChildTypeAllowed(NodeType const nodeType);
      64             : 
      65             :         /**
      66             :         Returns the name of this attribute.
      67             :         */
      68             :         virtual OUString SAL_CALL getName() throw (RuntimeException);
      69             : 
      70             :         /**
      71             :         The Element node this attribute is attached to or null if this
      72             :         attribute is not in use.
      73             :         */
      74             :         virtual Reference< XElement > SAL_CALL getOwnerElement() throw (RuntimeException);
      75             : 
      76             :         /**
      77             :         If this attribute was explicitly given a value in the original
      78             :         document, this is true; otherwise, it is false.
      79             :         */
      80             :         virtual sal_Bool SAL_CALL getSpecified()throw (RuntimeException);
      81             : 
      82             :         /**
      83             :         On retrieval, the value of the attribute is returned as a string.
      84             :         */
      85             :         virtual OUString SAL_CALL getValue() throw (RuntimeException);
      86             : 
      87             :         /**
      88             :         Sets the value of the attribute from a string.
      89             :         */
      90             : 
      91             :         virtual void SAL_CALL setValue(const OUString& value) throw (RuntimeException, DOMException);
      92             : 
      93             :         // resolve uno inheritance problems...
      94             :         // overrides for XNode base
      95             :         virtual OUString SAL_CALL getNodeName()
      96             :             throw (RuntimeException);
      97             :         virtual OUString SAL_CALL getNodeValue()
      98             :             throw (RuntimeException);
      99             :         virtual OUString SAL_CALL getLocalName()
     100             :             throw (RuntimeException);
     101             : 
     102             :     // --- delegation for XNde base.
     103           0 :     virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
     104             :         throw (RuntimeException, DOMException)
     105             :     {
     106           0 :         return CNode::appendChild(newChild);
     107             :     }
     108           0 :     virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep)
     109             :         throw (RuntimeException)
     110             :     {
     111           0 :         return CNode::cloneNode(deep);
     112             :     }
     113           0 :     virtual Reference< XNamedNodeMap > SAL_CALL getAttributes()
     114             :         throw (RuntimeException)
     115             :     {
     116           0 :         return CNode::getAttributes();
     117             :     }
     118           0 :     virtual Reference< XNodeList > SAL_CALL getChildNodes()
     119             :         throw (RuntimeException)
     120             :     {
     121           0 :         return CNode::getChildNodes();
     122             :     }
     123           0 :     virtual Reference< XNode > SAL_CALL getFirstChild()
     124             :         throw (RuntimeException)
     125             :     {
     126           0 :         return CNode::getFirstChild();
     127             :     }
     128           0 :     virtual Reference< XNode > SAL_CALL getLastChild()
     129             :         throw (RuntimeException)
     130             :     {
     131           0 :         return CNode::getLastChild();
     132             :     }
     133             :     virtual OUString SAL_CALL getNamespaceURI()
     134             :         throw (RuntimeException);
     135           0 :     virtual Reference< XNode > SAL_CALL getNextSibling()
     136             :         throw (RuntimeException)
     137             :     {
     138           0 :         return CNode::getNextSibling();
     139             :     }
     140           0 :     virtual NodeType SAL_CALL getNodeType()
     141             :         throw (RuntimeException)
     142             :     {
     143           0 :         return CNode::getNodeType();
     144             :     }
     145           0 :     virtual Reference< XDocument > SAL_CALL getOwnerDocument()
     146             :         throw (RuntimeException)
     147             :     {
     148           0 :         return CNode::getOwnerDocument();
     149             :     }
     150           0 :     virtual Reference< XNode > SAL_CALL getParentNode()
     151             :         throw (RuntimeException)
     152             :     {
     153           0 :         return CNode::getParentNode();
     154             :     }
     155             :     virtual OUString SAL_CALL getPrefix()
     156             :         throw (RuntimeException);
     157           0 :     virtual Reference< XNode > SAL_CALL getPreviousSibling()
     158             :         throw (RuntimeException)
     159             :     {
     160           0 :         return CNode::getPreviousSibling();
     161             :     }
     162           0 :     virtual sal_Bool SAL_CALL hasAttributes()
     163             :         throw (RuntimeException)
     164             :     {
     165           0 :         return CNode::hasAttributes();
     166             :     }
     167           0 :     virtual sal_Bool SAL_CALL hasChildNodes()
     168             :         throw (RuntimeException)
     169             :     {
     170           0 :         return CNode::hasChildNodes();
     171             :     }
     172           0 :     virtual Reference< XNode > SAL_CALL insertBefore(
     173             :             const Reference< XNode >& newChild, const Reference< XNode >& refChild)
     174             :         throw (RuntimeException, DOMException)
     175             :     {
     176           0 :         return CNode::insertBefore(newChild, refChild);
     177             :     }
     178           0 :     virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver)
     179             :         throw (RuntimeException)
     180             :     {
     181           0 :         return CNode::isSupported(feature, ver);
     182             :     }
     183           0 :     virtual void SAL_CALL normalize()
     184             :         throw (RuntimeException)
     185             :     {
     186           0 :         CNode::normalize();
     187           0 :     }
     188           0 :     virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
     189             :         throw (RuntimeException, DOMException)
     190             :     {
     191           0 :         return CNode::removeChild(oldChild);
     192             :     }
     193           0 :     virtual Reference< XNode > SAL_CALL replaceChild(
     194             :             const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
     195             :         throw (RuntimeException, DOMException)
     196             :     {
     197           0 :         return CNode::replaceChild(newChild, oldChild);
     198             :     }
     199           0 :     virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
     200             :         throw (RuntimeException, DOMException)
     201             :     {
     202           0 :         return setValue(nodeValue);
     203             :     }
     204             :     virtual void SAL_CALL setPrefix(const OUString& prefix)
     205             :         throw (RuntimeException, DOMException);
     206             : 
     207             :     };
     208             : }
     209             : 
     210             : #endif
     211             : 
     212             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10