LibreOffice Module sfx2 (master) 1
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
sfx2::sidebar::Context Class Reference

#include <Context.hxx>

Public Member Functions

 Context ()
 
 Context (OUString sApplication, OUString sContext)
 
sal_Int32 EvaluateMatch (const Context &rOther) const
 Return the numeric value that describes how good the match between two contexts is. More...
 
bool operator== (const Context &rOther) const
 
bool operator!= (const Context &rOther) const
 

Public Attributes

OUString msApplication
 
OUString msContext
 

Static Public Attributes

static const sal_Int32 NoMatch = 4
 When two contexts are matched against each other, then application or context name may have the wildcard value 'any'. More...
 
static const sal_Int32 OptimalMatch = 0
 
static const sal_Int32 ApplicationWildcardMatch = 1
 
static const sal_Int32 ContextWildcardMatch = 2
 

Detailed Description

Definition at line 27 of file Context.hxx.

Constructor & Destructor Documentation

◆ Context() [1/2]

sfx2::sidebar::Context::Context ( )

Definition at line 33 of file Context.cxx.

◆ Context() [2/2]

sfx2::sidebar::Context::Context ( OUString  sApplication,
OUString  sContext 
)

Definition at line 39 of file Context.cxx.

Member Function Documentation

◆ EvaluateMatch()

sal_Int32 sfx2::sidebar::Context::EvaluateMatch ( const Context rOther) const

Return the numeric value that describes how good the match between two contexts is.

Smaller values represent better matches.

Definition at line 47 of file Context.cxx.

References AnyApplicationName, AnyContextName, ApplicationWildcardMatch, ContextWildcardMatch, msApplication, msContext, and NoMatch.

Referenced by sfx2::sidebar::ContextList::FindBestMatch(), and sfx2::sidebar::ContextList::ToggleVisibilityForContext().

◆ operator!=()

bool sfx2::sidebar::Context::operator!= ( const Context rOther) const

Definition at line 71 of file Context.cxx.

References msApplication, and msContext.

◆ operator==()

bool sfx2::sidebar::Context::operator== ( const Context rOther) const

Definition at line 65 of file Context.cxx.

References msApplication, and msContext.

Member Data Documentation

◆ ApplicationWildcardMatch

const sal_Int32 sfx2::sidebar::Context::ApplicationWildcardMatch = 1
static

◆ ContextWildcardMatch

const sal_Int32 sfx2::sidebar::Context::ContextWildcardMatch = 2
static

◆ msApplication

OUString sfx2::sidebar::Context::msApplication

◆ msContext

OUString sfx2::sidebar::Context::msContext

◆ NoMatch

const sal_Int32 sfx2::sidebar::Context::NoMatch = 4
static

When two contexts are matched against each other, then application or context name may have the wildcard value 'any'.

In order to prefer matches without wildcards over matches with wildcards we introduce an integer evaluation for matches.

Definition at line 41 of file Context.hxx.

Referenced by EvaluateMatch(), and sfx2::sidebar::ContextList::FindBestMatch().

◆ OptimalMatch

const sal_Int32 sfx2::sidebar::Context::OptimalMatch = 0
static

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