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 (const OString &rUIXMLDescription)
 fallback version for dialogs for which only the UXMLDescription is known. More...
 
void processAllKnownDialogs ()
 helper to process all known dialogs More...
 
void processDialogBatchFile (const OUString &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_STATIC_LINK (BootstrapFixture, ImplInitFilterHdl, ConvertData &, bool)
 
 BootstrapFixture (bool bAssertOnDialog=true, bool bNeedUCB=true)
 
virtual ~BootstrapFixture () 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 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 OString &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 unotest::MacrosTest
static void dispatchCommand (const css::uno::Reference< css::lang::XComponent > &xComponent, const OUString &rCommand, const css::uno::Sequence< css::beans::PropertyValue > &rPropertyValues)
 
- 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 25 of file screenshot_test.hxx.

Constructor & Destructor Documentation

ScreenshotTest::ScreenshotTest ( )

Definition at line 45 of file screenshot_test.cxx.

References maCurrentLanguage.

ScreenshotTest::~ScreenshotTest ( )
overridevirtual

Definition at line 53 of file screenshot_test.cxx.

Member Function Documentation

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().

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 126 of file screenshot_test.cxx.

References createDialogByID(), and maKnownDialogs.

Referenced by processDialogBatchFile().

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

helper method to create and dump a dialog based on Builder contents.

Definition at line 162 of file screenshot_test.cxx.

References weld::Builder::create_screenshot_window(), i, saveScreenshot(), weld::Widget::set_help_id(), and weld::Builder::weld_notebook().

Referenced by dumpDialogToPath(), processAllKnownDialogs(), and processDialogBatchFile().

void ScreenshotTest::dumpDialogToPath ( VclAbstractDialog rDialog)

version for AbstractDialogs, the ones created in AbstractDialogFactories

Definition at line 138 of file screenshot_test.cxx.

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

void ScreenshotTest::dumpDialogToPath ( const OString &  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 198 of file screenshot_test.cxx.

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

const mapType& ScreenshotTest::getKnownDialogs ( ) const
inline

const access to known dialogs

Definition at line 90 of file screenshot_test.hxx.

Referenced by processAllKnownDialogs().

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

helper to process all known dialogs

Definition at line 223 of file screenshot_test.cxx.

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

void ScreenshotTest::processDialogBatchFile ( const OUString &  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 243 of file screenshot_test.cxx.

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

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().

void ScreenshotTest::saveScreenshot ( VclAbstractDialog const &  rDialog)
private
void ScreenshotTest::saveScreenshot ( weld::Window rDialog)
private
void ScreenshotTest::setUp ( )
overridevirtual

Member Data Documentation

OUString ScreenshotTest::maCurrentLanguage
private

The current UI language.

Definition at line 29 of file screenshot_test.hxx.

Referenced by implSaveScreenshot(), and ScreenshotTest().

mapType ScreenshotTest::maKnownDialogs
private

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

Definition at line 32 of file screenshot_test.hxx.

Referenced by createDialogByName(), and setUp().

weld::GenericDialogController ScreenshotTest::maParent
private

parent for non-dialog buildables

Definition at line 35 of file screenshot_test.hxx.

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

Definition at line 36 of file screenshot_test.hxx.

Referenced by dumpDialogToPath().


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