QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
NumerotationContext Class Reference

#include <numerotationcontext.h>

Collaboration diagram for NumerotationContext:
Collaboration graph

Public Member Functions

 NumerotationContext ()
 NumerotationContext (QDomElement &)
void clear ()
 NumerotationContext::clear, clear the content.
bool addValue (const QString &, const QVariant &=QVariant(1), const int=1, const int=0, const int=0, const QString &=QString())
 NumerotationContext::addValue add a new value on the contexte.
QString operator[] (const int &) const
 NumerotationContext::operator [].
void operator<< (const NumerotationContext &)
 NumerotationContext::operator << , append other.
int size () const
 NumerotationContext::size.
bool isEmpty () const
 NumerotationContext::isEmpty.
QStringList itemAt (const int) const
 NumerotationContext::itemAt.
QString validRegExpNum () const
 validRegExpNum
QString validRegExpNumber () const
 NumerotationContext::validRegExpNumber.
bool keyIsAcceptable (const QString &) const
 NumerotationContext::keyIsAcceptable.
bool keyIsNumber (const QString &) const
 NumerotationContext::keyIsNumber.
QDomElement toXml (QDomDocument &, const QString &)
 NumerotationContext::toXml Save the numerotation context in a QDomElement under the element name str.
void fromXml (QDomElement &)
 NumerotationContext::fromXml load numerotation context from e.
void replaceValue (int, QString)
 NumerotationContext::replaceValue This class replaces the current NC field value with content.
void replaceIncrease (int, int)
 NumerotationContext::replaceIncrease Change how much this part advances per step, leaving its current value, initial value, modulus and format untouched. Sibling to replaceValue(), which deliberately never touches this field.

Static Public Member Functions

static QString formatOf (const QStringList &item)
 NumerotationContext::formatOf.
static QString formatValue (const QStringList &item)
 NumerotationContext::formatValue.

Private Attributes

QStringList content_

Detailed Description

This class represents a numerotation context, i.e. the data (type, value, increase) of a numerotation at a given time. It is notably used by conductor to store the informations they need to do their autonumerotation.

Constructor & Destructor Documentation

◆ NumerotationContext() [1/2]

NumerotationContext::NumerotationContext ( )

Constructor

Here is the caller graph for this function:

◆ NumerotationContext() [2/2]

NumerotationContext::NumerotationContext ( QDomElement & e)

Constructor from xml

Here is the call graph for this function:

Member Function Documentation

◆ addValue()

bool NumerotationContext::addValue ( const QString & type,
const QVariant & value = QVariant(1),
const int increase = 1,
const int initialvalue = 0,
const int modulus = 0,
const QString & format = QString() )

NumerotationContext::addValue add a new value on the contexte.

Parameters
typethe type of value
valuethe value itself
increasethe increase number of value
initialvalue
moduluswrap-and-carry modulus (0 means "not a wrapping part")
formatzero-padding mask, spreadsheet style: "00" pads to two digits, "000" to three. Empty keeps the part type's natural width, so an absent format reproduces exactly the behaviour of every context written before this field existed.
Returns
true if value is append
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear()

void NumerotationContext::clear ( )

NumerotationContext::clear, clear the content.

Here is the caller graph for this function:

◆ formatOf()

QString NumerotationContext::formatOf ( const QStringList & item)
static

NumerotationContext::formatOf.

Zero-padding mask of a part, e.g. "00"; empty means the type's own natural width. See addValue().

Parameters
item: a context item as returned by itemAt()
Returns
the part's zero-padding mask, or an empty string when it has none – which every context written before the field existed will be.
Here is the caller graph for this function:

◆ formatValue()

QString NumerotationContext::formatValue ( const QStringList & item)
static

NumerotationContext::formatValue.

Zero-pad a part's value the same way the real numbering engine does (autonum::setSequentialToList in assignvariables.cpp), so a UI preview of a part's value matches what actually gets rendered.

Parameters
item: a context item as returned by itemAt()
Returns
the part's value, zero-padded exactly as autonum::setSequentialToList() pads it when composing a real label: an explicit format mask wins, then "ten"/"hundred" parts get their implicit 2/3-digit width, "alpha" is used as-is, everything else is a plain number. Kept in step with that function by hand since the two cannot share code without exposing an assignvariables.cpp-local helper.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fromXml()

void NumerotationContext::fromXml ( QDomElement & e)

NumerotationContext::fromXml load numerotation context from e.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isEmpty()

bool NumerotationContext::isEmpty ( ) const

NumerotationContext::isEmpty.

Returns
true if numerotation content is empty
Here is the caller graph for this function:

◆ itemAt()

QStringList NumerotationContext::itemAt ( const int i) const

NumerotationContext::itemAt.

Parameters
i
Returns
the content at position i 1:type 2:value 3:increase
Here is the caller graph for this function:

◆ keyIsAcceptable()

bool NumerotationContext::keyIsAcceptable ( const QString & type) const

NumerotationContext::keyIsAcceptable.

Returns
true if type is acceptable
Here is the call graph for this function:
Here is the caller graph for this function:

◆ keyIsNumber()

bool NumerotationContext::keyIsNumber ( const QString & type) const

NumerotationContext::keyIsNumber.

Returns
true if type represents a number
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator<<()

void NumerotationContext::operator<< ( const NumerotationContext & other)

NumerotationContext::operator << , append other.

Here is the call graph for this function:

◆ operator[]()

QString NumerotationContext::operator[] ( const int & i) const

NumerotationContext::operator [].

Parameters
i
Returns
the string at position i

◆ replaceIncrease()

void NumerotationContext::replaceIncrease ( int index,
int increase )

NumerotationContext::replaceIncrease Change how much this part advances per step, leaving its current value, initial value, modulus and format untouched. Sibling to replaceValue(), which deliberately never touches this field.

Parameters
indexof NC item
increasenew increase for that item
Here is the caller graph for this function:

◆ replaceValue()

void NumerotationContext::replaceValue ( int index,
QString content )

NumerotationContext::replaceValue This class replaces the current NC field value with content.

Parameters
indexof NC Item
contentto replace current value
Here is the caller graph for this function:

◆ size()

int NumerotationContext::size ( ) const

NumerotationContext::size.

Returns
size of context
Here is the caller graph for this function:

◆ toXml()

QDomElement NumerotationContext::toXml ( QDomDocument & d,
const QString & str )

NumerotationContext::toXml Save the numerotation context in a QDomElement under the element name str.

Here is the call graph for this function:

◆ validRegExpNum()

QString NumerotationContext::validRegExpNum ( ) const

validRegExpNum

Returns
all type use to numerotation
Here is the caller graph for this function:

◆ validRegExpNumber()

QString NumerotationContext::validRegExpNumber ( ) const

NumerotationContext::validRegExpNumber.

Returns
all type represents a number
Here is the caller graph for this function:

Member Data Documentation

◆ content_

QStringList NumerotationContext::content_
private

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