#include <Sheet.h>
Public Member Functions | |
void clear (App::CellAddress address, bool all=true) | |
Clear the cell at address. More... | |
void clearAll () | |
Clear all cells in the sheet. More... | |
std::set< std::string > dependsOn (App::CellAddress address) const | |
Return a set of dependencies links for cell at address. More... | |
App::DocumentObjectExecReturn * execute (void) | |
Update the document properties. More... | |
bool exportToFile (const std::string &filename, char delimiter='\t', char quoteChar='\0', char escapeChar='\\') const | |
Export spreadsheet data to file. More... | |
std::string getAddressFromAlias (const std::string &alias) const | |
Get cell given an alias string. More... | |
Cell * getCell (App::CellAddress address) | |
Get contents of the cell specified by address, or 0 if it is not defined. More... | |
bool getCellAddress (const App::Property *prop, App::CellAddress &address) | |
Get the address as address of the Property prop. More... | |
PropertySheet * getCells () | |
std::string getColumn (int offset=0) const | |
int getColumnWidth (int col) const | |
Get column with of column at index col. More... | |
std::map< int, int > getColumnWidths () const | |
Get a map with column indices and widths. More... | |
Cell * getNewCell (App::CellAddress address) | |
Get cell contents specified by address. More... | |
App::Property * getPropertyByName (const char *name) const | |
Retrieve a specific Property given by name. More... | |
PyObject * getPyObject () | |
Get the Python object for the Sheet. More... | |
std::string getRow (int offset=0) const | |
int getRowHeight (int row) const | |
Get height of row at index row. More... | |
std::map< int, int > getRowHeights () const | |
Get a map with row indices and heights. More... | |
void getSpans (App::CellAddress address, int &rows, int &cols) const | |
Get row an column span for the cell at (row, col). More... | |
std::vector< std::string > getUsedCells () const | |
Get a vector of strings with addresses of all used cells. More... | |
virtual const char * getViewProviderName (void) const | |
returns the type name of the ViewProvider More... | |
bool hasCell (const std::vector< App::Range > &ranges) const | |
bool importFromFile (const std::string &filename, char delimiter='\t', char quoteChar='\0', char escapeChar='\\') | |
Import a file into the spreadsheet object. More... | |
void insertColumns (int col, int count) | |
Insert count columns at before column col in the spreadsheet. More... | |
void insertRows (int row, int count) | |
Inser count rows at row row. More... | |
bool isMergedCell (App::CellAddress address) const | |
Determine whether this cell is merged with another or not. More... | |
bool isValidAlias (const std::string &candidate) | |
Determine whether a given alias candidate is valid or not. More... | |
bool mergeCells (const App::Range &range) | |
Merge a rectangle specified by range into one logical cell. More... | |
virtual short mustExecute (void) const | |
Determine whether this object needs to be executed to update internal structures. More... | |
void observeDocument (App::Document *document) | |
Create a document observer for this sheet. More... | |
void providesTo (App::CellAddress address, std::set< std::string > &result) const | |
Compute links to cells that cell at address provides input to. More... | |
void removeColumns (int col, int count) | |
Remove count columns at column col. More... | |
void removeRows (int row, int count) | |
Remove count rows starting at row from the spreadsheet. More... | |
virtual void renameObjectIdentifiers (const std::map< App::ObjectIdentifier, App::ObjectIdentifier > &paths) | |
void setAlias (App::CellAddress address, const std::string &alias) | |
Set alias for cell at address address to alias. More... | |
void setAlignment (App::CellAddress address, int alignment) | |
Set alignment of content in cell at address to alignment. More... | |
void setBackground (App::CellAddress address, const App::Color &color) | |
Set background color of cell at address address to color. More... | |
void setCell (App::CellAddress address, const char *value) | |
Set cell at address to value. More... | |
void setCell (const char *address, const char *value) | |
Set cell given by address to contents. More... | |
void setColumnWidth (int col, int width) | |
Set column with of column col to width-. More... | |
void setComputedUnit (App::CellAddress address, const Base::Unit &unit) | |
Set computed unit for cell at address address to unit. More... | |
void setContent (App::CellAddress address, const char *value) | |
Set content of cell at address to value. More... | |
void setDisplayUnit (App::CellAddress address, const std::string &unit) | |
Set display unit of cell at address address to unit. More... | |
void setForeground (App::CellAddress address, const App::Color &color) | |
Set foreground (text color) of cell at address address to color. More... | |
void setRowHeight (int row, int height) | |
Set row height of row given by index in row to height. More... | |
void setSpans (App::CellAddress address, int rows, int columns) | |
Set row and column span for the cell at address address to rows and columns. More... | |
void setStyle (App::CellAddress address, const std::set< std::string > &style) | |
Set style of cell at address to style. More... | |
Sheet () | |
Constructor. More... | |
void splitCell (App::CellAddress address) | |
Split a previously merged cell specified by address into its individual cells. More... | |
void touchCells (App::Range range) | |
virtual ~Sheet () | |
Sheet::~Sheet. More... | |
![]() | |
virtual App::Property * addDynamicProperty (const char *type, const char *name=0, const char *group=0, const char *doc=0, short attr=0, bool ro=false, bool hidden=false) override | |
virtual bool adjustRelativeLinks (const std::set< App::DocumentObject * > &inList, std::set< App::DocumentObject * > *visited=0) | |
Called to adjust link properties to avoid cyclic links. More... | |
virtual bool allowDuplicateLabel () const | |
virtual bool canLinkProperties () const | |
virtual int canLoadPartial () const | |
allow partial loading of dependent objects More... | |
void clearOutListCache () const | |
clear internal out list cache More... | |
virtual const char * detachFromDocument () override | |
DocumentObject (void) | |
Constructor. More... | |
void enforceRecompute () | |
Enforce this document object to be recomputed. More... | |
App::Document * getDocument (void) const | |
gets the document in which this Object is handled More... | |
std::string getExportName (bool forced=false) const | |
returns the name that is safe to be exported to other document More... | |
virtual const PropertyExpressionEngine::ExpressionInfo getExpression (const ObjectIdentifier &path) const | |
virtual std::string getFullName () const override | |
Return the object full name of the form DocName::ObjName. More... | |
DocumentObjectGroup * getGroup () const | |
get group if object is part of a group, otherwise 0 is returned More... | |
long getID () const | |
Return the object ID that is unique within its owner document. More... | |
const std::vector< App::DocumentObject * > & getInList (void) const | |
std::set< App::DocumentObject * > getInListEx (bool recursive) const | |
Return a set of all objects linking to this object, including possible external parent objects. More... | |
void getInListEx (std::set< App::DocumentObject * > &inSet, bool recursive, std::vector< App::DocumentObject * > *inList=0) const | |
Get a set of all objects linking to this object, including possible external parent objects. More... | |
std::vector< App::DocumentObject * > getInListRecursive (void) const | |
get all objects link directly or indirectly to this object More... | |
virtual DocumentObject * getLinkedObject (bool recurse=true, Base::Matrix4D *mat=0, bool transform=false, int depth=0) const | |
Return the linked object with optional transformation. More... | |
const char * getNameInDocument (void) const | |
returns the name which is set in the document for this object (not the name property!) More... | |
const std::string & getOldLabel () const | |
const std::vector< App::DocumentObject * > & getOutList () const | |
returns a list of objects this object is pointing to by Links More... | |
std::vector< App::DocumentObject * > getOutList (int option) const | |
void getOutList (int option, std::vector< App::DocumentObject * > &res) const | |
std::vector< App::DocumentObject * > getOutListOfProperty (App::Property *) const | |
returns a list of objects linked by the property More... | |
std::vector< App::DocumentObject * > getOutListRecursive (void) const | |
returns a list of objects this object is pointing to by Links and all further descended More... | |
std::vector< std::pair< App::DocumentObject *, std::string > > getParents (int depth=0) const | |
Obtain top parents and subnames of this object using its InList. More... | |
std::vector< std::list< App::DocumentObject * > > getPathsByOutList (App::DocumentObject *to) const | |
get all possible paths from this to another object following the OutList More... | |
unsigned long getStatus () const | |
return the status bits More... | |
const char * getStatusString (void) const | |
get the status Message More... | |
virtual DocumentObject * getSubObject (const char *subname, PyObject **pyObj=0, Base::Matrix4D *mat=0, bool transform=true, int depth=0) const | |
Get the sub element/object by name. More... | |
std::vector< DocumentObject * > getSubObjectList (const char *subname) const | |
Return a list of objects referenced by a given subname including this object. More... | |
virtual std::vector< std::string > getSubObjects (int reason=0) const | |
Return name reference of all sub-objects. More... | |
virtual const char * getViewProviderNameOverride () const | |
This function is introduced to allow Python feature override its view provider. More... | |
const char * getViewProviderNameStored () const | |
virtual bool hasChildElement () const | |
return true to activate tree view group object handling and element visibility More... | |
virtual bool isAttachedToDocument () const override | |
virtual int isElementVisible (const char *element) const | |
Get sub-element visibility. More... | |
bool isError (void) const | |
set this feature to error More... | |
int isExporting () const | |
bool isInInList (DocumentObject *objToTest) const | |
test if this object is directly (non recursive) in the InList More... | |
bool isInInListRecursive (DocumentObject *objToTest) const | |
test if this object is in the InList and recursive further down More... | |
bool isInOutList (DocumentObject *objToTest) const | |
test if this object is directly (non recursive) in the OutList More... | |
bool isInOutListRecursive (DocumentObject *objToTest) const | |
test if the given object is in the OutList and recursive further down More... | |
bool isRecomputing () const | |
returns true if this objects is currently recomputing More... | |
bool isRemoving () const | |
returns true if this objects is currently removed from the document More... | |
bool isRestoring () const | |
returns true if this objects is currently restoring from file More... | |
bool isTouched (void) const | |
test if this document object is touched More... | |
bool isValid (void) const | |
bool mustRecompute (void) const | |
Test if this document object must be recomputed. More... | |
virtual void onBeforeChangeLabel (std::string &newLabel) | |
virtual void onLostLinkToObject (DocumentObject *) | |
Called in case of losing a link Get called by the document when a object got deleted a link property of this object ist pointing to. More... | |
virtual void onUpdateElementReference (const Property *) | |
void purgeError (void) | |
remove the error from the object More... | |
void purgeTouched (void) | |
reset this document object touched More... | |
bool recomputeFeature (bool recursive=false) | |
Recompute only this feature. More... | |
virtual bool redirectSubName (std::ostringstream &ss, DocumentObject *topParent, DocumentObject *child) const | |
Allow object to redirect a subname path. More... | |
virtual bool removeDynamicProperty (const char *prop) override | |
App::DocumentObject * resolve (const char *subname, App::DocumentObject **parent=0, std::string *childName=0, const char **subElement=0, PyObject **pyObj=0, Base::Matrix4D *mat=0, bool transform=true, int depth=0) const | |
Resolve the last document object referenced in the subname. More... | |
App::DocumentObject * resolveRelativeLink (std::string &subname, App::DocumentObject *&link, std::string &linkSub) const | |
Resolve a link reference that is relative to this object reference. More... | |
virtual void Save (Base::Writer &writer) const override | |
This method is used to save properties to an XML document. More... | |
virtual int setElementVisible (const char *element, bool visible) | |
Child element handling. More... | |
virtual void setExpression (const ObjectIdentifier &path, boost::shared_ptr< App::Expression > expr) | |
void setStatus (ObjectStatus pos, bool on) | |
bool testIfLinkDAGCompatible (App::PropertyLinkSub &linkTo) const | |
bool testIfLinkDAGCompatible (App::PropertyLinkSubList &linksTo) const | |
bool testIfLinkDAGCompatible (const std::vector< DocumentObject * > &linksTo) const | |
bool testIfLinkDAGCompatible (DocumentObject *linkTo) const | |
testIfLinkIsDAG tests a link that is about to be created for circular references. More... | |
bool testStatus (ObjectStatus pos) const | |
void touch (bool noRecompute=false) | |
Set the property touched -> changed, cause recomputation in Update() More... | |
virtual ~DocumentObject () | |
![]() | |
TransactionalObject (void) | |
Constructor. More... | |
virtual ~TransactionalObject () | |
![]() | |
ExtensionIterator extensionBegin () | |
ExtensionContainer () | |
ExtensionIterator extensionEnd () | |
App::Extension * getExtension (Base::Type, bool derived=true, bool no_except=false) const | |
App::Extension * getExtension (const std::string &name) const | |
template<typename ExtensionT > | |
ExtensionT * getExtensionByType (bool no_except=false, bool derived=true) const | |
std::vector< Extension * > getExtensionsDerivedFrom (Base::Type type) const | |
template<typename ExtensionT > | |
std::vector< ExtensionT * > getExtensionsDerivedFromType () const | |
bool hasExtension (Base::Type, bool derived=true) const | |
bool hasExtension (const std::string &name) const | |
bool hasExtensions () const | |
void registerExtension (Base::Type extension, App::Extension *ext) | |
virtual ~ExtensionContainer () | |
virtual const char * getPropertyName (const Property *prop) const override | |
get the name of a property More... | |
virtual void getPropertyMap (std::map< std::string, Property * > &Map) const override | |
get all properties of the class (including properties of the parent) More... | |
virtual void getPropertyList (std::vector< Property * > &List) const override | |
get all properties of the class (including properties of the parent) More... | |
virtual short getPropertyType (const Property *prop) const override | |
get the Type of a Property More... | |
virtual short getPropertyType (const char *name) const override | |
get the Type of a named Property More... | |
virtual const char * getPropertyGroup (const Property *prop) const override | |
get the Group of a Property More... | |
virtual const char * getPropertyGroup (const char *name) const override | |
get the Group of a named Property More... | |
virtual const char * getPropertyDocumentation (const Property *prop) const override | |
get the Group of a Property More... | |
virtual const char * getPropertyDocumentation (const char *name) const override | |
get the Group of a named Property More... | |
virtual void Restore (Base::XMLReader &reader) override | |
This method is used to restore properties from an XML document. More... | |
void saveExtensions (Base::Writer &writer) const | |
void restoreExtensions (Base::XMLReader &reader) | |
![]() | |
virtual App::Property * getDynamicPropertyByName (const char *name) const | |
DynamicProperty::PropData getDynamicPropertyData (const Property *prop) const | |
virtual std::vector< std::string > getDynamicPropertyNames () const | |
virtual unsigned int getMemSize (void) const | |
This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? More... | |
const char * getPropertyPrefix () const | |
bool isHidden (const char *name) const | |
check if the named property is hidden More... | |
bool isHidden (const Property *prop) const | |
check if the property is hidden More... | |
bool isReadOnly (const char *name) const | |
check if the named property is read-only More... | |
bool isReadOnly (const Property *prop) const | |
check if the property is read-only More... | |
PropertyContainer () | |
A constructor. More... | |
void setPropertyPrefix (const char *prefix) | |
void setPropertyStatus (unsigned char bit, bool value) | |
set the Status bit of all properties at once More... | |
virtual ~PropertyContainer () | |
A destructor. More... | |
![]() | |
void dumpToStream (std::ostream &stream, int compression) | |
virtual Base::Type getTypeId (void) const | |
virtual void RestoreDocFile (Reader &) | |
This method is used to restore large amounts of data from a file In this method you simply stream in your SaveDocFile() saved data. More... | |
void restoreFromStream (std::istream &stream) | |
virtual void SaveDocFile (Writer &) const | |
This method is used to save large amounts of data to a binary file. More... | |
![]() | |
BaseClass () | |
Construction. More... | |
bool isDerivedFrom (const Type type) const | |
virtual void setPyObject (PyObject *) | |
virtual ~BaseClass () | |
Destruction. More... | |
Public Attributes | |
boost::signals2::signal< void(App::CellAddress)> cellSpanChanged | |
boost::signals2::signal< void(App::CellAddress)> cellUpdated | |
boost::signals2::signal< void(int, int)> columnWidthChanged | |
boost::signals2::signal< void(int, int)> rowHeightChanged | |
![]() | |
PropertyExpressionEngine ExpressionEngine | |
PropertyString Label | |
PropertyString Label2 | |
boost::signals2::signal< void(const App::DocumentObject &, const App::Property &)> signalBeforeChange | |
signal before changing a property of this object More... | |
boost::signals2::signal< void(const App::DocumentObject &, const App::Property &)> signalChanged | |
signal on changed property of this object More... | |
PropertyBool Visibility | |
Allow control visibility status in App name space. More... | |
Protected Types | |
typedef std::map< std::string, SheetObserver * > ObserverMap | |
Protected Member Functions | |
void aliasRemoved (App::CellAddress address, const std::string &alias) | |
Called when alias alias at address is removed. More... | |
App::Property * getProperty (App::CellAddress key) const | |
Get the Cell Property for the cell at key. More... | |
App::Property * getProperty (const char *addr) const | |
Get a dynamic property. More... | |
void onDocumentRestored () | |
get called after a document has been fully restored More... | |
virtual void onSettingDocument () | |
Update internal structure when document is set for this property. More... | |
std::set< App::CellAddress > providesTo (App::CellAddress address) const | |
Compute links to cells that cell at address provides input to. More... | |
void recomputeCell (App::CellAddress p) | |
Recompute cell at address p. More... | |
void removeAliases () | |
Remove all aliases. More... | |
App::Property * setFloatProperty (App::CellAddress key, double value) | |
Set the property for cell key to a PropertyFloat with the value value. More... | |
App::Property * setIntegerProperty (App::CellAddress key, long value) | |
App::Property * setObjectProperty (App::CellAddress key, Py::Object obj) | |
App::Property * setQuantityProperty (App::CellAddress key, double value, const Base::Unit &unit) | |
Set the property for cell key to a PropertyQuantity with value and unit. More... | |
App::Property * setStringProperty (App::CellAddress key, const std::string &value) | |
Set the property for cell key to a PropertyString with value. More... | |
void updateAlias (App::CellAddress key) | |
Update the alias for the cell at key. More... | |
void updateColumnsOrRows (bool horizontal, int section, int count) | |
void updateProperty (App::CellAddress key) | |
Update the Property given by key. More... | |
![]() | |
virtual void onBeforeChange (const Property *prop) override | |
get called before the value is changed More... | |
virtual void onChanged (const Property *prop) override | |
get called by the container when a property was changed More... | |
virtual void onPropertyStatusChanged (const Property &prop, unsigned long oldStatus) override | |
get called when a property status has changed More... | |
virtual App::DocumentObjectExecReturn * recompute (void) | |
recompute only this object More... | |
void resetError (void) | |
void setDocument (App::Document *doc) | |
void setError (void) | |
virtual void setupObject () | |
get called after a brand new object was created More... | |
virtual void unsetupObject () | |
get called when object is going to be removed from the document More... | |
![]() | |
void onBeforeChangeProperty (Document *doc, const Property *prop) | |
![]() | |
virtual const PropertyData & getPropertyData (void) const | |
virtual void handleChangedPropertyName (Base::XMLReader &reader, const char *TypeName, const char *PropName) | |
PropertyContainer::handleChangedPropertyName is called during restore to possibly fix reading of older versions of this property container. More... | |
virtual void handleChangedPropertyType (Base::XMLReader &reader, const char *TypeName, Property *prop) | |
PropertyContainer::handleChangedPropertyType is called during restore to possibly fix reading of older versions of the property container. More... | |
Protected Attributes | |
std::set< App::CellAddress > cellErrors | |
PropertySheet cells | |
PropertyColumnWidths columnWidths | |
int currentCol = -1 | |
int currentRow = -1 | |
ObserverMap observers | |
std::map< const App::Property *, App::CellAddress > propAddress | |
App::DynamicProperty & props | |
std::map< App::CellAddress, std::string > removedAliases | |
PropertyRowHeights rowHeights | |
![]() | |
std::string oldLabel | |
Old label; used for renaming expressions. More... | |
const std::string * pcNameInDocument | |
Py::Object PythonObject | |
python object of this class and all descendent More... | |
std::bitset< 32 > StatusBits | |
Status bits of the document object The first 8 bits are used for the base system the rest can be used in descendent classes to mark special statuses on the objects. More... | |
![]() | |
DynamicProperty dynamicProps | |
Friends | |
class PropertySheet | |
class SheetObserver | |
Additional Inherited Members | |
![]() | |
enum GSReason { GS_DEFAULT, GS_SELECT } | |
reason of calling getSubObjects() More... | |
enum OutListOption { OutListNoExpression = 1, OutListNoHidden = 2, OutListNoXLinked = 4 } | |
DAG handling This part of the interface deals with viewing the document as a DAG (directed acyclic graph). More... | |
![]() | |
typedef std::map< Base::Type, App::Extension * >::iterator ExtensionIterator | |
![]() | |
static const char * hasHiddenMarker (const char *subname) | |
Check if the subname reference ends with hidden marker. More... | |
static const std::string & hiddenMarker () | |
Special marker to mark the object as hidden. More... | |
![]() | |
static void * create (void) | |
static std::string encodeAttribute (const std::string &) | |
Encodes an attribute upon saving. More... | |
static Base::Type getClassTypeId (void) | |
static void init (void) | |
![]() | |
static void * create (void) | |
static Type getClassTypeId (void) | |
static void init (void) | |
![]() | |
static DocumentObjectExecReturn * StdReturn | |
![]() | |
static const PropertyData * getPropertyDataPtr (void) | |
![]() | |
static void initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr) | |
Member Typedef Documentation
◆ ObserverMap
|
protected |
Constructor & Destructor Documentation
◆ Sheet()
Sheet::Sheet | ( | ) |
Constructor.
Construct a new Sheet object.
References App::Prop_Hidden, App::Prop_Output, and App::Prop_ReadOnly.
◆ ~Sheet()
|
virtual |
Member Function Documentation
◆ aliasRemoved()
|
protected |
Called when alias alias at address is removed.
- Parameters
-
address Address of alias. alias Removed alias.
References removedAliases.
Referenced by Spreadsheet::PropertySheet::moveCell(), and Spreadsheet::PropertySheet::setAlias().
◆ clear()
void Sheet::clear | ( | App::CellAddress | address, |
bool | all = true |
||
) |
Clear the cell at address.
If all is false, only the text or expression contents are cleared. If all is true everything in the cell is cleared, including color, style, etc.
- Parameters
-
address Address of cell to clear all Whether we should clear all or not.
References cells, Spreadsheet::PropertySheet::clear(), Spreadsheet::Cell::getAlias(), getCell(), propAddress, and App::DocumentObject::removeDynamicProperty().
Referenced by Spreadsheet::PropertySheet::pasteCells(), setCell(), and updateProperty().
◆ clearAll()
void Sheet::clearAll | ( | ) |
Clear all cells in the sheet.
References cellErrors, cells, Spreadsheet::PropertyColumnWidths::clear(), Spreadsheet::PropertyRowHeights::clear(), Spreadsheet::PropertySheet::clear(), columnWidths, observers, propAddress, removedAliases, App::DocumentObject::removeDynamicProperty(), and rowHeights.
Referenced by importFromFile(), and ~Sheet().
◆ dependsOn()
std::set< std::string > Sheet::dependsOn | ( | App::CellAddress | address | ) | const |
Return a set of dependencies links for cell at address.
- Parameters
-
address Address of cell
- Returns
- Set of dependencies.
References cells, and Spreadsheet::PropertySheet::getDeps().
Referenced by SpreadsheetGui::SheetModel::data().
◆ execute()
|
virtual |
Update the document properties.
Reimplemented from App::DocumentObject.
References cellErrors, cells, cellUpdated, Spreadsheet::PropertyColumnWidths::clearDirty(), Spreadsheet::PropertyRowHeights::clearDirty(), columnWidthChanged, columnWidths, Spreadsheet::PropertyRowHeights::getDirty(), Spreadsheet::PropertyColumnWidths::getDirty(), Spreadsheet::PropertySheet::getDirty(), App::DocumentObject::getFullName(), Spreadsheet::PropertyRowHeights::getValue(), Spreadsheet::PropertyColumnWidths::getValue(), Spreadsheet::PropertySheet::getValue(), providesTo(), recomputeCell(), Spreadsheet::PropertySheet::recomputeDependencies(), removeAliases(), rowHeightChanged, rowHeights, and Spreadsheet::Cell::setException().
Referenced by ArchSite.Compass::buildCoordinates(), ArchSchedule.CommandArchSchedule::IsActive(), FeaturePython.DistanceBolt::onChanged(), and onDocumentRestored().
◆ exportToFile()
bool Sheet::exportToFile | ( | const std::string & | filename, |
char | delimiter = '\t' , |
||
char | quoteChar = '\0' , |
||
char | escapeChar = '\\' |
||
) | const |
Export spreadsheet data to file.
- Parameters
-
filename Filename to store data to. delimiter Field delimiter quoteChar Quote character ('\0' to disable) escapeChar Escape character ('\0' to disable)
- Returns
- True if store is successful, false if something failed.
References cells, getProperty(), Spreadsheet::PropertySheet::getUsedCells(), and Base::BaseClass::isDerivedFrom().
◆ getAddressFromAlias()
std::string Sheet::getAddressFromAlias | ( | const std::string & | alias | ) | const |
Get cell given an alias string.
- Parameters
-
alias Alias for cell
- Returns
- Name of cell, or empty string if not defined
References cells, Spreadsheet::Cell::getAddress(), Spreadsheet::PropertySheet::getValueFromAlias(), and App::CellAddress::toString().
Referenced by isValidAlias(), Spreadsheet::SheetPy::set(), and setAlias().
◆ getCell()
Cell * Sheet::getCell | ( | App::CellAddress | address | ) |
Get contents of the cell specified by address, or 0 if it is not defined.
- Returns
- A CellContent object or 0.
References cells, and Spreadsheet::PropertySheet::getValue().
Referenced by clear(), SpreadsheetGui::SheetModel::data(), Drawing::FeatureViewSpreadsheet::execute(), getNewCell(), TechDraw::DrawViewSpreadsheet::getSheetImage(), updateAlias(), and updateProperty().
◆ getCellAddress()
bool Sheet::getCellAddress | ( | const App::Property * | prop, |
App::CellAddress & | address | ||
) |
Get the address as address of the Property prop.
This function throws an exception if the property is not found.
References propAddress.
◆ getCells()
PropertySheet* Spreadsheet::Sheet::getCells | ( | ) |
◆ getColumn()
std::string Sheet::getColumn | ( | int | offset = 0 | ) | const |
References currentCol.
◆ getColumnWidth()
int Sheet::getColumnWidth | ( | int | col | ) | const |
Get column with of column at index col.
- Parameters
-
col
- Returns
References columnWidths, and Spreadsheet::PropertyColumnWidths::getValue().
Referenced by Drawing::FeatureViewSpreadsheet::execute(), TechDraw::DrawViewSpreadsheet::getSheetImage(), and SpreadsheetGui::SheetModel::headerData().
◆ getColumnWidths()
std::map< int, int > Sheet::getColumnWidths | ( | ) | const |
Get a map with column indices and widths.
- Returns
- Map with results.
References columnWidths, and Spreadsheet::PropertyColumnWidths::getValues().
Referenced by SpreadsheetGui::SheetTableView::setSheet().
◆ getNewCell()
Cell * Sheet::getNewCell | ( | App::CellAddress | address | ) |
Get cell contents specified by address.
- Parameters
-
address
References cells, Spreadsheet::PropertySheet::createCell(), and getCell().
Referenced by Spreadsheet::PropertySheet::pasteCells(), and SpreadsheetGui::PropertiesDialog::PropertiesDialog().
◆ getProperty() [1/2]
|
protected |
Get the Cell Property for the cell at key.
- Returns
- The Property object.
References App::CellAddress::toString().
Referenced by exportToFile(), and getPropertyByName().
◆ getProperty() [2/2]
|
protected |
Get a dynamic property.
- Parameters
-
addr Name of dynamic propeerty.
- Returns
- Pointer to property, or 0 if it does not exist.
◆ getPropertyByName()
|
virtual |
Retrieve a specific Property given by name.
This function might throw an exception if something fails, but might also return 0 in case the property is not found.
- Returns
- The property, or 0 if not found.
Reimplemented from App::ExtensionContainer.
References getProperty(), and App::CellAddress::toString().
Referenced by SpreadsheetGui::SheetModel::data(), Drawing::FeatureViewSpreadsheet::execute(), Spreadsheet::Cell::getFormattedQuantity(), TechDraw::DrawViewSpreadsheet::getSheetImage(), and isValidAlias().
◆ getPyObject()
|
virtual |
Get the Python object for the Sheet.
- Returns
- The Python object.
Reimplemented from App::DocumentObject.
References App::DocumentObject::PythonObject.
◆ getRow()
std::string Sheet::getRow | ( | int | offset = 0 | ) | const |
References currentRow.
◆ getRowHeight()
int Sheet::getRowHeight | ( | int | row | ) | const |
Get height of row at index row.
- Parameters
-
row Index of row.
- Returns
- Height
References Spreadsheet::PropertyRowHeights::getValue(), and rowHeights.
Referenced by Drawing::FeatureViewSpreadsheet::execute(), TechDraw::DrawViewSpreadsheet::getSheetImage(), and SpreadsheetGui::SheetModel::headerData().
◆ getRowHeights()
std::map< int, int > Sheet::getRowHeights | ( | ) | const |
Get a map with row indices and heights.
- Returns
- Map with results
References Spreadsheet::PropertyRowHeights::getValues(), and rowHeights.
Referenced by SpreadsheetGui::SheetTableView::setSheet().
◆ getSpans()
void Sheet::getSpans | ( | App::CellAddress | address, |
int & | rows, | ||
int & | cols | ||
) | const |
Get row an column span for the cell at (row, col).
- Parameters
-
address Address of cell rows The number of unit cells this cell spans cols The number of unit rows this cell spans
References cells, and Spreadsheet::PropertySheet::getSpans().
Referenced by SpreadsheetGui::SheetTableView::updateCellSpan().
◆ getUsedCells()
std::vector< std::string > Sheet::getUsedCells | ( | ) | const |
Get a vector of strings with addresses of all used cells.
- Returns
- vector of strings.
References cells, and Spreadsheet::PropertySheet::getUsedCells().
Referenced by SpreadsheetGui::SheetTableView::setSheet().
◆ getViewProviderName()
|
virtual |
returns the type name of the ViewProvider
Reimplemented from App::DocumentObject.
◆ hasCell()
bool Sheet::hasCell | ( | const std::vector< App::Range > & | ranges | ) | const |
References cells, and Spreadsheet::PropertySheet::getValue().
◆ importFromFile()
bool Sheet::importFromFile | ( | const std::string & | filename, |
char | delimiter = '\t' , |
||
char | quoteChar = '\0' , |
||
char | escapeChar = '\\' |
||
) |
Import a file into the spreadsheet object.
- Parameters
-
filename Name of file to import delimiter The field delimiter character used. quoteChar Quote character, if any (set to '\0' to disable). escapeChar The escape character used, if any (set to '0' to disable).
- Returns
- True if successful, false if something failed.
References Spreadsheet::PropertySheet::AtomicPropertyChange, cells, clearAll(), and setCell().
◆ insertColumns()
void Sheet::insertColumns | ( | int | col, |
int | count | ||
) |
Insert count columns at before column col in the spreadsheet.
- Parameters
-
col Address of column where the columns are inserted. count Number of columns to insert
References cells, Spreadsheet::PropertySheet::insertColumns(), and updateColumnsOrRows().
◆ insertRows()
void Sheet::insertRows | ( | int | row, |
int | count | ||
) |
Inser count rows at row row.
- Parameters
-
row Address of row where the rows are inserted. count Number of rows to insert.
References cells, Spreadsheet::PropertySheet::insertRows(), and updateColumnsOrRows().
◆ isMergedCell()
bool Sheet::isMergedCell | ( | App::CellAddress | address | ) | const |
Determine whether this cell is merged with another or not.
- Parameters
-
address
- Returns
- True if cell is merged, false if not.
References cells, and Spreadsheet::PropertySheet::isMergedCell().
Referenced by SpreadsheetGui::SheetTableView::setSheet().
◆ isValidAlias()
bool Sheet::isValidAlias | ( | const std::string & | candidate | ) |
Determine whether a given alias candidate is valid or not.
A candidate is valid is the string is syntactically correct, and the alias does not conflict with an existing property.
References cells, getAddressFromAlias(), getPropertyByName(), and Spreadsheet::PropertySheet::isValidAlias().
Referenced by setAlias().
◆ mergeCells()
bool Sheet::mergeCells | ( | const App::Range & | range | ) |
Merge a rectangle specified by range into one logical cell.
Data in all but the upper right cell are cleared when the cells are merged.
- Parameters
-
range Range to merge.
- Returns
- True if the cells were merged, false if the merge was unsuccessful.
References cells, and Spreadsheet::PropertySheet::mergeCells().
◆ mustExecute()
|
virtual |
Determine whether this object needs to be executed to update internal structures.
Reimplemented from App::DocumentObject.
References cellErrors, cells, and Spreadsheet::PropertySheet::isDirty().
◆ observeDocument()
void Sheet::observeDocument | ( | App::Document * | document | ) |
Create a document observer for this sheet.
Used to track changes.
- Parameters
-
document document to observer.
References cells, App::Document::getName(), observers, and SheetObserver.
◆ onDocumentRestored()
|
protectedvirtual |
get called after a document has been fully restored
Reimplemented from App::DocumentObject.
References execute(), and App::DocumentObject::getFullName().
◆ onSettingDocument()
|
protectedvirtual |
Update internal structure when document is set for this property.
Reimplemented from App::DocumentObject.
References cells, and Spreadsheet::PropertySheet::documentSet().
◆ providesTo() [1/2]
|
protected |
Compute links to cells that cell at address provides input to.
- Parameters
-
address Address of cell result Set of links.
References cells, Spreadsheet::PropertySheet::getDeps(), and App::DocumentObject::getFullName().
◆ providesTo() [2/2]
void Sheet::providesTo | ( | App::CellAddress | address, |
std::set< std::string > & | result | ||
) | const |
Compute links to cells that cell at address provides input to.
- Parameters
-
address Address of cell result Set of links.
References cells, Spreadsheet::PropertySheet::getDeps(), and App::DocumentObject::getFullName().
Referenced by SpreadsheetGui::SheetModel::data(), and execute().
◆ recomputeCell()
|
protected |
Recompute cell at address p.
- Parameters
-
p Address of cell.
References cellErrors, cells, cellSpanChanged, cellUpdated, Spreadsheet::PropertySheet::clearDirty(), Base::AbortException::getClassTypeId(), Spreadsheet::Cell::getStringContent(), Spreadsheet::PropertySheet::getValue(), Spreadsheet::Cell::hasException(), Spreadsheet::Cell::setContent(), Spreadsheet::Cell::setException(), setStringProperty(), Spreadsheet::Cell::spansChanged(), Base::Tools::toStdString(), updateAlias(), and updateProperty().
Referenced by execute().
◆ removeAliases()
|
protected |
Remove all aliases.
References removedAliases, and App::DocumentObject::removeDynamicProperty().
Referenced by execute().
◆ removeColumns()
void Sheet::removeColumns | ( | int | col, |
int | count | ||
) |
Remove count columns at column col.
- Parameters
-
col Address of first column to remove. count Number of columns to remove.
References cells, Spreadsheet::PropertySheet::removeColumns(), and updateColumnsOrRows().
◆ removeRows()
void Sheet::removeRows | ( | int | row, |
int | count | ||
) |
Remove count rows starting at row from the spreadsheet.
- Parameters
-
row Address of first row to remove. count Number of rows to remove.
References cells, Spreadsheet::PropertySheet::removeRows(), and updateColumnsOrRows().
◆ renameObjectIdentifiers()
|
virtual |
Reimplemented from App::DocumentObject.
References cells, and Spreadsheet::PropertySheet::renameObjectIdentifiers().
◆ setAlias()
void Sheet::setAlias | ( | App::CellAddress | address, |
const std::string & | alias | ||
) |
Set alias for cell at address address to alias.
If the alias is an empty string, the existing alias is removed.
- Parameters
-
address Address of cell alias New alias.
References cells, getAddressFromAlias(), isValidAlias(), and Spreadsheet::PropertySheet::setAlias().
◆ setAlignment()
void Sheet::setAlignment | ( | App::CellAddress | address, |
int | alignment | ||
) |
Set alignment of content in cell at address to alignment.
- Parameters
-
address Address of cell alignment New alignment
References cells, and Spreadsheet::PropertySheet::setAlignment().
◆ setBackground()
void Sheet::setBackground | ( | App::CellAddress | address, |
const App::Color & | color | ||
) |
Set background color of cell at address address to color.
- Parameters
-
address Address of cell color New color
References cells, and Spreadsheet::PropertySheet::setBackground().
◆ setCell() [1/2]
void Sheet::setCell | ( | App::CellAddress | address, |
const char * | value | ||
) |
Set cell at address to value.
If a merged cell is specified, the upper right corner of the merged cell must be specified.
- Parameters
-
address Row position of cell. value String value of expression.
References clear(), and setContent().
◆ setCell() [2/2]
void Sheet::setCell | ( | const char * | address, |
const char * | contents | ||
) |
Set cell given by address to contents.
- Parameters
-
address Address of cell to set. contents New contents of given cell.
Referenced by importFromFile(), and Spreadsheet::SheetPy::set().
◆ setColumnWidth()
void Sheet::setColumnWidth | ( | int | col, |
int | width | ||
) |
Set column with of column col to width-.
- Parameters
-
col Index of column. width New width of column.
References columnWidths, and Spreadsheet::PropertyColumnWidths::setValue().
◆ setComputedUnit()
void Sheet::setComputedUnit | ( | App::CellAddress | address, |
const Base::Unit & | unit | ||
) |
Set computed unit for cell at address address to unit.
- Parameters
-
address Address of cell unit New unit.
References cells, and Spreadsheet::PropertySheet::setComputedUnit().
◆ setContent()
void Sheet::setContent | ( | App::CellAddress | address, |
const char * | value | ||
) |
Set content of cell at address to value.
- Parameters
-
address Address of cell value New value
References cells, and Spreadsheet::PropertySheet::setContent().
Referenced by setCell(), and SpreadsheetGui::SheetModel::setData().
◆ setDisplayUnit()
void Sheet::setDisplayUnit | ( | App::CellAddress | address, |
const std::string & | unit | ||
) |
Set display unit of cell at address address to unit.
- Parameters
-
address Address of cell unit New unit
References cells, and Spreadsheet::PropertySheet::setDisplayUnit().
◆ setFloatProperty()
|
protected |
Set the property for cell key
to a PropertyFloat with the value value.
If the Property exists, but of wrong type, the previous Property is destroyed and recreated as the correct type.
- Parameters
-
key The address of the cell we want to create a Property for value The value we want to assign to the Property.
References App::DocumentObject::addDynamicProperty(), Base::Persistence::getTypeId(), App::Prop_Hidden, App::Prop_NoPersist, App::Prop_ReadOnly, propAddress, App::DocumentObject::removeDynamicProperty(), App::PropertyFloat::setValue(), and App::CellAddress::toString().
Referenced by updateProperty().
◆ setForeground()
void Sheet::setForeground | ( | App::CellAddress | address, |
const App::Color & | color | ||
) |
Set foreground (text color) of cell at address address to color.
- Parameters
-
address Address of cell color New color
References cells, and Spreadsheet::PropertySheet::setForeground().
◆ setIntegerProperty()
|
protected |
References App::DocumentObject::addDynamicProperty(), Base::Persistence::getTypeId(), App::Prop_Hidden, App::Prop_NoPersist, App::Prop_ReadOnly, propAddress, App::DocumentObject::removeDynamicProperty(), App::PropertyInteger::setValue(), and App::CellAddress::toString().
Referenced by updateProperty().
◆ setObjectProperty()
|
protected |
◆ setQuantityProperty()
|
protected |
Set the property for cell key
to a PropertyQuantity with value and unit.
If the Property exists, but of wrong type, the previous Property is destroyed and recreated as the correct type.
- Parameters
-
key The address of the cell we want to create a Property for value The value we want to assign to the Property. unit The associated unit for value.
References App::DocumentObject::addDynamicProperty(), cells, Base::Persistence::getClassTypeId(), Base::Persistence::getTypeId(), App::Prop_Hidden, App::Prop_NoPersist, App::Prop_ReadOnly, propAddress, App::DocumentObject::removeDynamicProperty(), Spreadsheet::PropertySheet::setComputedUnit(), App::PropertyQuantity::setUnit(), App::PropertyQuantity::setValue(), and App::CellAddress::toString().
Referenced by updateProperty().
◆ setRowHeight()
void Sheet::setRowHeight | ( | int | row, |
int | height | ||
) |
Set row height of row given by index in row
to height.
- Parameters
-
row Row index. height New height of row.
References rowHeights, and Spreadsheet::PropertyRowHeights::setValue().
◆ setSpans()
void Sheet::setSpans | ( | App::CellAddress | address, |
int | rows, | ||
int | columns | ||
) |
Set row and column span for the cell at address address to rows and columns.
- Parameters
-
address Address to upper right corner of cell rows Rows to span columns Columns to span
References cells, and Spreadsheet::PropertySheet::setSpans().
◆ setStringProperty()
|
protected |
Set the property for cell key
to a PropertyString with value.
If the Property exists, but of wrong type, the previous Property is destroyed and recreated as the correct type.
- Parameters
-
key The address of the cell we want to create a Property for value The value we want to assign to the Property.
References App::DocumentObject::addDynamicProperty(), App::Prop_Hidden, App::Prop_NoPersist, App::Prop_ReadOnly, propAddress, App::DocumentObject::removeDynamicProperty(), App::PropertyString::setValue(), and App::CellAddress::toString().
Referenced by recomputeCell(), and updateProperty().
◆ setStyle()
void Sheet::setStyle | ( | App::CellAddress | address, |
const std::set< std::string > & | style | ||
) |
Set style of cell at address to style.
- Parameters
-
address Address of cell style New style
References cells, and Spreadsheet::PropertySheet::setStyle().
◆ splitCell()
void Sheet::splitCell | ( | App::CellAddress | address | ) |
Split a previously merged cell specified by address into its individual cells.
The address can point to any of the cells that make up the merged cell.
- Parameters
-
address Address of cell to split
References cells, and Spreadsheet::PropertySheet::splitCell().
◆ touchCells()
void Sheet::touchCells | ( | App::Range | range | ) |
References cells, and Spreadsheet::PropertySheet::setDirty().
◆ updateAlias()
|
protected |
Update the alias for the cell at key.
- Parameters
-
key Cell to update.
References App::DocumentObject::addDynamicProperty(), Spreadsheet::Cell::getAlias(), getCell(), Base::Type::getName(), Base::Persistence::getTypeId(), App::Property::Hidden, App::Property::Paste(), App::Prop_NoPersist, App::Prop_ReadOnly, App::DocumentObject::removeDynamicProperty(), App::Property::setStatus(), and App::CellAddress::toString().
Referenced by recomputeCell().
◆ updateColumnsOrRows()
|
protected |
References columnWidths, Spreadsheet::PropertyColumnWidths::getValues(), Spreadsheet::PropertyRowHeights::getValues(), rowHeights, Spreadsheet::PropertyRowHeights::setValues(), and Spreadsheet::PropertyColumnWidths::setValues().
Referenced by insertColumns(), insertRows(), removeColumns(), and removeRows().
◆ updateProperty()
|
protected |
Update the Property given by key.
This will also eventually trigger recomputations of cells depending on key.
- Parameters
-
key The address of the cell we want to recompute.
References cellUpdated, clear(), currentCol, currentRow, getCell(), Spreadsheet::Cell::getExpression(), Spreadsheet::Cell::getStringContent(), setFloatProperty(), setIntegerProperty(), setObjectProperty(), setQuantityProperty(), and setStringProperty().
Referenced by recomputeCell().
Friends And Related Function Documentation
◆ PropertySheet
|
friend |
◆ SheetObserver
|
friend |
Referenced by observeDocument().
Member Data Documentation
◆ cellErrors
|
protected |
Referenced by clearAll(), execute(), mustExecute(), and recomputeCell().
◆ cells
|
protected |
Referenced by clear(), clearAll(), dependsOn(), execute(), exportToFile(), getAddressFromAlias(), getCell(), getNewCell(), getSpans(), getUsedCells(), hasCell(), importFromFile(), insertColumns(), insertRows(), isMergedCell(), isValidAlias(), mergeCells(), mustExecute(), observeDocument(), onSettingDocument(), providesTo(), recomputeCell(), removeColumns(), removeRows(), renameObjectIdentifiers(), setAlias(), setAlignment(), setBackground(), setComputedUnit(), setContent(), setDisplayUnit(), setForeground(), setQuantityProperty(), setSpans(), setStyle(), splitCell(), and touchCells().
◆ cellSpanChanged
boost::signals2::signal<void (App::CellAddress)> Spreadsheet::Sheet::cellSpanChanged |
Referenced by recomputeCell(), and SpreadsheetGui::SheetTableView::setSheet().
◆ cellUpdated
boost::signals2::signal<void (App::CellAddress)> Spreadsheet::Sheet::cellUpdated |
◆ columnWidthChanged
boost::signals2::signal<void (int, int)> Spreadsheet::Sheet::columnWidthChanged |
Referenced by execute().
◆ columnWidths
|
protected |
Referenced by clearAll(), execute(), getColumnWidth(), getColumnWidths(), setColumnWidth(), and updateColumnsOrRows().
◆ currentCol
|
protected |
Referenced by getColumn(), and updateProperty().
◆ currentRow
|
protected |
Referenced by getRow(), and updateProperty().
◆ observers
|
protected |
Referenced by clearAll(), and observeDocument().
◆ propAddress
|
protected |
Referenced by clear(), clearAll(), getCellAddress(), setFloatProperty(), setIntegerProperty(), setObjectProperty(), setQuantityProperty(), and setStringProperty().
◆ props
|
protected |
◆ removedAliases
|
protected |
Referenced by aliasRemoved(), clearAll(), and removeAliases().
◆ rowHeightChanged
boost::signals2::signal<void (int, int)> Spreadsheet::Sheet::rowHeightChanged |
Referenced by execute().
◆ rowHeights
|
protected |
Referenced by clearAll(), execute(), getRowHeight(), getRowHeights(), setRowHeight(), and updateColumnsOrRows().
The documentation for this class was generated from the following files:
- src/Mod/Spreadsheet/App/Sheet.h
- src/Mod/Spreadsheet/App/Sheet.cpp