LibreOffice Module test (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ScreenshotTest Class Referenceabstract

#include <screenshot_test.hxx>

Inheritance diagram for ScreenshotTest:
[legend]
Collaboration diagram for ScreenshotTest:
[legend]

Public Member Functions

 ScreenshotTest ()
 
virtual ~ScreenshotTest () override
 
virtual void setUp () override
 
VclPtr< VclAbstractDialogcreateDialogByName (const OString &rName)
 Dialog creation for known dialogs by Name (path and UIXMLDescription, *.ui file). More...
 
void dumpDialogToPath (VclAbstractDialog &rDialog)
 version for AbstractDialogs, the ones created in AbstractDialogFactories More...
 
void dumpDialogToPath (std::string_view rUIXMLDescription)
 fallback version for dialogs for which only the UXMLDescription is known. More...
 
void processAllKnownDialogs ()
 helper to process all known dialogs More...
 
void processDialogBatchFile (std::u16string_view rFile)
 helper to process an input file containing the UXMLDescriptions of the dialogs to dump. More...
 
const mapTypegetKnownDialogs () const
 const access to known dialogs More...
 
- Public Member Functions inherited from test::BootstrapFixture
 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
 
- Public Member Functions inherited from test::BootstrapFixtureBase
 BootstrapFixtureBase ()
 
virtual ~BootstrapFixtureBase () override
 
const css::uno::Reference< css::uno::XComponentContext > & getComponentContext () const
 
const css::uno::Reference< css::lang::XMultiServiceFactory > & getMultiServiceFactory () const
 
virtual void setUp () override
 
virtual void tearDown () override
 
- Public Member Functions inherited from unotest::MacrosTest
 MacrosTest ()
 
 ~MacrosTest ()
 
css::uno::Reference< css::lang::XComponent > loadFromDesktop (const OUString &rURL, const OUString &rDocService=OUString(), const css::uno::Sequence< css::beans::PropertyValue > &rExtra_args=css::uno::Sequence< css::beans::PropertyValue >())
 
void setUpNssGpg (const test::Directories &rDirectories, const OUString &rTestName)
 
void tearDownNssGpg ()
 

Private Member Functions

void implSaveScreenshot (const BitmapEx &rScreenshot, const OUString &rScreenshotId)
 helpers More...
 
void saveScreenshot (VclAbstractDialog const &rDialog)
 
void saveScreenshot (weld::Window &rDialog)
 
void dumpDialogToPath (weld::Builder &rDialog)
 helper method to create and dump a dialog based on Builder contents. More...
 
virtual void registerKnownDialogsByID (mapType &rKnownDialogs)=0
 helper method to populate maKnownDialogs, called in setUp(). More...
 
virtual VclPtr< VclAbstractDialogcreateDialogByID (sal_uInt32 nID)=0
 dialog creation for known dialogs by ID. More...
 

Private Attributes

OUString maCurrentLanguage
 The current UI language. More...
 
mapType maKnownDialogs
 the set of known dialogs and their ID for usage in createDialogByID More...
 
weld::GenericDialogController maParent
 parent for non-dialog buildables More...
 
std::unique_ptr< weld::ContainermxParentWidget
 

Additional Inherited Members

- Static Public Member Functions inherited from test::BootstrapFixture
static sal_uInt16 getDefaultDeviceBitCount ()
 
- Static Public Member Functions inherited from unotest::MacrosTest
static css::uno::Any dispatchCommand (const css::uno::Reference< css::lang::XComponent > &xComponent, const OUString &rCommand, const css::uno::Sequence< css::beans::PropertyValue > &rPropertyValues)
 
static std::unique_ptr< SvStreamparseExportStream (const OUString &url, const OUString &rStreamName)
 
static bool IsValid (const css::uno::Reference< css::security::XCertificate > &cert, const css::uno::Reference< css::xml::crypto::XSecurityEnvironment > &env)
 
static css::uno::Reference< css::security::XCertificate > GetValidCertificate (const css::uno::Sequence< css::uno::Reference< css::security::XCertificate > > &certs, const css::uno::Reference< css::xml::crypto::XSecurityEnvironment > &env, const css::uno::Sequence< css::beans::PropertyValue > &rFilterData={})
 
- Static Protected Member Functions inherited from test::BootstrapFixture
static bool IsDefaultDPI ()
 
static std::pair< double, double > getDPIScaling ()
 
- Protected Attributes inherited from test::BootstrapFixture
css::uno::Reference< css::uno::XComponentContext > mxComponentContext
 
- Protected Attributes inherited from test::BootstrapFixtureBase
Directories m_directories
 
css::uno::Reference< css::uno::XComponentContext > m_xContext
 
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSFactory
 
css::uno::Reference< css::lang::XMultiComponentFactory > m_xFactory
 
- Protected Attributes inherited from unotest::MacrosTest
css::uno::Reference< css::frame::XDesktop2 > mxDesktop
 

Detailed Description

Definition at line 26 of file screenshot_test.hxx.

Constructor & Destructor Documentation

◆ ScreenshotTest()

ScreenshotTest::ScreenshotTest ( )

Definition at line 45 of file screenshot_test.cxx.

References env, and maCurrentLanguage.

◆ ~ScreenshotTest()

ScreenshotTest::~ScreenshotTest ( )
overridevirtual

Definition at line 54 of file screenshot_test.cxx.

Member Function Documentation

◆ createDialogByID()

virtual VclPtr< VclAbstractDialog > ScreenshotTest::createDialogByID ( sal_uInt32  nID)
privatepure virtual

dialog creation for known dialogs by ID.

Has to be implemented for each registered known dialog

Referenced by createDialogByName(), and processAllKnownDialogs().

◆ createDialogByName()

VclPtr< VclAbstractDialog > ScreenshotTest::createDialogByName ( const OString &  rName)

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

Definition at line 127 of file screenshot_test.cxx.

References createDialogByID(), and maKnownDialogs.

Referenced by processDialogBatchFile().

◆ dumpDialogToPath() [1/3]

void ScreenshotTest::dumpDialogToPath ( std::string_view  rUIXMLDescription)

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)

Definition at line 199 of file screenshot_test.cxx.

References Application::CreateBuilder(), dumpDialogToPath(), and mxParentWidget.

◆ dumpDialogToPath() [2/3]

void ScreenshotTest::dumpDialogToPath ( VclAbstractDialog rDialog)

version for AbstractDialogs, the ones created in AbstractDialogFactories

Definition at line 139 of file screenshot_test.cxx.

References a, VclAbstractDialog::getAllPageUIXMLDescriptions(), saveScreenshot(), and VclAbstractDialog::selectPageByUIXMLDescription().

◆ dumpDialogToPath() [3/3]

void ScreenshotTest::dumpDialogToPath ( weld::Builder rDialog)
private

◆ getKnownDialogs()

const mapType & ScreenshotTest::getKnownDialogs ( ) const
inline

const access to known dialogs

Definition at line 91 of file screenshot_test.hxx.

Referenced by processAllKnownDialogs().

◆ implSaveScreenshot()

void ScreenshotTest::implSaveScreenshot ( const BitmapEx rScreenshot,
const OUString &  rScreenshotId 
)
private

◆ processAllKnownDialogs()

void ScreenshotTest::processAllKnownDialogs ( )

helper to process all known dialogs

Definition at line 224 of file screenshot_test.cxx.

References createDialogByID(), dumpDialogToPath(), and getKnownDialogs().

◆ processDialogBatchFile()

void ScreenshotTest::processDialogBatchFile ( std::u16string_view  rFile)

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)

Definition at line 244 of file screenshot_test.cxx.

References aURL, createDialogByName(), dumpDialogToPath(), test::Directories::getURLFromSrc(), and SvStream::ReadLine().

◆ registerKnownDialogsByID()

virtual void ScreenshotTest::registerKnownDialogsByID ( mapType rKnownDialogs)
privatepure virtual

helper method to populate maKnownDialogs, called in setUp().

Needs to be written and has to add entries to maKnownDialogs

Referenced by setUp().

◆ saveScreenshot() [1/2]

void ScreenshotTest::saveScreenshot ( VclAbstractDialog const &  rDialog)
private

◆ saveScreenshot() [2/2]

void ScreenshotTest::saveScreenshot ( weld::Window rDialog)
private

◆ setUp()

void ScreenshotTest::setUp ( )
overridevirtual

Member Data Documentation

◆ maCurrentLanguage

OUString ScreenshotTest::maCurrentLanguage
private

The current UI language.

Definition at line 30 of file screenshot_test.hxx.

Referenced by implSaveScreenshot(), and ScreenshotTest().

◆ maKnownDialogs

mapType ScreenshotTest::maKnownDialogs
private

the set of known dialogs and their ID for usage in createDialogByID

Definition at line 33 of file screenshot_test.hxx.

Referenced by createDialogByName(), and setUp().

◆ maParent

weld::GenericDialogController ScreenshotTest::maParent
private

parent for non-dialog buildables

Definition at line 36 of file screenshot_test.hxx.

◆ mxParentWidget

std::unique_ptr<weld::Container> ScreenshotTest::mxParentWidget
private

Definition at line 37 of file screenshot_test.hxx.

Referenced by dumpDialogToPath().


The documentation for this class was generated from the following files: