LibreOffice Module test (master) 1
screenshot_test.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 */
9
10#ifndef INCLUDED_TEST_SCREENSHOT_TEST_HXX
11#define INCLUDED_TEST_SCREENSHOT_TEST_HXX
12
13#include <sal/config.h>
16#include <com/sun/star/lang/XComponent.hpp>
17#include <osl/file.hxx>
18#include <vcl/vclptr.hxx>
19#include <vcl/weld.hxx>
20#include <map>
21#include <string_view>
22
24typedef std::map<OString, sal_uInt32> mapType;
25
27{
28private:
31
34
37 std::unique_ptr<weld::Container> mxParentWidget;
38
39private:
41 void implSaveScreenshot(const BitmapEx& rScreenshot, const OUString& rScreenshotId);
42 void saveScreenshot(VclAbstractDialog const& rDialog);
43 void saveScreenshot(weld::Window& rDialog);
44
46 void dumpDialogToPath(weld::Builder& rDialog);
47
50 virtual void registerKnownDialogsByID(mapType& rKnownDialogs) = 0;
51
54 virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) = 0;
55
56public:
58 virtual ~ScreenshotTest() override;
59
60 virtual void setUp() override;
61
65 VclPtr<VclAbstractDialog> createDialogByName(const OString& rName);
66
68 void dumpDialogToPath(VclAbstractDialog& rDialog);
69
74 void dumpDialogToPath(std::string_view rUIXMLDescription);
75
77 void processAllKnownDialogs();
78
88 void processDialogBatchFile(std::u16string_view rFile);
89
91 const mapType& getKnownDialogs() const { return maKnownDialogs; }
92};
93
94#endif // INCLUDED_TEST_SCREENSHOT_TEST_HXX
95
96/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
mapType maKnownDialogs
the set of known dialogs and their ID for usage in createDialogByID
virtual VclPtr< VclAbstractDialog > createDialogByID(sal_uInt32 nID)=0
dialog creation for known dialogs by ID.
std::unique_ptr< weld::Container > mxParentWidget
virtual void registerKnownDialogsByID(mapType &rKnownDialogs)=0
helper method to populate maKnownDialogs, called in setUp().
weld::GenericDialogController maParent
parent for non-dialog buildables
const mapType & getKnownDialogs() const
const access to known dialogs
OUString maCurrentLanguage
The current UI language.
virtual void setUp() override
std::map< OString, sal_uInt32 > mapType
#define OOO_DLLPUBLIC_TEST
Definition: testdllapi.hxx:28