1*7f654276SAndrew Rist /************************************************************** 2*7f654276SAndrew Rist * 3*7f654276SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*7f654276SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*7f654276SAndrew Rist * distributed with this work for additional information 6*7f654276SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*7f654276SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*7f654276SAndrew Rist * "License"); you may not use this file except in compliance 9*7f654276SAndrew Rist * with the License. You may obtain a copy of the License at 10*7f654276SAndrew Rist * 11*7f654276SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*7f654276SAndrew Rist * 13*7f654276SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*7f654276SAndrew Rist * software distributed under the License is distributed on an 15*7f654276SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*7f654276SAndrew Rist * KIND, either express or implied. See the License for the 17*7f654276SAndrew Rist * specific language governing permissions and limitations 18*7f654276SAndrew Rist * under the License. 19*7f654276SAndrew Rist * 20*7f654276SAndrew Rist *************************************************************/ 21*7f654276SAndrew Rist 22*7f654276SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef XPATH_XPATHOBJECT_HXX 25cdf0e10cSrcweir #define XPATH_XPATHOBJECT_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <boost/shared_ptr.hpp> 28cdf0e10cSrcweir 29cdf0e10cSrcweir #include <libxml/tree.h> 30cdf0e10cSrcweir #include <libxml/xpath.h> 31cdf0e10cSrcweir 32cdf0e10cSrcweir #include <sal/types.h> 33cdf0e10cSrcweir #include <rtl/ref.hxx> 34cdf0e10cSrcweir 35cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx> 36cdf0e10cSrcweir 37cdf0e10cSrcweir #include <com/sun/star/uno/Reference.h> 38cdf0e10cSrcweir #include <com/sun/star/xml/dom/XNodeList.hpp> 39cdf0e10cSrcweir #include <com/sun/star/xml/xpath/XXPathObject.hpp> 40cdf0e10cSrcweir 41cdf0e10cSrcweir 42cdf0e10cSrcweir using ::rtl::OUString; 43cdf0e10cSrcweir using namespace com::sun::star::uno; 44cdf0e10cSrcweir using namespace com::sun::star::xml::dom; 45cdf0e10cSrcweir using namespace com::sun::star::xml::xpath; 46cdf0e10cSrcweir 47cdf0e10cSrcweir 48cdf0e10cSrcweir namespace DOM { 49cdf0e10cSrcweir class CDocument; 50cdf0e10cSrcweir } 51cdf0e10cSrcweir 52cdf0e10cSrcweir namespace XPath 53cdf0e10cSrcweir { 54cdf0e10cSrcweir class CXPathObject : public cppu::WeakImplHelper1< XXPathObject > 55cdf0e10cSrcweir { 56cdf0e10cSrcweir private: 57cdf0e10cSrcweir ::rtl::Reference< DOM::CDocument > const m_pDocument; 58cdf0e10cSrcweir ::osl::Mutex & m_rMutex; 59cdf0e10cSrcweir boost::shared_ptr<xmlXPathObject> const m_pXPathObj; 60cdf0e10cSrcweir XPathObjectType const m_XPathObjectType; 61cdf0e10cSrcweir 62cdf0e10cSrcweir public: 63cdf0e10cSrcweir CXPathObject( ::rtl::Reference<DOM::CDocument> const& pDocument, 64cdf0e10cSrcweir ::osl::Mutex & rMutex, 65cdf0e10cSrcweir ::boost::shared_ptr<xmlXPathObject> const& pXPathObj); 66cdf0e10cSrcweir 67cdf0e10cSrcweir /** 68cdf0e10cSrcweir get object type 69cdf0e10cSrcweir */ 70cdf0e10cSrcweir virtual XPathObjectType SAL_CALL getObjectType() throw (RuntimeException); 71cdf0e10cSrcweir 72cdf0e10cSrcweir /** 73cdf0e10cSrcweir get the nodes from a nodelist type object 74cdf0e10cSrcweir */ 75cdf0e10cSrcweir virtual Reference< XNodeList > SAL_CALL getNodeList() 76cdf0e10cSrcweir throw (RuntimeException); 77cdf0e10cSrcweir 78cdf0e10cSrcweir /** 79cdf0e10cSrcweir get value of a boolean object 80cdf0e10cSrcweir */ 81cdf0e10cSrcweir virtual sal_Bool SAL_CALL getBoolean() throw (RuntimeException); 82cdf0e10cSrcweir 83cdf0e10cSrcweir /** 84cdf0e10cSrcweir get number as byte 85cdf0e10cSrcweir */ 86cdf0e10cSrcweir virtual sal_Int8 SAL_CALL getByte() throw (RuntimeException); 87cdf0e10cSrcweir 88cdf0e10cSrcweir /** 89cdf0e10cSrcweir get number as short 90cdf0e10cSrcweir */ 91cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getShort() throw (RuntimeException); 92cdf0e10cSrcweir 93cdf0e10cSrcweir /** 94cdf0e10cSrcweir get number as long 95cdf0e10cSrcweir */ 96cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getLong() throw (RuntimeException); 97cdf0e10cSrcweir 98cdf0e10cSrcweir /** 99cdf0e10cSrcweir get number as hyper 100cdf0e10cSrcweir */ 101cdf0e10cSrcweir virtual sal_Int64 SAL_CALL getHyper() throw (RuntimeException); 102cdf0e10cSrcweir 103cdf0e10cSrcweir /** 104cdf0e10cSrcweir get number as float 105cdf0e10cSrcweir */ 106cdf0e10cSrcweir virtual float SAL_CALL getFloat() throw (RuntimeException); 107cdf0e10cSrcweir 108cdf0e10cSrcweir /** 109cdf0e10cSrcweir get number as double 110cdf0e10cSrcweir */ 111cdf0e10cSrcweir virtual double SAL_CALL getDouble() throw (RuntimeException); 112cdf0e10cSrcweir 113cdf0e10cSrcweir /** 114cdf0e10cSrcweir get string value 115cdf0e10cSrcweir */ 116cdf0e10cSrcweir virtual OUString SAL_CALL getString() throw (RuntimeException); 117cdf0e10cSrcweir 118cdf0e10cSrcweir }; 119cdf0e10cSrcweir } 120cdf0e10cSrcweir 121cdf0e10cSrcweir #endif 122