1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <test/unoapi_test.hxx>
11 #include <test/lang/xserviceinfo.hxx>
12 #include <test/text/textdocumentsettings.hxx>
13 #include <test/text/textprintersettings.hxx>
14 #include <test/text/textsettings.hxx>
16 #include <com/sun/star/frame/Desktop.hpp>
18 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
20 #include <com/sun/star/text/XTextDocument.hpp>
21 #include <com/sun/star/uno/XInterface.hpp>
28 * Test for Java API test of file com.sun.star.comp.Writer.DocumentSettings.csv
30 class SwXDocumentSettings final
: public UnoApiTest
,
31 public apitest::TextDocumentSettings
,
32 public apitest::TextSettings
,
33 public apitest::TextPrinterSettings
,
34 public apitest::XServiceInfo
38 : UnoApiTest(u
""_ustr
)
39 , apitest::XServiceInfo(u
"SwXDocumentSettings"_ustr
,
40 u
"com.sun.star.text.DocumentSettings"_ustr
){};
41 uno::Reference
<uno::XInterface
> init() override
;
43 CPPUNIT_TEST_SUITE(SwXDocumentSettings
);
44 CPPUNIT_TEST(testGetImplementationName
);
45 CPPUNIT_TEST(testGetSupportedServiceNames
);
46 CPPUNIT_TEST(testSupportsService
);
47 CPPUNIT_TEST(testDocumentSettingsProperties
);
48 CPPUNIT_TEST(testSettingsProperties
);
49 CPPUNIT_TEST(testPrinterSettingsProperties
);
50 CPPUNIT_TEST_SUITE_END();
53 uno::Reference
<uno::XInterface
> SwXDocumentSettings::init()
55 loadFromURL(u
"private:factory/swriter"_ustr
);
56 uno::Reference
<text::XTextDocument
> xTextDocument(mxComponent
, uno::UNO_QUERY_THROW
);
57 uno::Reference
<lang::XMultiServiceFactory
> xFactory(xTextDocument
, uno::UNO_QUERY_THROW
);
59 uno::Reference
<uno::XInterface
> xDocumentSettings(
60 xFactory
->createInstance(u
"com.sun.star.text.DocumentSettings"_ustr
), uno::UNO_SET_THROW
);
62 return xDocumentSettings
;
65 CPPUNIT_TEST_SUITE_REGISTRATION(SwXDocumentSettings
);
67 } // end anonymous namespace
69 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */