#include <Cell.h>
Public Member Functions | |
| void | afterRestore () |
| Cell (const App::CellAddress &_address, PropertySheet *_owner) | |
| Construct a CellContent object. More... | |
| Cell (PropertySheet *_owner, const Cell &other) | |
| void | clearDirty () |
| void | clearException () |
| void | clearResolveException () |
| App::CellAddress | getAddress () const |
| bool | getAlias (std::string &n) const |
| bool | getAlignment (int &_alignment) const |
| Get alignment. More... | |
| bool | getBackground (App::Color &color) const |
| Get the background color of the cell into color. More... | |
| bool | getComputedUnit (Base::Unit &unit) const |
| Get the computed unit into unit. More... | |
| bool | getDisplayUnit (DisplayUnit &unit) const |
| Get the display unit for the cell into unit. More... | |
| const std::string & | getException () const |
| const App::Expression * | getExpression (bool withFormat=false) const |
| Get the expression tree. More... | |
| bool | getForeground (App::Color &color) const |
| Get foreground color of the cell. More... | |
| std::string | getFormattedQuantity (void) |
| bool | getSpans (int &rows, int &columns) const |
| Get the row and column spans for the cell into rows and columns. More... | |
| bool | getStringContent (std::string &s, bool persistent=false) const |
| Get string content. More... | |
| bool | getStyle (std::set< std::string > &style) const |
| Get the style of the cell. More... | |
| bool | hasException () const |
| bool | isMarked () const |
| bool | isUsed () const |
| Determine if the any of the contents of the cell is set a non-default value. More... | |
| void | mark () |
| void | moveAbsolute (App::CellAddress newAddress) |
| Move the cell to a new position given by _row and _col. More... | |
| Cell & | operator= (const Cell &rhs) |
| void | restore (Base::XMLReader &reader, bool checkAlias=false) |
| Restore cell contents from reader. More... | |
| void | save (Base::Writer &writer) const |
| Save cell contents into writer. More... | |
| void | save (std::ostream &os, const char *indent, bool noContent) const |
| void | setAlias (const std::string &n) |
| void | setAlignment (int _alignment) |
| Set alignment of this cell. More... | |
| void | setBackground (const App::Color &color) |
| Set background color of the cell to color. More... | |
| void | setComputedUnit (const Base::Unit &unit) |
| Set the computed unit for the cell to unit. More... | |
| void | setContent (const char *value) |
| void | setDirty () |
| void | setDisplayUnit (const std::string &unit) |
| Set the display unit for the cell. More... | |
| void | setException (const std::string &e, bool silent=false) |
| void | setForeground (const App::Color &color) |
| Set foreground (i.e text) color of the cell to color. More... | |
| void | setResolveException (const std::string &e) |
| void | setSpans (int rows, int columns) |
| Set the cell's row and column span to rows and columns. More... | |
| void | setStyle (const std::set< std::string > &_style) |
| Set style to the given set _style. More... | |
| bool | spansChanged () const |
| void | visit (App::ExpressionVisitor &v) |
| ~Cell () | |
| Destroy a CellContent object. More... | |
Static Public Member Functions | |
| static int | decodeAlignment (const std::string &itemStr, int alignment) |
| Decode alignment into its internal value. More... | |
| static App::Color | decodeColor (const std::string &color, const App::Color &defaultColor) |
| Decode a string of the format #rrggbb or #rrggbbaa into a Color. More... | |
| static std::string | encodeAlignment (int alignment) |
| Encode internal alignment value as a string. More... | |
| static std::string | encodeColor (const App::Color &color) |
| Encode color as a #rrggbbaa string. More... | |
| static std::string | encodeStyle (const std::set< std::string > &style) |
| Encode set of styles as a string. More... | |
Static Public Attributes | |
| static const int | ALIGNMENT_BOTTOM = 0x40 |
| static const int | ALIGNMENT_HCENTER = 0x02 |
| static const int | ALIGNMENT_HIMPLIED = 0x08 |
| static const int | ALIGNMENT_HORIZONTAL = 0x0f |
| static const int | ALIGNMENT_LEFT = 0x01 |
| static const int | ALIGNMENT_RIGHT = 0x04 |
| static const int | ALIGNMENT_TOP = 0x10 |
| static const int | ALIGNMENT_VCENTER = 0x20 |
| static const int | ALIGNMENT_VERTICAL = 0xf0 |
| static const int | ALIGNMENT_VIMPLIED = 0x80 |
Friends | |
| class | PropertySheet |
| Cell::Cell | ( | const App::CellAddress & | _address, |
| PropertySheet * | _owner | ||
| ) |
Construct a CellContent object.
| _address | The address of the cell (i.e. row and column) |
| _owner | The spreadsheet that owns this cell. |
| Cell::Cell | ( | PropertySheet * | _owner, |
| const Cell & | other | ||
| ) |
References setAlias(), and setDirty().
| Cell::~Cell | ( | ) |
Destroy a CellContent object.
Referenced by decodeAlignment().
| void Cell::afterRestore | ( | ) |
References setContent().
| void Cell::clearDirty | ( | ) |
References Spreadsheet::PropertySheet::clearDirty().
| void Cell::clearException | ( | ) |
Referenced by setContent().
| void Cell::clearResolveException | ( | ) |
Decode alignment into its internal value.
| itemStr | Alignment as a string |
| alignment | Current alignment. This is or'ed with the one in itemStr. |
References ALIGNMENT_BOTTOM, ALIGNMENT_HCENTER, ALIGNMENT_HIMPLIED, ALIGNMENT_HORIZONTAL, ALIGNMENT_LEFT, ALIGNMENT_RIGHT, ALIGNMENT_TOP, ALIGNMENT_VCENTER, ALIGNMENT_VERTICAL, ALIGNMENT_VIMPLIED, and ~Cell().
Referenced by restore().
|
static |
Decode a string of the format #rrggbb or #rrggbbaa into a Color.
| color | The color to decode. |
| defaultColor | A default color in case the decoding fails. |
Referenced by restore().
|
static |
Encode internal alignment value as a string.
| alignment | Alignment as a binary value. |
References ALIGNMENT_BOTTOM, ALIGNMENT_HCENTER, ALIGNMENT_HIMPLIED, ALIGNMENT_LEFT, ALIGNMENT_RIGHT, ALIGNMENT_TOP, ALIGNMENT_VCENTER, ALIGNMENT_VERTICAL, and ALIGNMENT_VIMPLIED.
Referenced by save().
|
static |
Encode color as a #rrggbbaa string.
| color | Color to encode. |
Referenced by save().
|
static |
Encode set of styles as a string.
| style | Set of string describing the style. |
Referenced by save().
| App::CellAddress Spreadsheet::Cell::getAddress | ( | ) | const |
| bool Cell::getAlias | ( | std::string & | n | ) | const |
References isUsed().
Referenced by SpreadsheetGui::SheetModel::data(), SpreadsheetGui::PropertiesDialog::PropertiesDialog(), and Spreadsheet::PropertySheet::setAlias().
Get alignment.
References isUsed().
Referenced by SpreadsheetGui::SheetModel::data(), Drawing::FeatureViewSpreadsheet::execute(), TechDraw::DrawViewSpreadsheet::getSheetImage(), and SpreadsheetGui::PropertiesDialog::PropertiesDialog().
| bool Cell::getBackground | ( | App::Color & | color | ) | const |
Get the background color of the cell into color.
References isUsed().
Referenced by SpreadsheetGui::SheetModel::data(), Drawing::FeatureViewSpreadsheet::execute(), TechDraw::DrawViewSpreadsheet::getSheetImage(), and SpreadsheetGui::PropertiesDialog::PropertiesDialog().
| bool Cell::getComputedUnit | ( | Base::Unit & | unit | ) | const |
Get the computed unit into unit.
References isUsed().
| bool Cell::getDisplayUnit | ( | DisplayUnit & | unit | ) | const |
Get the display unit for the cell into unit.
References isUsed().
Referenced by SpreadsheetGui::SheetModel::data(), getFormattedQuantity(), and SpreadsheetGui::PropertiesDialog::PropertiesDialog().
| const std::string & Spreadsheet::Cell::getException | ( | ) | const |
Referenced by SpreadsheetGui::SheetModel::data().
| const App::Expression * Cell::getExpression | ( | bool | withFormat = false | ) | const |
Get the expression tree.
References save().
Referenced by SpreadsheetGui::SheetModel::data(), SpreadsheetGui::DlgSheetConf::prepare(), and Spreadsheet::Sheet::updateProperty().
| bool Cell::getForeground | ( | App::Color & | color | ) | const |
Get foreground color of the cell.
References isUsed().
Referenced by SpreadsheetGui::SheetModel::data(), Drawing::FeatureViewSpreadsheet::execute(), TechDraw::DrawViewSpreadsheet::getSheetImage(), and SpreadsheetGui::PropertiesDialog::PropertiesDialog().
| std::string Cell::getFormattedQuantity | ( | void | ) |
References Base::Tools::fromStdString(), getAddress(), Base::Persistence::getClassTypeId(), Base::UnitsApi::getDecimals(), getDisplayUnit(), Spreadsheet::Sheet::getPropertyByName(), App::PropertyQuantity::getUnit(), App::PropertyString::getValue(), Base::BaseClass::isDerivedFrom(), Base::Unit::isEmpty(), Spreadsheet::DisplayUnit::scaler, Spreadsheet::PropertySheet::sheet(), Spreadsheet::DisplayUnit::stringRep, Base::Tools::toStdString(), App::CellAddress::toString(), and Spreadsheet::DisplayUnit::unit.
Referenced by TechDraw::DrawViewSpreadsheet::getSheetImage().
Get the row and column spans for the cell into rows and columns.
References isUsed().
Referenced by Drawing::FeatureViewSpreadsheet::execute(), TechDraw::DrawViewSpreadsheet::getSheetImage(), Spreadsheet::PropertySheet::getSpans(), Spreadsheet::PropertySheet::Restore(), and Spreadsheet::PropertySheet::splitCell().
Get string content.
References draftfunctions.svgtext::getText().
Referenced by SpreadsheetGui::SheetModel::data(), Spreadsheet::Sheet::recomputeCell(), save(), SpreadsheetGui::SheetModel::setData(), and Spreadsheet::Sheet::updateProperty().
| bool Cell::getStyle | ( | std::set< std::string > & | style | ) | const |
Get the style of the cell.
References isUsed().
Referenced by SpreadsheetGui::SheetModel::data(), Drawing::FeatureViewSpreadsheet::execute(), TechDraw::DrawViewSpreadsheet::getSheetImage(), and SpreadsheetGui::PropertiesDialog::PropertiesDialog().
| bool Spreadsheet::Cell::hasException | ( | ) | const |
Referenced by SpreadsheetGui::SheetModel::data(), and Spreadsheet::Sheet::recomputeCell().
| bool Spreadsheet::Cell::isMarked | ( | ) | const |
Referenced by Spreadsheet::PropertySheet::Paste().
| bool Cell::isUsed | ( | ) | const |
Determine if the any of the contents of the cell is set a non-default value.
Referenced by SpreadsheetGui::SheetTableView::finishEditWithMove(), getAlias(), getAlignment(), getBackground(), getComputedUnit(), getDisplayUnit(), getForeground(), getSpans(), getStyle(), and save().
| void Spreadsheet::Cell::mark | ( | ) |
| void Cell::moveAbsolute | ( | App::CellAddress | newAddress | ) |
Move the cell to a new position given by _row and _col.
| void Cell::restore | ( | Base::XMLReader & | reader, |
| bool | checkAlias = false |
||
| ) |
Restore cell contents from reader.
References Spreadsheet::PropertySheet::AtomicPropertyChange, decodeAlignment(), decodeColor(), Base::XMLReader::getAttribute(), Base::XMLReader::hasAttribute(), setAlias(), setAlignment(), setBackground(), setContent(), setDisplayUnit(), setForeground(), setSpans(), and setStyle().
Referenced by Spreadsheet::PropertySheet::Restore().
| void Cell::save | ( | Base::Writer & | writer | ) | const |
Save cell contents into writer.
References Base::Writer::ind(), save(), and Base::Writer::Stream().
Referenced by getExpression(), Mod.Show.mTempoVis.TempoVis::modify(), Mod.Show.mTempoVis.TempoVis::modifyVPProperty(), draftguitools.gui_setstyle.Draft_SetStyle_TaskPanel::onSaveStyle(), save(), and Mod.Show.mTempoVis.TempoVis::saveCamera().
| void Cell::save | ( | std::ostream & | os, |
| const char * | indent, | ||
| bool | noContent | ||
| ) | const |
References encodeAlignment(), Base::Persistence::encodeAttribute(), encodeColor(), encodeStyle(), getStringContent(), isUsed(), and Spreadsheet::DisplayUnit::stringRep.
Referenced by Mod.Show.mTempoVis.TempoVis::modify(), Mod.Show.mTempoVis.TempoVis::modifyVPProperty(), draftguitools.gui_setstyle.Draft_SetStyle_TaskPanel::onSaveStyle(), and Mod.Show.mTempoVis.TempoVis::saveCamera().
| void Cell::setAlias | ( | const std::string & | n | ) |
| void Cell::setAlignment | ( | int | _alignment | ) |
Set alignment of this cell.
Alignment is the or'ed value of vertical and horizontal alignment, given by the constants defined in the class.
References ALIGNMENT_HIMPLIED, ALIGNMENT_LEFT, ALIGNMENT_VCENTER, ALIGNMENT_VIMPLIED, Spreadsheet::PropertySheet::AtomicPropertyChange, and setDirty().
Referenced by operator=(), restore(), and Spreadsheet::PropertySheet::setAlignment().
| void Cell::setBackground | ( | const App::Color & | color | ) |
Set background color of the cell to color.
References Spreadsheet::PropertySheet::AtomicPropertyChange, and setDirty().
Referenced by operator=(), restore(), and Spreadsheet::PropertySheet::setBackground().
| void Cell::setComputedUnit | ( | const Base::Unit & | unit | ) |
Set the computed unit for the cell to unit.
References Spreadsheet::PropertySheet::AtomicPropertyChange, Base::Unit::isEmpty(), and setDirty().
Referenced by operator=(), and Spreadsheet::PropertySheet::setComputedUnit().
| void Cell::setContent | ( | const char * | value | ) |
References Spreadsheet::PropertySheet::AtomicPropertyChange, clearException(), App::DocumentObject::isRestoring(), draftfunctions.move::move(), App::ExpressionParser::parse(), and Spreadsheet::PropertySheet::sheet().
Referenced by afterRestore(), Spreadsheet::Sheet::recomputeCell(), restore(), and Spreadsheet::PropertySheet::setContent().
| void Cell::setDirty | ( | ) |
References Spreadsheet::PropertySheet::setDirty().
Referenced by PathScripts.PathOpGui.TaskPanelBaseGeometryPage::addBase(), Cell(), PathScripts.PathOpGui.TaskPanelBaseGeometryPage::clearBase(), PathScripts.PathOpGui.TaskPanelBaseGeometryPage::deleteBase(), PathScripts.PathOpGui.TaskPanelDepthsPage::depthSet(), PathScripts.PathFeatureExtensionsGui.TaskPanelExtensionPage::extensionsClear(), operator=(), PathScripts.PathOpGui.TaskPanelPage::pageGetFields(), setAlias(), setAlignment(), setBackground(), setComputedUnit(), setDisplayUnit(), PathScripts.PathThreadMillingGui.TaskPanelOpPage::setFields(), setForeground(), setSpans(), setStyle(), PathScripts.PathDressupPathBoundaryGui.TaskPanel::setupUi(), PathScripts.PathFeatureExtensionsGui.TaskPanelExtensionPage::toggleExtensionCorners(), and PathScripts.PathFeatureExtensionsGui.TaskPanelExtensionPage::updateItemEnabled().
| void Cell::setDisplayUnit | ( | const std::string & | unit | ) |
Set the display unit for the cell.
References Spreadsheet::PropertySheet::AtomicPropertyChange, Spreadsheet::DisplayUnit::isEmpty(), setDirty(), and Spreadsheet::PropertySheet::sheet().
Referenced by operator=(), restore(), and Spreadsheet::PropertySheet::setDisplayUnit().
| void Cell::setException | ( | const std::string & | e, |
| bool | silent = false |
||
| ) |
References App::DocumentObject::getFullName(), and Spreadsheet::PropertySheet::sheet().
Referenced by Spreadsheet::Sheet::execute(), and Spreadsheet::Sheet::recomputeCell().
| void Cell::setForeground | ( | const App::Color & | color | ) |
Set foreground (i.e text) color of the cell to color.
References Spreadsheet::PropertySheet::AtomicPropertyChange, and setDirty().
Referenced by operator=(), restore(), and Spreadsheet::PropertySheet::setForeground().
| void Cell::setResolveException | ( | const std::string & | e | ) |
References App::DocumentObject::getFullName(), and Spreadsheet::PropertySheet::sheet().
Referenced by Spreadsheet::PropertySheet::invalidateDependants().
Set the cell's row and column span to rows and columns.
This is done when cells are merged.
References Spreadsheet::PropertySheet::AtomicPropertyChange, and setDirty().
Referenced by operator=(), Spreadsheet::PropertySheet::pasteCells(), restore(), and Spreadsheet::PropertySheet::setSpans().
| void Cell::setStyle | ( | const std::set< std::string > & | _style | ) |
Set style to the given set _style.
References Spreadsheet::PropertySheet::AtomicPropertyChange, and setDirty().
Referenced by operator=(), restore(), and Spreadsheet::PropertySheet::setStyle().
| bool Spreadsheet::Cell::spansChanged | ( | ) | const |
Referenced by Spreadsheet::Sheet::recomputeCell().
| void Cell::visit | ( | App::ExpressionVisitor & | v | ) |
|
friend |
|
static |
Referenced by decodeAlignment(), and encodeAlignment().
|
static |
|
static |
Referenced by decodeAlignment(), encodeAlignment(), and setAlignment().
|
static |
Referenced by decodeAlignment().
|
static |
|
static |
|
static |
Referenced by decodeAlignment(), and encodeAlignment().
|
static |
Referenced by decodeAlignment(), encodeAlignment(), and setAlignment().
|
static |
Referenced by decodeAlignment(), and encodeAlignment().
|
static |
Referenced by decodeAlignment(), encodeAlignment(), and setAlignment().