1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _XMLOFF_XFORMSAPI_HXX 28 #define _XMLOFF_XFORMSAPI_HXX 29 30 // 31 // this is a collection of several functions to make dealing with the XForms 32 // API a little easier 33 // 34 35 #include <com/sun/star/uno/Any.hxx> 36 37 namespace rtl { class OUString; } 38 namespace com { namespace sun { namespace star { 39 namespace beans { class XPropertySet; } 40 namespace frame { class XModel; } 41 namespace uno { template<class A> class Reference; } 42 namespace xforms { class XDataTypeRepository; } 43 } } } 44 class SvXMLNamespaceMap; 45 46 47 #define OUSTRING(msg) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(msg)) 48 49 com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> lcl_createXFormsModel(); 50 51 com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> lcl_createXFormsBinding(); 52 53 void lcl_addXFormsModel( 54 const com::sun::star::uno::Reference<com::sun::star::frame::XModel>& xDocument, 55 const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& xModel ); 56 57 com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> lcl_findXFormsBinding( com::sun::star::uno::Reference<com::sun::star::frame::XModel>&, const rtl::OUString& ); 58 59 com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> lcl_findXFormsSubmission( com::sun::star::uno::Reference<com::sun::star::frame::XModel>&, const rtl::OUString& ); 60 61 void lcl_setValue( 62 com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& xPropSet, 63 const rtl::OUString& rName, 64 const com::sun::star::uno::Any rAny ); 65 66 template<typename T> 67 void lcl_setValue( 68 com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& xPropSet, 69 const rtl::OUString& rName, 70 T& aValue ) 71 { 72 lcl_setValue( xPropSet, rName, com::sun::star::uno::makeAny( aValue ) ); 73 } 74 75 76 com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> lcl_getXFormsModel( const com::sun::star::uno::Reference<com::sun::star::frame::XModel>& ); 77 78 sal_uInt16 lcl_getTypeClass( 79 const com::sun::star::uno::Reference<com::sun::star::xforms::XDataTypeRepository>& xRepository, 80 const SvXMLNamespaceMap& rNamespaceMap, 81 const rtl::OUString& rXMLName ); 82 83 rtl::OUString lcl_getTypeName( 84 const com::sun::star::uno::Reference<com::sun::star::xforms::XDataTypeRepository>& xRepository, 85 const SvXMLNamespaceMap& rNamespaceMap, 86 const rtl::OUString& rXMLName ); 87 88 rtl::OUString lcl_getBasicTypeName( 89 const com::sun::star::uno::Reference<com::sun::star::xforms::XDataTypeRepository>& xRepository, 90 const SvXMLNamespaceMap& rNamespaceMap, 91 const rtl::OUString& rXMLName ); 92 93 #endif 94