nss: upgrade to release 3.73
[LibreOffice.git] / forms / source / xforms / pathexpression.hxx
blob03e2ca18f5f529b6d12b474f713cfee0747075c6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_FORMS_SOURCE_XFORMS_PATHEXPRESSION_HXX
21 #define INCLUDED_FORMS_SOURCE_XFORMS_PATHEXPRESSION_HXX
23 #include "computedexpression.hxx"
25 #include <vector>
27 // forward declaractions
28 namespace com::sun::star::xml::dom
30 class XNodeList;
31 namespace events
33 class XEventListener;
37 namespace xforms
39 /** PathExpression represents an XPath Expression and caches results */
40 class PathExpression final : public ComputedExpression
42 public:
43 typedef std::vector<css::uno::Reference<css::xml::dom::XNode>> NodeVector_t;
45 private:
46 /// the node-list result from the last bind (cached from mxResult)
47 NodeVector_t maNodes;
49 /// get expression for evaluation
50 OUString _getExpressionForEvaluation() const;
52 public:
53 PathExpression();
54 ~PathExpression();
56 /// set the expression string
57 /// (overridden to do remove old listeners)
58 /// (also defines simple expressions)
59 void setExpression(const OUString& rExpression);
61 /// evaluate the expression relative to the content node.
62 void evaluate(const xforms::EvaluationContext& rContext);
64 // get the result of this expression as node/node list/...
65 css::uno::Reference<css::xml::dom::XNode> getNode() const;
66 const NodeVector_t& getNodeList() const { return maNodes; }
67 css::uno::Reference<css::xml::dom::XNodeList> getXNodeList() const;
70 } // namespace xforms
72 #endif
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */