Avoid potential negative array index access to cached text.
[LibreOffice.git] / xmloff / source / xforms / xformsapi.hxx
blobba66e985b50aa3942e490c159c5f08be26e6dc7b
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 .
19 #pragma once
22 // this is a collection of several functions to make dealing with the XForms
23 // API a little easier
26 #include <com/sun/star/uno/Any.hxx>
28 namespace com::sun::star {
29 namespace beans { class XPropertySet; }
30 namespace frame { class XModel; }
31 namespace uno { template<class A> class Reference; }
32 namespace xforms { class XDataTypeRepository; class XModel2; }
34 class SvXMLNamespaceMap;
36 css::uno::Reference<css::xforms::XModel2> xforms_createXFormsModel();
38 void xforms_addXFormsModel(
39 const css::uno::Reference<css::frame::XModel>& xDocument,
40 const css::uno::Reference<css::xforms::XModel2>& xModel );
42 css::uno::Reference<css::beans::XPropertySet> xforms_findXFormsBinding( css::uno::Reference<css::frame::XModel> const &, const OUString& );
44 css::uno::Reference<css::beans::XPropertySet> xforms_findXFormsSubmission( css::uno::Reference<css::frame::XModel> const &, const OUString& );
46 void xforms_setValueAny(
47 css::uno::Reference<css::beans::XPropertySet> const & xPropSet,
48 const OUString& rName,
49 const css::uno::Any& rAny );
51 template<typename T>
52 inline void xforms_setValue(
53 const css::uno::Reference<css::beans::XPropertySet>& xPropSet,
54 const OUString& rName,
55 const T& aValue )
57 xforms_setValueAny( xPropSet, rName, css::uno::Any( aValue ) );
59 template<>
60 inline void xforms_setValue(
61 const css::uno::Reference<css::beans::XPropertySet>& xPropSet,
62 const OUString& rName,
63 const css::uno::Any& aValue )
65 xforms_setValueAny( xPropSet, rName, aValue );
68 sal_uInt16 xforms_getTypeClass(
69 const css::uno::Reference<css::xforms::XDataTypeRepository>& xRepository,
70 const SvXMLNamespaceMap& rNamespaceMap,
71 const OUString& rXMLName );
73 OUString xforms_getTypeName(
74 const css::uno::Reference<css::xforms::XDataTypeRepository>& xRepository,
75 const SvXMLNamespaceMap& rNamespaceMap,
76 const OUString& rXMLName );
78 OUString xforms_getBasicTypeName(
79 const css::uno::Reference<css::xforms::XDataTypeRepository>& xRepository,
80 const SvXMLNamespaceMap& rNamespaceMap,
81 const OUString& rXMLName );
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */