LibreOffice Module reportdesign (master) 1
Public Types | Public Member Functions | Private Attributes | List of all members
rptui::ReportFormula Class Reference

#include <reportformula.hxx>

Public Types

enum  BindType {
  Expression ,
  Field ,
  Invalid
}
 

Public Member Functions

 ReportFormula (const OUString &_rFormula)
 constructs a ReportFormula object from a string More...
 
 ReportFormula (const BindType _eType, const OUString &_rFieldOrExpression)
 constructs a ReportFormula by BindType More...
 
 ~ReportFormula ()
 
bool isValid () const
 returns whether the object denotes a valid formula More...
 
BindType getType () const
 returns the type of the binding represented by the formula More...
 
const OUString & getCompleteFormula () const
 returns the complete formula represented by the object More...
 
const OUString & getUndecoratedContent () const
 gets the undecorated formula content More...
 
OUString const & getFieldName () const
 convenience alias for getUndecoratedContent, which asserts (in a non-product build) when used on an expression More...
 
OUString getEqualUndecoratedContent () const
 
OUString const & getExpression () const
 convenience alias for getUndecoratedContent, which asserts (in a non-product build) when used on a field More...
 
OUString getBracketedFieldOrExpression () const
 returns a bracketed field name of the formula denotes a field reference, or the undecorated expression if the formula denotes an expression. More...
 

Private Attributes

BindType m_eType
 
OUString m_sCompleteFormula
 
OUString m_sUndecoratedContent
 

Detailed Description

Definition at line 35 of file reportformula.hxx.

Member Enumeration Documentation

◆ BindType

Enumerator
Expression 
Field 
Invalid 

Definition at line 38 of file reportformula.hxx.

Constructor & Destructor Documentation

◆ ReportFormula() [1/2]

rptui::ReportFormula::ReportFormula ( const OUString &  _rFormula)

constructs a ReportFormula object from a string

does it refer to a field?

Definition at line 38 of file reportformula.cxx.

References Expression, Field, Invalid, Invalid, m_eType, m_eType, m_sCompleteFormula, and m_sUndecoratedContent.

◆ ReportFormula() [2/2]

rptui::ReportFormula::ReportFormula ( const BindType  _eType,
const OUString &  _rFieldOrExpression 
)

constructs a ReportFormula by BindType

Definition at line 69 of file reportformula.cxx.

References Expression, Field, m_eType, m_eType, m_sCompleteFormula, m_sUndecoratedContent, and u.

◆ ~ReportFormula()

rptui::ReportFormula::~ReportFormula ( )

Definition at line 96 of file reportformula.cxx.

Member Function Documentation

◆ getBracketedFieldOrExpression()

OUString rptui::ReportFormula::getBracketedFieldOrExpression ( ) const

returns a bracketed field name of the formula denotes a field reference, or the undecorated expression if the formula denotes an expression.

Effectively, this means the method returns the complete formula, stripped by the prefix which indicates a field or an expression.

Definition at line 100 of file reportformula.cxx.

References Field, getType(), and getUndecoratedContent().

Referenced by rptui::Condition::fillFormatCondition(), rptui::ConditionUpdater::impl_adjustFormatConditions_nothrow(), and rptui::Condition::impl_setCondition().

◆ getCompleteFormula()

const OUString & rptui::ReportFormula::getCompleteFormula ( ) const
inline

◆ getEqualUndecoratedContent()

OUString rptui::ReportFormula::getEqualUndecoratedContent ( ) const
Returns
"=" + getFieldName()

Definition at line 115 of file reportformula.cxx.

References getUndecoratedContent().

◆ getExpression()

OUString const & rptui::ReportFormula::getExpression ( ) const
inline

convenience alias for getUndecoratedContent, which asserts (in a non-product build) when used on a field

Definition at line 107 of file reportformula.hxx.

References Expression, getType(), and getUndecoratedContent().

Referenced by rptui::ConditionUpdater::impl_adjustFormatConditions_nothrow(), and rptui::Condition::impl_setCondition().

◆ getFieldName()

OUString const & rptui::ReportFormula::getFieldName ( ) const
inline

convenience alias for getUndecoratedContent, which asserts (in a non-product build) when used on an expression

Definition at line 100 of file reportformula.hxx.

References Field, getType(), and getUndecoratedContent().

◆ getType()

BindType rptui::ReportFormula::getType ( ) const
inline

returns the type of the binding represented by the formula

Definition at line 63 of file reportformula.hxx.

References m_eType.

Referenced by getBracketedFieldOrExpression(), getExpression(), getFieldName(), rptui::Condition::impl_setCondition(), and isValid().

◆ getUndecoratedContent()

const OUString & rptui::ReportFormula::getUndecoratedContent ( ) const
inline

gets the undecorated formula content

If the formula denotes a field binding, the undecorated content is the field name.

If the formula denotes an expression, then the undecorated content is the expression itself.

Definition at line 77 of file reportformula.hxx.

Referenced by getBracketedFieldOrExpression(), getEqualUndecoratedContent(), getExpression(), getFieldName(), rptui::IMPL_LINK_NOARG(), rptui::lcl_getName(), and rptui::openDialogFormula_nothrow().

◆ isValid()

bool rptui::ReportFormula::isValid ( ) const

returns whether the object denotes a valid formula

Definition at line 113 of file reportformula.cxx.

References getType(), and Invalid.

Referenced by rptui::GeometryHandler::impl_convertToFormula(), and rptui::lcl_getName().

Member Data Documentation

◆ m_eType

BindType rptui::ReportFormula::m_eType
private

Definition at line 47 of file reportformula.hxx.

Referenced by ReportFormula().

◆ m_sCompleteFormula

OUString rptui::ReportFormula::m_sCompleteFormula
private

Definition at line 48 of file reportformula.hxx.

Referenced by ReportFormula().

◆ m_sUndecoratedContent

OUString rptui::ReportFormula::m_sUndecoratedContent
private

Definition at line 49 of file reportformula.hxx.

Referenced by ReportFormula().


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