From 267c6f2ac71f92999e969232431ba04678e7437e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 07:54:39 +0200 Subject: Adding upstream version 4:24.2.0. Signed-off-by: Daniel Baumann --- include/test/a11y/AccessibilityTools.hxx | 289 ++++++++++++++++++++ include/test/a11y/accessibletestbase.hxx | 298 +++++++++++++++++++++ include/test/a11y/eventposter.hxx | 131 +++++++++ include/test/a11y/swaccessibletestbase.hxx | 58 ++++ include/test/beans/xpropertyset.hxx | 74 +++++ include/test/bootstrapfixture.hxx | 73 +++++ include/test/callgrind.hxx | 21 ++ include/test/chart/xchartdata.hxx | 35 +++ include/test/container/xchild.hxx | 34 +++ include/test/container/xelementaccess.hxx | 46 ++++ include/test/container/xenumeration.hxx | 36 +++ include/test/container/xenumerationaccess.hxx | 34 +++ include/test/container/xindexaccess.hxx | 46 ++++ include/test/container/xnameaccess.hxx | 47 ++++ include/test/container/xnamecontainer.hxx | 61 +++++ include/test/container/xnamed.hxx | 50 ++++ include/test/container/xnamereplace.hxx | 49 ++++ include/test/cppunitasserthelper.hxx | 79 ++++++ include/test/document/xactionlockable.hxx | 36 +++ include/test/document/xembeddedobjectsupplier.hxx | 35 +++ include/test/document/xlinktargetsupplier.hxx | 34 +++ include/test/drawing/captionshape.hxx | 33 +++ include/test/drawing/xdrawpages.hxx | 37 +++ include/test/drawing/xgluepointssupplier.hxx | 33 +++ include/test/drawing/xshape.hxx | 42 +++ include/test/drawing/xshapedescriptor.hxx | 41 +++ include/test/drawing/xshapegrouper.hxx | 44 +++ include/test/drawing/xshapes.hxx | 43 +++ include/test/helper/form.hxx | 64 +++++ include/test/helper/shape.hxx | 92 +++++++ include/test/helper/transferable.hxx | 29 ++ include/test/htmltesttools.hxx | 32 +++ include/test/lang/xcomponent.hxx | 39 +++ include/test/lang/xserviceinfo.hxx | 56 ++++ include/test/lokcallback.hxx | 65 +++++ include/test/screenshot_test.hxx | 96 +++++++ include/test/sheet/cellarealink.hxx | 48 ++++ include/test/sheet/cellproperties.hxx | 34 +++ include/test/sheet/databaseimportdescriptor.hxx | 35 +++ include/test/sheet/databaserange.hxx | 43 +++ include/test/sheet/datapilotfield.hxx | 36 +++ include/test/sheet/datapilotitem.hxx | 33 +++ include/test/sheet/documentsettings.hxx | 34 +++ include/test/sheet/functiondescription.hxx | 34 +++ include/test/sheet/globalsheetsettings.hxx | 34 +++ include/test/sheet/scenario.hxx | 34 +++ include/test/sheet/shape.hxx | 36 +++ include/test/sheet/sheetcell.hxx | 34 +++ include/test/sheet/sheetcellrange.hxx | 34 +++ include/test/sheet/sheetcellranges.hxx | 34 +++ include/test/sheet/sheetfilterdescriptor.hxx | 34 +++ include/test/sheet/sheetlink.hxx | 34 +++ include/test/sheet/sheetsortdescriptor2.hxx | 34 +++ include/test/sheet/spreadsheet.hxx | 35 +++ include/test/sheet/spreadsheetdocumentsettings.hxx | 34 +++ include/test/sheet/spreadsheetviewsettings.hxx | 34 +++ include/test/sheet/subtotaldescriptor.hxx | 34 +++ include/test/sheet/tableautoformat.hxx | 34 +++ include/test/sheet/tablevalidation.hxx | 34 +++ include/test/sheet/xactivationbroadcaster.hxx | 36 +++ include/test/sheet/xarealink.hxx | 34 +++ include/test/sheet/xarealinks.hxx | 36 +++ include/test/sheet/xarrayformularange.hxx | 32 +++ include/test/sheet/xcalculatable.hxx | 39 +++ include/test/sheet/xcelladdressable.hxx | 31 +++ include/test/sheet/xcellformatrangessupplier.hxx | 34 +++ include/test/sheet/xcellrangeaddressable.hxx | 34 +++ include/test/sheet/xcellrangedata.hxx | 36 +++ include/test/sheet/xcellrangeformula.hxx | 34 +++ include/test/sheet/xcellrangemovement.hxx | 37 +++ include/test/sheet/xcellrangereferrer.hxx | 40 +++ include/test/sheet/xcellrangesquery.hxx | 39 +++ include/test/sheet/xcellseries.hxx | 38 +++ include/test/sheet/xconsolidatable.hxx | 35 +++ include/test/sheet/xconsolidationdescriptor.hxx | 45 ++++ include/test/sheet/xdatabaserange.hxx | 38 +++ include/test/sheet/xdatabaseranges.hxx | 34 +++ include/test/sheet/xdatapilotdescriptor.hxx | 53 ++++ include/test/sheet/xdatapilotfield.hxx | 34 +++ include/test/sheet/xdatapilotfieldgrouping.hxx | 35 +++ include/test/sheet/xdatapilottable.hxx | 39 +++ include/test/sheet/xdatapilottable2.hxx | 58 ++++ include/test/sheet/xdatapilottables.hxx | 35 +++ include/test/sheet/xdatapilottablessupplier.hxx | 34 +++ include/test/sheet/xddelink.hxx | 43 +++ include/test/sheet/xddelinks.hxx | 45 ++++ include/test/sheet/xdocumentauditing.hxx | 43 +++ include/test/sheet/xformulaquery.hxx | 57 ++++ include/test/sheet/xfunctiondescriptions.hxx | 34 +++ include/test/sheet/xgoalseek.hxx | 32 +++ include/test/sheet/xheaderfootercontent.hxx | 36 +++ include/test/sheet/xlabelrange.hxx | 35 +++ include/test/sheet/xlabelranges.hxx | 35 +++ include/test/sheet/xmultiformulatokens.hxx | 37 +++ include/test/sheet/xmultipleoperation.hxx | 39 +++ include/test/sheet/xnamedrange.hxx | 41 +++ include/test/sheet/xnamedranges.hxx | 60 +++++ include/test/sheet/xprintareas.hxx | 41 +++ include/test/sheet/xrecentfunctions.hxx | 36 +++ include/test/sheet/xscenario.hxx | 34 +++ include/test/sheet/xscenarioenhanced.hxx | 34 +++ include/test/sheet/xscenarios.hxx | 35 +++ include/test/sheet/xscenariossupplier.hxx | 34 +++ include/test/sheet/xsheetannotation.hxx | 42 +++ include/test/sheet/xsheetannotationanchor.hxx | 34 +++ include/test/sheet/xsheetannotations.hxx | 43 +++ .../test/sheet/xsheetannotationshapesupplier.hxx | 32 +++ include/test/sheet/xsheetannotationssupplier.hxx | 34 +++ include/test/sheet/xsheetauditing.hxx | 38 +++ include/test/sheet/xsheetcellcursor.hxx | 39 +++ include/test/sheet/xsheetcellrange.hxx | 34 +++ include/test/sheet/xsheetcellrangecontainer.hxx | 39 +++ include/test/sheet/xsheetcellranges.hxx | 36 +++ include/test/sheet/xsheetcondition.hxx | 37 +++ include/test/sheet/xsheetconditionalentries.hxx | 41 +++ include/test/sheet/xsheetconditionalentry.hxx | 34 +++ include/test/sheet/xsheetfilterable.hxx | 38 +++ include/test/sheet/xsheetfilterableex.hxx | 35 +++ include/test/sheet/xsheetfilterdescriptor.hxx | 35 +++ include/test/sheet/xsheetfilterdescriptor2.hxx | 35 +++ include/test/sheet/xsheetfilterdescriptor3.hxx | 35 +++ include/test/sheet/xsheetlinkable.hxx | 35 +++ include/test/sheet/xsheetoperation.hxx | 35 +++ include/test/sheet/xsheetoutline.hxx | 38 +++ include/test/sheet/xsheetpagebreak.hxx | 34 +++ include/test/sheet/xspreadsheet.hxx | 34 +++ include/test/sheet/xspreadsheetdocument.hxx | 37 +++ include/test/sheet/xspreadsheets.hxx | 34 +++ include/test/sheet/xspreadsheets2.hxx | 62 +++++ include/test/sheet/xspreadsheetview.hxx | 33 +++ include/test/sheet/xsubtotalcalculatable.hxx | 34 +++ include/test/sheet/xsubtotaldescriptor.hxx | 33 +++ include/test/sheet/xsubtotalfield.hxx | 33 +++ .../test/sheet/xuniquecellformatrangessupplier.hxx | 34 +++ include/test/sheet/xusedareacursor.hxx | 33 +++ include/test/sheet/xviewfreezable.hxx | 31 +++ include/test/sheet/xviewpane.hxx | 35 +++ include/test/sheet/xviewsplitable.hxx | 33 +++ include/test/style/xstyleloader.hxx | 51 ++++ include/test/table/tablecolumn.hxx | 41 +++ include/test/table/tablerow.hxx | 36 +++ include/test/table/xcell.hxx | 37 +++ include/test/table/xcellcursor.hxx | 39 +++ include/test/table/xcellrange.hxx | 50 ++++ include/test/table/xcolumnrowrange.hxx | 35 +++ include/test/table/xtablechart.hxx | 37 +++ include/test/table/xtablecharts.hxx | 36 +++ include/test/table/xtablechartssupplier.hxx | 34 +++ include/test/table/xtablecolumns.hxx | 57 ++++ include/test/table/xtablerows.hxx | 38 +++ include/test/testdllapi.hxx | 39 +++ include/test/testinteractionhandler.hxx | 154 +++++++++++ include/test/text/baseindex.hxx | 30 +++ include/test/text/baseindexmark.hxx | 31 +++ include/test/text/documentindexmark.hxx | 31 +++ include/test/text/footnote.hxx | 27 ++ include/test/text/numberingrules.hxx | 31 +++ include/test/text/textcontent.hxx | 51 ++++ include/test/text/textdocumentindex.hxx | 30 +++ include/test/text/textdocumentsettings.hxx | 29 ++ include/test/text/textprintersettings.hxx | 30 +++ include/test/text/textsettings.hxx | 30 +++ include/test/text/xautotextcontainer.hxx | 44 +++ include/test/text/xdocumentindex.hxx | 36 +++ include/test/text/xfootnote.hxx | 33 +++ include/test/text/xsimpletext.hxx | 36 +++ include/test/text/xtext.hxx | 33 +++ include/test/text/xtextcontent.hxx | 39 +++ include/test/text/xtextfield.hxx | 37 +++ include/test/text/xtextrange.hxx | 38 +++ include/test/text/xtextrangecompare.hxx | 34 +++ include/test/unoapi_property_testers.hxx | 173 ++++++++++++ include/test/unoapi_test.hxx | 108 ++++++++ include/test/unoapixml_test.hxx | 30 +++ include/test/util/searchdescriptor.hxx | 33 +++ include/test/util/xindent.hxx | 35 +++ include/test/util/xmergeable.hxx | 34 +++ include/test/util/xrefreshable.hxx | 36 +++ include/test/util/xreplaceable.hxx | 41 +++ include/test/util/xreplacedescriptor.hxx | 33 +++ include/test/util/xsearchable.hxx | 42 +++ include/test/util/xsearchdescriptor.hxx | 33 +++ include/test/view/xcontrolaccess.hxx | 35 +++ include/test/view/xformlayeraccess.hxx | 43 +++ include/test/xmldiff.hxx | 21 ++ include/test/xmldocptr.hxx | 20 ++ include/test/xmltesttools.hxx | 114 ++++++++ 187 files changed, 8247 insertions(+) create mode 100644 include/test/a11y/AccessibilityTools.hxx create mode 100644 include/test/a11y/accessibletestbase.hxx create mode 100644 include/test/a11y/eventposter.hxx create mode 100644 include/test/a11y/swaccessibletestbase.hxx create mode 100644 include/test/beans/xpropertyset.hxx create mode 100644 include/test/bootstrapfixture.hxx create mode 100644 include/test/callgrind.hxx create mode 100644 include/test/chart/xchartdata.hxx create mode 100644 include/test/container/xchild.hxx create mode 100644 include/test/container/xelementaccess.hxx create mode 100644 include/test/container/xenumeration.hxx create mode 100644 include/test/container/xenumerationaccess.hxx create mode 100644 include/test/container/xindexaccess.hxx create mode 100644 include/test/container/xnameaccess.hxx create mode 100644 include/test/container/xnamecontainer.hxx create mode 100644 include/test/container/xnamed.hxx create mode 100644 include/test/container/xnamereplace.hxx create mode 100644 include/test/cppunitasserthelper.hxx create mode 100644 include/test/document/xactionlockable.hxx create mode 100644 include/test/document/xembeddedobjectsupplier.hxx create mode 100644 include/test/document/xlinktargetsupplier.hxx create mode 100644 include/test/drawing/captionshape.hxx create mode 100644 include/test/drawing/xdrawpages.hxx create mode 100644 include/test/drawing/xgluepointssupplier.hxx create mode 100644 include/test/drawing/xshape.hxx create mode 100644 include/test/drawing/xshapedescriptor.hxx create mode 100644 include/test/drawing/xshapegrouper.hxx create mode 100644 include/test/drawing/xshapes.hxx create mode 100644 include/test/helper/form.hxx create mode 100644 include/test/helper/shape.hxx create mode 100644 include/test/helper/transferable.hxx create mode 100644 include/test/htmltesttools.hxx create mode 100644 include/test/lang/xcomponent.hxx create mode 100644 include/test/lang/xserviceinfo.hxx create mode 100644 include/test/lokcallback.hxx create mode 100644 include/test/screenshot_test.hxx create mode 100644 include/test/sheet/cellarealink.hxx create mode 100644 include/test/sheet/cellproperties.hxx create mode 100644 include/test/sheet/databaseimportdescriptor.hxx create mode 100644 include/test/sheet/databaserange.hxx create mode 100644 include/test/sheet/datapilotfield.hxx create mode 100644 include/test/sheet/datapilotitem.hxx create mode 100644 include/test/sheet/documentsettings.hxx create mode 100644 include/test/sheet/functiondescription.hxx create mode 100644 include/test/sheet/globalsheetsettings.hxx create mode 100644 include/test/sheet/scenario.hxx create mode 100644 include/test/sheet/shape.hxx create mode 100644 include/test/sheet/sheetcell.hxx create mode 100644 include/test/sheet/sheetcellrange.hxx create mode 100644 include/test/sheet/sheetcellranges.hxx create mode 100644 include/test/sheet/sheetfilterdescriptor.hxx create mode 100644 include/test/sheet/sheetlink.hxx create mode 100644 include/test/sheet/sheetsortdescriptor2.hxx create mode 100644 include/test/sheet/spreadsheet.hxx create mode 100644 include/test/sheet/spreadsheetdocumentsettings.hxx create mode 100644 include/test/sheet/spreadsheetviewsettings.hxx create mode 100644 include/test/sheet/subtotaldescriptor.hxx create mode 100644 include/test/sheet/tableautoformat.hxx create mode 100644 include/test/sheet/tablevalidation.hxx create mode 100644 include/test/sheet/xactivationbroadcaster.hxx create mode 100644 include/test/sheet/xarealink.hxx create mode 100644 include/test/sheet/xarealinks.hxx create mode 100644 include/test/sheet/xarrayformularange.hxx create mode 100644 include/test/sheet/xcalculatable.hxx create mode 100644 include/test/sheet/xcelladdressable.hxx create mode 100644 include/test/sheet/xcellformatrangessupplier.hxx create mode 100644 include/test/sheet/xcellrangeaddressable.hxx create mode 100644 include/test/sheet/xcellrangedata.hxx create mode 100644 include/test/sheet/xcellrangeformula.hxx create mode 100644 include/test/sheet/xcellrangemovement.hxx create mode 100644 include/test/sheet/xcellrangereferrer.hxx create mode 100644 include/test/sheet/xcellrangesquery.hxx create mode 100644 include/test/sheet/xcellseries.hxx create mode 100644 include/test/sheet/xconsolidatable.hxx create mode 100644 include/test/sheet/xconsolidationdescriptor.hxx create mode 100644 include/test/sheet/xdatabaserange.hxx create mode 100644 include/test/sheet/xdatabaseranges.hxx create mode 100644 include/test/sheet/xdatapilotdescriptor.hxx create mode 100644 include/test/sheet/xdatapilotfield.hxx create mode 100644 include/test/sheet/xdatapilotfieldgrouping.hxx create mode 100644 include/test/sheet/xdatapilottable.hxx create mode 100644 include/test/sheet/xdatapilottable2.hxx create mode 100644 include/test/sheet/xdatapilottables.hxx create mode 100644 include/test/sheet/xdatapilottablessupplier.hxx create mode 100644 include/test/sheet/xddelink.hxx create mode 100644 include/test/sheet/xddelinks.hxx create mode 100644 include/test/sheet/xdocumentauditing.hxx create mode 100644 include/test/sheet/xformulaquery.hxx create mode 100644 include/test/sheet/xfunctiondescriptions.hxx create mode 100644 include/test/sheet/xgoalseek.hxx create mode 100644 include/test/sheet/xheaderfootercontent.hxx create mode 100644 include/test/sheet/xlabelrange.hxx create mode 100644 include/test/sheet/xlabelranges.hxx create mode 100644 include/test/sheet/xmultiformulatokens.hxx create mode 100644 include/test/sheet/xmultipleoperation.hxx create mode 100644 include/test/sheet/xnamedrange.hxx create mode 100644 include/test/sheet/xnamedranges.hxx create mode 100644 include/test/sheet/xprintareas.hxx create mode 100644 include/test/sheet/xrecentfunctions.hxx create mode 100644 include/test/sheet/xscenario.hxx create mode 100644 include/test/sheet/xscenarioenhanced.hxx create mode 100644 include/test/sheet/xscenarios.hxx create mode 100644 include/test/sheet/xscenariossupplier.hxx create mode 100644 include/test/sheet/xsheetannotation.hxx create mode 100644 include/test/sheet/xsheetannotationanchor.hxx create mode 100644 include/test/sheet/xsheetannotations.hxx create mode 100644 include/test/sheet/xsheetannotationshapesupplier.hxx create mode 100644 include/test/sheet/xsheetannotationssupplier.hxx create mode 100644 include/test/sheet/xsheetauditing.hxx create mode 100644 include/test/sheet/xsheetcellcursor.hxx create mode 100644 include/test/sheet/xsheetcellrange.hxx create mode 100644 include/test/sheet/xsheetcellrangecontainer.hxx create mode 100644 include/test/sheet/xsheetcellranges.hxx create mode 100644 include/test/sheet/xsheetcondition.hxx create mode 100644 include/test/sheet/xsheetconditionalentries.hxx create mode 100644 include/test/sheet/xsheetconditionalentry.hxx create mode 100644 include/test/sheet/xsheetfilterable.hxx create mode 100644 include/test/sheet/xsheetfilterableex.hxx create mode 100644 include/test/sheet/xsheetfilterdescriptor.hxx create mode 100644 include/test/sheet/xsheetfilterdescriptor2.hxx create mode 100644 include/test/sheet/xsheetfilterdescriptor3.hxx create mode 100644 include/test/sheet/xsheetlinkable.hxx create mode 100644 include/test/sheet/xsheetoperation.hxx create mode 100644 include/test/sheet/xsheetoutline.hxx create mode 100644 include/test/sheet/xsheetpagebreak.hxx create mode 100644 include/test/sheet/xspreadsheet.hxx create mode 100644 include/test/sheet/xspreadsheetdocument.hxx create mode 100644 include/test/sheet/xspreadsheets.hxx create mode 100644 include/test/sheet/xspreadsheets2.hxx create mode 100644 include/test/sheet/xspreadsheetview.hxx create mode 100644 include/test/sheet/xsubtotalcalculatable.hxx create mode 100644 include/test/sheet/xsubtotaldescriptor.hxx create mode 100644 include/test/sheet/xsubtotalfield.hxx create mode 100644 include/test/sheet/xuniquecellformatrangessupplier.hxx create mode 100644 include/test/sheet/xusedareacursor.hxx create mode 100644 include/test/sheet/xviewfreezable.hxx create mode 100644 include/test/sheet/xviewpane.hxx create mode 100644 include/test/sheet/xviewsplitable.hxx create mode 100644 include/test/style/xstyleloader.hxx create mode 100644 include/test/table/tablecolumn.hxx create mode 100644 include/test/table/tablerow.hxx create mode 100644 include/test/table/xcell.hxx create mode 100644 include/test/table/xcellcursor.hxx create mode 100644 include/test/table/xcellrange.hxx create mode 100644 include/test/table/xcolumnrowrange.hxx create mode 100644 include/test/table/xtablechart.hxx create mode 100644 include/test/table/xtablecharts.hxx create mode 100644 include/test/table/xtablechartssupplier.hxx create mode 100644 include/test/table/xtablecolumns.hxx create mode 100644 include/test/table/xtablerows.hxx create mode 100644 include/test/testdllapi.hxx create mode 100644 include/test/testinteractionhandler.hxx create mode 100644 include/test/text/baseindex.hxx create mode 100644 include/test/text/baseindexmark.hxx create mode 100644 include/test/text/documentindexmark.hxx create mode 100644 include/test/text/footnote.hxx create mode 100644 include/test/text/numberingrules.hxx create mode 100644 include/test/text/textcontent.hxx create mode 100644 include/test/text/textdocumentindex.hxx create mode 100644 include/test/text/textdocumentsettings.hxx create mode 100644 include/test/text/textprintersettings.hxx create mode 100644 include/test/text/textsettings.hxx create mode 100644 include/test/text/xautotextcontainer.hxx create mode 100644 include/test/text/xdocumentindex.hxx create mode 100644 include/test/text/xfootnote.hxx create mode 100644 include/test/text/xsimpletext.hxx create mode 100644 include/test/text/xtext.hxx create mode 100644 include/test/text/xtextcontent.hxx create mode 100644 include/test/text/xtextfield.hxx create mode 100644 include/test/text/xtextrange.hxx create mode 100644 include/test/text/xtextrangecompare.hxx create mode 100644 include/test/unoapi_property_testers.hxx create mode 100644 include/test/unoapi_test.hxx create mode 100644 include/test/unoapixml_test.hxx create mode 100644 include/test/util/searchdescriptor.hxx create mode 100644 include/test/util/xindent.hxx create mode 100644 include/test/util/xmergeable.hxx create mode 100644 include/test/util/xrefreshable.hxx create mode 100644 include/test/util/xreplaceable.hxx create mode 100644 include/test/util/xreplacedescriptor.hxx create mode 100644 include/test/util/xsearchable.hxx create mode 100644 include/test/util/xsearchdescriptor.hxx create mode 100644 include/test/view/xcontrolaccess.hxx create mode 100644 include/test/view/xformlayeraccess.hxx create mode 100644 include/test/xmldiff.hxx create mode 100644 include/test/xmldocptr.hxx create mode 100644 include/test/xmltesttools.hxx (limited to 'include/test') diff --git a/include/test/a11y/AccessibilityTools.hxx b/include/test/a11y/AccessibilityTools.hxx new file mode 100644 index 0000000000..5235faedd3 --- /dev/null +++ b/include/test/a11y/AccessibilityTools.hxx @@ -0,0 +1,289 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include + +class OOO_DLLPUBLIC_TEST AccessibilityTools +{ +public: + /** Maximum number of children to work on. This is especially useful for + * Calc which has a million elements, if not more. */ + static const sal_Int32 MAX_CHILDREN = 500; + + static css::uno::Reference + getAccessibleObjectForPredicate( + const css::uno::Reference& xCtx, + const std::function< + bool(const css::uno::Reference&)>& cPredicate); + static css::uno::Reference + getAccessibleObjectForPredicate( + const css::uno::Reference& xAcc, + const std::function< + bool(const css::uno::Reference&)>& cPredicate); + static css::uno::Reference getAccessibleObjectForRole( + const css::uno::Reference& xCtx, sal_Int16 role); + static css::uno::Reference + getAccessibleObjectForRole(const css::uno::Reference& xacc, + sal_Int16 role); + + /** + * @brief Gets a descendant of @p xCtx (or @p xCtx itself) that matches the given role and name. + * @param xCtx An accessible context object to start the search from + * @param role The role of the object to look up. + * @param name The name of the object to look up. + * @returns The found object, or @c nullptr if not found. + * + * Finds a descendant of @p xCtx (or @p xCtx itself) that matches @p role and @p name. + * @code + * AccessibilityTools::getAccessibleObjectForName( + * css::accessibility::AccessibleRole::PUSH_BUTTON, u"Insert"); + * @endcode + * + * @see AccessibilityTools::getAccessibleObjectForPredicate() */ + static css::uno::Reference getAccessibleObjectForName( + const css::uno::Reference& xCtx, + const sal_Int16 role, std::u16string_view name); + static inline css::uno::Reference + getAccessibleObjectForName(const css::uno::Reference& xAcc, + const sal_Int16 role, std::u16string_view name) + { + return getAccessibleObjectForName(xAcc->getAccessibleContext(), role, name); + } + + /** + * @brief Gets a descendant of @p xCtx (or @p xCtx itself) that matches the last given role and + * name pair, and has ancestors matching the leading pairs in the given order. + * @param xCtx An accessible context to start the search from. + * @param role The role of the first ancestor to match. + * @param name The name of the first ancestor to match. + * @param Ts...args Additional role and name pairs of ancestors, ending with the role and name + * pair of the target object to match. + * @returns The found object, or @c nullptr if not found. + * + * Specialized version allowing specifying arbitrary objects on the path to the target one. Not + * all objects have to be matched, but there have to be ancestors matching in the given order. + * This is useful to easily solve conflicts if there are more than one possible match. + * + * This can be used to find an "Insert" push button inside a panel named "Some group" for + * example, as shown below: + * + * @code + * AccessibilityTools::getAccessibleObjectForName( + * css::accessibility::AccessibleRole::PANEL, u"Some group", + * css::accessibility::AccessibleRole::PUSH_BUTTON, u"Insert"); + * @endcode + * + * @note This returns the first match in the object tree when walking it depth-first. Depending + * on the tree, this might not be able to find the expected match, e.g. if there is a + * first match with intermediate unmatched objects, and the target has the same tree but + * without intermediate objects that can be used to refine the search and prevent the + * unwanted tree to match. The same issue arises with two identical trees, yet in that + * case no walking scenario could solve it automatically anyway. + * In such situations, a custom @c getAccessibleObjectForPredicate() call, or successive + * lookups interleaved with specific child lookups are likely the best solution. + * + * @see getAccessibleObjectForPredicate(). + */ + /* TODO: reimplement as IDDFS or BFS? Not sure the additional complexity/performance costs + * warrant it. */ + template + static css::uno::Reference getAccessibleObjectForName( + const css::uno::Reference& xCtx, + const sal_Int16 role, std::u16string_view name, Ts... args) + { + auto nChildren = xCtx->getAccessibleChildCount(); + + // try self first + if (xCtx->getAccessibleRole() == role && nameEquals(xCtx, name)) + { + for (decltype(nChildren) i = 0; i < nChildren && i < MAX_CHILDREN; i++) + { + if (auto xMatchChild + = getAccessibleObjectForName(xCtx->getAccessibleChild(i), args...)) + return xMatchChild; + } + } + + // if not found, try at a deeper level + for (decltype(nChildren) i = 0; i < nChildren && i < MAX_CHILDREN; i++) + { + if (auto xMatchChild + = getAccessibleObjectForName(xCtx->getAccessibleChild(i), role, name, args...)) + return xMatchChild; + } + + return nullptr; + } + + template + static inline css::uno::Reference + getAccessibleObjectForName(const css::uno::Reference& xAcc, + const sal_Int16 role, std::u16string_view name, Ts... args) + { + return getAccessibleObjectForName(xAcc->getAccessibleContext(), role, name, args...); + } + + static bool equals(const css::uno::Reference& xacc1, + const css::uno::Reference& xacc2); + static bool equals(const css::uno::Reference& xctx1, + const css::uno::Reference& xctx2); + + /** + * @brief Compares the accessible name against a string + * @param xCtx A XAccessibleContext on which compare the name + * @param name The string to compare to + * @returns @c true if @p xCtx name matches @p name. + * + * This is conceptually equivalent to @code xCtx->getAccessibleName() == name @endcode, but + * handles the case OSL debugging is active and inserts a type suffix. Unless you know for + * sure the accessible you are comparing is not subject to those suffixes under debugging, + * always use this function instead of direct comparison. + */ + static bool nameEquals(const css::uno::Reference& xCtx, + const std::u16string_view name); + static bool nameEquals(const css::uno::Reference& xAcc, + const std::u16string_view name) + { + return nameEquals(xAcc->getAccessibleContext(), name); + } + + static OUString getRoleName(const sal_Int16 role); + static OUString getEventIdName(const sal_Int16 event_id); + static OUString getRelationTypeName(const sal_Int16 rel_type); + + template static std::string debugString(const css::uno::Reference& x) + { + return debugString(x.get()); + } + + template static std::string debugString(const T& x) { return debugString(&x); } + + template static std::string debugString(const T* p) + { + /* only the forwarding to debugName() might actually dereference @c p, + * and we rely on specializations to be as constant as possible and not + * violate the cast here. In practice it'll be the case for all types + * handle if we carefully write the specializations. In most case the + * specialization could take a const itself if the methods were + * properly marked const, but well. */ + return debugString(const_cast(p)); + } + + template static std::string debugString(T* p) + { + CPPUNIT_NS::OStringStream ost; + + ost << "(" << static_cast(p) << ")"; + if (p != nullptr) + ost << " " << debugName(p); + + return ost.str(); + } + + static OUString debugAccessibleStateSet(sal_Int64 p); + + /** + * @brief Process events until a condition or a timeout + * @param cUntilCallback Callback condition + * @param nTimeoutMs Maximum time in ms to wait for condition + * @returns @c true if the condition was met, or @c false if the timeout + * has been reached. + * + * Processes events until idle, and either until the given condition + * becomes @c true or a timeout is reached. + * + * This is similar to Scheduler::ProcessEventsToIdle() but awaits a + * condition up to a timeout. This is useful if the waited-on condition + * might happen after the first idle time. The timeout helps in case the + * condition is not satisfied in reasonable time. + * + * @p cUntilCallback is called each time the scheduler reaches idle to check + * whether the condition is met. + * + * Example: + * @code + * ProcessEvents([&]() { return taskHasRun; }); + * @endcode + * + * @see Scheduler::ProcessEventsToIdle() + */ + static bool Await(const std::function& cUntilCallback, sal_uInt64 nTimeoutMs = 3000); + + /** + * @brief Process events for a given time + * @param nTimeoutMs Time to dispatch events for + * + * Process events for a given time. This can be useful if waiting is in + * order but there is no actual condition to wait on (e.g. expect + * something *not* to happen). This similar in spirit to + * @c sleep(nTimeoutMs), but dispatches events during the wait. + * + * This function should be used sparsely because waiting a given time is + * rarely a good solution for a problem, but in some specific situations + * there is no better alternative (like, again, waiting for something not + * to happen). + */ + static void Wait(sal_uInt64 nTimeoutMs); + +private: + static OUString debugName(css::accessibility::XAccessibleContext* xctx); + static OUString debugName(css::accessibility::XAccessible* xacc); + static OUString debugName(const css::accessibility::AccessibleEventObject* evobj); + static OUString debugName(css::accessibility::XAccessibleAction* xAct); + static OUString debugName(css::accessibility::XAccessibleText* xTxt); +}; + +CPPUNIT_NS_BEGIN +/* How to generate those automatically? We don't want to match all types + * not to mess up cppunit for types we don't support */ +#define AT_ASSERTION_TRAITS(T) \ + template <> struct assertion_traits> \ + { \ + static bool equal(const css::uno::Reference& x, const css::uno::Reference& y) \ + { \ + return AccessibilityTools::equals(x, y); \ + } \ + \ + static std::string toString(const css::uno::Reference& x) \ + { \ + return AccessibilityTools::debugString(x); \ + } \ + } + +AT_ASSERTION_TRAITS(css::accessibility::XAccessible); +AT_ASSERTION_TRAITS(css::accessibility::XAccessibleContext); + +#undef AT_ASSERTION_TRAITS + +CPPUNIT_NS_END + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/a11y/accessibletestbase.hxx b/include/test/a11y/accessibletestbase.hxx new file mode 100644 index 0000000000..e23c2e1246 --- /dev/null +++ b/include/test/a11y/accessibletestbase.hxx @@ -0,0 +1,298 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "AccessibilityTools.hxx" + +namespace test +{ +class OOO_DLLPUBLIC_TEST AccessibleTestBase : public test::BootstrapFixture +{ +protected: + css::uno::Reference mxDesktop; + css::uno::Reference mxDocument; + css::uno::Reference mxWindow; + + static bool isDocumentRole(const sal_Int16 role); + + virtual void load(const rtl::OUString& sURL); + virtual void loadFromSrc(const rtl::OUString& sSrcPath); + void close(); + css::uno::Reference getWindowAccessibleContext(); + virtual css::uno::Reference + getDocumentAccessibleContext(); + + void documentPostKeyEvent(int nType, int nCharCode, int nKeyCode) + { + vcl::ITiledRenderable* pTiledRenderable + = dynamic_cast(mxDocument.get()); + CPPUNIT_ASSERT(pTiledRenderable); + pTiledRenderable->postKeyEvent(nType, nCharCode, nKeyCode); + } + + static css::uno::Reference getFirstRelationTargetOfType( + const css::uno::Reference& xContext, + sal_Int16 relationType); + + /** + * @brief Tries to list all children of an accessible + * @param xContext An XAccessibleContext object + * @returns The list of all children (but no more than @c AccessibilityTools::MAX_CHILDREN) + * + * This fetches children of @p xContext. This would ideally just be the same than iterating + * over children the regular way up to @c AccessibilityTools::MAX_CHILDREN, but unfortunately + * some components (Writer, Impress, ...) do not provide all their children the regular way and + * require specifics to include them. + * + * There is no guarantee on *which* children are returned if there are more than + * @c AccessibilityTools::MAX_CHILDREN -- yet they will always be the same in a given context. + */ + virtual std::deque> + getAllChildren(const css::uno::Reference& xContext); + + void dumpA11YTree(const css::uno::Reference& xContext, + const int depth = 0); + + css::uno::Reference + getItemFromName(const css::uno::Reference& xMenuCtx, + std::u16string_view name); + bool + activateMenuItem(const css::uno::Reference& xAction); + /* just convenience not to have to query accessibility::XAccessibleAction manually */ + bool activateMenuItem(const css::uno::Reference& xCtx) + { + return activateMenuItem(css::uno::Reference( + xCtx, css::uno::UNO_QUERY_THROW)); + } + + /* convenience to get a menu item from a list of menu item names. Unlike + * getItemFromName(context, name), this requires subsequently found items to implement + * XAccessibleAction, as each but the last item will be activated before looking for + * the next one, to account for the fact menus might not be fully populated before being + * activated. */ + template + css::uno::Reference + getItemFromName(const css::uno::Reference& xMenuCtx, + std::u16string_view name, Ts... names) + { + auto item = getItemFromName(xMenuCtx, name); + CPPUNIT_ASSERT(item.is()); + activateMenuItem(item); + return getItemFromName(item, names...); + } + + /* convenience to activate an item by its name and all its parent menus up to xMenuCtx. + * @see getItemFromName() */ + template + bool + activateMenuItem(const css::uno::Reference& xMenuCtx, + Ts... names) + { + auto item = getItemFromName(xMenuCtx, names...); + CPPUNIT_ASSERT(item.is()); + return activateMenuItem(item); + } + + /* convenience to activate an item by its name and all its parent menus up to the main window + * menu bar */ + template bool activateMenuItem(Ts... names) + { + auto menuBar = AccessibilityTools::getAccessibleObjectForRole( + getWindowAccessibleContext(), css::accessibility::AccessibleRole::MENU_BAR); + CPPUNIT_ASSERT(menuBar.is()); + return activateMenuItem(menuBar, names...); + } + + /** + * @brief Gets the focused accessible object at @p xAcc level or below + * @param xAcc An accessible object + * @returns The accessible context of the focused object, or @c nullptr + * + * Finds the accessible object context at or under @p xAcc that has the focused state (and is + * showing). Normally only one such object should exist in a given hierarchy, but in all cases + * this function will return the first one found. + * + * @see AccessibilityTools::getAccessibleObjectForPredicate() + */ + static css::uno::Reference + getFocusedObject(const css::uno::Reference& xCtx); + + static inline css::uno::Reference + getFocusedObject(const css::uno::Reference& xAcc) + { + return getFocusedObject(xAcc->getAccessibleContext()); + } + + /** + * @brief Navigates through focusable elements using the Tab keyboard shortcut. + * @param xRoot The root element to look for focused elements in. + * @param role The accessible role of the element to tab to. + * @param name The accessible name of the element to tab to. + * @param pEventPosterHelper Pointer to a @c EventPosterHelper instance, or @c nullptr to obtain + * it from @p xRoot. + * @returns The element tabbed to, or @c nullptr if not found. + * + * Navigates through focusable elements in the top level containing @p xRoot using the Tab + * keyboard key until the focused elements matches @p role and @p name. + * + * Note that usually @p xRoot should be the toplevel accessible, or at least contain all + * focusable elements within that window. It is however *not* a requirement, but only elements + * actually inside it will be candidate for a match, and thus if focus goes outside it, it might + * lead to not finding the target element. + * + * If @p pEventPosterHelper is @c nullptr, this function will try to construct one from + * @p xRoot. @see EventPosterHelper. + */ + static css::uno::Reference + tabTo(const css::uno::Reference& xRoot, const sal_Int16 role, + const std::u16string_view name, + const EventPosterHelperBase* pEventPosterHelper = nullptr); + + static bool tabTo(const css::uno::Reference& xRoot, + const css::uno::Reference& xChild, + const EventPosterHelperBase* pEventPosterHelper = nullptr); + +#if !defined(MACOSX) + /* Dialog handling */ + class Dialog : public test::AccessibleEventPosterHelper + { + private: + bool mbAutoClose; + css::uno::Reference mxDialog2; + css::uno::Reference mxAccessible; + + public: + Dialog(css::uno::Reference& xDialog2, bool bAutoClose = true); + virtual ~Dialog(); + + void setAutoClose(bool bAutoClose) { mbAutoClose = bAutoClose; } + + css::uno::Reference getAccessible() const + { + return mxAccessible; + } + + void close(sal_Int32 result = VclResponseType::RET_CANCEL); + + css::uno::Reference + tabTo(const sal_Int16 role, const std::u16string_view name) + { + return AccessibleTestBase::tabTo(getAccessible(), role, name, this); + } + + bool tabTo(const css::uno::Reference& xChild) + { + return AccessibleTestBase::tabTo(getAccessible(), xChild, this); + } + }; + + class DialogWaiter + { + public: + virtual ~DialogWaiter() {} + + /** + * @brief Waits for the associated dialog to close + * @param nTimeoutMs Maximum delay to wait the dialog for + * @returns @c true if the dialog closed, @c false if timeout was reached + * + * @throws css::uno::RuntimeException if an unexpected dialog popped up instead of the + * expected one. + * @throws Any exception that the user callback supplied to awaitDialog() might have thrown. + */ + virtual bool waitEndDialog(sal_uInt64 nTimeoutMs = 3000) = 0; + }; + + /** + * @brief Helper to call user code when a given dialog opens + * @param name The title of the dialog window to wait for + * @param callback The user code to run when the given dialog opens + * @param bAutoClose Whether to automatically cancel the dialog after the user code finished, if + * the dialog is still there. You should leave this to @c true unless you + * know exactly what you are doing, see below. + * @returns A @c DialogWaiter wrapper on which call waitEndDialog() after having triggered the + * dialog in some way. + * + * This function makes it fairly easy and safe to execute code once a dialog pops up: + * @code + * auto waiter = awaitDialog(u"Special Characters", [this](Dialog &dialog) { + * // for example, something like this: + * // something(); + * // CPPUNIT_ASSERT(dialog.tabTo(...)); + * // CPPUNIT_ASSERT(somethingElse); + * // dialog.postKeyEventAsync(0, awt::Key::RETURN); + * }); + * CPPUNIT_ASSERT(activateMenuItem(u"Some menu", u"Some Item Triggering a Dialog...")); + * CPPUNIT_ASSERT(waiter->waitEndDialog()); + * @endcode + * + * @note The user code might actually be executed before DialogWaiter::waitEndDialog() is + * called. It is actually likely to be called at the time the call that triggers the + * dialog happens. However, as letting an exception slip in a event handler is likely to + * cause problems, exceptions are forwarded to the DialogWaiter::waitEndDialog() call. + * However, note that you cannot rely on something like this: + * @code + * int foo = 0; + * auto waiter = awaitDialog(u"Some Dialog", [&foo](Dialog&) { + * CPPUNIT_ASSERT_EQUAL(1, foo); + * }); + * CPPUNIT_ASSERT(activateMenuItem(u"Some menu", u"Some Item Triggering a Dialog...")); + * foo = 1; // here, the callback likely already ran as a result of the + * // Scheduler::ProcessEventsToIdle() call that activateMenuItem() did. + * CPPUNIT_ASSERT(waiter->waitEndDialog()); + * @endcode + * + * @warning You should almost certainly always leave @p bAutoClose to @c true. If it is set to + * @c false, you have to take extreme care: + * - The dialog will not be canceled if the user code raises an exception. + * - If the dialog is run through Dialog::Execute(), control won't return to the test + * body until the dialog is closed. This means that the only ways to execute code + * until then is a separate thread or via code dispatched by the main loop. + * Thus, you have to make sure you DO close the dialog some way or another yourself + * in order for the test code to terminate at some point. + * - If the dialog doesn't use Dialog::Execute() but is rather similar to a second + * separate window (e.g. non-modal), you might still have to close the dialog before + * closing the test document is possible without a CloseVetoException -- which might + * badly break the test run. + */ + static std::shared_ptr awaitDialog(const std::u16string_view name, + std::function callback, + bool bAutoClose = true); +#endif //defined(MACOSX) + +public: + virtual void setUp() override; + virtual void tearDown() override; +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/a11y/eventposter.hxx b/include/test/a11y/eventposter.hxx new file mode 100644 index 0000000000..d9bce5601f --- /dev/null +++ b/include/test/a11y/eventposter.hxx @@ -0,0 +1,131 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include + +#include +#include + +#include +#include +#include + +namespace test +{ +/** + * @brief Base helper class to send events to a window. + * + * Implementations of this helper will usually just wrap an implementation of post*Event*() calls. + * This class is mostly useful to encapsulate the calls when getting the target window is not + * trivial or is only relevant to sending events, and to have a generic event poster interface. + * + * Additionally, this class provides simplified helpers to send event pairs, like key down/up, or + * text+commit, to make it easier on the common case for callers. + */ +class OOO_DLLPUBLIC_TEST EventPosterHelperBase +{ +public: + virtual ~EventPosterHelperBase(){}; + + /** @see SfxLokHelper::postKeyEventAsync */ + virtual void postKeyEventAsync(int nType, int nCharCode, int nKeyCode) const = 0; + + /** Posts a full key down/up cycle */ + void postKeyEventAsync(int nCharCode, int nKeyCode) const + { + postKeyEventAsync(LOK_KEYEVENT_KEYINPUT, nCharCode, nKeyCode); + postKeyEventAsync(LOK_KEYEVENT_KEYUP, nCharCode, nKeyCode); + } + + /** @see SfxLokHelper::postExtTextEventAsync */ + virtual void postExtTextEventAsync(int nType, const OUString& rText) const = 0; + + /** Posts a full text input + commit sequence */ + void postExtTextEventAsync(const OUString& rText) const + { + postExtTextEventAsync(LOK_EXT_TEXTINPUT, rText); + postExtTextEventAsync(LOK_EXT_TEXTINPUT_END, rText); + } +}; + +/** + * @brief Helper to send events to a window. + * + * This helper basically just wraps SfxLokHelper::post*EventAsync() calls to hold the target window + * reference in the class. + */ +class OOO_DLLPUBLIC_TEST EventPosterHelper : public EventPosterHelperBase +{ +protected: + VclPtr mxWindow; + +public: + EventPosterHelper(void) + : mxWindow(nullptr) + { + } + EventPosterHelper(VclPtr xWindow) + : mxWindow(xWindow) + { + } + EventPosterHelper(vcl::Window* pWindow) + : mxWindow(pWindow) + { + } + + vcl::Window* getWindow() const { return mxWindow; } + + void setWindow(VclPtr xWindow) { mxWindow = xWindow; } + void setWindow(vcl::Window* pWindow) { mxWindow = pWindow; } + + explicit operator bool() const { return mxWindow && !mxWindow->isDisposed(); } + bool operator!() const { return !bool(*this); } + + using EventPosterHelperBase::postKeyEventAsync; + using EventPosterHelperBase::postExtTextEventAsync; + + /** @see SfxLokHelper::postKeyEventAsync */ + virtual void postKeyEventAsync(int nType, int nCharCode, int nKeyCode) const override; + /** @see SfxLokHelper::postExtTextEventAsync */ + virtual void postExtTextEventAsync(int nType, const OUString& rText) const override; +}; + +/** + * @brief Accessibility-specialized helper to send events to a window. + * + * This augments @c test::EventPosterHelper to simplify usage in accessibility tests. + */ +class OOO_DLLPUBLIC_TEST AccessibleEventPosterHelper : public EventPosterHelper +{ +public: + AccessibleEventPosterHelper(void) + : EventPosterHelper() + { + } + AccessibleEventPosterHelper(const css::uno::Reference xAcc) + { + setWindow(xAcc); + } + + /** + * @brief Sets the window on which post events based on an accessible object inside it. + * @param xAcc An accessible object inside a toplevel. + * + * This method tries and find the top level window containing @p xAcc to use it to post events. + * + * This currently relies on a toplevel accessible being a @c VCLXWindow, and requires that + * window's output device to be set (@see VCLXWindow::GetWindow()). + */ + void setWindow(css::uno::Reference xAcc); +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/a11y/swaccessibletestbase.hxx b/include/test/a11y/swaccessibletestbase.hxx new file mode 100644 index 0000000000..a8ed42a4dc --- /dev/null +++ b/include/test/a11y/swaccessibletestbase.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include + +#include + +#include +#include + +#include +#include + +#include "accessibletestbase.hxx" + +namespace test +{ +class OOO_DLLPUBLIC_TEST SwAccessibleTestBase : public AccessibleTestBase +{ +private: + void collectText(const css::uno::Reference& xContext, + rtl::OUStringBuffer& buffer, bool onlyChildren = false); + +protected: + static css::uno::Reference getPreviousFlowingSibling( + const css::uno::Reference& xContext); + static css::uno::Reference getNextFlowingSibling( + const css::uno::Reference& xContext); + + /** + * This fetches regular children plus siblings linked with FLOWS_TO/FLOWS_FROM which are not + * already in the regular children set. This is required because most offscreen children of the + * document contents are not listed as part of their parent children, but as FLOWS_* reference + * from one to the next. + * There is currently no guarantee all children will be listed, and it is fairly likely + * offscreen frames and tables might be missing for example. + */ + virtual std::deque> getAllChildren( + const css::uno::Reference& xContext) override; + + /** Collects contents of @p xContext in a dummy markup form */ + OUString + collectText(const css::uno::Reference& xContext); + + /** Collects contents of the current document */ + OUString collectText() { return collectText(getDocumentAccessibleContext()); } +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/beans/xpropertyset.hxx b/include/test/beans/xpropertyset.hxx new file mode 100644 index 0000000000..dbfac0a2e8 --- /dev/null +++ b/include/test/beans/xpropertyset.hxx @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_BEANS_XPROPERTYSET_HXX +#define INCLUDED_TEST_BEANS_XPROPERTYSET_HXX + +#include +#include + +#include + +#include + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XPropertySet +{ +public: + XPropertySet() {} + + XPropertySet(const std::set rIgnoreValue) + : m_IgnoreValue(rIgnoreValue) + { + } + virtual css::uno::Reference init() = 0; + + void testGetPropertySetInfo(); + void testSetPropertyValue(); + void testGetPropertyValue(); + void testPropertyChangeListener(); + void testVetoableChangeListener(); + +protected: + ~XPropertySet(){}; + bool isPropertyValueChangeable(const OUString& rName); + + virtual bool isPropertyIgnored(const OUString& rName); + +private: + void fillPropsToTest(const css::uno::Reference& xPropInfo); + static bool + getSinglePropertyValue(const css::uno::Reference& xPropSet, + const OUString& rName); + + struct OOO_DLLPUBLIC_TEST PropsToTest + { + std::vector constrained; + std::vector bound; + std::vector normal; + std::vector readonly; + + bool initialized; + + PropsToTest(); + }; + + PropsToTest maPropsToTest; + std::set m_IgnoreValue; +}; + +} // namespace apitest + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/bootstrapfixture.hxx b/include/test/bootstrapfixture.hxx new file mode 100644 index 0000000000..438bba58a4 --- /dev/null +++ b/include/test/bootstrapfixture.hxx @@ -0,0 +1,73 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#pragma once + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace test +{ +enum ValidationFormat +{ + OOXML, + ODF, + MSBINARY +}; + +// Class to do lots of heavy-lifting UNO & environment +// bootstrapping for unit tests, such that we can use +// almost an entire LibreOffice during compile - so +// that we can get pieces of code alone to beat them up. + +// NB. this class is instantiated multiple times during a +// run of unit tests ... +class OOO_DLLPUBLIC_TEST BootstrapFixture : public BootstrapFixtureBase +{ + bool m_bNeedUCB; + bool m_bAssertOnDialog; + +protected: + css::uno::Reference mxComponentContext; + + // A convenience function to be used to conditionally exclude tests not behaving properly + // on UI scaling other than 1:1. Using this should be considered a temporary workaround, + // until a proper fix is implemented that either considers the DPI properly in the test, or + // makes the invariants that test uses independent of DPI. + static bool IsDefaultDPI(); + static std::pair getDPIScaling(); + +public: + DECL_DLLPRIVATE_STATIC_LINK(BootstrapFixture, ImplInitFilterHdl, ConvertData&, bool); + + BootstrapFixture(bool bAssertOnDialog = true, bool bNeedUCB = true); + virtual ~BootstrapFixture() override; + + virtual void setUp() override; + + void validate(const OUString& rURL, ValidationFormat) const; + + // Allows to exclude tests dependent on color depth of the default virtual device + static sal_uInt16 getDefaultDeviceBitCount(); +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/callgrind.hxx b/include/test/callgrind.hxx new file mode 100644 index 0000000000..6a16fa8319 --- /dev/null +++ b/include/test/callgrind.hxx @@ -0,0 +1,21 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_CALLGRIND_HXX +#define INCLUDED_TEST_CALLGRIND_HXX + +#include +#include + +void OOO_DLLPUBLIC_TEST callgrindStart(); +void OOO_DLLPUBLIC_TEST callgrindDump(const char* name); + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/chart/xchartdata.hxx b/include/test/chart/xchartdata.hxx new file mode 100644 index 0000000000..315d727ed5 --- /dev/null +++ b/include/test/chart/xchartdata.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XChartData +{ +public: + virtual css::uno::Reference init() = 0; + + void testChartDataChangeEventListener(); + void testGetNotANumber(); + void testIsNotANumber(); + +protected: + ~XChartData() {} +}; + +} // namespace apitest + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/container/xchild.hxx b/include/test/container/xchild.hxx new file mode 100644 index 0000000000..60efed6fc2 --- /dev/null +++ b/include/test/container/xchild.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* +* This file is part of the LibreOffice project. +* +* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. +*/ + +#ifndef INCLUDED_TEST_CONTAINER_XCHILD_HXX +#define INCLUDED_TEST_CONTAINER_XCHILD_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XChild +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetSetParent(); + +protected: + ~XChild() {} +}; +} + +#endif // INCLUDED_TEST_CONTAINER_XCHILD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/container/xelementaccess.hxx b/include/test/container/xelementaccess.hxx new file mode 100644 index 0000000000..95ee85162d --- /dev/null +++ b/include/test/container/xelementaccess.hxx @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_CONTAINER_XELEMENTACCESS_HXX +#define INCLUDED_TEST_CONTAINER_XELEMENTACCESS_HXX + +#include + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XElementAccess +{ +public: + XElementAccess(css::uno::Type const& rType) + : m_aType(rType) + { + } + + void testGetElementType(); + void testHasElements(); + + virtual css::uno::Reference init() = 0; + +protected: + ~XElementAccess() {} + +private: + css::uno::Type m_aType; +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_CONTAINER_XELEMENTACCESS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/container/xenumeration.hxx b/include/test/container/xenumeration.hxx new file mode 100644 index 0000000000..0d39a0dc98 --- /dev/null +++ b/include/test/container/xenumeration.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_CONTAINER_XENUMERATION_HXX +#define INCLUDED_TEST_CONTAINER_XENUMERATION_HXX + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XEnumeration +{ +public: + virtual css::uno::Reference init() = 0; + + void testHasMoreElements(); + void testNextElement(); + +protected: + ~XEnumeration() {} +}; +} // namespace apitest + +#endif // INCLUDED_TEST_CONTAINER_XENUMERATION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/container/xenumerationaccess.hxx b/include/test/container/xenumerationaccess.hxx new file mode 100644 index 0000000000..272172c8d5 --- /dev/null +++ b/include/test/container/xenumerationaccess.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* +* This file is part of the LibreOffice project. +* +* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. +*/ + +#ifndef INCLUDED_TEST_CONTAINER_XENUMERATIONACCESS_HXX +#define INCLUDED_TEST_CONTAINER_XENUMERATIONACCESS_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XEnumerationAccess +{ +public: + virtual css::uno::Reference init() = 0; + + void testCreateEnumeration(); + +protected: + ~XEnumerationAccess() {} +}; +} + +#endif // INCLUDED_TEST_CONTAINER_XENUMERATIONACCESS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/container/xindexaccess.hxx b/include/test/container/xindexaccess.hxx new file mode 100644 index 0000000000..64a34b8bf2 --- /dev/null +++ b/include/test/container/xindexaccess.hxx @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_CONTAINER_XINDEXACCESS_HXX +#define INCLUDED_TEST_CONTAINER_XINDEXACCESS_HXX + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XIndexAccess +{ +public: + XIndexAccess(sal_Int32 nItems) + : m_nItems(nItems) + { + } + + virtual css::uno::Reference init() = 0; + void testGetCount(); + void testGetByIndex(); + // will throw an exception and should fail if not + void testGetByIndexException(); + +protected: + ~XIndexAccess() {} + +private: + sal_Int32 m_nItems; +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_CONTAINER_XINDEXACCESS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/container/xnameaccess.hxx b/include/test/container/xnameaccess.hxx new file mode 100644 index 0000000000..875c2bed60 --- /dev/null +++ b/include/test/container/xnameaccess.hxx @@ -0,0 +1,47 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_CONTAINER_XNAMEACCESS_HXX +#define INCLUDED_TEST_CONTAINER_XNAMEACCESS_HXX + +#include + +#include + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XNameAccess +{ +public: + XNameAccess(OUString aName) + : m_aName(std::move(aName)) + { + } + + virtual css::uno::Reference init() = 0; + + void testGetByName(); + void testGetElementNames(); + void testHasByName(); + +protected: + ~XNameAccess() {} + +private: + OUString const m_aName; +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_CONTAINER_XNAMEACCESS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/container/xnamecontainer.hxx b/include/test/container/xnamecontainer.hxx new file mode 100644 index 0000000000..5cc4bab125 --- /dev/null +++ b/include/test/container/xnamecontainer.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_CONTAINER_XNAMECONTAINER_HXX +#define INCLUDED_TEST_CONTAINER_XNAMECONTAINER_HXX + +#include +#include + +#include + +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XNameContainer +{ +public: + // removes default entry + XNameContainer() + : m_aName("XNameContainer") + { + } + // removes given entry + XNameContainer(OUString aNameToRemove) + : m_aName(std::move(aNameToRemove)) + { + } + + virtual css::uno::Reference init() = 0; + virtual void setElement(const css::uno::Any& rElement) { m_aElement = rElement; } + + void testInsertByName(); + void testInsertByNameEmptyName(); + void testInsertByNameDuplicate(); + void testInsertByNameInvalidElement(); + void testRemoveByName(); + void testRemoveByNameEmptyName(); + void testRemoveByNameNoneExistingElement(); + +protected: + ~XNameContainer() {} + +private: + OUString m_aName; + css::uno::Any m_aElement; +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_CONTAINER_XNAMECONTAINER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/container/xnamed.hxx b/include/test/container/xnamed.hxx new file mode 100644 index 0000000000..17ef070de9 --- /dev/null +++ b/include/test/container/xnamed.hxx @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_CONTAINER_XNAMED_HXX +#define INCLUDED_TEST_CONTAINER_XNAMED_HXX + +#include + +#include + +#include + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XNamed +{ +public: + XNamed(OUString aTestName) + : m_aTestName(std::move(aTestName)) + { + } + + void testGetName(); + void testSetName(); + // special case, here name is equal to links URL + void testSetNameByScSheetLinkObj(); + void testSetNameThrowsException(); + + virtual css::uno::Reference init() = 0; + +protected: + ~XNamed() {} + +private: + OUString m_aTestName; +}; +} + +#endif // INCLUDED_TEST_CONTAINER_XNAMED_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/container/xnamereplace.hxx b/include/test/container/xnamereplace.hxx new file mode 100644 index 0000000000..dcecaf9717 --- /dev/null +++ b/include/test/container/xnamereplace.hxx @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_CONTAINER_XNAMEREPLACE_HXX +#define INCLUDED_TEST_CONTAINER_XNAMEREPLACE_HXX + +#include +#include + +#include + +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XNameReplace +{ +public: + XNameReplace(OUString aName) + : m_aReplacementName(std::move(aName)) + { + } + + virtual css::uno::Reference init() = 0; + void testReplaceByName(); + + void setElement(const css::uno::Any& rElement) { m_aReplacementElement = rElement; } + +protected: + ~XNameReplace() {} + +private: + OUString m_aReplacementName; + css::uno::Any m_aReplacementElement; +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_CONTAINER_XNAMEREPLACE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/cppunitasserthelper.hxx b/include/test/cppunitasserthelper.hxx new file mode 100644 index 0000000000..0fd3806b65 --- /dev/null +++ b/include/test/cppunitasserthelper.hxx @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_CPPUNITASSERTHELPER_HXX +#define INCLUDED_TEST_CPPUNITASSERTHELPER_HXX + +#include + +#include +#include +#include +#include + +#include + +/** @brief Trait used by CPPUNIT_ASSERT* macros to compare com::sun::star:awt::Point. + * + * This specialization from @c struct @c assertion_traits<> helps to compare + * @see com::sun::star::awt::Point. + */ +template <> +inline std::string CPPUNIT_NS::assertion_traits::toString(const css::awt::Point& x) +{ + OStringStream ost; + ost << "Point: " << x.X << "." << x.Y << " (coordinate: X.Y)"; + return ost.str(); +} + +/** @brief Trait used by CPPUNIT_ASSERT* macros to compare com::sun::star:awt::Size. + * + * This specialization from @c struct @c assertion_traits<> helps to compare + * @see com::sun::star::awt::Size. + */ +template <> +inline std::string CPPUNIT_NS::assertion_traits::toString(const css::awt::Size& x) +{ + OStringStream ost; + ost << "Size: " << x.Width << " x " << x.Height << " (Width x Height)"; + return ost.str(); +} + +/** @brief Trait used by CPPUNIT_ASSERT* macros to compare com::sun::star::table::CellAddress. + * + * This specialization from @c struct @c assertion_traits<> helps to compare + * @see com::sun::star::table::CellAddress. + */ +template <> +inline std::string +CPPUNIT_NS::assertion_traits::toString(const css::table::CellAddress& x) +{ + OStringStream ost; + ost << "Sheet: " << x.Sheet << " Column: " << x.Column << " Row: " << x.Row; + return ost.str(); +} + +/** @brief Trait used by CPPUNIT_ASSERT* macros to compare com::sun::star::table::CellRangeAddress. + * + * This specialization from @c struct @c assertion_traits<> helps to compare + * @see com::sun::star::table::CellRangeAddress. + */ +template <> +inline std::string CPPUNIT_NS::assertion_traits::toString( + const css::table::CellRangeAddress& x) +{ + OStringStream ost; + ost << "Sheet: " << x.Sheet << " StartColumn: " << x.StartColumn << " StartRow: " << x.StartRow + << " EndColumn: " << x.EndColumn << " EndRow: " << x.EndRow; + return ost.str(); +} + +#endif // INCLUDED_TEST_CPPUNITASSERTHELPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/document/xactionlockable.hxx b/include/test/document/xactionlockable.hxx new file mode 100644 index 0000000000..c1a76373bc --- /dev/null +++ b/include/test/document/xactionlockable.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_DOCUMENT_XACTIONLOCKABLE_HXX +#define INCLUDED_TEST_DOCUMENT_XACTIONLOCKABLE_HXX + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XActionLockable +{ +public: + virtual css::uno::Reference init() = 0; + + void testAddRemoveActionLock(); + void testSetResetActionLock(); + +protected: + ~XActionLockable(){}; +}; +} // namespace apitest + +#endif // INCLUDED_TEST_DOCUMENT_XACTIONLOCKABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/document/xembeddedobjectsupplier.hxx b/include/test/document/xembeddedobjectsupplier.hxx new file mode 100644 index 0000000000..b9caee190a --- /dev/null +++ b/include/test/document/xembeddedobjectsupplier.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_DOCUMENT_XEMBEDDEDOBJECTSUPPLIER_HXX +#define INCLUDED_TEST_DOCUMENT_XEMBEDDEDOBJECTSUPPLIER_HXX + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XEmbeddedObjectSupplier +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetEmbeddedObject(); + +protected: + ~XEmbeddedObjectSupplier() {} +}; +} // namespace apitest + +#endif // INCLUDED_TEST_DOCUMENT_XEMBEDDEDOBJECTSUPPLIER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/document/xlinktargetsupplier.hxx b/include/test/document/xlinktargetsupplier.hxx new file mode 100644 index 0000000000..de273f89b8 --- /dev/null +++ b/include/test/document/xlinktargetsupplier.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* +* This file is part of the LibreOffice project. +* +* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. +*/ + +#ifndef INCLUDED_TEST_DOCUMENT_XLINKTARGETSUPPLIER_HXX +#define INCLUDED_TEST_DOCUMENT_XLINKTARGETSUPPLIER_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XLinkTargetSupplier +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetLinks(); + +protected: + ~XLinkTargetSupplier() {} +}; +} + +#endif // INCLUDED_TEST_DOCUMENT_XLINKTARGETSUPPLIER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/drawing/captionshape.hxx b/include/test/drawing/captionshape.hxx new file mode 100644 index 0000000000..321de6e792 --- /dev/null +++ b/include/test/drawing/captionshape.hxx @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_DRAWING_CAPTION_SHAPE_HXX +#define INCLUDED_TEST_DRAWING_CAPTION_SHAPE_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST CaptionShape +{ +public: + virtual css::uno::Reference init() = 0; + + void testCaptionShapeProperties(); + +protected: + ~CaptionShape() {} +}; +} +#endif // INCLUDED_TEST_DRAWING_CAPTION_SHAPE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/drawing/xdrawpages.hxx b/include/test/drawing/xdrawpages.hxx new file mode 100644 index 0000000000..b6430df602 --- /dev/null +++ b/include/test/drawing/xdrawpages.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_DRAWING_XDRAWPAGES_HXX +#define INCLUDED_TEST_DRAWING_XDRAWPAGES_HXX + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XDrawPages +{ +public: + virtual css::uno::Reference init() = 0; + + virtual void testInsertNewByIndex(); + virtual void testRemove(); + +protected: + ~XDrawPages() {} +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_DRAWING_XDRAWPAGES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/drawing/xgluepointssupplier.hxx b/include/test/drawing/xgluepointssupplier.hxx new file mode 100644 index 0000000000..0dd8bf58a1 --- /dev/null +++ b/include/test/drawing/xgluepointssupplier.hxx @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XGluePointsSupplier +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetGluePoints(); + +protected: + ~XGluePointsSupplier() {} +}; + +} // namespace apitest + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/drawing/xshape.hxx b/include/test/drawing/xshape.hxx new file mode 100644 index 0000000000..2e9c26c9df --- /dev/null +++ b/include/test/drawing/xshape.hxx @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XShape +{ +public: + XShape() = default; + XShape(bool bObjSupportsPosition) + : m_bObjSupportsPosition(bObjSupportsPosition) + { + } + virtual css::uno::Reference init() = 0; + + void testGetSetPosition(); + void testGetSetSize(); + +protected: + ~XShape() {} + +private: + bool const m_bObjSupportsPosition{ true }; +}; + +} // namespace apitest + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/drawing/xshapedescriptor.hxx b/include/test/drawing/xshapedescriptor.hxx new file mode 100644 index 0000000000..4bbebac3f4 --- /dev/null +++ b/include/test/drawing/xshapedescriptor.hxx @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include + +#include + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XShapeDescriptor +{ +public: + XShapeDescriptor(OUString aShapeType) + : m_aShapeType(std::move(aShapeType)) + { + } + virtual css::uno::Reference init() = 0; + + void testGetShapeType(); + +protected: + ~XShapeDescriptor() {} + +private: + OUString const m_aShapeType; +}; + +} // namespace apitest + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/drawing/xshapegrouper.hxx b/include/test/drawing/xshapegrouper.hxx new file mode 100644 index 0000000000..1770d3f76d --- /dev/null +++ b/include/test/drawing/xshapegrouper.hxx @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_DRAWING_XSHAPEGROUPER_HXX +#define INCLUDED_TEST_DRAWING_XSHAPEGROUPER_HXX + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XShapeGrouper +{ +public: + void setDrawPage(const css::uno::Reference& r_xDrawPage) + { + m_xDrawPage = r_xDrawPage; + } + + virtual css::uno::Reference init() = 0; + + void testGroup(); + void testUngroup(); + +protected: + ~XShapeGrouper() {} + +private: + css::uno::Reference m_xDrawPage; +}; +} // namespace apitest + +#endif // INCLUDED_TEST_DRAWING_XSHAPEGROUPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/drawing/xshapes.hxx b/include/test/drawing/xshapes.hxx new file mode 100644 index 0000000000..f04131dc41 --- /dev/null +++ b/include/test/drawing/xshapes.hxx @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_DRAWING_XSHAPES_HXX +#define INCLUDED_TEST_DRAWING_XSHAPES_HXX + +#include +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XShapes +{ +public: + virtual css::uno::Reference init() = 0; + void setShape(const css::uno::Reference& r_xShape) + { + m_xShape = r_xShape; + } + + void testAddRemove(); + +protected: + ~XShapes() {} + +private: + css::uno::Reference m_xShape; +}; +} // namespace apitest + +#endif // INCLUDED_TEST_DRAWING_XSHAPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/helper/form.hxx b/include/test/helper/form.hxx new file mode 100644 index 0000000000..d3b80544d7 --- /dev/null +++ b/include/test/helper/form.hxx @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_HELPER_FORM_HXX +#define INCLUDED_TEST_HELPER_FORM_HXX + +#include + +#include + +#include +#include + +#include + +#include +#include + +namespace apitest +{ +namespace helper +{ +namespace form +{ +/** @brief Create a XControlShape of kind "CommandButton". + * + * @param r_xComponent The document. + * @param nX The x-position of the shape. + * @param nY The y-position of the shape. + * @param nHeight The height of the shape. + * @param nWidth The width of the shape. + * @return The created XControlShape. + */ +css::uno::Reference OOO_DLLPUBLIC_TEST createCommandButton( + const css::uno::Reference& r_xComponent, const sal_Int32 nX, + const sal_Int32 nY, const sal_Int32 nHeight, const sal_Int32 nWidth); + +/** @brief Create a XControlShape + * + * @param r_xComponent The document. + * @param r_aKind The kind of the shape. + * @param nX The x-position of the shape. + * @param nY The y-position of the shape. + * @param nHeight The height of the shape. + * @param nWidth The width of the shape. + * @return The created XControlShape. + */ +css::uno::Reference OOO_DLLPUBLIC_TEST createControlShape( + const css::uno::Reference& r_xComponent, std::u16string_view r_aKind, + const sal_Int32 nX, const sal_Int32 nY, const sal_Int32 nHeight, const sal_Int32 nWidth); + +} // namespace form +} // namespace helper +} // namespace apitest + +#endif // INCLUDED_TEST_HELPER_FORM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/helper/shape.hxx b/include/test/helper/shape.hxx new file mode 100644 index 0000000000..dbf3745219 --- /dev/null +++ b/include/test/helper/shape.hxx @@ -0,0 +1,92 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_HELPER_SHAPE_HXX +#define INCLUDED_TEST_HELPER_SHAPE_HXX + +#include + +#include + +#include +#include + +#include +#include + +#include + +namespace apitest +{ +namespace helper +{ +namespace shape +{ +/** @brief Create a XShape of kind "Ellipse". + * + * @param r_xComponent The document + * @param nX The x-position of the shape. + * @param nY The y-position of the shape. + * @param nHeight The height of the shape. + * @param nWidth The width of the shape. + * @return The created XShape. + */ +css::uno::Reference + OOO_DLLPUBLIC_TEST createEllipse(const css::uno::Reference& r_xComponent, + const sal_Int32 nX, const sal_Int32 nY, const sal_Int32 nWidth, + const sal_Int32 nHeight); + +/** @brief Create a XShape of kind "Line". + * + * @param r_xComponent The document + * @param nX The x-position of the shape. + * @param nY The y-position of the shape. + * @param nHeight The height of the shape. + * @param nWidth The width of the shape. + * @return The created XShape. + */ +css::uno::Reference + OOO_DLLPUBLIC_TEST createLine(const css::uno::Reference& r_xComponent, + const sal_Int32 nX, const sal_Int32 nY, const sal_Int32 nWidth, + const sal_Int32 nHeight); + +/** @brief Create a XShape of kind "Rectangle". + * + * @param r_xComponent The document + * @param nX The x-position of the shape. + * @param nY The y-position of the shape. + * @param nHeight The height of the shape. + * @param nWidth The width of the shape. + * @return The created XShape. + */ +css::uno::Reference OOO_DLLPUBLIC_TEST +createRectangle(const css::uno::Reference& r_xComponent, const sal_Int32 nX, + const sal_Int32 nY, const sal_Int32 nWidth, const sal_Int32 nHeight); + +/** @brief Create a XShape. + * + * @param r_xComponent The document + * @param r_aKind The kind of shape. + * @param nX The x-position of the shape. + * @param nY The y-position of the shape. + * @param nHeight The height of the shape. + * @param nWidth The width of the shape. + * @return The created XShape. + */ +css::uno::Reference OOO_DLLPUBLIC_TEST createShape( + const css::uno::Reference& r_xComponent, std::u16string_view r_aKind, + const sal_Int32 nX, const sal_Int32 nY, const sal_Int32 nWidth, const sal_Int32 nHeight); + +} // namespace shape +} // namespace helper +} // namespace apitest + +#endif // INCLUDED_TEST_HELPER_SHAPE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/helper/transferable.hxx b/include/test/helper/transferable.hxx new file mode 100644 index 0000000000..d0454bc6e4 --- /dev/null +++ b/include/test/helper/transferable.hxx @@ -0,0 +1,29 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include +#include +#include +#include + +namespace apitest +{ +namespace helper +{ +namespace transferable +{ +OString OOO_DLLPUBLIC_TEST getTextSelection( + const css::uno::Reference& xTransferable, OString mimeType); +} // namespace transferable +} // namespace helper +} // namespace apitest + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/htmltesttools.hxx b/include/test/htmltesttools.hxx new file mode 100644 index 0000000000..d72d43f8c9 --- /dev/null +++ b/include/test/htmltesttools.hxx @@ -0,0 +1,32 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_HTMLTESTTOOLS_HXX +#define INCLUDED_TEST_HTMLTESTTOOLS_HXX + +#include +#include +#include + +#include +#include + +#include + +using htmlDocUniquePtr = xmlDocUniquePtr; + +class OOO_DLLPUBLIC_TEST HtmlTestTools +{ +protected: + static htmlDocUniquePtr parseHtml(utl::TempFileNamed const& aTempFile); + static htmlDocUniquePtr parseHtmlStream(SvStream* pStream); +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/lang/xcomponent.hxx b/include/test/lang/xcomponent.hxx new file mode 100644 index 0000000000..9314749fbc --- /dev/null +++ b/include/test/lang/xcomponent.hxx @@ -0,0 +1,39 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_LANG_XCOMPONENT_HXX +#define INCLUDED_TEST_LANG_XCOMPONENT_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XComponent +{ +public: + virtual css::uno::Reference init() = 0; + virtual void triggerDesktopTerminate() = 0; + + void testAddEventListener(); + void testRemoveEventListener(); + void testDispose(); + void testDisposedByDesktopTerminate(); + +protected: + ~XComponent() {} +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_LANG_XCOMPONENT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/lang/xserviceinfo.hxx b/include/test/lang/xserviceinfo.hxx new file mode 100644 index 0000000000..29cc17dc07 --- /dev/null +++ b/include/test/lang/xserviceinfo.hxx @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_LANG_XSERVICEINFO_HXX +#define INCLUDED_TEST_LANG_XSERVICEINFO_HXX + +#include +#include + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XServiceInfo +{ +public: + XServiceInfo(OUString aImplName, const OUString& rServiceName) + : m_aImplName(std::move(aImplName)) + { + m_aServiceNames.push_back(rServiceName); + } + XServiceInfo(OUString aImplName, const std::vector rServiceNames) + : m_aImplName(std::move(aImplName)) + , m_aServiceNames(rServiceNames) + { + } + + virtual css::uno::Reference init() = 0; + + void testGetImplementationName(); + void testGetSupportedServiceNames(); + void testSupportsService(); + +protected: + ~XServiceInfo() {} + +private: + OUString const m_aImplName; + std::vector m_aServiceNames; +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_LANG_XSERVICEINFO_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/lokcallback.hxx b/include/test/lokcallback.hxx new file mode 100644 index 0000000000..bba7a392ae --- /dev/null +++ b/include/test/lokcallback.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include + +/** +A helper to convert SfxLokCallbackInterface to a LIbreOfficeKitCallback for tests. + +It reimplements the specialized callbacks and converts them to the generic type/payload +callback. +*/ +class OOO_DLLPUBLIC_TEST TestLokCallbackWrapper final : public SfxLokCallbackInterface, public Idle +{ +public: + TestLokCallbackWrapper(LibreOfficeKitCallback callback, void* data); + /// Discard all possibly still held events. + void clear(); + /// Set the view id of the associated SfxViewShell. + void setLOKViewId(int viewId) { m_viewId = viewId; } + virtual void libreOfficeKitViewCallback(int nType, const rtl::OString& pPayload) override; + virtual void libreOfficeKitViewCallbackWithViewId(int nType, const rtl::OString& pPayload, + int nViewId) override; + virtual void libreOfficeKitViewInvalidateTilesCallback(const tools::Rectangle* pRect, int nPart, + int nMode) override; + virtual void libreOfficeKitViewUpdatedCallback(int nType) override; + virtual void libreOfficeKitViewUpdatedCallbackPerViewId(int nType, int nViewId, + int nSourceViewId) override; + virtual void libreOfficeKitViewAddPendingInvalidateTiles() override; + virtual void dumpState(rtl::OStringBuffer&) override{}; + + virtual void Invoke() override; + +private: + void callCallback(int nType, const char* pPayload, int nViewId); + void startTimer(); + void flushLOKData(); + void discardUpdatedTypes(int nType, int nViewId); + LibreOfficeKitCallback m_callback; + void* m_data; + int m_viewId = -1; // the associated SfxViewShell + std::vector m_updatedTypes; // value is type + struct PerViewIdData + { + int type; + int viewId; + int sourceViewId; + }; + std::vector m_updatedTypesPerViewId; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/screenshot_test.hxx b/include/test/screenshot_test.hxx new file mode 100644 index 0000000000..801eb80c7b --- /dev/null +++ b/include/test/screenshot_test.hxx @@ -0,0 +1,96 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SCREENSHOT_TEST_HXX +#define INCLUDED_TEST_SCREENSHOT_TEST_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class VclAbstractDialog; +typedef std::map mapType; + +class OOO_DLLPUBLIC_TEST ScreenshotTest : public test::BootstrapFixture, public unotest::MacrosTest +{ +private: + /// The current UI language + OUString maCurrentLanguage; + + /// the set of known dialogs and their ID for usage in createDialogByID + mapType maKnownDialogs; + + /// parent for non-dialog buildables + weld::GenericDialogController maParent; + std::unique_ptr mxParentWidget; + +private: + /// helpers + void implSaveScreenshot(const BitmapEx& rScreenshot, const OUString& rScreenshotId); + void saveScreenshot(VclAbstractDialog const& rDialog); + void saveScreenshot(weld::Window& rDialog); + + /// helper method to create and dump a dialog based on Builder contents. + void dumpDialogToPath(weld::Builder& rDialog); + + /// helper method to populate maKnownDialogs, called in setUp(). Needs to be + /// written and has to add entries to maKnownDialogs + virtual void registerKnownDialogsByID(mapType& rKnownDialogs) = 0; + + /// dialog creation for known dialogs by ID. Has to be implemented for + /// each registered known dialog + virtual VclPtr createDialogByID(sal_uInt32 nID) = 0; + +public: + ScreenshotTest(); + virtual ~ScreenshotTest() override; + + virtual void setUp() override; + + /// Dialog creation for known dialogs by Name (path and UIXMLDescription, *.ui file). + /// This uses maKnownDialogs to check if known, and if so, calls createDialogByID + /// with the ID from the map + VclPtr createDialogByName(const OString& rName); + + /// version for AbstractDialogs, the ones created in AbstractDialogFactories + void dumpDialogToPath(VclAbstractDialog& rDialog); + + /// fallback version for dialogs for which only the UXMLDescription is known. + /// This should be used with care - no active layouting will be done, only the + /// VclBuilder will be activated for layouting. Result can thus vary drastically + /// compared to the active dialog (can be compared with dialog previewer) + void dumpDialogToPath(std::string_view rUIXMLDescription); + + /// helper to process all known dialogs + void processAllKnownDialogs(); + + /// helper to process an input file containing the UXMLDescriptions + /// of the dialogs to dump. It will internally try to detect and open + /// as known dialog first. If not successful, it will then use the + /// fallback version to dump the dialog. + /// The syntax of the input file is as follows: + /// - empty lines are allowed + /// - lines starting with '#' are treated as comment + /// - all other lines should contain a *.ui filename in the same + /// notation as in the dialog constructors(see code) + void processDialogBatchFile(std::u16string_view rFile); + + /// const access to known dialogs + const mapType& getKnownDialogs() const { return maKnownDialogs; } +}; + +#endif // INCLUDED_TEST_SCREENSHOT_TEST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/cellarealink.hxx b/include/test/sheet/cellarealink.hxx new file mode 100644 index 0000000000..bf300be30f --- /dev/null +++ b/include/test/sheet/cellarealink.hxx @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_CELLAREALINK_HXX +#define INCLUDED_TEST_SHEET_CELLAREALINK_HXX + +#include + +#include + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST CellAreaLink +{ +public: + CellAreaLink(OUString aFileURL) + : m_aFileURL(std::move(aFileURL)) + { + } + virtual css::uno::Reference init() = 0; + + void testUrl(); + void testFilter(); + void testFilterOptions(); + void testRefreshDelay(); + void testRefreshPeriod(); + +protected: + ~CellAreaLink() {} + +private: + OUString const m_aFileURL; +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_SHEET_CELLAREALINK_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/cellproperties.hxx b/include/test/sheet/cellproperties.hxx new file mode 100644 index 0000000000..aa5fe0f2c1 --- /dev/null +++ b/include/test/sheet/cellproperties.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_CELLPROPERTIES_HXX +#define INCLUDED_TEST_SHEET_CELLPROPERTIES_HXX + +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST CellProperties +{ +public: + virtual css::uno::Reference init() = 0; + + void testVertJustify(); + void testRotateReference(); + +protected: + ~CellProperties() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_CELLPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/databaseimportdescriptor.hxx b/include/test/sheet/databaseimportdescriptor.hxx new file mode 100644 index 0000000000..14c9c6f294 --- /dev/null +++ b/include/test/sheet/databaseimportdescriptor.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_DATABASEIMPORTDESCRIPTOR_HXX +#define INCLUDED_TEST_SHEET_DATABASEIMPORTDESCRIPTOR_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST DatabaseImportDescriptor +{ +public: + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getXImportable() = 0; + + void testDatabaseImportDescriptorProperties(); + +protected: + ~DatabaseImportDescriptor() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_DATABASEIMPORTDESCRIPTOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/databaserange.hxx b/include/test/sheet/databaserange.hxx new file mode 100644 index 0000000000..9aca2f5eb3 --- /dev/null +++ b/include/test/sheet/databaserange.hxx @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_DATABASERANGE_HXX +#define INCLUDED_TEST_SHEET_DATABASERANGE_HXX + +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST DatabaseRange +{ +public: + virtual css::uno::Reference init(const OUString& rDBName) = 0; + + void testMoveCells(); + void testKeepFormats(); + void testStripData(); + void testAutoFilter(); + void testUseFilterCriteriaSource(); + void testFilterCriteriaSource(); + void testRefreshPeriod(); + void testFromSelection(); + void testTokenIndex(); + void testTotalsRow(); + void testContainsHeader(); + +protected: + ~DatabaseRange() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_DATABASERANGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/datapilotfield.hxx b/include/test/sheet/datapilotfield.hxx new file mode 100644 index 0000000000..28e73d7a20 --- /dev/null +++ b/include/test/sheet/datapilotfield.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_DATAPILOTFIELD_HXX +#define INCLUDED_TEST_SHEET_DATAPILOTFIELD_HXX + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST DataPilotField +{ +public: + virtual css::uno::Reference init() = 0; + + void testSortInfo(); + void testLayoutInfo(); + void testAutoShowInfo(); + void testReference(); + void testIsGroupField(); + +protected: + ~DataPilotField() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_DATAPILOTFIELD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/datapilotitem.hxx b/include/test/sheet/datapilotitem.hxx new file mode 100644 index 0000000000..bf711d3bab --- /dev/null +++ b/include/test/sheet/datapilotitem.hxx @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_DATAPILOTITEM_HXX +#define INCLUDED_TEST_SHEET_DATAPILOTITEM_HXX + +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST DataPilotItem +{ +public: + virtual css::uno::Reference init() = 0; + + void testProperties(); + +protected: + ~DataPilotItem() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_DATAPILOTITEM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/documentsettings.hxx b/include/test/sheet/documentsettings.hxx new file mode 100644 index 0000000000..7de391f64a --- /dev/null +++ b/include/test/sheet/documentsettings.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_DOCUMENTSETTINGS_HXX +#define INCLUDED_TEST_SHEET_DOCUMENTSETTINGS_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST DocumentSettings +{ +public: + virtual css::uno::Reference init() = 0; + + void testDocumentSettingsProperties(); + +protected: + ~DocumentSettings() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_DOCUMENTSETTINGS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/functiondescription.hxx b/include/test/sheet/functiondescription.hxx new file mode 100644 index 0000000000..bfe719bc59 --- /dev/null +++ b/include/test/sheet/functiondescription.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_FUNCTIONDESCRIPTION_HXX +#define INCLUDED_TEST_SHEET_FUNCTIONDESCRIPTION_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST FunctionDescription +{ +public: + virtual css::uno::Sequence init() = 0; + + void testFunctionDescriptionProperties(); + +protected: + ~FunctionDescription() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_FUNCTIONDESCRIPTION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/globalsheetsettings.hxx b/include/test/sheet/globalsheetsettings.hxx new file mode 100644 index 0000000000..8ae2968dee --- /dev/null +++ b/include/test/sheet/globalsheetsettings.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_GLOBALSHEETSETTINGS_HXX +#define INCLUDED_TEST_SHEET_GLOBALSHEETSETTINGS_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST GlobalSheetSettings +{ +public: + virtual css::uno::Reference init() = 0; + + void testGlobalSheetSettingsProperties(); + +protected: + ~GlobalSheetSettings() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_GLOBALSHEETSETTINGS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/scenario.hxx b/include/test/sheet/scenario.hxx new file mode 100644 index 0000000000..3a3ec8d871 --- /dev/null +++ b/include/test/sheet/scenario.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_SCENARIO_HXX +#define INCLUDED_TEST_SHEET_SCENARIO_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST Scenario +{ +public: + virtual css::uno::Reference getScenarioSpreadsheet() = 0; + + void testScenarioProperties(); + +protected: + ~Scenario() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_SCENARIO_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/shape.hxx b/include/test/sheet/shape.hxx new file mode 100644 index 0000000000..ad2b7b7657 --- /dev/null +++ b/include/test/sheet/shape.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_SHAPE_HXX +#define INCLUDED_TEST_SHEET_SHAPE_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST Shape +{ +public: + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getXSheetDocument() = 0; + + void testShapePropertiesAnchor(); + void testShapePropertiesPosition(); + +protected: + ~Shape() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_SHAPE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/sheetcell.hxx b/include/test/sheet/sheetcell.hxx new file mode 100644 index 0000000000..a5d35cee1a --- /dev/null +++ b/include/test/sheet/sheetcell.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_SHEETCELL_HXX +#define INCLUDED_TEST_SHEET_SHEETCELL_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST SheetCell +{ +public: + virtual css::uno::Reference init() = 0; + + void testSheetCellProperties(); + +protected: + ~SheetCell() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_SHEETCELL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/sheetcellrange.hxx b/include/test/sheet/sheetcellrange.hxx new file mode 100644 index 0000000000..d4c2b551a2 --- /dev/null +++ b/include/test/sheet/sheetcellrange.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_SHEETCELLRANGE_HXX +#define INCLUDED_TEST_SHEET_SHEETCELLRANGE_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST SheetCellRange +{ +public: + virtual css::uno::Reference init() = 0; + + void testSheetCellRangeProperties(); + +protected: + ~SheetCellRange() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_SHEETCELLRANGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/sheetcellranges.hxx b/include/test/sheet/sheetcellranges.hxx new file mode 100644 index 0000000000..f40b186fad --- /dev/null +++ b/include/test/sheet/sheetcellranges.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_SHEETCELLRANGES_HXX +#define INCLUDED_TEST_SHEET_SHEETCELLRANGES_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST SheetCellRanges +{ +public: + virtual css::uno::Reference init() = 0; + + void testSheetCellRangesProperties(); + +protected: + ~SheetCellRanges() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_SHEETCELLRANGES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/sheetfilterdescriptor.hxx b/include/test/sheet/sheetfilterdescriptor.hxx new file mode 100644 index 0000000000..919b841716 --- /dev/null +++ b/include/test/sheet/sheetfilterdescriptor.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_SHEETFILTERDESCRIPTOR_HXX +#define INCLUDED_TEST_SHEET_SHEETFILTERDESCRIPTOR_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST SheetFilterDescriptor +{ +public: + virtual css::uno::Reference init() = 0; + + void testSheetFilterDescriptorProperties(); + +protected: + ~SheetFilterDescriptor() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_SHEETFILTERDESCRIPTOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/sheetlink.hxx b/include/test/sheet/sheetlink.hxx new file mode 100644 index 0000000000..0f9e033a8b --- /dev/null +++ b/include/test/sheet/sheetlink.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_SHEETLINK_HXX +#define INCLUDED_TEST_SHEET_SHEETLINK_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST SheetLink +{ +public: + virtual css::uno::Reference init() = 0; + + void testSheetLinkProperties(); + +protected: + ~SheetLink() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_SHEETLINK_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/sheetsortdescriptor2.hxx b/include/test/sheet/sheetsortdescriptor2.hxx new file mode 100644 index 0000000000..0f3c5713d9 --- /dev/null +++ b/include/test/sheet/sheetsortdescriptor2.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_SHEETSORTDESCRIPTOR2_HXX +#define INCLUDED_TEST_SHEET_SHEETSORTDESCRIPTOR2_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST SheetSortDescriptor2 +{ +public: + virtual css::uno::Reference init() = 0; + + void testSheetSortDescriptor2Properties(); + +protected: + ~SheetSortDescriptor2() {} +}; +} // namespace apitest + +#endif // INCLUDED_TEST_SHEET_SHEETSORTDESCRIPTOR2_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/spreadsheet.hxx b/include/test/sheet/spreadsheet.hxx new file mode 100644 index 0000000000..597790a8e9 --- /dev/null +++ b/include/test/sheet/spreadsheet.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_SPREADSHEET_HXX +#define INCLUDED_TEST_SHEET_SPREADSHEET_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST Spreadsheet +{ +public: + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getXSpreadsheetDocument() = 0; + + void testSpreadsheetProperties(); + +protected: + ~Spreadsheet() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_SPREADSHEET_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/spreadsheetdocumentsettings.hxx b/include/test/sheet/spreadsheetdocumentsettings.hxx new file mode 100644 index 0000000000..1385541576 --- /dev/null +++ b/include/test/sheet/spreadsheetdocumentsettings.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_SPREADSHEETDOCUMENTSETTINGS_HXX +#define INCLUDED_TEST_SHEET_SPREADSHEETDOCUMENTSETTINGS_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST SpreadsheetDocumentSettings +{ +public: + virtual css::uno::Reference init() = 0; + + void testSpreadsheetDocumentSettingsProperties(); + +protected: + ~SpreadsheetDocumentSettings() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_SPREADSHEETDOCUMENTSETTINGS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/spreadsheetviewsettings.hxx b/include/test/sheet/spreadsheetviewsettings.hxx new file mode 100644 index 0000000000..135c95e5d0 --- /dev/null +++ b/include/test/sheet/spreadsheetviewsettings.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_SPREADSHEETVIEWSETTINGS_HXX +#define INCLUDED_TEST_SHEET_SPREADSHEETVIEWSETTINGS_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST SpreadsheetViewSettings +{ +public: + virtual css::uno::Reference init() = 0; + + void testSpreadsheetViewSettingsProperties(); + +protected: + ~SpreadsheetViewSettings() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_SPREADSHEETVIEWSETTINGS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/subtotaldescriptor.hxx b/include/test/sheet/subtotaldescriptor.hxx new file mode 100644 index 0000000000..9b2c21f21c --- /dev/null +++ b/include/test/sheet/subtotaldescriptor.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_SUBTOTALDESCRIPTOR_HXX +#define INCLUDED_TEST_SHEET_SUBTOTALDESCRIPTOR_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST SubTotalDescriptor +{ +public: + virtual css::uno::Reference init() = 0; + + void testSubTotalDescriptorProperties(); + +protected: + ~SubTotalDescriptor() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_SUBTOTALDESCRIPTOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/tableautoformat.hxx b/include/test/sheet/tableautoformat.hxx new file mode 100644 index 0000000000..3a04784a19 --- /dev/null +++ b/include/test/sheet/tableautoformat.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_TABLEAUTOFORMAT_HXX +#define INCLUDED_TEST_SHEET_TABLEAUTOFORMAT_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST TableAutoFormat +{ +public: + virtual css::uno::Reference init() = 0; + + void testTableAutoFormatProperties(); + +protected: + ~TableAutoFormat() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_TABLEAUTOFORMAT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/tablevalidation.hxx b/include/test/sheet/tablevalidation.hxx new file mode 100644 index 0000000000..8097452541 --- /dev/null +++ b/include/test/sheet/tablevalidation.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_TABLEVALIDATION_HXX +#define INCLUDED_TEST_SHEET_TABLEVALIDATION_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST TableValidation +{ +public: + virtual css::uno::Reference init() = 0; + + void testTableValidationProperties(); + +protected: + ~TableValidation() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_TABLEVALIDATION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xactivationbroadcaster.hxx b/include/test/sheet/xactivationbroadcaster.hxx new file mode 100644 index 0000000000..5dc21edc01 --- /dev/null +++ b/include/test/sheet/xactivationbroadcaster.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XACTIVATIONBROADCASTER_HXX +#define INCLUDED_TEST_SHEET_XACTIVATIONBROADCASTER_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XActivationBroadcaster +{ +public: + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getXSpreadsheet(const sal_Int16 nNumber = 0) + = 0; + + void testAddRemoveActivationEventListener(); + +protected: + ~XActivationBroadcaster() {} +}; +} // namespace apitest + +#endif // INCLUDED_TEST_SHEET_XACTIVATIONBROADCASTER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xarealink.hxx b/include/test/sheet/xarealink.hxx new file mode 100644 index 0000000000..15a65f249a --- /dev/null +++ b/include/test/sheet/xarealink.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XAREALINK_HXX +#define INCLUDED_TEST_SHEET_XAREALINK_HXX + +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XAreaLink +{ +public: + virtual css::uno::Reference init() = 0; + virtual ~XAreaLink() {} + + void testGetSourceArea(); + void testSetSourceArea(); + void testGetDestArea(); + void testSetDestArea(); +}; +} + +#endif // INCLUDED_TEST_SHEET_XAREALINK_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xarealinks.hxx b/include/test/sheet/xarealinks.hxx new file mode 100644 index 0000000000..1007c28e57 --- /dev/null +++ b/include/test/sheet/xarealinks.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XAREALINKS_HXX +#define INCLUDED_TEST_SHEET_XAREALINKS_HXX + +#include +#include +#include + +namespace apitest { + +class OOO_DLLPUBLIC_TEST XAreaLinks +{ +public: + virtual css::uno::Reference< css::uno::XInterface > init() = 0; + + void testInsertAtPosition(); + void testRemoveByIndex(); + +protected: + ~XAreaLinks(){} + +}; + +} + +#endif // INCLUDED_TEST_SHEET_XAREALINKS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xarrayformularange.hxx b/include/test/sheet/xarrayformularange.hxx new file mode 100644 index 0000000000..2529b8153f --- /dev/null +++ b/include/test/sheet/xarrayformularange.hxx @@ -0,0 +1,32 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XArrayFormulaRange +{ +public: + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getXSpreadsheet() = 0; + + void testGetSetArrayFormula(); + +protected: + ~XArrayFormulaRange() {} +}; +} // namespace apitest + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xcalculatable.hxx b/include/test/sheet/xcalculatable.hxx new file mode 100644 index 0000000000..94614768ef --- /dev/null +++ b/include/test/sheet/xcalculatable.hxx @@ -0,0 +1,39 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XCALCULATABLE_HXX +#define INCLUDED_TEST_SHEET_XCALCULATABLE_HXX + +#include +#include +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XCalculatable +{ +public: + virtual css::uno::Reference init() = 0; + virtual css::uno::Sequence> getXCells() = 0; + + void testCalculate(); + void testCalculateAll(); + void testEnableAutomaticCalculation(); + +protected: + ~XCalculatable() {} +}; +} // namespace apitest + +#endif // INCLUDED_TEST_SHEET_XCALCULATABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xcelladdressable.hxx b/include/test/sheet/xcelladdressable.hxx new file mode 100644 index 0000000000..506415a11a --- /dev/null +++ b/include/test/sheet/xcelladdressable.hxx @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XCELLADDRESSABLE_HXX +#define INCLUDED_TEST_SHEET_XCELLADDRESSABLE_HXX + +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XCellAddressable +{ +public: + virtual css::uno::Reference init() = 0; + virtual ~XCellAddressable() {} + + void testGetCellAddress(); +}; +} + +#endif // INCLUDED_TEST_SHEET_XCELLADDRESSABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xcellformatrangessupplier.hxx b/include/test/sheet/xcellformatrangessupplier.hxx new file mode 100644 index 0000000000..1f2f6d3794 --- /dev/null +++ b/include/test/sheet/xcellformatrangessupplier.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XCELLFORMATRANGESSUPPLIER_HXX +#define INCLUDED_TEST_SHEET_XCELLFORMATRANGESSUPPLIER_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XCellFormatRangesSupplier +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetCellFormatRanges(); + +protected: + ~XCellFormatRangesSupplier() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XCELLFORMATRANGESSUPPLIER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xcellrangeaddressable.hxx b/include/test/sheet/xcellrangeaddressable.hxx new file mode 100644 index 0000000000..0819b34c15 --- /dev/null +++ b/include/test/sheet/xcellrangeaddressable.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XCELLRANGEADDRESSABLE_HXX +#define INCLUDED_TEST_SHEET_XCELLRANGEADDRESSABLE_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XCellRangeAddressable +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetRangeAddress(); + +protected: + ~XCellRangeAddressable() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XCELLRANGEADDRESSABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xcellrangedata.hxx b/include/test/sheet/xcellrangedata.hxx new file mode 100644 index 0000000000..0b6efef2e0 --- /dev/null +++ b/include/test/sheet/xcellrangedata.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XCELLRANGEDATA_HXX +#define INCLUDED_TEST_SHEET_XCELLRANGEDATA_HXX + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XCellRangeData +{ +public: + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getXCellRangeData() = 0; + + void testGetDataArray(); + void testSetDataArray(); + void testGetDataArrayOnTableSheet(); + void testSetDataArrayOnTableSheet(); + +protected: + ~XCellRangeData() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XCELLRANGEDATA_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xcellrangeformula.hxx b/include/test/sheet/xcellrangeformula.hxx new file mode 100644 index 0000000000..9fcc432c83 --- /dev/null +++ b/include/test/sheet/xcellrangeformula.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XCELLRANGEFORMULA_HXX +#define INCLUDED_TEST_SHEET_XCELLRANGEFORMULA_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XCellRangeFormula +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetSetFormulaArray(); + +protected: + ~XCellRangeFormula() {} +}; +} // namespace apitest + +#endif // INCLUDED_TEST_SHEET_XCELLRANGEFORMULA_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xcellrangemovement.hxx b/include/test/sheet/xcellrangemovement.hxx new file mode 100644 index 0000000000..a95fdf6421 --- /dev/null +++ b/include/test/sheet/xcellrangemovement.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XCELLRANGEMOVEMENT_HXX +#define INCLUDED_TEST_SHEET_XCELLRANGEMOVEMENT_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XCellRangeMovement +{ +public: + virtual css::uno::Reference init() = 0; + + void testInsertCells(); + void testCopyRange(); + void testMoveRange(); + void testRemoveRange(); + +protected: + ~XCellRangeMovement() {} +}; +} // namespace apitest + +#endif // INCLUDED_TEST_SHEET_XCELLRANGEMOVEMENT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xcellrangereferrer.hxx b/include/test/sheet/xcellrangereferrer.hxx new file mode 100644 index 0000000000..a2a659d17d --- /dev/null +++ b/include/test/sheet/xcellrangereferrer.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XCELLRANGEREFERRER_HXX +#define INCLUDED_TEST_SHEET_XCELLRANGEREFERRER_HXX + +#include +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XCellRangeReferrer +{ +public: + virtual css::uno::Reference init() = 0; + + void setCellRange(css::table::CellRangeAddress aCellRange) { m_aCellRange = aCellRange; } + const css::table::CellRangeAddress& getCellRange() const { return m_aCellRange; } + void testGetReferredCells(); + +protected: + ~XCellRangeReferrer() {} + +private: + css::table::CellRangeAddress m_aCellRange; +}; +} + +#endif // INCLUDED_TEST_SHEET_XCELLRANGEREFERRER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xcellrangesquery.hxx b/include/test/sheet/xcellrangesquery.hxx new file mode 100644 index 0000000000..ba275295a0 --- /dev/null +++ b/include/test/sheet/xcellrangesquery.hxx @@ -0,0 +1,39 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XCELLRANGESQUERY_HXX +#define INCLUDED_TEST_SHEET_XCELLRANGESQUERY_HXX + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XCellRangesQuery +{ +public: + virtual css::uno::Reference init() = 0; + + //Testcases + void testQueryColumnDifference(); + void testQueryContentDifference(); + void testQueryEmptyCells(); + void testQueryFormulaCells(); + void testQueryIntersection(); + void testQueryRowDifference(); + void testQueryVisibleCells(); + +protected: + ~XCellRangesQuery() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XCELLRANGESQUERY_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xcellseries.hxx b/include/test/sheet/xcellseries.hxx new file mode 100644 index 0000000000..d51d6d9e30 --- /dev/null +++ b/include/test/sheet/xcellseries.hxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XCELLSERIES_HXX +#define INCLUDED_TEST_SHEET_XCELLSERIES_HXX + +#include +#include + +namespace apitest { + +class OOO_DLLPUBLIC_TEST XCellSeries +{ +public: + XCellSeries(sal_Int32 aStartX, sal_Int32 aStartY) : maStartX(aStartX), maStartY(aStartY){} + virtual css::uno::Reference< css::uno::XInterface > init() = 0; + virtual ~XCellSeries(){} + + void testFillAuto(); + void testFillSeries(); + +private: + sal_Int32 maStartX; + sal_Int32 maStartY; +}; + +} + +#endif // INCLUDED_TEST_SHEET_XCELLSERIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ + diff --git a/include/test/sheet/xconsolidatable.hxx b/include/test/sheet/xconsolidatable.hxx new file mode 100644 index 0000000000..9edb591089 --- /dev/null +++ b/include/test/sheet/xconsolidatable.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XCONSOLIDATABLE_HXX +#define INCLUDED_TEST_SHEET_XCONSOLIDATABLE_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XConsolidatable +{ +public: + virtual css::uno::Reference init() = 0; + + void testCreateConsolidationDescriptor(); + void testConsolidate(); + +protected: + ~XConsolidatable() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XCONSOLIDATABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xconsolidationdescriptor.hxx b/include/test/sheet/xconsolidationdescriptor.hxx new file mode 100644 index 0000000000..ff5fb5b825 --- /dev/null +++ b/include/test/sheet/xconsolidationdescriptor.hxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XCONSOLIDATIONDESCRIPTOR_HXX +#define INCLUDED_TEST_SHEET_XCONSOLIDATIONDESCRIPTOR_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XConsolidationDescriptor +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetFunction(); + void testSetFunction(); + void testGetSources(); + void testSetSources(); + void testGetStartOutputPosition(); + void testSetStartOutputPosition(); + void testGetUseColumnHeaders(); + void testSetUseColumnHeaders(); + void testGetUseRowHeaders(); + void testSetUseRowHeaders(); + void testGetInsertLinks(); + void testSetInsertLinks(); + +protected: + ~XConsolidationDescriptor() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XCONSOLIDATIONDESCRIPTOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xdatabaserange.hxx b/include/test/sheet/xdatabaserange.hxx new file mode 100644 index 0000000000..388b89d9ab --- /dev/null +++ b/include/test/sheet/xdatabaserange.hxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XDATABASERANGE_HXX +#define INCLUDED_TEST_SHEET_XDATABASERANGE_HXX + +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XDatabaseRange +{ +public: + virtual css::uno::Reference init(const OUString& rDBName) = 0; + + void testDataArea(); + void testGetSortDescriptor(); + void testGetSubtotalDescriptor(); + void testGetImportDescriptor(); + void testGetFilterDescriptor(); + void testRefresh(); + +protected: + ~XDatabaseRange() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XDATABASERANGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xdatabaseranges.hxx b/include/test/sheet/xdatabaseranges.hxx new file mode 100644 index 0000000000..b42e6fcc93 --- /dev/null +++ b/include/test/sheet/xdatabaseranges.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XDATABASERANGES_HXX +#define INCLUDED_TEST_SHEET_XDATABASERANGES_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XDatabaseRanges +{ +public: + virtual css::uno::Reference init() = 0; + + void testAddRemoveDbRanges(); + +protected: + ~XDatabaseRanges() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XDATABASERANGES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xdatapilotdescriptor.hxx b/include/test/sheet/xdatapilotdescriptor.hxx new file mode 100644 index 0000000000..5e4e7c62da --- /dev/null +++ b/include/test/sheet/xdatapilotdescriptor.hxx @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XDATAPILOTDESCRIPTOR_HXX +#define INCLUDED_TEST_SHEET_XDATAPILOTDESCRIPTOR_HXX + +#include +#include +#include + +#include + +#include +#include + +namespace apitest { + +class OOO_DLLPUBLIC_TEST XDataPilotDescriptor +{ +public: + void testSourceRange(); + void testTag(); + void testGetFilterDescriptor(); + void testGetDataPilotFields(); + void testGetColumnFields(); + void testGetRowFields(); + void testGetPageFields(); + void testGetDataFields(); + void testGetHiddenFields(); + + virtual css::uno::Reference< css::uno::XInterface > init() = 0; + +protected: + ~XDataPilotDescriptor() {} + +private: + static void testGetDataPilotFields_Impl( css::uno::Reference< css::sheet::XDataPilotDescriptor > const & xDescr ); + + static void checkName( css::uno::Reference< css::container::XIndexAccess > const & xIndex, std::size_t nIndex ); + static std::vector maFieldNames; +}; + +} + +#endif // INCLUDED_TEST_SHEET_XDATAPILOTDESCRIPTOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xdatapilotfield.hxx b/include/test/sheet/xdatapilotfield.hxx new file mode 100644 index 0000000000..6622b71bcf --- /dev/null +++ b/include/test/sheet/xdatapilotfield.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XDATAPILOTFIELD_HXX +#define INCLUDED_TEST_SHEET_XDATAPILOTFIELD_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XDataPilotField +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetItems(); + +protected: + ~XDataPilotField() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XDATAPILOTFIELD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xdatapilotfieldgrouping.hxx b/include/test/sheet/xdatapilotfieldgrouping.hxx new file mode 100644 index 0000000000..5508572125 --- /dev/null +++ b/include/test/sheet/xdatapilotfieldgrouping.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XDATAPILOTFIELDGROUPING_HXX +#define INCLUDED_TEST_SHEET_XDATAPILOTFIELDGROUPING_HXX + +#include +#include +#include + +namespace apitest { + +class OOO_DLLPUBLIC_TEST XDataPilotFieldGrouping +{ +public: + void testCreateNameGroup(); + void testCreateDateGroup(); + + virtual css::uno::Reference< css::uno::XInterface > init() = 0; + +protected: + ~XDataPilotFieldGrouping() {} +}; + +} + +#endif // INCLUDED_TEST_SHEET_XDATAPILOTFIELDGROUPING_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xdatapilottable.hxx b/include/test/sheet/xdatapilottable.hxx new file mode 100644 index 0000000000..05ba1e293f --- /dev/null +++ b/include/test/sheet/xdatapilottable.hxx @@ -0,0 +1,39 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XDATAPILOTTABLE_HXX +#define INCLUDED_TEST_SHEET_XDATAPILOTTABLE_HXX + +#include +#include +#include + +#include + +namespace apitest { + +class OOO_DLLPUBLIC_TEST XDataPilotTable +{ +public: + virtual css::uno::Reference< css::uno::XInterface > init() = 0; + virtual ~XDataPilotTable(); + + void testGetOutputRange(); + void testRefresh(); + +protected: + css::uno::Reference< css::table::XCell > xCellForChange; + css::uno::Reference< css::table::XCell > xCellForCheck; +}; + +} + +#endif // INCLUDED_TEST_SHEET_XDATAPILOTTABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xdatapilottable2.hxx b/include/test/sheet/xdatapilottable2.hxx new file mode 100644 index 0000000000..a7ffde07d9 --- /dev/null +++ b/include/test/sheet/xdatapilottable2.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XDATAPILOTTABLE2_HXX +#define INCLUDED_TEST_SHEET_XDATAPILOTTABLE2_HXX + +#include +#include +#include +#include +#include +#include + +#include + +#include + +namespace apitest { + +class OOO_DLLPUBLIC_TEST XDataPilotTable2 +{ +public: + void testGetPositionData(); + void testGetDrillDownData(); + void testGetOutputRangeByType(); + void testInsertDrillDownSheet(); + virtual ~XDataPilotTable2(); + + virtual css::uno::Reference< css::uno::XInterface > initDP2() = 0; + virtual css::uno::Reference< css::uno::XInterface > getSheets() = 0; + +protected: + +private: + static void checkDrillDownSheetContent(css::uno::Reference< css::sheet::XSpreadsheet > const & xSheet, const css::uno::Sequence< css::uno::Sequence < css::uno::Any > >& aData); + + void getOutputRanges(css::uno::Reference< css::sheet::XDataPilotTable2 > const &); + void buildDataFields(css::uno::Reference< css::sheet::XDataPilotTable2 > const &); + void buildResultCells(css::uno::Reference< css::sheet::XDataPilotTable2 > const &); + + std::vector< css::table::CellAddress > maResultCells; + std::vector< sal_Int32 > maDataFieldDims; + css::table::CellRangeAddress maRangeWhole; + css::table::CellRangeAddress maRangeTable; + css::table::CellRangeAddress maRangeResult; +}; + +} + +#endif // INCLUDED_TEST_SHEET_XDATAPILOTTABLE2_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xdatapilottables.hxx b/include/test/sheet/xdatapilottables.hxx new file mode 100644 index 0000000000..f1d3671647 --- /dev/null +++ b/include/test/sheet/xdatapilottables.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XDATAPILOTTABLES_HXX +#define INCLUDED_TEST_SHEET_XDATAPILOTTABLES_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XDataPilotTables +{ +public: + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getXSpreadsheet() = 0; + + void testXDataPilotTables(); + +protected: + ~XDataPilotTables() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XDATAPILOTTABLES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xdatapilottablessupplier.hxx b/include/test/sheet/xdatapilottablessupplier.hxx new file mode 100644 index 0000000000..ca1e623b3b --- /dev/null +++ b/include/test/sheet/xdatapilottablessupplier.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XDATAPILOTTABLESSUPPLIER_HXX +#define INCLUDED_TEST_SHEET_XDATAPILOTTABLESSUPPLIER_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XDataPilotTablesSupplier +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetDataPilotTables(); + +protected: + ~XDataPilotTablesSupplier() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XDATAPILOTTABLESSUPPLIER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xddelink.hxx b/include/test/sheet/xddelink.hxx new file mode 100644 index 0000000000..3cc86812ee --- /dev/null +++ b/include/test/sheet/xddelink.hxx @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XDDELINK_HXX +#define INCLUDED_TEST_SHEET_XDDELINK_HXX + +#include +#include + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XDDELink +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetApplication(); + void testGetItem(); + void testGetTopic(); + +protected: + explicit XDDELink(OUString aURL) + : m_URL(std::move(aURL)) + { + } + ~XDDELink() {} + + OUString const m_URL; +}; +} // namespace apitest + +#endif // INCLUDED_TEST_SHEET_XDDELINK_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xddelinks.hxx b/include/test/sheet/xddelinks.hxx new file mode 100644 index 0000000000..accfa3aadb --- /dev/null +++ b/include/test/sheet/xddelinks.hxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XDDELINKS_HXX +#define INCLUDED_TEST_SHEET_XDDELINKS_HXX + +#include + +#include +#include + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XDDELinks +{ +public: + XDDELinks(OUString aTopic) + : m_aTopic(std::move(aTopic)) + { + } + + virtual css::uno::Reference init() = 0; + + void testAddDDELink(); + +protected: + ~XDDELinks() {} + +private: + OUString const m_aTopic; +}; +} // namespace apitest + +#endif // INCLUDED_TEST_SHEET_XDDELINKS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xdocumentauditing.hxx b/include/test/sheet/xdocumentauditing.hxx new file mode 100644 index 0000000000..7d443bf820 --- /dev/null +++ b/include/test/sheet/xdocumentauditing.hxx @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XDocumentAuditing +{ +public: + virtual css::uno::Reference init() = 0; + + void testRefreshArrows(); + +protected: + ~XDocumentAuditing() {} + +private: + bool hasRightAmountOfShapes(const css::uno::Reference& xDrawPage, + sal_Int32 nElementCount, sal_Int32 nShapes); + static void dispatch(const css::uno::Reference& xFrame, + const css::uno::Sequence& rArguments); + css::awt::Point m_Position; +}; +} // namespace apitest + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xformulaquery.hxx b/include/test/sheet/xformulaquery.hxx new file mode 100644 index 0000000000..8382e961a9 --- /dev/null +++ b/include/test/sheet/xformulaquery.hxx @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XFORMULAQUERY_HXX +#define INCLUDED_TEST_SHEET_XFORMULAQUERY_HXX + +#include +#include +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XFormulaQuery +{ +public: + XFormulaQuery(css::table::CellRangeAddress aCellRangeAddressDependents, + css::table::CellRangeAddress aCellRangeAddressPrecedents, + unsigned int nIdxDependents = 1, unsigned int nIdxPrecedents = 1) + : m_aCellRangeAddressDependents(aCellRangeAddressDependents) + , m_aCellRangeAddressPrecedents(aCellRangeAddressPrecedents) + , m_nIdxDependents(nIdxDependents) + , m_nIdxPrecedents(nIdxPrecedents) + { + } + + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getXSpreadsheet() = 0; + void setXCell(css::uno::Reference xCell) { m_xCell = xCell; } + css::uno::Reference const& getXCell() const { return m_xCell; } + + void testQueryDependents(); + void testQueryPrecedents(); + +protected: + ~XFormulaQuery() {} + +private: + css::uno::Reference m_xCell; + css::table::CellRangeAddress m_aCellRangeAddressDependents; + css::table::CellRangeAddress m_aCellRangeAddressPrecedents; + unsigned int m_nIdxDependents; + unsigned int m_nIdxPrecedents; +}; +} // namespace apitest + +#endif // INCLUDED_TEST_SHEET_XFORMULAQUERY_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xfunctiondescriptions.hxx b/include/test/sheet/xfunctiondescriptions.hxx new file mode 100644 index 0000000000..ffffe3b59f --- /dev/null +++ b/include/test/sheet/xfunctiondescriptions.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XFUNCTIONDESCRIPTIONS_HXX +#define INCLUDED_TEST_SHEET_XFUNCTIONDESCRIPTIONS_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XFunctionDescriptions +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetById(); + +protected: + ~XFunctionDescriptions() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XFUNCTIONDESCRIPTIONS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xgoalseek.hxx b/include/test/sheet/xgoalseek.hxx new file mode 100644 index 0000000000..08eeae92ac --- /dev/null +++ b/include/test/sheet/xgoalseek.hxx @@ -0,0 +1,32 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XGOALSEEK_HXX +#define INCLUDED_TEST_SHEET_XGOALSEEK_HXX + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XGoalSeek +{ +public: + virtual css::uno::Reference init() = 0; + + void testSeekGoal(); + +protected: + virtual ~XGoalSeek() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XGOALSEEK_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xheaderfootercontent.hxx b/include/test/sheet/xheaderfootercontent.hxx new file mode 100644 index 0000000000..64d3fea463 --- /dev/null +++ b/include/test/sheet/xheaderfootercontent.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XHEADERFOOTERCONTENT_HXX +#define INCLUDED_TEST_SHEET_XHEADERFOOTERCONTENT_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XHeaderFooterContent +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetCenterText(); + void testGetLeftText(); + void testGetRightText(); + +protected: + ~XHeaderFooterContent() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XHEADERFOOTERCONTENT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xlabelrange.hxx b/include/test/sheet/xlabelrange.hxx new file mode 100644 index 0000000000..24d2f3a07b --- /dev/null +++ b/include/test/sheet/xlabelrange.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XLABELRANGE_HXX +#define INCLUDED_TEST_SHEET_XLABELRANGE_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XLabelRange +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetSetDataArea(); + void testGetSetLabelArea(); + +protected: + ~XLabelRange() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XLABELRANGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xlabelranges.hxx b/include/test/sheet/xlabelranges.hxx new file mode 100644 index 0000000000..820c031d7e --- /dev/null +++ b/include/test/sheet/xlabelranges.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XLABELRANGES_HXX +#define INCLUDED_TEST_SHEET_XLABELRANGES_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XLabelRanges +{ +public: + virtual css::uno::Reference init() = 0; + + void testAddNew(); + void testRemoveByIndex(); + +protected: + ~XLabelRanges() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XLABELRANGES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xmultiformulatokens.hxx b/include/test/sheet/xmultiformulatokens.hxx new file mode 100644 index 0000000000..2d20e9bced --- /dev/null +++ b/include/test/sheet/xmultiformulatokens.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XMULTIFORMULATOKENS_HXX +#define INCLUDED_TEST_SHEET_XMULTIFORMULATOKENS_HXX + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XMultiFormulaTokens +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetCount(); + void testGetSetTokens(); + +protected: + ~XMultiFormulaTokens() {} +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_SHEET_XMULTIFORMULATOKENS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xmultipleoperation.hxx b/include/test/sheet/xmultipleoperation.hxx new file mode 100644 index 0000000000..107902da1a --- /dev/null +++ b/include/test/sheet/xmultipleoperation.hxx @@ -0,0 +1,39 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XMULTIPLEOPERATION_HXX +#define INCLUDED_TEST_SHEET_XMULTIPLEOPERATION_HXX + +#include +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XMultipleOperation +{ +public: + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getXSpreadsheet() = 0; + + void testSetTableOperation(); + +protected: + ~XMultipleOperation() {} + +private: + static void fillCells(css::uno::Reference const&); +}; +} + +#endif // INCLUDED_TEST_SHEET_XMULTIPLEOPERATION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xnamedrange.hxx b/include/test/sheet/xnamedrange.hxx new file mode 100644 index 0000000000..f088bf2abf --- /dev/null +++ b/include/test/sheet/xnamedrange.hxx @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XNAMEDRANGE_HXX +#define INCLUDED_TEST_SHEET_XNAMEDRANGE_HXX + +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XNamedRange +{ +public: + virtual css::uno::Reference init() = 0; + + // XNamedRange + void testGetContent(); + void testSetContent(); + void testGetType(); + void testSetType(); + void testGetReferencePosition(); + void testSetReferencePosition(); + +protected: + ~XNamedRange() {} + + virtual css::uno::Reference getNamedRange(const OUString&) = 0; +}; +} + +#endif // INCLUDED_TEST_SHEET_XNAMEDRANGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xnamedranges.hxx b/include/test/sheet/xnamedranges.hxx new file mode 100644 index 0000000000..90b8ab6c2f --- /dev/null +++ b/include/test/sheet/xnamedranges.hxx @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XNAMEDRANGES_HXX +#define INCLUDED_TEST_SHEET_XNAMEDRANGES_HXX + +#include + +#include + +#include +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XNamedRanges +{ +public: + // remove default entry + XNamedRanges() + : maNameToRemove("initial1") + { + } + + // removes given entry + XNamedRanges(OUString aNameToRemove) + : maNameToRemove(std::move(aNameToRemove)) + { + } + + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getXNamedRanges(sal_Int32 nSheet = 0) = 0; + + // XNamedRanges + void testAddNewByName(); + void testAddNewFromTitles(); + void testRemoveByName(); + void testOutputList(); + +protected: + ~XNamedRanges(){}; + css::uno::Reference xSheet; + +private: + OUString maNameToRemove; +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_SHEET_XNAMEDRANGES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xprintareas.hxx b/include/test/sheet/xprintareas.hxx new file mode 100644 index 0000000000..b3edbeb7dc --- /dev/null +++ b/include/test/sheet/xprintareas.hxx @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XPRINTAREAS_HXX +#define INCLUDED_TEST_SHEET_XPRINTAREAS_HXX + +#include +#include + +namespace apitest { + +class OOO_DLLPUBLIC_TEST XPrintAreas +{ +public: + virtual css::uno::Reference< css::uno::XInterface > init() = 0; + + void testSetAndGetPrintTitleColumns(); //getter and setter in one test case + void testSetAndGetPrintTitleRows(); + + void testGetPrintAreas(); // returns a sequence containing all print areas of the sheet. + void testSetPrintAreas(); // sets the print areas of the sheet. + void testGetTitleColumns(); // returns the range that is specified as title columns range. + void testSetTitleColumns(); // specifies a range of columns as title columns range. + void testGetTitleRows(); // returns the range that is specified as title rows range. + void testSetTitleRows(); // specifies a range of rows as title rows range. + +protected: + ~XPrintAreas() {} +}; + +} + +#endif // INCLUDED_TEST_SHEET_XPRINTAREAS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xrecentfunctions.hxx b/include/test/sheet/xrecentfunctions.hxx new file mode 100644 index 0000000000..8f7ac55a25 --- /dev/null +++ b/include/test/sheet/xrecentfunctions.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XRECENTFUNCTIONS_HXX +#define INCLUDED_TEST_SHEET_XRECENTFUNCTIONS_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XRecentFunctions +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetRecentFunctionIds(); + void testSetRecentFunctionIds(); + void testGetMaxRecentFunctions(); + +protected: + ~XRecentFunctions() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XRECENTFUNCTIONS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xscenario.hxx b/include/test/sheet/xscenario.hxx new file mode 100644 index 0000000000..8892d26c1c --- /dev/null +++ b/include/test/sheet/xscenario.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSCENARIO_HXX +#define INCLUDED_TEST_SHEET_XSCENARIO_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XScenario +{ +public: + virtual css::uno::Reference getScenarioSpreadsheet() = 0; + + void testScenario(); + +protected: + ~XScenario() {} +}; +} // namespace apitest + +#endif // INCLUDED_TEST_SHEET_XSCENARIO_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xscenarioenhanced.hxx b/include/test/sheet/xscenarioenhanced.hxx new file mode 100644 index 0000000000..ff5261f31d --- /dev/null +++ b/include/test/sheet/xscenarioenhanced.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSCENARIOENHANCED_HXX +#define INCLUDED_TEST_SHEET_XSCENARIOENHANCED_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XScenarioEnhanced +{ +public: + virtual css::uno::Reference getScenarioSpreadsheet() = 0; + + void testGetRanges(); + +protected: + ~XScenarioEnhanced() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSCENARIOENHANCED_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xscenarios.hxx b/include/test/sheet/xscenarios.hxx new file mode 100644 index 0000000000..f890a5030f --- /dev/null +++ b/include/test/sheet/xscenarios.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSCENARIOS_HXX +#define INCLUDED_TEST_SHEET_XSCENARIOS_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XScenarios +{ +public: + virtual css::uno::Reference init() = 0; + + void testAddNewByName(); + void testRemoveByName(); + +protected: + ~XScenarios() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSCENARIOS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xscenariossupplier.hxx b/include/test/sheet/xscenariossupplier.hxx new file mode 100644 index 0000000000..e4a6eea11f --- /dev/null +++ b/include/test/sheet/xscenariossupplier.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSCENARIOSSUPPLIER_HXX +#define INCLUDED_TEST_SHEET_XSCENARIOSSUPPLIER_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XScenariosSupplier +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetScenarios(); + +protected: + ~XScenariosSupplier() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSCENARIOSSUPPLIER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xsheetannotation.hxx b/include/test/sheet/xsheetannotation.hxx new file mode 100644 index 0000000000..0003d8b119 --- /dev/null +++ b/include/test/sheet/xsheetannotation.hxx @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETANNOTATION_HXX +#define INCLUDED_TEST_SHEET_XSHEETANNOTATION_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetAnnotation +{ +public: + virtual css::uno::Reference init() = 0; + + // XSheetAnnotation + void testGetPosition(); + void testGetAuthor(); + void testGetDate(); + void testGetIsVisible(); + void testSetIsVisible(); + +protected: + ~XSheetAnnotation() {} + + virtual css::uno::Reference + getAnnotation(css::table::CellAddress&) = 0; +}; +} + +#endif // INCLUDED_TEST_SHEET_XSHEETANNOTATION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xsheetannotationanchor.hxx b/include/test/sheet/xsheetannotationanchor.hxx new file mode 100644 index 0000000000..a0c6fc58d4 --- /dev/null +++ b/include/test/sheet/xsheetannotationanchor.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETANNOTATIONANCHOR_HXX +#define INCLUDED_TEST_SHEET_XSHEETANNOTATIONANCHOR_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetAnnotationAnchor +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetAnnotation(); + +protected: + ~XSheetAnnotationAnchor() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSHEETANNOTATIONANCHOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xsheetannotations.hxx b/include/test/sheet/xsheetannotations.hxx new file mode 100644 index 0000000000..f9b92968ff --- /dev/null +++ b/include/test/sheet/xsheetannotations.hxx @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETANNOTATIONS_HXX +#define INCLUDED_TEST_SHEET_XSHEETANNOTATIONS_HXX + +#include +#include + +#include + +#include +#include + +namespace apitest { + +class OOO_DLLPUBLIC_TEST XSheetAnnotations +{ +public: + virtual css::uno::Reference< css::uno::XInterface > init() = 0; + virtual css::uno::Reference< css::sheet::XSheetAnnotations> getAnnotations(tools::Long nIndex) = 0; + + // XSheetAnnotations + void testIndex(); + void testInsertNew(); + void testRemoveByIndex(); + void testCount(); + +protected: + ~XSheetAnnotations() {} +}; + +} + +#endif // INCLUDED_TEST_SHEET_XSHEETANNOTATIONS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xsheetannotationshapesupplier.hxx b/include/test/sheet/xsheetannotationshapesupplier.hxx new file mode 100644 index 0000000000..72600c1aac --- /dev/null +++ b/include/test/sheet/xsheetannotationshapesupplier.hxx @@ -0,0 +1,32 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETANNOTATIONSHAPESUPPLIER_HXX +#define INCLUDED_TEST_SHEET_XSHEETANNOTATIONSHAPESUPPLIER_HXX + +#include +#include +#include + +namespace apitest { + +class OOO_DLLPUBLIC_TEST XSheetAnnotationShapeSupplier +{ +public: + virtual css::uno::Reference< css::uno::XInterface > init() = 0; + virtual ~XSheetAnnotationShapeSupplier(){} + + void testGetAnnotationShape(); +}; + +} + +#endif // INCLUDED_TEST_SHEET_XSHEETANNOTATIONSHAPESUPPLIER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xsheetannotationssupplier.hxx b/include/test/sheet/xsheetannotationssupplier.hxx new file mode 100644 index 0000000000..cc9e008ec6 --- /dev/null +++ b/include/test/sheet/xsheetannotationssupplier.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETANNOTATIONSSUPPLIER_HXX +#define INCLUDED_TEST_SHEET_XSHEETANNOTATIONSSUPPLIER_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetAnnotationsSupplier +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetAnnotations(); + +protected: + ~XSheetAnnotationsSupplier() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSHEETANNOTATIONSSUPPLIER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xsheetauditing.hxx b/include/test/sheet/xsheetauditing.hxx new file mode 100644 index 0000000000..44c1ddd5c5 --- /dev/null +++ b/include/test/sheet/xsheetauditing.hxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETAUDITING_HXX +#define INCLUDED_TEST_SHEET_XSHEETAUDITING_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetAuditing +{ +public: + virtual css::uno::Reference init() = 0; + + void testShowHideDependents(); + void testShowHidePrecedents(); + void testShowErrors(); + void testShowInvalid(); + void testClearArrows(); + +protected: + ~XSheetAuditing() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSHEETAUDITING_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xsheetcellcursor.hxx b/include/test/sheet/xsheetcellcursor.hxx new file mode 100644 index 0000000000..3686ac521f --- /dev/null +++ b/include/test/sheet/xsheetcellcursor.hxx @@ -0,0 +1,39 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETCELLCURSOR_HXX +#define INCLUDED_TEST_SHEET_XSHEETCELLCURSOR_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetCellCursor +{ +public: + virtual css::uno::Reference init() = 0; + + void testCollapseToCurrentArray(); + void testCollapseToCurrentRegion(); + void testCollapseToMergedArea(); + void testCollapseToSize(); + void testExpandToEntireColumns(); + void testExpandToEntireRows(); + +protected: + ~XSheetCellCursor() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSHEETCELLCURSOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xsheetcellrange.hxx b/include/test/sheet/xsheetcellrange.hxx new file mode 100644 index 0000000000..42ce2d094c --- /dev/null +++ b/include/test/sheet/xsheetcellrange.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETCELLRANGE_HXX +#define INCLUDED_TEST_SHEET_XSHEETCELLRANGE_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetCellRange +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetSpreadsheet(); + +protected: + ~XSheetCellRange() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSHEETCELLRANGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xsheetcellrangecontainer.hxx b/include/test/sheet/xsheetcellrangecontainer.hxx new file mode 100644 index 0000000000..734c2c4e2f --- /dev/null +++ b/include/test/sheet/xsheetcellrangecontainer.hxx @@ -0,0 +1,39 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETCELLRANGECONTAINER_HXX +#define INCLUDED_TEST_SHEET_XSHEETCELLRANGECONTAINER_HXX + +#include + +#include +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetCellRangeContainer +{ +public: + virtual css::uno::Reference init() = 0; + + void testAddRemoveRangeAddress(); + void testAddRemoveRangeAddresses(); + +protected: + ~XSheetCellRangeContainer() {} + static css::uno::Sequence createCellRangeAddresses(); +}; +} + +#endif // INCLUDED_TEST_SHEET_XSHEETCELLRANGECONTAINER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xsheetcellranges.hxx b/include/test/sheet/xsheetcellranges.hxx new file mode 100644 index 0000000000..4f21f446c2 --- /dev/null +++ b/include/test/sheet/xsheetcellranges.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETCELLRANGES_HXX +#define INCLUDED_TEST_SHEET_XSHEETCELLRANGES_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetCellRanges +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetCells(); + void testGetRangeAddresses(); + void testGetRangeAddressesAsString(); + +protected: + ~XSheetCellRanges() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSHEETCELLRANGES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xsheetcondition.hxx b/include/test/sheet/xsheetcondition.hxx new file mode 100644 index 0000000000..c69625f445 --- /dev/null +++ b/include/test/sheet/xsheetcondition.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETCONDITION_HXX +#define INCLUDED_TEST_SHEET_XSHEETCONDITION_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetCondition +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetSetFormula1(); + void testGetSetFormula2(); + void testGetSetOperator(); + void testGetSetSourcePosition(); + +protected: + ~XSheetCondition() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSHEETCONDITION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xsheetconditionalentries.hxx b/include/test/sheet/xsheetconditionalentries.hxx new file mode 100644 index 0000000000..673e7ceb17 --- /dev/null +++ b/include/test/sheet/xsheetconditionalentries.hxx @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETCONDITIONALENTRIES_HXX +#define INCLUDED_TEST_SHEET_XSHEETCONDITIONALENTRIES_HXX + +#include +#include + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetConditionalEntries +{ +public: + virtual css::uno::Reference init() = 0; + virtual css::uno::Sequence + createCondition(const sal_Int32 nr) = 0; + + void testAddNew(); + void testClear(); + void testRemoveByIndex(); + +protected: + ~XSheetConditionalEntries() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSHEETCONDITIONALENTRIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xsheetconditionalentry.hxx b/include/test/sheet/xsheetconditionalentry.hxx new file mode 100644 index 0000000000..d143f78434 --- /dev/null +++ b/include/test/sheet/xsheetconditionalentry.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETCONDITIONALENTRY_HXX +#define INCLUDED_TEST_SHEET_XSHEETCONDITIONALENTRY_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetConditionalEntry +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetSetStyleName(); + +protected: + ~XSheetConditionalEntry() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSHEETCONDITIONALENTRY_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xsheetfilterable.hxx b/include/test/sheet/xsheetfilterable.hxx new file mode 100644 index 0000000000..a46b10b078 --- /dev/null +++ b/include/test/sheet/xsheetfilterable.hxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETFILTERABLE_HXX +#define INCLUDED_TEST_SHEET_XSHEETFILTERABLE_HXX + + +#include +#include + +#include + +namespace apitest { + +class OOO_DLLPUBLIC_TEST XSheetFilterable +{ +public: + virtual css::uno::Reference< css::uno::XInterface > init() =0; + virtual css::uno::Reference< css::uno::XInterface > getXSpreadsheet() =0; + + void testCreateFilterDescriptor(); + void testFilter(); + +protected: + ~XSheetFilterable() {} +}; + +} + +#endif // INCLUDED_TEST_SHEET_XSHEETFILTERABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xsheetfilterableex.hxx b/include/test/sheet/xsheetfilterableex.hxx new file mode 100644 index 0000000000..71be889a3c --- /dev/null +++ b/include/test/sheet/xsheetfilterableex.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETFILTERABLEEX_HXX +#define INCLUDED_TEST_SHEET_XSHEETFILTERABLEEX_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetFilterableEx +{ +public: + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getXSpreadsheet() = 0; + + void testCreateFilterDescriptorByObject(); + +protected: + ~XSheetFilterableEx() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSHEETFILTERABLEEX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xsheetfilterdescriptor.hxx b/include/test/sheet/xsheetfilterdescriptor.hxx new file mode 100644 index 0000000000..65620f0f09 --- /dev/null +++ b/include/test/sheet/xsheetfilterdescriptor.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR_HXX +#define INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetFilterDescriptor +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetSetFilterFields(); + +protected: + ~XSheetFilterDescriptor() {} +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xsheetfilterdescriptor2.hxx b/include/test/sheet/xsheetfilterdescriptor2.hxx new file mode 100644 index 0000000000..7555c65cb3 --- /dev/null +++ b/include/test/sheet/xsheetfilterdescriptor2.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR2_HXX +#define INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR2_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetFilterDescriptor2 +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetSetFilterFields2(); + +protected: + ~XSheetFilterDescriptor2() {} +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR2_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xsheetfilterdescriptor3.hxx b/include/test/sheet/xsheetfilterdescriptor3.hxx new file mode 100644 index 0000000000..1d8f940872 --- /dev/null +++ b/include/test/sheet/xsheetfilterdescriptor3.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR3_HXX +#define INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR3_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetFilterDescriptor3 +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetSetFilterFields3(); + +protected: + ~XSheetFilterDescriptor3() {} +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR3_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xsheetlinkable.hxx b/include/test/sheet/xsheetlinkable.hxx new file mode 100644 index 0000000000..fc239fb7b7 --- /dev/null +++ b/include/test/sheet/xsheetlinkable.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETLINKABLE_HXX +#define INCLUDED_TEST_SHEET_XSHEETLINKABLE_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetLinkable +{ +public: + virtual css::uno::Reference init() = 0; + virtual OUString getFileURL() = 0; + + void testSheetLinkable(); + +protected: + ~XSheetLinkable() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSHEETLINKABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xsheetoperation.hxx b/include/test/sheet/xsheetoperation.hxx new file mode 100644 index 0000000000..ea436ce38b --- /dev/null +++ b/include/test/sheet/xsheetoperation.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETOPERATION_HXX +#define INCLUDED_TEST_SHEET_XSHEETOPERATION_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetOperation +{ +public: + virtual css::uno::Reference init() = 0; + + void testComputeFunction(); + void testClearContents(); + +protected: + ~XSheetOperation() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSHEETOPERATION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xsheetoutline.hxx b/include/test/sheet/xsheetoutline.hxx new file mode 100644 index 0000000000..0210e62147 --- /dev/null +++ b/include/test/sheet/xsheetoutline.hxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETOUTLINE_HXX +#define INCLUDED_TEST_SHEET_XSHEETOUTLINE_HXX + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetOutline +{ +public: + virtual css::uno::Reference init() = 0; + + // XSheetOutline + void testHideDetail(); + void testShowDetail(); + void testShowLevel(); + void testUngroup(); + void testGroup(); + void testClearOutline(); + +protected: + ~XSheetOutline() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSHEETOUTLINE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xsheetpagebreak.hxx b/include/test/sheet/xsheetpagebreak.hxx new file mode 100644 index 0000000000..e7a47628d0 --- /dev/null +++ b/include/test/sheet/xsheetpagebreak.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSHEETPAGEBREAK_HXX +#define INCLUDED_TEST_SHEET_XSHEETPAGEBREAK_HXX + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSheetPageBreak +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetColumnPageBreaks(); + void testGetRowPageBreaks(); + void testRemoveAllManualPageBreaks(); + +protected: + ~XSheetPageBreak() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSHEETPAGEBREAK_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xspreadsheet.hxx b/include/test/sheet/xspreadsheet.hxx new file mode 100644 index 0000000000..8033b8e552 --- /dev/null +++ b/include/test/sheet/xspreadsheet.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSPREADSHEET_HXX +#define INCLUDED_TEST_SHEET_XSPREADSHEET_HXX + +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSpreadsheet +{ +public: + virtual css::uno::Reference init() = 0; + + void testCreateCursor(); + void testCreateCursorByRange(); + +protected: + ~XSpreadsheet() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSPREADSHEET_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xspreadsheetdocument.hxx b/include/test/sheet/xspreadsheetdocument.hxx new file mode 100644 index 0000000000..8f56624890 --- /dev/null +++ b/include/test/sheet/xspreadsheetdocument.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSPREADSHEETDOCUMENT_HXX +#define INCLUDED_TEST_SHEET_XSPREADSHEETDOCUMENT_HXX + +#include + +namespace apitest { + +class XSpreadsheetDocument +{ +public: + XSpreadsheetDocument(sal_Int32 nSheets) : mnSheets(nSheets) {} + + virtual css::uno::Reference< css::uno::XInterface > init() = 0; + + void testGetSheets(); + +protected: + ~XSpreadsheetDocument() {} + +private: + sal_Int32 mnSheets; +}; + +} + +#endif // INCLUDED_TEST_SHEET_XSPREADSHEETDOCUMENT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xspreadsheets.hxx b/include/test/sheet/xspreadsheets.hxx new file mode 100644 index 0000000000..2ec471db64 --- /dev/null +++ b/include/test/sheet/xspreadsheets.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSPREADSHEETS_HXX +#define INCLUDED_TEST_SHEET_XSPREADSHEETS_HXX + +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSpreadsheets +{ +public: + virtual css::uno::Reference init() = 0; + virtual ~XSpreadsheets() {} + + void testInsertNewByName(); + void testInsertNewByNameBadName(); + void testMoveByName(); + void testCopyByName(); +}; +} + +#endif // INCLUDED_TEST_SHEET_XSPREADSHEETS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xspreadsheets2.hxx b/include/test/sheet/xspreadsheets2.hxx new file mode 100644 index 0000000000..30311a40c4 --- /dev/null +++ b/include/test/sheet/xspreadsheets2.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSPREADSHEETS2_HXX +#define INCLUDED_TEST_SHEET_XSPREADSHEETS2_HXX + +#include + +#include +#include +#include +#include + +namespace apitest { + +class OOO_DLLPUBLIC_TEST XSpreadsheets2 +{ +public: + XSpreadsheets2(); + virtual ~XSpreadsheets2(); + + // XSpreadsheets2 + void testImportedSheetNameAndIndex(); + void testImportString(); + void testImportValue(); + void testImportFormulaBasicMath(); + void testImportFormulaWithNamedRange(); + void testImportOverExistingNamedRange(); + void testImportNamedRangeDefinedInSource(); + void testImportNamedRangeRedefinedInSource(); + void testImportNewNamedRange(); + void testImportCellStyle(); + void testLastAfterInsertCopy(); + + virtual css::uno::Reference< css::uno::XInterface > init() = 0; + virtual css::uno::Reference< css::lang::XComponent > loadFromDesktop(const OUString&) = 0; + +protected: + css::uno::Reference< css::sheet::XSpreadsheetDocument> xDocument; + +private: + css::uno::Reference< css::sheet::XSpreadsheetDocument> getDoc(const OUString&); + static css::uno::Reference< css::sheet::XNamedRanges> getNamedRanges(css::uno::Reference< css::sheet::XSpreadsheetDocument > const &); + void importSheetToCopy(); + static bool isExternalReference(std::u16string_view aDestContent, std::u16string_view aSrcContent ); + + css::uno::Reference< css::sheet::XSpreadsheetDocument> xDestDoc; + css::uno::Reference< css::sheet::XSpreadsheet > xDestSheet; + css::uno::Reference< css::sheet::XSpreadsheet > xSrcSheet; +}; + +} + +#endif // INCLUDED_TEST_SHEET_XSPREADSHEETS2_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xspreadsheetview.hxx b/include/test/sheet/xspreadsheetview.hxx new file mode 100644 index 0000000000..144b54ac12 --- /dev/null +++ b/include/test/sheet/xspreadsheetview.hxx @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSPREADSHEETVIEW_HXX +#define INCLUDED_TEST_SHEET_XSPREADSHEETVIEW_HXX + +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSpreadsheetView +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetSetActiveSheet(); + +protected: + ~XSpreadsheetView() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XSPREADSHEETVIEW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xsubtotalcalculatable.hxx b/include/test/sheet/xsubtotalcalculatable.hxx new file mode 100644 index 0000000000..2160816d3a --- /dev/null +++ b/include/test/sheet/xsubtotalcalculatable.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSUBTOTALCALCULATABLE_HXX +#define INCLUDED_TEST_SHEET_XSUBTOTALCALCULATABLE_HXX + +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSubTotalCalculatable +{ +public: + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getXSpreadsheet() = 0; + + void testCreateSubTotalDescriptor(); + void testApplyRemoveSubTotals(); + +protected: + ~XSubTotalCalculatable() {} +}; +} +#endif // INCLUDED_TEST_SHEET_XSUBTOTALCALCULATABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xsubtotaldescriptor.hxx b/include/test/sheet/xsubtotaldescriptor.hxx new file mode 100644 index 0000000000..dc570c1819 --- /dev/null +++ b/include/test/sheet/xsubtotaldescriptor.hxx @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSUBTOTALDESCRIPTOR_HXX +#define INCLUDED_TEST_SHEET_XSUBTOTALDESCRIPTOR_HXX + +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSubTotalDescriptor +{ +public: + virtual css::uno::Reference init() = 0; + + void testAddNew(); + void testClear(); + +protected: + ~XSubTotalDescriptor() {} +}; +} +#endif // INCLUDED_TEST_SHEET_XSUBTOTALDESCRIPTOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xsubtotalfield.hxx b/include/test/sheet/xsubtotalfield.hxx new file mode 100644 index 0000000000..c5925ee6c7 --- /dev/null +++ b/include/test/sheet/xsubtotalfield.hxx @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XSUBTOTALFIELD_HXX +#define INCLUDED_TEST_SHEET_XSUBTOTALFIELD_HXX + +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSubTotalField +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetSetGroupColumn(); + void testGetSetTotalColumns(); + +protected: + ~XSubTotalField() {} +}; +} +#endif // INCLUDED_TEST_SHEET_XSUBTOTALFIELD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xuniquecellformatrangessupplier.hxx b/include/test/sheet/xuniquecellformatrangessupplier.hxx new file mode 100644 index 0000000000..f3adcc2166 --- /dev/null +++ b/include/test/sheet/xuniquecellformatrangessupplier.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XUNIQUECELLFORMATRANGESSUPPLIER_HXX +#define INCLUDED_TEST_SHEET_XUNIQUECELLFORMATRANGESSUPPLIER_HXX + +#include +#include +#include + +namespace apitest { + +class OOO_DLLPUBLIC_TEST XUniqueCellFormatRangesSupplier +{ +public: + virtual css::uno::Reference< css::uno::XInterface > init() = 0; + + void testGetUniqueCellFormatRanges(); + +protected: + ~XUniqueCellFormatRangesSupplier() {} +}; + +} + +#endif // INCLUDED_TEST_SHEET_XUNIQUECELLFORMATRANGESSUPPLIER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xusedareacursor.hxx b/include/test/sheet/xusedareacursor.hxx new file mode 100644 index 0000000000..95b4fe4025 --- /dev/null +++ b/include/test/sheet/xusedareacursor.hxx @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XUSEDAREACURSOR_HXX +#define INCLUDED_TEST_SHEET_XUSEDAREACURSOR_HXX + +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XUsedAreaCursor +{ +public: + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getXSpreadsheet() = 0; + virtual ~XUsedAreaCursor() {} + + void testGotoStartOfUsedArea(); + void testGotoEndOfUsedArea(); +}; +} + +#endif // INCLUDED_TEST_SHEET_XUSEDAREACURSOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xviewfreezable.hxx b/include/test/sheet/xviewfreezable.hxx new file mode 100644 index 0000000000..642e2eaf03 --- /dev/null +++ b/include/test/sheet/xviewfreezable.hxx @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XVIEWFREEZABLE_HXX +#define INCLUDED_TEST_SHEET_XVIEWFREEZABLE_HXX + +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XViewFreezable +{ +public: + virtual css::uno::Reference init() = 0; + virtual ~XViewFreezable() {} + + void testFreeze(); +}; +} + +#endif // INCLUDED_TEST_SHEET_XVIEWFREEZABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/sheet/xviewpane.hxx b/include/test/sheet/xviewpane.hxx new file mode 100644 index 0000000000..ba0689bd24 --- /dev/null +++ b/include/test/sheet/xviewpane.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XVIEWPANE_HXX +#define INCLUDED_TEST_SHEET_XVIEWPANE_HXX + +#include +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XViewPane +{ +public: + virtual css::uno::Reference init() = 0; + + void testFirstVisibleColumn(); + void testFirstVisibleRow(); + void testVisibleRange(); + +protected: + virtual ~XViewPane() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XVIEWPANE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/sheet/xviewsplitable.hxx b/include/test/sheet/xviewsplitable.hxx new file mode 100644 index 0000000000..36956d375e --- /dev/null +++ b/include/test/sheet/xviewsplitable.hxx @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_SHEET_XVIEWSPLITABLE_HXX +#define INCLUDED_TEST_SHEET_XVIEWSPLITABLE_HXX + +#include +#include +#include + +namespace apitest { + +class OOO_DLLPUBLIC_TEST XViewSplitable +{ + +public: + virtual css::uno::Reference< css::uno::XInterface > init() = 0; + virtual ~XViewSplitable(){} + + void testSplit(); +}; + +} + +#endif // INCLUDED_TEST_SHEET_XVIEWSPLITABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/style/xstyleloader.hxx b/include/test/style/xstyleloader.hxx new file mode 100644 index 0000000000..ca34a72cf4 --- /dev/null +++ b/include/test/style/xstyleloader.hxx @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_STYLE_XSTYLELOADER_HXX +#define INCLUDED_TEST_STYLE_XSTYLELOADER_HXX + +#include +#include +#include +#include + +#include + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XStyleLoader +{ +public: + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getTargetDoc() = 0; + virtual css::uno::Reference getSourceComponent() = 0; + virtual OUString getTestURL() = 0; + + // XStyleLoader + void testLoadStylesFromURL(); + void testLoadStylesFromStream(); + // XStyleLoader2 + void testLoadStylesFromDocument(); + +private: + static void checkStyleProperties( + css::uno::Reference const& xFamilySupplier); + +protected: + ~XStyleLoader() {} +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_STYLE_XSTYLELOADER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/table/tablecolumn.hxx b/include/test/table/tablecolumn.hxx new file mode 100644 index 0000000000..a6ea3a01b4 --- /dev/null +++ b/include/test/table/tablecolumn.hxx @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST TableColumn +{ +public: + virtual css::uno::Reference init() = 0; + void setSpreadsheet(const css::uno::Reference& r_xSheet) + { + m_xSheet = r_xSheet; + } + + void testTableColumnProperties(); + +protected: + ~TableColumn() {} + +private: + css::uno::Reference m_xSheet; +}; + +} // namespace apitest + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/table/tablerow.hxx b/include/test/table/tablerow.hxx new file mode 100644 index 0000000000..150534bb22 --- /dev/null +++ b/include/test/table/tablerow.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_TABLE_TABLEROW_HXX +#define INCLUDED_TEST_TABLE_TABLEROW_HXX + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST TableRow +{ +public: + virtual css::uno::Reference init() = 0; + + void testTableRowProperties(); + +protected: + ~TableRow() {} +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_TABLE_TABLEROW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/table/xcell.hxx b/include/test/table/xcell.hxx new file mode 100644 index 0000000000..a0249aac91 --- /dev/null +++ b/include/test/table/xcell.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* +* This file is part of the LibreOffice project. +* +* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. +*/ + +#ifndef INCLUDED_TEST_TABLE_XCELL_HXX +#define INCLUDED_TEST_TABLE_XCELL_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XCell +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetError(); + void testGetType(); + void testSetGetFormula(); + void testSetGetValue(); + +protected: + ~XCell() {} +}; +} + +#endif // INCLUDED_TEST_TABLE_XCELL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/table/xcellcursor.hxx b/include/test/table/xcellcursor.hxx new file mode 100644 index 0000000000..0fb5c06225 --- /dev/null +++ b/include/test/table/xcellcursor.hxx @@ -0,0 +1,39 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* +* This file is part of the LibreOffice project. +* +* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. +*/ + +#ifndef INCLUDED_TEST_TABLE_XCELLCURSOR_HXX +#define INCLUDED_TEST_TABLE_XCELLCURSOR_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XCellCursor +{ +public: + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getXSpreadsheet() = 0; + + void testGoToNext(); + void testGoToOffset(); + void testGoToPrevious(); + void testGoToStart(); + void testGoToEnd(); + +protected: + ~XCellCursor() {} +}; +} + +#endif // INCLUDED_TEST_TABLE_XCELLCURSOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/table/xcellrange.hxx b/include/test/table/xcellrange.hxx new file mode 100644 index 0000000000..94db1130b2 --- /dev/null +++ b/include/test/table/xcellrange.hxx @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_TABLE_XCELLRANGE_HXX +#define INCLUDED_TEST_TABLE_XCELLRANGE_HXX + +#include + +#include + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XCellRange +{ +public: + XCellRange() + : m_aRangeName("A1:A1") + { + } + XCellRange(OUString aRangeName) + : m_aRangeName(std::move(aRangeName)) + { + } + + virtual css::uno::Reference init() = 0; + + void testGetCellByPosition(); + void testGetCellRangeByName(); + void testGetCellRangeByPosition(); + +protected: + ~XCellRange() {} + +private: + OUString const m_aRangeName; +}; +} // namespace apitest + +#endif // INCLUDED_TEST_TABLE_XCELLRANGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/table/xcolumnrowrange.hxx b/include/test/table/xcolumnrowrange.hxx new file mode 100644 index 0000000000..279a988478 --- /dev/null +++ b/include/test/table/xcolumnrowrange.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* +* This file is part of the LibreOffice project. +* +* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. +*/ + +#ifndef INCLUDED_TEST_TABLE_XCOLUMNROWRANGE_HXX +#define INCLUDED_TEST_TABLE_XCOLUMNROWRANGE_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XColumnRowRange +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetColumns(); + void testGetRows(); + +protected: + ~XColumnRowRange() {} +}; +} + +#endif // INCLUDED_TEST_TABLE_XCOLUMNROWRANGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/table/xtablechart.hxx b/include/test/table/xtablechart.hxx new file mode 100644 index 0000000000..6c57bf3ac3 --- /dev/null +++ b/include/test/table/xtablechart.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_TABLE_XTABLECHART_HXX +#define INCLUDED_TEST_TABLE_XTABLECHART_HXX + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XTableChart +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetSetHasColumnHeaders(); + void testGetSetHasRowHeaders(); + void testGetSetRanges(); + +protected: + ~XTableChart() {} +}; +} // namespace apitest + +#endif // INCLUDED_TEST_TABLE_XTABLECHART_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/table/xtablecharts.hxx b/include/test/table/xtablecharts.hxx new file mode 100644 index 0000000000..fa43e552e3 --- /dev/null +++ b/include/test/table/xtablecharts.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_TABLE_XTABLECHARTS_HXX +#define INCLUDED_TEST_TABLE_XTABLECHARTS_HXX + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XTableCharts +{ +public: + virtual css::uno::Reference init() = 0; + + void testAddNewRemoveByName(); + +protected: + ~XTableCharts() {} +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_TABLE_XTABLECHARTS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/table/xtablechartssupplier.hxx b/include/test/table/xtablechartssupplier.hxx new file mode 100644 index 0000000000..9e5d45dd0d --- /dev/null +++ b/include/test/table/xtablechartssupplier.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* +* This file is part of the LibreOffice project. +* +* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. +*/ + +#ifndef INCLUDED_TEST_TABLE_XTABLECHARTSSUPPLIER_HXX +#define INCLUDED_TEST_TABLE_XTABLECHARTSSUPPLIER_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XTableChartsSupplier +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetCharts(); + +protected: + ~XTableChartsSupplier() {} +}; +} + +#endif // INCLUDED_TEST_TABLE_XTABLECHARTSSUPPLIER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/table/xtablecolumns.hxx b/include/test/table/xtablecolumns.hxx new file mode 100644 index 0000000000..957d344c59 --- /dev/null +++ b/include/test/table/xtablecolumns.hxx @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_TABLE_XTABLECOLUMNS_HXX +#define INCLUDED_TEST_TABLE_XTABLECOLUMNS_HXX + +#include +#include +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XTableColumns +{ +public: + virtual css::uno::Reference init() = 0; + + void setXSpreadsheet(const css::uno::Reference& r_xSheet) + { + m_xSheet = r_xSheet; + } + + void testInsertByIndex(); + void testInsertByIndexWithNegativeIndex(); + // only use with ScTableColumnsObj + void testInsertByIndexWithNoColumn(); + void testInsertByIndexWithOutOfBoundIndex(); + void testRemoveByIndex(); + void testRemoveByIndexWithNegativeIndex(); + // only use with ScTableColumnsObj + void testRemoveByIndexWithNoColumn(); + void testRemoveByIndexWithOutOfBoundIndex(); + +protected: + ~XTableColumns() {} + +private: + css::uno::Reference m_xSheet; + + static OUString getCellText(const css::uno::Reference& r_xCell); +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_TABLE_XTABLECOLUMNS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/table/xtablerows.hxx b/include/test/table/xtablerows.hxx new file mode 100644 index 0000000000..ac874daac7 --- /dev/null +++ b/include/test/table/xtablerows.hxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_TABLE_XTABLEROWS_HXX +#define INCLUDED_TEST_TABLE_XTABLEROWS_HXX + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XTableRows +{ +public: + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getXCellRange() = 0; + + virtual void testInsertByIndex(); + virtual void testRemoveByIndex(); + +protected: + ~XTableRows() {} +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_TABLE_XTABLEROWS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/testdllapi.hxx b/include/test/testdllapi.hxx new file mode 100644 index 0000000000..c0a1eb0290 --- /dev/null +++ b/include/test/testdllapi.hxx @@ -0,0 +1,39 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_TEST_TESTDLLAPI_HXX +#define INCLUDED_TEST_TESTDLLAPI_HXX + +#include +#include + +#if defined OOO_DLLIMPLEMENTATION_TEST +#define OOO_DLLPUBLIC_TEST SAL_DLLPUBLIC_EXPORT +#else +#define OOO_DLLPUBLIC_TEST SAL_DLLPUBLIC_IMPORT +#endif + +#if defined OOO_DLLIMPLEMENTATION_TEST_SETUPVCL +#define OOO_DLLPUBLIC_TEST_SETUPVCL SAL_DLLPUBLIC_EXPORT +#else +#define OOO_DLLPUBLIC_TEST_SETUPVCL SAL_DLLPUBLIC_IMPORT +#endif + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/testinteractionhandler.hxx b/include/test/testinteractionhandler.hxx new file mode 100644 index 0000000000..1cfdec663d --- /dev/null +++ b/include/test/testinteractionhandler.hxx @@ -0,0 +1,154 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_TESTINTERACTIONHANDLER_HXX +#define INCLUDED_TEST_TESTINTERACTIONHANDLER_HXX + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +class TestInteractionHandler : public cppu::WeakImplHelper +{ + OUString msPassword; + bool mbPasswordRequested; + + TestInteractionHandler(const TestInteractionHandler&) = delete; + TestInteractionHandler& operator=(const TestInteractionHandler&) = delete; + +public: + TestInteractionHandler(const OUString& sPassword) + : msPassword(sPassword) + , mbPasswordRequested(false) + {} + + bool wasPasswordRequested() + { + return mbPasswordRequested; + } + + virtual OUString SAL_CALL getImplementationName() override + { + return "com.sun.star.comp.uui.TestInteractionHandler"; + } + + virtual sal_Bool SAL_CALL supportsService(OUString const & rServiceName) override + { + return cppu::supportsService(this, rServiceName); + } + + virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() override + { + return { "com.sun.star.task.InteractionHandler", + // added to indicate support for configuration.backend.MergeRecoveryRequest + "com.sun.star.configuration.backend.InteractionHandler", + // for backwards compatibility + "com.sun.star.uui.InteractionHandler" }; + } + + virtual void SAL_CALL initialize(css::uno::Sequence const & /*rArguments*/) override + {} + + virtual void SAL_CALL handle(css::uno::Reference const & rRequest) override + { + handleInteractionRequest(rRequest); + } + + virtual sal_Bool SAL_CALL handleInteractionRequest(const css::uno::Reference& rRequest) override + { + mbPasswordRequested = false; + + css::uno::Sequence> const &rContinuations = rRequest->getContinuations(); + css::uno::Any const aRequest(rRequest->getRequest()); + + if (handlePasswordRequest(rContinuations, aRequest)) + return true; + + for (auto const & cont : rContinuations) + { + css::uno::Reference xApprove(cont, css::uno::UNO_QUERY); + if (xApprove.is()) + xApprove->select(); + } + + return true; + } + + bool handlePasswordRequest(const css::uno::Sequence> &rContinuations, + const css::uno::Any& rRequest) + { + bool bPasswordRequestFound = false; + bool bIsRequestPasswordToModify = false; + css::task::PasswordRequestMode mode{}; + + css::task::DocumentPasswordRequest2 passwordRequest2; + if (rRequest >>= passwordRequest2) + { + bIsRequestPasswordToModify = passwordRequest2.IsRequestPasswordToModify; + mode = passwordRequest2.Mode; + bPasswordRequestFound = true; + } + css::task::DocumentMSPasswordRequest2 passwordMSRequest2; + if (rRequest >>= passwordMSRequest2) + { + bIsRequestPasswordToModify = passwordMSRequest2.IsRequestPasswordToModify; + mode = passwordMSRequest2.Mode; + bPasswordRequestFound = true; + } + + if (!bPasswordRequestFound) + { + mbPasswordRequested = false; + return false; + } + mbPasswordRequested = true; + + for (auto const & cont : rContinuations) + { + if (mode == css::task::PasswordRequestMode_PASSWORD_REENTER) + { // cancel re-enter of wrong password, to avoid infinite loop + css::uno::Reference const xAbort(cont, css::uno::UNO_QUERY); + if (xAbort.is()) + xAbort->select(); + } + else if (bIsRequestPasswordToModify) + { + css::uno::Reference const xIPW2(cont, css::uno::UNO_QUERY); + xIPW2->setPasswordToModify(msPassword); + xIPW2->select(); + } + else + { + css::uno::Reference const xIPW(cont, css::uno::UNO_QUERY); + if (xIPW.is()) + { + xIPW->setPassword(msPassword); + xIPW->select(); + } + } + } + return true; + } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/text/baseindex.hxx b/include/test/text/baseindex.hxx new file mode 100644 index 0000000000..7a523ed55e --- /dev/null +++ b/include/test/text/baseindex.hxx @@ -0,0 +1,30 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_TEXT_BASEINDEXTEST_HXX +#define INCLUDED_TEST_TEXT_BASEINDEXTEST_HXX + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST BaseIndex +{ +public: + virtual css::uno::Reference init() = 0; + virtual ~BaseIndex(); + void testBaseIndexProperties(); +}; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/text/baseindexmark.hxx b/include/test/text/baseindexmark.hxx new file mode 100644 index 0000000000..e6835a6d11 --- /dev/null +++ b/include/test/text/baseindexmark.hxx @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST BaseIndexMark +{ +public: + virtual css::uno::Reference init() = 0; + + void testBaseIndexMarkProperties(); + +protected: + ~BaseIndexMark() {} +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/text/documentindexmark.hxx b/include/test/text/documentindexmark.hxx new file mode 100644 index 0000000000..228668c3b0 --- /dev/null +++ b/include/test/text/documentindexmark.hxx @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST DocumentIndexMark +{ +public: + virtual css::uno::Reference init() = 0; + + void testDocumentIndexMarkProperties(); + +protected: + ~DocumentIndexMark() {} +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/text/footnote.hxx b/include/test/text/footnote.hxx new file mode 100644 index 0000000000..9970ee43cc --- /dev/null +++ b/include/test/text/footnote.hxx @@ -0,0 +1,27 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST Footnote +{ +public: + virtual css::uno::Reference init() = 0; + virtual ~Footnote(); + void testFootnoteProperties(); +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/text/numberingrules.hxx b/include/test/text/numberingrules.hxx new file mode 100644 index 0000000000..a6db84bd05 --- /dev/null +++ b/include/test/text/numberingrules.hxx @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST NumberingRules +{ +public: + virtual css::uno::Reference init() = 0; + + void testNumberingRulesProperties(); + +protected: + ~NumberingRules() {} +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/text/textcontent.hxx b/include/test/text/textcontent.hxx new file mode 100644 index 0000000000..e6333d60e4 --- /dev/null +++ b/include/test/text/textcontent.hxx @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include + +#include +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST TextContent +{ +public: + TextContent(const css::text::TextContentAnchorType aExpectedTCAT, + const css::text::TextContentAnchorType aNewTCAT, + const css::text::WrapTextMode aExpectedWTM, const css::text::WrapTextMode aNewWTM) + : m_aExpectedTCAT(aExpectedTCAT) + , m_aNewTCAT(aNewTCAT) + , m_aExpectedWTM(aExpectedWTM) + , m_aNewWTM(aNewWTM) + { + } + + virtual css::uno::Reference init() = 0; + + void testTextContentProperties(); + +protected: + ~TextContent() {} + +private: + css::text::TextContentAnchorType const m_aExpectedTCAT; + css::text::TextContentAnchorType const m_aNewTCAT; + css::text::WrapTextMode const m_aExpectedWTM; + css::text::WrapTextMode const m_aNewWTM; +}; + +} // namespace apitest + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/text/textdocumentindex.hxx b/include/test/text/textdocumentindex.hxx new file mode 100644 index 0000000000..92e827cfeb --- /dev/null +++ b/include/test/text/textdocumentindex.hxx @@ -0,0 +1,30 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_TEXT_DOCUMENTINDEXTEST_HXX +#define INCLUDED_TEST_TEXT_DOCUMENTINDEXTEST_HXX + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST TextDocumentIndex +{ +public: + virtual css::uno::Reference init() = 0; + virtual ~TextDocumentIndex(); + void testDocumentIndexProperties(); +}; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/text/textdocumentsettings.hxx b/include/test/text/textdocumentsettings.hxx new file mode 100644 index 0000000000..e7a28a2f15 --- /dev/null +++ b/include/test/text/textdocumentsettings.hxx @@ -0,0 +1,29 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_TEXT_TEXTDOCUMENTSETTINGS_HXX +#define INCLUDED_TEST_TEXT_TEXTDOCUMENTSETTINGS_HXX + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST TextDocumentSettings +{ +public: + virtual css::uno::Reference init() = 0; + virtual ~TextDocumentSettings(); + void testDocumentSettingsProperties(); +}; +} // end namespace apitest + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/text/textprintersettings.hxx b/include/test/text/textprintersettings.hxx new file mode 100644 index 0000000000..2ceac34b9b --- /dev/null +++ b/include/test/text/textprintersettings.hxx @@ -0,0 +1,30 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_TEXT_TEXTPRINTERSETTINGS_HXX +#define INCLUDED_TEST_TEXT_TEXTPRINTERSETTINGS_HXX + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST TextPrinterSettings +{ +public: + virtual css::uno::Reference init() = 0; + virtual ~TextPrinterSettings(); + void testPrinterSettingsProperties(); +}; +} // end namespace apitest + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/text/textsettings.hxx b/include/test/text/textsettings.hxx new file mode 100644 index 0000000000..9566f21dca --- /dev/null +++ b/include/test/text/textsettings.hxx @@ -0,0 +1,30 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_TEXT_TEXTSETTINGS_HXX +#define INCLUDED_TEST_TEXT_TEXTSETTINGS_HXX + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST TextSettings +{ +public: + virtual css::uno::Reference init() = 0; + virtual ~TextSettings(); + void testSettingsProperties(); +}; +} // end namespace apitest + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/text/xautotextcontainer.hxx b/include/test/text/xautotextcontainer.hxx new file mode 100644 index 0000000000..cfc20f04c6 --- /dev/null +++ b/include/test/text/xautotextcontainer.hxx @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include +#include + +#include + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XAutoTextContainer +{ +public: + XAutoTextContainer(OUString aNameToRemove) + : m_aName(std::move(aNameToRemove)) + { + } + + virtual css::uno::Reference init() = 0; + + void testInsertNewByName(); + void testRemoveByName(); + +protected: + ~XAutoTextContainer() {} + +private: + OUString m_aName; +}; + +} // namespace apitest + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/text/xdocumentindex.hxx b/include/test/text/xdocumentindex.hxx new file mode 100644 index 0000000000..4efdaeeec6 --- /dev/null +++ b/include/test/text/xdocumentindex.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_TEST_XDOCUMENTINDEX_HXX +#define INCLUDED_TEST_TEST_XDOCUMENTINDEX_HXX + +#include + +#include + +namespace apitest +{ +/** + * Testing com.sun.star.text.XDocumentIndex + * + * @see com.sun.star.text.XDocumentIndex + */ +class OOO_DLLPUBLIC_TEST XDocumentIndex +{ +public: + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getTextDocument() = 0; + virtual ~XDocumentIndex(); + void testUpdate(); +}; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/text/xfootnote.hxx b/include/test/text/xfootnote.hxx new file mode 100644 index 0000000000..a6f29b8084 --- /dev/null +++ b/include/test/text/xfootnote.hxx @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XFootnote +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetSetLabel(); + +protected: + ~XFootnote() {} +}; + +} // namespace apitest + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/text/xsimpletext.hxx b/include/test/text/xsimpletext.hxx new file mode 100644 index 0000000000..ec371ea210 --- /dev/null +++ b/include/test/text/xsimpletext.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_TEXT_XSIMPLETEXT_HXX +#define INCLUDED_TEST_TEXT_XSIMPLETEXT_HXX + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSimpleText +{ +public: + virtual css::uno::Reference init() = 0; + + void testCreateTextCursor(); + void testCreateTextCursorByRange(); + void testInsertString(); + void testInsertControlCharacter(); + +protected: + ~XSimpleText() {} +}; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/text/xtext.hxx b/include/test/text/xtext.hxx new file mode 100644 index 0000000000..537cfa21da --- /dev/null +++ b/include/test/text/xtext.hxx @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_TEXT_XTEXT_HXX +#define INCLUDED_TEST_TEXT_XTEXT_HXX + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XText +{ +public: + virtual ~XText(); + + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getTextContent() = 0; + + void testInsertRemoveTextContent(); +}; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/text/xtextcontent.hxx b/include/test/text/xtextcontent.hxx new file mode 100644 index 0000000000..f238520625 --- /dev/null +++ b/include/test/text/xtextcontent.hxx @@ -0,0 +1,39 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_TEXT_XTEXTCONTENT_HXX +#define INCLUDED_TEST_TEXT_XTEXTCONTENT_HXX + +#include +#include +#include + +#include + +namespace apitest { + +class OOO_DLLPUBLIC_TEST XTextContent +{ +public: + virtual ~XTextContent() {} + + virtual css::uno::Reference< css::uno::XInterface > init() = 0; + virtual css::uno::Reference< css::text::XTextRange > getTextRange() = 0; + virtual css::uno::Reference< css::text::XTextContent > getTextContent() = 0; + virtual bool isAttachSupported() = 0; + + void testGetAnchor(); + void testAttach(); +}; + +} + +#endif // INCLUDED_TEST_TEXT_XTEXTCONTENT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/text/xtextfield.hxx b/include/test/text/xtextfield.hxx new file mode 100644 index 0000000000..6d717b1ead --- /dev/null +++ b/include/test/text/xtextfield.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_TEXT_XTEXTFIELD_HXX +#define INCLUDED_TEST_TEXT_XTEXTFIELD_HXX + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XTextField +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetPresentation(); + void testGetPresentationEmptyString(); + +protected: + ~XTextField() {} +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_TEXT_XTEXTFIELD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/text/xtextrange.hxx b/include/test/text/xtextrange.hxx new file mode 100644 index 0000000000..a986e7faed --- /dev/null +++ b/include/test/text/xtextrange.hxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_TEXT_XTEXTRANGE_HXX +#define INCLUDED_TEST_TEXT_XTEXTRANGE_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XTextRange +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetEnd(); + void testGetSetString(); + void testGetStart(); + void testGetText(); + +protected: + ~XTextRange() {} +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_TEXT_XTEXTRANGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/text/xtextrangecompare.hxx b/include/test/text/xtextrangecompare.hxx new file mode 100644 index 0000000000..60f4ff67b1 --- /dev/null +++ b/include/test/text/xtextrangecompare.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XTextRangeCompare +{ +public: + virtual css::uno::Reference init() = 0; + + void testCompareRegionStarts(); + void testCompareRegionEnds(); + +protected: + ~XTextRangeCompare() {} +}; + +} // namespace apitest + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/unoapi_property_testers.hxx b/include/test/unoapi_property_testers.hxx new file mode 100644 index 0000000000..4d83e8179c --- /dev/null +++ b/include/test/unoapi_property_testers.hxx @@ -0,0 +1,173 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_INC_UNOAPIPROPERTYTESTERS_HXX +#define INCLUDED_TEST_INC_UNOAPIPROPERTYTESTERS_HXX + +#include +#include +#include + +#include +#include + +namespace apitest +{ +/** @brief Tester for property type 'boolean' of a @see com::sun::star::beans::XPropertySet. + * + * @param xPropertySet The property set, which contains the property to test against. + * @param name Name of property to test. + */ +void OOO_DLLPUBLIC_TEST testBooleanProperty( + css::uno::Reference const& xPropertySet, const OUString& name); + +/** @brief Tester for optional property type 'boolean' of a @see com::sun::star::beans::XPropertySet. + * + * Pass the test also if the property doesn't exists (throws a com::sun::star::beans::UnknownPropertyException) + * + * @param xPropertySet The property set, which contains the property to test against. + * @param name Name of property to test. + */ +void OOO_DLLPUBLIC_TEST testBooleanOptionalProperty( + css::uno::Reference const& xPropertySet, const OUString& name); + +/** @brief Tester for read-only property type 'boolean' of a @see com::sun::star::beans::XPropertySet. + * + * @param xPropertySet The property set, which contains the property to test against. + * @param name Name of property to test. + */ +void OOO_DLLPUBLIC_TEST testBooleanReadonlyProperty( + css::uno::Reference const& xPropertySet, const OUString& name); + +/** @brief Tester for property type 'double' of a @see com::sun::star::beans::XPropertySet. + * + * @param xPropertySet The property set, which contains the property to test against. + * @param name Name of property to test. + * @param nValue Value to use when setting a new value. + */ +void OOO_DLLPUBLIC_TEST +testDoubleProperty(css::uno::Reference const& xPropertySet, + const OUString& name, const double& dValue = 42.0); + +/** @brief Tester for read-only property type 'double' of a @see com::sun::star::beans::XPropertySet. + * + * @param xPropertySet The property set, which contains the property to test against. + * @param name Name of property to test. + * @param nValue Value to use when setting a new value. + */ +void OOO_DLLPUBLIC_TEST +testDoubleReadonlyProperty(css::uno::Reference const& xPropertySet, + const OUString& name, const double& dValue = 42.0); + +/** @brief Tester for property type 'long' of a @see com::sun::star::beans::XPropertySet. + * + * @param xPropertySet The property set, which contains the property to test against. + * @param name Name of property to test. + * @param nValue Value to use when setting a new value. + */ +void OOO_DLLPUBLIC_TEST +testLongProperty(css::uno::Reference const& xPropertySet, + const OUString& name, const sal_Int32& nValue = 42); + +/** @brief Tester for optional property type 'long' of a @see com::sun::star::beans::XPropertySet. + * + * @param xPropertySet The property set, which contains the property to test against. + * @param name Name of property to test. + * @param nValue Value to use when setting a new value. + */ +void OOO_DLLPUBLIC_TEST +testLongOptionalProperty(css::uno::Reference const& xPropertySet, + const OUString& name, const sal_Int32& nValue = 42); + +/** @brief Tester for read-only property type 'long' of a @see com::sun::star::beans::XPropertySet. + * + * @param xPropertySet The property set, which contains the property to test against. + * @param name Name of property to test. + * @param nValue Value to use when setting a new value. + */ +void OOO_DLLPUBLIC_TEST +testLongReadonlyProperty(css::uno::Reference const& xPropertySet, + const OUString& name, const sal_Int32& nValue = 42); + +/** @brief Tester for property type 'short' of a @see com::sun::star::beans::XPropertySet. + * + * @param xPropertySet The property set, which contains the property to test against. + * @param name Name of property to test. + * @param nValue Value to use when setting a new value. + */ +void OOO_DLLPUBLIC_TEST +testShortProperty(css::uno::Reference const& xPropertySet, + const OUString& name, const sal_Int16& nValue = 42); + +/** @brief Tester for optional property type 'short' of a @see com::sun::star::beans::XPropertySet. + * + * @param xPropertySet The property set, which contains the property to test against. + * @param name Name of property to test. + * @param nValue Value to use when setting a new value. + */ +void OOO_DLLPUBLIC_TEST +testShortOptionalProperty(css::uno::Reference const& xPropertySet, + const OUString& name, const sal_Int16& nValue = 42); + +/** @brief Tester for read-only property type 'short' of a @see com::sun::star::beans::XPropertySet. + * + * @param xPropertySet The property set, which contains the property to test against. + * @param name Name of property to test. + * @param nValue Value to use when setting a new value. + */ +void OOO_DLLPUBLIC_TEST +testShortReadonlyProperty(css::uno::Reference const& xPropertySet, + const OUString& name, const sal_Int16& nValue = 42); + +/** @brief Tester for property type 'string' of a @see com::sun::star::beans::XPropertySet. + * + * @param xPropertySet The property set, which contains the property to test against. + * @param name Name of property to test. + * @param rValue Value to use when setting a new value. + */ +void OOO_DLLPUBLIC_TEST +testStringProperty(css::uno::Reference const& xPropertySet, + const OUString& name, const OUString& rValue); + +/** @brief Tester for optional property type 'string' of a @see com::sun::star::beans::XPropertySet. + * + * Pass the test also if the property doesn't exists (throws a com::sun::star::beans::UnknownPropertyException) + * + * @param xPropertySet The property set, which contains the property to test against. + * @param name Name of property to test. + * @param rValue Value to use when setting a new value. + */ +void OOO_DLLPUBLIC_TEST +testStringOptionalProperty(css::uno::Reference const& xPropertySet, + const OUString& name, const OUString& rValue = OUString("StringValue")); + +/** @brief Tester for read-only property type 'string' of a @see com::sun::star::beans::XPropertySet. + * + * @param xPropertySet The property set, which contains the property to test against. + * @param name Name of property to test. + * @param rValue Value to use when setting a new value. + */ +void OOO_DLLPUBLIC_TEST +testStringReadonlyProperty(css::uno::Reference const& xPropertySet, + const OUString& name, const OUString& rValue); + +/** @brief Tester for property type com::sun::star::util::Color of a @see com::sun::star::beans::XPropertySet. + * + * @param xPropertySet The property set, which contains the property to test against. + * @param name Name of property to test. + * @param rValue Value to use when setting a new value. + */ +void OOO_DLLPUBLIC_TEST testColorProperty( + css::uno::Reference const& xPropertySet, const OUString& name, + const css::util::Color& rValue = css::util::Color(0x12345678)); + +} // namespace apitest +#endif // INCLUDED_TEST_INC_UNOAPIPROPERTYTESTERS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx new file mode 100644 index 0000000000..2594583296 --- /dev/null +++ b/include/test/unoapi_test.hxx @@ -0,0 +1,108 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_UNOAPI_TEST_HXX +#define INCLUDED_TEST_UNOAPI_TEST_HXX + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +// basic uno api test class + +class OOO_DLLPUBLIC_TEST UnoApiTest : public test::BootstrapFixture, public unotest::MacrosTest +{ +public: + UnoApiTest(OUString path); + + virtual void setUp() override; + virtual void tearDown() override; + + OUString createFileURL(std::u16string_view aFileBase); + OUString createFilePath(std::u16string_view aFileBase); + void load(const OUString& rURL, const char* pPassword = nullptr); + void loadWithParams(const OUString& rURL, + const css::uno::Sequence& rParams); + OUString loadFromFile(std::u16string_view aFileBase, const char* pPassword = nullptr); + + css::uno::Any executeMacro(const OUString& rScriptURL, + const css::uno::Sequence& rParams = {}); + + void save(const OUString& rFilter, const char* pPassword = nullptr); + void saveWithParams(const css::uno::Sequence& rParams); + void saveAndReload(const OUString& rFilter, const char* pPassword = nullptr); + + std::unique_ptr parsePDFExport(const OString& rPassword = OString()); + + void createTempCopy(std::u16string_view fileName); + + void skipValidation() { mbSkipValidation = true; } + void setFilterOptions(const OUString& rFilterOptions) { maFilterOptions = rFilterOptions; } + + void setImportFilterOptions(const OUString& rFilterOptions) + { + maImportFilterOptions = rFilterOptions; + } + + void setImportFilterName(const OUString& rFilterName) { maImportFilterName = rFilterName; } + +protected: + // reference to document component that we are testing + css::uno::Reference mxComponent; + + // In case the test needs to work with two documents at the same time + css::uno::Reference mxComponent2; + + utl::TempFileNamed maTempFile; + + SvMemoryStream maMemory; // Underlying memory for parsed PDF files. + + rtl::Reference xInteractionHandler; + +private: + void + setTestInteractionHandler(const char* pPassword, + std::vector& rFilterOptions); + + bool mbSkipValidation; + OUString m_aBaseString; + OUString maFilterOptions; + + OUString maImportFilterOptions; + OUString maImportFilterName; +}; + +inline void assertRectangleEqual(const tools::Rectangle& rExpected, const tools::Rectangle& rActual, + const sal_Int32 nTolerance, const CppUnit::SourceLine& rSourceLine) +{ + CPPUNIT_NS::assertDoubleEquals(rExpected.Top(), rActual.Top(), nTolerance, rSourceLine, + "different Top"); + CPPUNIT_NS::assertDoubleEquals(rExpected.Left(), rActual.Left(), nTolerance, rSourceLine, + "different Left"); + CPPUNIT_NS::assertDoubleEquals(rExpected.GetWidth(), rActual.GetWidth(), nTolerance, + rSourceLine, "different Width"); + CPPUNIT_NS::assertDoubleEquals(rExpected.GetHeight(), rActual.GetHeight(), nTolerance, + rSourceLine, "different Height"); +} + +#define CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpected, aActual, aTolerance) \ + assertRectangleEqual(aExpected, aActual, aTolerance, CPPUNIT_SOURCELINE()) + +#endif // INCLUDED_TEST_UNOAPI_TEST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/unoapixml_test.hxx b/include/test/unoapixml_test.hxx new file mode 100644 index 0000000000..660fda6c20 --- /dev/null +++ b/include/test/unoapixml_test.hxx @@ -0,0 +1,30 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_UNOAPIXML_TEST_HXX +#define INCLUDED_TEST_UNOAPIXML_TEST_HXX + +#include + +#include +#include + +// basic uno api xml test class + +class OOO_DLLPUBLIC_TEST UnoApiXmlTest : public UnoApiTest, public XmlTestTools +{ +public: + UnoApiXmlTest(OUString path); + + xmlDocUniquePtr parseExport(OUString const& rStreamName); +}; + +#endif // INCLUDED_TEST_UNOAPIXML_TEST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/util/searchdescriptor.hxx b/include/test/util/searchdescriptor.hxx new file mode 100644 index 0000000000..b2f5d5bd62 --- /dev/null +++ b/include/test/util/searchdescriptor.hxx @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST SearchDescriptor +{ +public: + virtual css::uno::Reference init() = 0; + + void testSearchDescriptorProperties(); + +protected: + ~SearchDescriptor() {} +}; + +} // namespace apitest + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/util/xindent.hxx b/include/test/util/xindent.hxx new file mode 100644 index 0000000000..bb3c0e5d3e --- /dev/null +++ b/include/test/util/xindent.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* +* This file is part of the LibreOffice project. +* +* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. +*/ + +#ifndef INCLUDED_TEST_UTIL_XINDENT_HXX +#define INCLUDED_TEST_UTIL_XINDENT_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XIndent +{ +public: + virtual css::uno::Reference init() = 0; + + void testIncrementIndent(); + void testDecrementIndent(); + +protected: + ~XIndent() {} +}; +} + +#endif // INCLUDED_TEST_UTIL_XINDENT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/util/xmergeable.hxx b/include/test/util/xmergeable.hxx new file mode 100644 index 0000000000..9ed2d479be --- /dev/null +++ b/include/test/util/xmergeable.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* +* This file is part of the LibreOffice project. +* +* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. +*/ + +#ifndef INCLUDED_TEST_UTIL_XMERGEABLE_HXX +#define INCLUDED_TEST_UTIL_XMERGEABLE_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XMergeable +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetIsMergedMerge(); + +protected: + ~XMergeable() {} +}; +} + +#endif // INCLUDED_TEST_UTIL_XMERGEABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/util/xrefreshable.hxx b/include/test/util/xrefreshable.hxx new file mode 100644 index 0000000000..dd82303259 --- /dev/null +++ b/include/test/util/xrefreshable.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_UTIL_XREFRESHABLE_HXX +#define INCLUDED_TEST_UTIL_XREFRESHABLE_HXX + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XRefreshable +{ +public: + virtual css::uno::Reference init() = 0; + + void testRefreshListener(); + +protected: + ~XRefreshable() {} +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_UTIL_XREFRESHABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/util/xreplaceable.hxx b/include/test/util/xreplaceable.hxx new file mode 100644 index 0000000000..5773e75aec --- /dev/null +++ b/include/test/util/xreplaceable.hxx @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_UTIL_XREPLACEABLE_HXX +#define INCLUDED_TEST_UTIL_XREPLACEABLE_HXX + +#include +#include +#include + +namespace apitest { + +class OOO_DLLPUBLIC_TEST XReplaceable +{ +public: + XReplaceable( OUString aSearchString, OUString aReplaceString): + maSearchString(std::move(aSearchString)), maReplaceString(std::move(aReplaceString)) {} + virtual css::uno::Reference< css::uno::XInterface > init() = 0; + + void testCreateReplaceDescriptor(); + void testReplaceAll(); + +protected: + ~XReplaceable() {} + +private: + OUString maSearchString; + OUString maReplaceString; +}; + +} + +#endif // INCLUDED_TEST_UTIL_XREPLACEABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/util/xreplacedescriptor.hxx b/include/test/util/xreplacedescriptor.hxx new file mode 100644 index 0000000000..878ee7126f --- /dev/null +++ b/include/test/util/xreplacedescriptor.hxx @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XReplaceDescriptor +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetSetReplaceString(); + +protected: + ~XReplaceDescriptor() {} +}; + +} // namespace apitest + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/util/xsearchable.hxx b/include/test/util/xsearchable.hxx new file mode 100644 index 0000000000..0f78ceb18c --- /dev/null +++ b/include/test/util/xsearchable.hxx @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_UTIL_XSEARCHABLE_HXX +#define INCLUDED_TEST_UTIL_XSEARCHABLE_HXX + +#include + +#include +#include + +namespace apitest { + +class OOO_DLLPUBLIC_TEST XSearchable +{ +public: + XSearchable(OUString aString, sal_Int32 nCount) : maSearchString(std::move(aString)), mnCount(nCount) {} + XSearchable() : maSearchString("SearchString"), mnCount(1) {} + virtual ~XSearchable(); + + void testFindFirst(); + void testFindNext(); + void testFindAll(); + + virtual css::uno::Reference< css::uno::XInterface > init() = 0; + +private: + OUString maSearchString; + sal_Int32 mnCount; +}; + +} + +#endif // INCLUDED_TEST_UTIL_XSEARCHABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/util/xsearchdescriptor.hxx b/include/test/util/xsearchdescriptor.hxx new file mode 100644 index 0000000000..1bad973753 --- /dev/null +++ b/include/test/util/xsearchdescriptor.hxx @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XSearchDescriptor +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetSetSearchString(); + +protected: + ~XSearchDescriptor() {} +}; + +} // namespace apitest + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/view/xcontrolaccess.hxx b/include/test/view/xcontrolaccess.hxx new file mode 100644 index 0000000000..b25cb169c3 --- /dev/null +++ b/include/test/view/xcontrolaccess.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_VIEW_XCONTROLACCESS_HXX +#define INCLUDED_TEST_VIEW_XCONTROLACCESS_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XControlAccess +{ +public: + virtual css::uno::Reference init() = 0; + virtual css::uno::Reference getXComponent() = 0; + + void testGetControl(); + +protected: + ~XControlAccess() {} +}; +} // namespace apitest + +#endif // INCLUDED_TEST_VIEW_XCONTROLACCESS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/view/xformlayeraccess.hxx b/include/test/view/xformlayeraccess.hxx new file mode 100644 index 0000000000..ddd2542ab8 --- /dev/null +++ b/include/test/view/xformlayeraccess.hxx @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_VIEW_XFORMLAYERACCESS_HXX +#define INCLUDED_TEST_VIEW_XFORMLAYERACCESS_HXX + +#include +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XFormLayerAccess +{ +public: + virtual css::uno::Reference init() = 0; + void setForm(const css::uno::Reference& r_xForm) { m_xForm = r_xForm; } + + void testGetFormController(); + void testIsFormDesignMode(); + void testSetFormDesignMode(); + +protected: + ~XFormLayerAccess() {} + +private: + css::uno::Reference m_xForm; +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_VIEW_XFORMLAYERACCESS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/xmldiff.hxx b/include/test/xmldiff.hxx new file mode 100644 index 0000000000..5023bec35b --- /dev/null +++ b/include/test/xmldiff.hxx @@ -0,0 +1,21 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_XMLDIFF_HXX +#define INCLUDED_TEST_XMLDIFF_HXX + +#include + +bool OOO_DLLPUBLIC_TEST +doXMLDiff(const char* pFileName, const char* pContent, int size, + const char* pToleranceFileName); + +#endif // INCLUDED_TEST_XMLDIFF_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/xmldocptr.hxx b/include/test/xmldocptr.hxx new file mode 100644 index 0000000000..bb41ddb9e0 --- /dev/null +++ b/include/test/xmldocptr.hxx @@ -0,0 +1,20 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#pragma once + +#include +#include + +struct xmlDocDeleter +{ + void operator()(xmlDoc* p) { xmlFreeDoc(p); } +}; +using xmlDocUniquePtr = std::unique_ptr; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/xmltesttools.hxx b/include/test/xmltesttools.hxx new file mode 100644 index 0000000000..d18b5d51e8 --- /dev/null +++ b/include/test/xmltesttools.hxx @@ -0,0 +1,114 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_TEST_XMLTESTTOOLS_HXX +#define INCLUDED_TEST_XMLTESTTOOLS_HXX + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include + +class OOO_DLLPUBLIC_TEST XmlTestTools +{ +public: + /// Return xmlDocPtr representation of the XML stream read from pStream. + static xmlDocUniquePtr parseXmlStream(SvStream* pStream); + + static xmlDocUniquePtr dumpAndParse(MetafileXmlDump& rDumper, const GDIMetaFile& rGDIMetaFile); + +protected: + XmlTestTools(); + virtual ~XmlTestTools(); + + static xmlDocUniquePtr parseXml(utl::TempFileNamed const & aTempFile); + + virtual void registerNamespaces(xmlXPathContextPtr& pXmlXpathCtx); + + // Caller must call xmlXPathFreeObject: + xmlXPathObjectPtr getXPathNode(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath); + /** + * Same as the assertXPath(), but don't assert: return the string instead. + */ + OUString getXPath(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, const OString& rAttribute); + /** + * Same as the assertXPathContent(), but don't assert: return the string instead. + */ + OUString getXPathContent(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath); + /** + * Get the position of the child named rName of the parent node specified by rXPath. + * Useful for checking relative order of elements. + */ + int getXPathPosition(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, std::string_view rChildName); + /** + * Get the number of the nodes returned by the rXPath. + */ + int countXPathNodes(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath); + /** + * Assert that rXPath exists, returns exactly one node, and the rXPath's attribute's value + * equals to the rExpected value. + */ + void assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, const OString& rAttribute, + const OUString& rExpectedValue); + void assertXPathAttrs(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, + const std::vector>& aPairVector); + + /** + * Given a double for the rExpected value, assert that rXPath exists, returns exactly one node, + * and the rXPath's attribute's value matches the rExpected value within tolerance provided + * by delta. This is used to account for HiDPI scaling. + */ + void assertXPathDoubleValue(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, const OString& rAttribute, + double expectedValue, double delta); + /** + * Assert that rXPath exists, and returns exactly nNumberOfNodes nodes (1 by default). + * Also useful for checking that we do _not_ export some node (nNumberOfNodes == 0). + */ + void assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, int nNumberOfNodes = 1); + /** + * Assert that rXPath exists, and its content equals rContent. + */ + void assertXPathContent(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, const OUString& rContent); + /** + * Assert that rXPath exists and it has an rNSPrefix=rNSHref namespace definition. + */ + void assertXPathNSDef(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, std::u16string_view rNSPrefix, + std::u16string_view rNSHref); + /** + * Assert that rXPath exists, and has exactly nNumberOfChildNodes child nodes. + * Useful for checking that we do have a no child nodes to a specific node (nNumberOfChildNodes == 0). + */ + void assertXPathChildren(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, int nNumberOfChildNodes); + /** + * Assert that rXPath exists, has exactly 1 result set nodes and does *not* have an attribute named rAttribute. + */ + void assertXPathNoAttribute(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, const OString& rAttribute); + + static void registerODFNamespaces(xmlXPathContextPtr& pXmlXpathCtx); + static void registerOOXMLNamespaces(xmlXPathContextPtr& pXmlXpathCtx); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3