LibreOffice Module xmloff (master)  1
Macros | Typedefs | Functions | Variables
xformsexport.cxx File Reference
#include <xmloff/xformsexport.hxx>
#include "XFormsModelExport.hxx"
#include <xmloff/xmlexp.hxx>
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlnmspe.hxx>
#include <xmloff/nmspmap.hxx>
#include <DomExport.hxx>
#include <sax/tools/converter.hxx>
#include <comphelper/processfactory.hxx>
#include <tools/diagnose_ex.h>
#include <sal/log.hxx>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/document/NamedPropertyValues.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/xml/dom/XDocument.hpp>
#include <com/sun/star/form/binding/XBindableValue.hpp>
#include <com/sun/star/form/binding/XListEntrySink.hpp>
#include <com/sun/star/form/submission/XSubmissionSupplier.hpp>
#include <com/sun/star/xforms/XModel.hpp>
#include <com/sun/star/xforms/XDataTypeRepository.hpp>
#include <com/sun/star/xforms/XFormsSupplier.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/container/XEnumeration.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/xsd/WhiteSpaceTreatment.hpp>
#include <com/sun/star/xsd/DataTypeClass.hpp>
#include <com/sun/star/util/Date.hpp>
#include <com/sun/star/util/Time.hpp>
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/util/Duration.hpp>
Include dependency graph for xformsexport.cxx:

Go to the source code of this file.

Macros

#define TABLE_ENTRY(NAME, NAMESPACE, TOKEN, CONVERTER)   { NAME,XML_NAMESPACE_##NAMESPACE,xmloff::token::XML_##TOKEN, CONVERTER }
 
#define TABLE_END   { nullptr, 0, 0, nullptr }
 

Typedefs

typedef OUString(* convert_t) (const Any &)
 

Functions

void exportXForms (SvXMLExport &rExport)
 export an XForms model. More...
 
static void exportXFormsInstance (SvXMLExport &, const Sequence< PropertyValue > &)
 
static void exportXFormsBinding (SvXMLExport &, const Reference< XPropertySet > &)
 
static void exportXFormsSubmission (SvXMLExport &, const Reference< XPropertySet > &)
 
static void exportXFormsSchemas (SvXMLExport &, const Reference< css::xforms::XModel > &)
 
static void lcl_export (const Reference< XPropertySet > &rPropertySet, SvXMLExport &rExport, const ExportTable *pTable)
 
static OUString xforms_string (const Any &)
 
static OUString xforms_bool (const Any &)
 
static OUString xforms_whitespace (const Any &)
 
template<typename T , void(*)(OUStringBuffer &, T) FUNC>
static OUString xforms_convert (const Any &)
 
template<typename T , void(*)(OUStringBuffer &, const T &) FUNC>
static OUString xforms_convertRef (const Any &)
 
static void xforms_formatDate (OUStringBuffer &aBuffer, const util::Date &aDate)
 
static void xforms_formatTime (OUStringBuffer &aBuffer, const css::util::Time &aTime)
 
static void xforms_formatDateTime (OUStringBuffer &aBuffer, const util::DateTime &aDateTime)
 
static void convertNumber (OUStringBuffer &b, sal_Int32 n)
 
static OUString lcl_getXSDType (SvXMLExport const &rExport, const Reference< XPropertySet > &xType)
 
void exportXFormsModel (SvXMLExport &rExport, const Reference< XPropertySet > &xModelPropSet)
 
static void lcl_exportDataTypeFacets (SvXMLExport &rExport, const Reference< XPropertySet > &rPropertySet, const ExportTable *pTable)
 
static void lcl_exportDataType (SvXMLExport &rExport, const Reference< XPropertySet > &xType)
 
template<typename T , void(*)(OUStringBuffer &, T) FUNC>
OUString xforms_convert (const Any &rAny)
 
template<typename T , void(*)(OUStringBuffer &, const T &) FUNC>
OUString xforms_convertRef (const Any &rAny)
 
static OUString lcl_getXFormsBindName (const Reference< XPropertySet > &xBinding)
 return name of Binding More...
 
OUString getXFormsBindName (const Reference< XPropertySet > &xControl)
 
OUString getXFormsListBindName (const Reference< XPropertySet > &xControl)
 
OUString getXFormsSubmissionName (const Reference< XPropertySet > &xBinding)
 
void getXFormsSettings (const Reference< XNameAccess > &_rXForms, Sequence< PropertyValue > &_out_rSettings)
 

Variables

convert_t const xforms_int32 = &xforms_convert<sal_Int32,&convertNumber>
 
convert_t const xforms_double = &xforms_convert<double,&::sax::Converter::convertDouble>
 
convert_t const xforms_dateTime = &xforms_convertRef<util::DateTime,&xforms_formatDateTime>
 
convert_t const xforms_date = &xforms_convertRef<util::Date,&xforms_formatDate>
 
convert_t const xforms_time = &xforms_convertRef<css::util::Time,&xforms_formatTime>
 
const ExportTable aXFormsModelTable []
 
const ExportTable aXFormsBindingTable []
 
const ExportTable aXFormsSubmissionTable []
 
const ExportTable aDataTypeFacetTable []
 

Macro Definition Documentation

#define TABLE_END   { nullptr, 0, 0, nullptr }

Definition at line 125 of file xformsexport.cxx.

#define TABLE_ENTRY (   NAME,
  NAMESPACE,
  TOKEN,
  CONVERTER 
)    { NAME,XML_NAMESPACE_##NAMESPACE,xmloff::token::XML_##TOKEN, CONVERTER }

Definition at line 124 of file xformsexport.cxx.

Typedef Documentation

typedef OUString(* convert_t) (const Any &)

Definition at line 106 of file xformsexport.cxx.

Function Documentation

static void convertNumber ( OUStringBuffer &  b,
sal_Int32  n 
)
static

Definition at line 138 of file xformsexport.cxx.

void exportXForms ( SvXMLExport )

export an XForms model.

Definition at line 79 of file xformsexport.cxx.

References exportXFormsModel(), SvXMLExport::GetModel(), and xModel.

void exportXFormsBinding ( SvXMLExport rExport,
const Reference< XPropertySet > &  xBinding 
)
static
void exportXFormsInstance ( SvXMLExport rExport,
const Sequence< PropertyValue > &  xInstance 
)
static
void exportXFormsModel ( SvXMLExport rExport,
const Reference< XPropertySet > &  xModelPropSet 
)
void exportXFormsSchemas ( SvXMLExport rExport,
const Reference< css::xforms::XModel > &  xModel 
)
static
void exportXFormsSubmission ( SvXMLExport rExport,
const Reference< XPropertySet > &  xSubmission 
)
static

Definition at line 389 of file xformsexport.cxx.

References lcl_export(), XML_NAMESPACE_XFORMS, and xmloff::token::XML_SUBMISSION.

Referenced by exportXFormsModel().

OUString getXFormsBindName ( const Reference< XPropertySet > &  xControl)
OUString getXFormsListBindName ( const Reference< XPropertySet > &  xControl)
void getXFormsSettings ( const Reference< XNameAccess > &  _rXForms,
Sequence< PropertyValue > &  _out_rSettings 
)
OUString getXFormsSubmissionName ( const Reference< XPropertySet > &  xBinding)
static void lcl_export ( const Reference< XPropertySet > &  rPropertySet,
SvXMLExport rExport,
const ExportTable *  pTable 
)
static
static void lcl_exportDataType ( SvXMLExport rExport,
const Reference< XPropertySet > &  xType 
)
static
static void lcl_exportDataTypeFacets ( SvXMLExport rExport,
const Reference< XPropertySet > &  rPropertySet,
const ExportTable *  pTable 
)
static
static OUString lcl_getXFormsBindName ( const Reference< XPropertySet > &  xBinding)
static

return name of Binding

Definition at line 706 of file xformsexport.cxx.

Referenced by getXFormsBindName(), and getXFormsListBindName().

static OUString lcl_getXSDType ( SvXMLExport const &  rExport,
const Reference< XPropertySet > &  xType 
)
static
OUString xforms_bool ( const Any &  rAny)
static
template<typename T , void(*)(OUStringBuffer &, T) FUNC>
static OUString xforms_convert ( const Any &  )
static

Definition at line 621 of file xformsexport.cxx.

References aBuffer, and aData.

template<typename T , void(*)(OUStringBuffer &, T) FUNC>
OUString xforms_convert ( const Any &  rAny)

Definition at line 621 of file xformsexport.cxx.

References aBuffer, and aData.

template<typename T , void(*)(OUStringBuffer &, const T &) FUNC>
static OUString xforms_convertRef ( const Any &  )
static

Definition at line 633 of file xformsexport.cxx.

References aBuffer, and aData.

template<typename T , void(*)(OUStringBuffer &, const T &) FUNC>
OUString xforms_convertRef ( const Any &  rAny)

Definition at line 633 of file xformsexport.cxx.

References aBuffer, and aData.

void xforms_formatDate ( OUStringBuffer &  aBuffer,
const util::Date aDate 
)
static

Definition at line 660 of file xformsexport.cxx.

void xforms_formatDateTime ( OUStringBuffer &  aBuffer,
const util::DateTime aDateTime 
)
static

Definition at line 677 of file xformsexport.cxx.

References sax::Converter::convertDateTime().

void xforms_formatTime ( OUStringBuffer &  aBuffer,
const css::util::Time aTime 
)
static

Definition at line 667 of file xformsexport.cxx.

References sax::Converter::convertDuration().

OUString xforms_string ( const Any &  rAny)
static

Definition at line 644 of file xformsexport.cxx.

OUString xforms_whitespace ( const Any &  rAny)
static

Variable Documentation

const ExportTable aDataTypeFacetTable[]

Definition at line 401 of file xformsexport.cxx.

const ExportTable aXFormsBindingTable[]
Initial value:
=
{
TABLE_ENTRY( "BindingID", NONE, ID, xforms_string ),
TABLE_ENTRY( "BindingExpression", NONE, NODESET, xforms_string ),
TABLE_ENTRY( "ReadonlyExpression", NONE, READONLY, xforms_string ),
TABLE_ENTRY( "RelevantExpression", NONE, RELEVANT, xforms_string ),
TABLE_ENTRY( "RequiredExpression", NONE, REQUIRED, xforms_string ),
TABLE_ENTRY( "ConstraintExpression", NONE, CONSTRAINT, xforms_string ),
TABLE_ENTRY( "CalculateExpression", NONE, CALCULATE, xforms_string ),
}
#define TABLE_END
static OUString xforms_string(const Any &)
#define TABLE_ENTRY(NAME, NAMESPACE, TOKEN, CONVERTER)

Definition at line 255 of file xformsexport.cxx.

const ExportTable aXFormsModelTable[]
Initial value:
=
{
TABLE_ENTRY( "ID", NONE, ID, xforms_string ),
TABLE_ENTRY( "SchemaRef", NONE, SCHEMA, xforms_string ),
}
#define TABLE_END
static OUString xforms_string(const Any &)
#define TABLE_ENTRY(NAME, NAMESPACE, TOKEN, CONVERTER)

Definition at line 156 of file xformsexport.cxx.

const ExportTable aXFormsSubmissionTable[]
Initial value:
=
{
TABLE_ENTRY( "ID", NONE, ID, xforms_string ),
TABLE_ENTRY( "Bind", NONE, BIND, xforms_string ),
TABLE_ENTRY( "Ref", NONE, REF, xforms_string ),
TABLE_ENTRY( "Action", NONE, ACTION, xforms_string ),
TABLE_ENTRY( "Method", NONE, METHOD, xforms_string ),
TABLE_ENTRY( "Version", NONE, VERSION, xforms_string ),
TABLE_ENTRY( "Indent", NONE, INDENT, xforms_bool ),
TABLE_ENTRY( "MediaType", NONE, MEDIATYPE, xforms_string ),
TABLE_ENTRY( "Encoding", NONE, ENCODING, xforms_string ),
TABLE_ENTRY( "OmitXmlDeclaration", NONE, OMIT_XML_DECLARATION, xforms_bool ),
TABLE_ENTRY( "Standalone", NONE, STANDALONE, xforms_bool ),
TABLE_ENTRY( "CDataSectionElement", NONE, CDATA_SECTION_ELEMENTS, xforms_string ),
TABLE_ENTRY( "Replace", NONE, REPLACE, xforms_string ),
TABLE_ENTRY( "Separator", NONE, SEPARATOR, xforms_string ),
TABLE_ENTRY( "IncludeNamespacePrefixes", NONE, INCLUDENAMESPACEPREFIXES, xforms_string ),
}
#define TABLE_END
ACTION
static OUString xforms_string(const Any &)
static OUString xforms_bool(const Any &)
#define TABLE_ENTRY(NAME, NAMESPACE, TOKEN, CONVERTER)

Definition at line 369 of file xformsexport.cxx.

Definition at line 145 of file xformsexport.cxx.

Definition at line 144 of file xformsexport.cxx.

convert_t const xforms_double = &xforms_convert<double,&::sax::Converter::convertDouble>

Definition at line 143 of file xformsexport.cxx.

convert_t const xforms_int32 = &xforms_convert<sal_Int32,&convertNumber>

Definition at line 142 of file xformsexport.cxx.

Definition at line 146 of file xformsexport.cxx.