LibreOffice Module framework (master) 1
Public Types | Static Public Member Functions | List of all members
framework::TargetHelper Class Reference

can be used to detect, if a target name (used e.g. More...

#include <targethelper.hxx>

Public Types

enum class  ESpecialTarget {
  Blank ,
  Default ,
  Beamer ,
  HelpTask
}
 it's used at the following interfaces to classify target names. More...
 

Static Public Member Functions

static bool matchSpecialTarget (std::u16string_view sCheckTarget, ESpecialTarget eSpecialTarget)
 it checks the given unknown target name, if it's the expected special one. More...
 
static bool isValidNameForFrame (std::u16string_view sName)
 it checks, if the given name can be used to set it at a frame using XFrame.setName() method. More...
 

Detailed Description

can be used to detect, if a target name (used e.g.

for XFrame.findFrame()) has a special meaning or can be used as normal frame name (e.g. for XFrame.setName()).

Definition at line 29 of file targethelper.hxx.

Member Enumeration Documentation

◆ ESpecialTarget

it's used at the following interfaces to classify target names.

Enumerator
Blank 
Default 
Beamer 
HelpTask 

Definition at line 37 of file targethelper.hxx.

Member Function Documentation

◆ isValidNameForFrame()

bool framework::TargetHelper::isValidNameForFrame ( std::u16string_view  sName)
static

it checks, if the given name can be used to set it at a frame using XFrame.setName() method.

@descr Because we handle special targets in a hard coded way (means we do not check the real name of a frame then) such named frames will never be found!

And in case such special names can exists one times only by definition inside the same frame tree (e.g. _beamer and OFFICE_HELP_TASK) it's not a good idea to allow anything here :-)

Of course we can't check unknown names, which are not special ones. But we decide, that it's not allowed to use "_" as first sign (because we reserve this letter for our own purposes!) and the value must not a well known special target.

Parameters
sNamethe new frame name, which should be checked.

Definition at line 46 of file targethelper.cxx.

References Beamer, HelpTask, matchSpecialTarget(), and sName.

Referenced by framework::LoadEnv::impl_reactForLoadingState().

◆ matchSpecialTarget()

bool framework::TargetHelper::matchSpecialTarget ( std::u16string_view  sCheckTarget,
ESpecialTarget  eSpecialTarget 
)
static

it checks the given unknown target name, if it's the expected special one.

Note
An empty target is similar to "_self"!
Parameters
sCheckTargetmust be the unknown target name, which should be checked.
eSpecialTargetrepresent the expected target.
Returns
It returns <TRUE> if sCheckTarget represent the expected eSpecialTarget value; <FALSE> otherwise.

Definition at line 25 of file targethelper.cxx.

References Beamer, Blank, Default, HelpTask, framework::SPECIALTARGET_BEAMER, framework::SPECIALTARGET_BLANK, framework::SPECIALTARGET_DEFAULT, and framework::SPECIALTARGET_HELPTASK.

Referenced by framework::LoadEnv::impl_loadContent(), framework::LoadEnv::impl_searchAlreadyLoaded(), and isValidNameForFrame().


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