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>
15 #include <unotest/macros_test.hxx>
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 
24 typedef std::map<OString, sal_uInt32> mapType;
25 
27 {
28 private:
31 
34 
37  std::unique_ptr<weld::Container> mxParentWidget;
38 
39 private:
41  void implSaveScreenshot(const BitmapEx& rScreenshot, const OString& 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 
56 public:
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
OUString maCurrentLanguage
The current UI language.
std::map< OString, sal_uInt32 > mapType
const mapType & getKnownDialogs() const
const access to known dialogs
std::unique_ptr< weld::Container > mxParentWidget
virtual void setUp() override
weld::GenericDialogController maParent
parent for non-dialog buildables
#define OOO_DLLPUBLIC_TEST
Definition: testdllapi.hxx:28