|
OpenLexocad
27.0
|
#include <CoreApplication.h>
Public Member Functions | |
| CoreApplication (int argc, char **argv) | |
| ~CoreApplication () | |
| Base::String | getApplicationName () const |
| Returns the name of the application. More... | |
| void | setApplicationName (const Base::String &name) |
| Sets the application name. More... | |
| Core::CoreDocument * | newCoreDocument (const std::string &typeName, const Base::String &name=Base::String()) |
| Creates a new document without Gui. The new document becomes NOT the active document. The document has default objects. More... | |
| Core::CoreDocument * | newDocument (const std::string &typeName, const Base::String &name=Base::String(), bool createGui=true, bool setAsActiveDocument=true, bool createDefaultObjects=true) |
| Core::CoreDocument * | openCoreDocument (const std::string &typeName, const Base::String &path) |
| Opens a document without Gui. The document path is not saved. The new document becomes NOT the active document. More... | |
| Core::CoreDocument * | openDocument (const std::string &typeName, const Base::String &path=Base::String(), bool createGui=true, bool savepath=true, bool setAsActiveDocument=true) |
| Opens a document. If no path is provided and the application has a Gui the user is prompted with a file selection dialog. More... | |
| bool | closeDocument (Core::CoreDocument *doc) |
| Closes the document. Returns 'true' if successful, 'false' if canceled. More... | |
| Core::CoreDocument * | getActiveDocument () const |
| Returns the active document. Returns Null if there is no active document. More... | |
| bool | setActiveDocument (Core::CoreDocument *doc) |
| Sets the active document. More... | |
| Core::CoreDocument * | getDocumentByName (const Base::String &name) |
| Returns the document by name. More... | |
| void | closeApplication () |
| Closes the application. More... | |
| Base::String | getApplicationPath () const |
| Get the Application-Path. More... | |
| Base::String | getTmpDirectory (Core::CoreDocument *doc) |
| Gets the TempDir of the specified document. If doc = 0 takes the active document. More... | |
| void | setModulePreferenceValue (const std::string &moduleName, const std::string &key, const std::string &value) |
| Sets a persistent preference key and value for a module. On Windows the key and value are stored in the registry. More... | |
| std::string | getModulePreferenceValue (const std::string &moduleName, const std::string &key) |
| Returns the persistent value of a preference key for a module. Returns empty string if key or module was not found. More... | |
| bool | registerCommandObserver (CA_CommandObserver *observer) |
| Register an Observer for Commands. More... | |
| bool | unregisterCommandObserver (CA_CommandObserver *observer) |
| Unregister an Observer for Commands. More... | |
| ca_CommandObserver_Vector | getCommandObserver () |
| Returns a List of CA_CommandObserver. More... | |
| bool | add_TransactionObserver (CA_TransactionObserver *observer) |
| bool | remove_TransactionObserver (CA_TransactionObserver *observer) |
| CA_TransactionObserver_Vector | getTransactionObservers () |
| void | notifyObject (Core::CoreDocument *doc, Core::DocObject *obj, Core::Property *pro, CA_Transaction::why transaction) |
| void | notifyDocumentCreated (Core::CoreDocument *doc) |
| void | notifyDocumentDeleted (Core::CoreDocument *doc) |
| void | notifyDocumentRenamed (Core::CoreDocument *doc) |
| void | notifyDocumentOpened (Core::CoreDocument *doc) |
| void | notifyDocumentClosed (Core::CoreDocument *doc) |
| void | notifyDocumentSaved (Core::CoreDocument *doc) |
| void | notifyDocumentFinishedRead (Core::CoreDocument *doc) |
| void | notifyDocumentChanged (Core::CoreDocument *doc, Core::Property *pro) |
| void | notifyDocumentSetActive (Core::CoreDocument *doc) |
| void | notifyObjectCreated (Core::CoreDocument *doc, Core::DocObject *obj) |
| void | notifyObjectDeleted (Core::CoreDocument *doc, Core::DocObject *obj) |
| void | notifyObjectAdded (Core::CoreDocument *doc, Core::DocObject *obj) |
| void | notifyObjectChanged (Core::CoreDocument *doc, Core::DocObject *obj, Core::Property *pro) |
| void | notifyObjectHasError (Core::CoreDocument *doc, Core::DocObject *obj) |
| void | notifyPropertyCreate (Core::CoreDocument *doc, Core::DocObject *obj, Core::Property *pro) |
| void | notifyPropertyChanged (Core::CoreDocument *doc, Core::DocObject *obj, Core::Property *pro) |
| void | notifyPropertyDeleted (Core::CoreDocument *doc, Core::DocObject *obj, Core::Property *pro) |
| void | notifyRecomputeSuccess (Core::CoreDocument *doc) |
| void | notifyRecomputeFailed (Core::CoreDocument *doc) |
| void | notifyApp (Core::CoreDocument *doc, AppChanges::why why, bool createGui, bool setAsActiveDocument=true) |
| void | notifyCmdObservers (Core::CoreDocument *doc, bool createGui) |
| bool | closeDocument (Core::CoreDocument *doc, bool forceClose, bool dontNotify=false) |
| Closes a document. More... | |
| bool | onClose (bool forceClose, bool dontNotify, bool &hardClose) |
| bool | closeApplication (bool forceClose, bool dontNotify, bool &hardClose) |
| Base::String | getUniqueDocumentName (const Base::String &s) const |
| int | getOpenDocuments (std::vector< Core::CoreDocument * > &vec) |
| void | initPython () const |
| Initialize the Python interpreter (if not already initialized). Call it before using any other Python/C API functions. More... | |
| void | finalizePython () |
| bool | runPythonString (const Base::String &str) const |
| bool | runPythonString (const Base::String &str, Base::String &err) const |
| bool | runPythonScript (const Base::String &scr, Base::String &err) const |
| bool | runPythonScript (const Base::String &scr) const |
| bool | isClosing () const |
| bool | hasGui () const |
| void | sethasGui (bool on) |
| void | ref (void) |
| Increments the reference count by one. More... | |
| void | unref (void) |
| Decrements the reference count by one. More... | |
| LoadedDll * | loadDllByName (Base::String n) |
| LoadedDll * | getPartAcis () |
| void | setCommandFactory (Core::CommandFactory *commandFactory) |
| Core::CommandFactory * | getCommandFactory () const |
| virtual const char * | subject_name (void) |
Public Member Functions inherited from Base::Subject< Core::AppChanges > | |
| Subject () | |
| virtual | ~Subject () |
| void | attach (Observer< Core::AppChanges > *ToObserv) |
| void | detach (Observer< Core::AppChanges > *ToObserv) |
| void | detachAll () |
| void | notify_internal (Core::AppChanges &rcReason, size_t deep) |
| void | notify (Core::AppChanges &rcReason) |
| Observer< Core::AppChanges > * | get (const char *Name) |
| std::vector< Observer< Core::AppChanges > * > | getAll () |
| void | resetObserverTime () |
| std::map< std::string, double > | getObserverTime () |
Static Public Member Functions | |
| static CoreApplication * | instance (void) |
| Returns the Singleton. More... | |
| static void | destroy () |
| Deletes the Singleton. More... | |
| static void | reset () |
| Resets the Singleton. More... | |
| static std::string | getVersion () |
| Gets the version number of the application. More... | |
| static void | getVersion (int &one, int &two, int &three, int &revision) |
| static unsigned int | getVersionYear () |
| static std::string | getVersionStr () |
| static std::string | getBuildDateTime () |
| static std::string | getDocumentVersion () |
| static int | getDocumentVersionAsInteger () |
| static long | getRefCount () |
| Returns the reference count of the Application. More... | |
Protected Member Functions | |
| Core::CoreDocument * | _newDocument (const std::string &typeName, const Base::String &name, bool createGui) |
| void | deleteDocument (Core::CoreDocument *doc) |
| Physically deletes a document. The maps are not effected. More... | |
Protected Member Functions inherited from Base::Subject< Core::AppChanges > | |
| std::vector< ObserverHolder > | getObserverSortedByPriority (const ObserverSetType &obs) |
Protected Attributes | |
| std::map< Base::String, Core::CoreDocument * > | _documentMap |
| Map of all documents. More... | |
Protected Attributes inherited from Base::Subject< Core::AppChanges > | |
| ObserverSetType | _ObserverSet |
| ObserverSetType | _ObserverSet_AddedLater |
| Set of attached observers. More... | |
| bool | _running_notify |
| Set of attached observers at running notify. More... | |
| std::list< Core::AppChanges > | _messages_WhileRunningNotify |
| std::map< std::string, double > | _observerTime |
Additional Inherited Members | |
Public Types inherited from Base::Subject< Core::AppChanges > | |
| typedef Observer< Core::AppChanges > | ObserverType |
| typedef Core::AppChanges | MessageType |
| typedef Subject< Core::AppChanges > | SubjectType |
Protected Types inherited from Base::Subject< Core::AppChanges > | |
| typedef std::set< ObserverHolder, CompareObservers > | ObserverSetType |
| Core::CoreApplication::CoreApplication | ( | int | argc, |
| char ** | argv | ||
| ) |
| Core::CoreApplication::~CoreApplication | ( | ) |
|
protected |
| bool Core::CoreApplication::add_TransactionObserver | ( | CA_TransactionObserver * | observer | ) |
| void Core::CoreApplication::closeApplication | ( | ) |
Closes the application.
| bool Core::CoreApplication::closeApplication | ( | bool | forceClose, |
| bool | dontNotify, | ||
| bool & | hardClose | ||
| ) |
| bool Core::CoreApplication::closeDocument | ( | Core::CoreDocument * | doc | ) |
Closes the document. Returns 'true' if successful, 'false' if canceled.
| bool Core::CoreApplication::closeDocument | ( | Core::CoreDocument * | doc, |
| bool | forceClose, | ||
| bool | dontNotify = false |
||
| ) |
Closes a document.
|
protected |
Physically deletes a document. The maps are not effected.
|
static |
Deletes the Singleton.
| void Core::CoreApplication::finalizePython | ( | ) |
Undo all initializations made in initPython() and subsequent use of Python/C API functions. Useful to restart Python without having to restart the application itself.
| Core::CoreDocument* Core::CoreApplication::getActiveDocument | ( | ) | const |
Returns the active document. Returns Null if there is no active document.
| Base::String Core::CoreApplication::getApplicationName | ( | ) | const |
Returns the name of the application.
| Base::String Core::CoreApplication::getApplicationPath | ( | ) | const |
Get the Application-Path.
|
static |
|
inline |
| ca_CommandObserver_Vector Core::CoreApplication::getCommandObserver | ( | ) |
Returns a List of CA_CommandObserver.
| Core::CoreDocument* Core::CoreApplication::getDocumentByName | ( | const Base::String & | name | ) |
Returns the document by name.
|
static |
|
static |
| std::string Core::CoreApplication::getModulePreferenceValue | ( | const std::string & | moduleName, |
| const std::string & | key | ||
| ) |
Returns the persistent value of a preference key for a module. Returns empty string if key or module was not found.
| int Core::CoreApplication::getOpenDocuments | ( | std::vector< Core::CoreDocument * > & | vec | ) |
| LoadedDll* Core::CoreApplication::getPartAcis | ( | ) |
|
static |
Returns the reference count of the Application.
| Base::String Core::CoreApplication::getTmpDirectory | ( | Core::CoreDocument * | doc | ) |
Gets the TempDir of the specified document. If doc = 0 takes the active document.
| CA_TransactionObserver_Vector Core::CoreApplication::getTransactionObservers | ( | ) |
| Base::String Core::CoreApplication::getUniqueDocumentName | ( | const Base::String & | s | ) | const |
|
static |
Gets the version number of the application.
|
static |
|
static |
|
static |
| bool Core::CoreApplication::hasGui | ( | ) | const |
| void Core::CoreApplication::initPython | ( | ) | const |
Initialize the Python interpreter (if not already initialized). Call it before using any other Python/C API functions.
|
static |
Returns the Singleton.
| bool Core::CoreApplication::isClosing | ( | ) | const |
| LoadedDll* Core::CoreApplication::loadDllByName | ( | Base::String | n | ) |
| Core::CoreDocument* Core::CoreApplication::newCoreDocument | ( | const std::string & | typeName, |
| const Base::String & | name = Base::String() |
||
| ) |
Creates a new document without Gui. The new document becomes NOT the active document. The document has default objects.
| Core::CoreDocument* Core::CoreApplication::newDocument | ( | const std::string & | typeName, |
| const Base::String & | name = Base::String(), |
||
| bool | createGui = true, |
||
| bool | setAsActiveDocument = true, |
||
| bool | createDefaultObjects = true |
||
| ) |
Creates a new document. If 'createGui = true' a GUI is created. If 'setAsActiveDocument = true' the new document becomes the active document. If 'createDefaultObjects = true' default objects are created.
| void Core::CoreApplication::notifyApp | ( | Core::CoreDocument * | doc, |
| AppChanges::why | why, | ||
| bool | createGui, | ||
| bool | setAsActiveDocument = true |
||
| ) |
| void Core::CoreApplication::notifyCmdObservers | ( | Core::CoreDocument * | doc, |
| bool | createGui | ||
| ) |
| void Core::CoreApplication::notifyDocumentChanged | ( | Core::CoreDocument * | doc, |
| Core::Property * | pro | ||
| ) |
| void Core::CoreApplication::notifyDocumentClosed | ( | Core::CoreDocument * | doc | ) |
| void Core::CoreApplication::notifyDocumentCreated | ( | Core::CoreDocument * | doc | ) |
| void Core::CoreApplication::notifyDocumentDeleted | ( | Core::CoreDocument * | doc | ) |
| void Core::CoreApplication::notifyDocumentFinishedRead | ( | Core::CoreDocument * | doc | ) |
| void Core::CoreApplication::notifyDocumentOpened | ( | Core::CoreDocument * | doc | ) |
| void Core::CoreApplication::notifyDocumentRenamed | ( | Core::CoreDocument * | doc | ) |
| void Core::CoreApplication::notifyDocumentSaved | ( | Core::CoreDocument * | doc | ) |
| void Core::CoreApplication::notifyDocumentSetActive | ( | Core::CoreDocument * | doc | ) |
| void Core::CoreApplication::notifyObject | ( | Core::CoreDocument * | doc, |
| Core::DocObject * | obj, | ||
| Core::Property * | pro, | ||
| CA_Transaction::why | transaction | ||
| ) |
| void Core::CoreApplication::notifyObjectAdded | ( | Core::CoreDocument * | doc, |
| Core::DocObject * | obj | ||
| ) |
| void Core::CoreApplication::notifyObjectChanged | ( | Core::CoreDocument * | doc, |
| Core::DocObject * | obj, | ||
| Core::Property * | pro | ||
| ) |
| void Core::CoreApplication::notifyObjectCreated | ( | Core::CoreDocument * | doc, |
| Core::DocObject * | obj | ||
| ) |
| void Core::CoreApplication::notifyObjectDeleted | ( | Core::CoreDocument * | doc, |
| Core::DocObject * | obj | ||
| ) |
| void Core::CoreApplication::notifyObjectHasError | ( | Core::CoreDocument * | doc, |
| Core::DocObject * | obj | ||
| ) |
| void Core::CoreApplication::notifyPropertyChanged | ( | Core::CoreDocument * | doc, |
| Core::DocObject * | obj, | ||
| Core::Property * | pro | ||
| ) |
| void Core::CoreApplication::notifyPropertyCreate | ( | Core::CoreDocument * | doc, |
| Core::DocObject * | obj, | ||
| Core::Property * | pro | ||
| ) |
| void Core::CoreApplication::notifyPropertyDeleted | ( | Core::CoreDocument * | doc, |
| Core::DocObject * | obj, | ||
| Core::Property * | pro | ||
| ) |
| void Core::CoreApplication::notifyRecomputeFailed | ( | Core::CoreDocument * | doc | ) |
| void Core::CoreApplication::notifyRecomputeSuccess | ( | Core::CoreDocument * | doc | ) |
| bool Core::CoreApplication::onClose | ( | bool | forceClose, |
| bool | dontNotify, | ||
| bool & | hardClose | ||
| ) |
| Core::CoreDocument* Core::CoreApplication::openCoreDocument | ( | const std::string & | typeName, |
| const Base::String & | path | ||
| ) |
Opens a document without Gui. The document path is not saved. The new document becomes NOT the active document.
| Core::CoreDocument* Core::CoreApplication::openDocument | ( | const std::string & | typeName, |
| const Base::String & | path = Base::String(), |
||
| bool | createGui = true, |
||
| bool | savepath = true, |
||
| bool | setAsActiveDocument = true |
||
| ) |
Opens a document. If no path is provided and the application has a Gui the user is prompted with a file selection dialog.
| void Core::CoreApplication::ref | ( | void | ) |
Increments the reference count by one.
| bool Core::CoreApplication::registerCommandObserver | ( | CA_CommandObserver * | observer | ) |
Register an Observer for Commands.
| bool Core::CoreApplication::remove_TransactionObserver | ( | CA_TransactionObserver * | observer | ) |
|
static |
Resets the Singleton.
| bool Core::CoreApplication::runPythonScript | ( | const Base::String & | scr, |
| Base::String & | err | ||
| ) | const |
| bool Core::CoreApplication::runPythonScript | ( | const Base::String & | scr | ) | const |
| bool Core::CoreApplication::runPythonString | ( | const Base::String & | str | ) | const |
| bool Core::CoreApplication::runPythonString | ( | const Base::String & | str, |
| Base::String & | err | ||
| ) | const |
| bool Core::CoreApplication::setActiveDocument | ( | Core::CoreDocument * | doc | ) |
Sets the active document.
| void Core::CoreApplication::setApplicationName | ( | const Base::String & | name | ) |
Sets the application name.
|
inline |
| void Core::CoreApplication::sethasGui | ( | bool | on | ) |
| void Core::CoreApplication::setModulePreferenceValue | ( | const std::string & | moduleName, |
| const std::string & | key, | ||
| const std::string & | value | ||
| ) |
Sets a persistent preference key and value for a module. On Windows the key and value are stored in the registry.
|
inlinevirtual |
Reimplemented from Base::Subject< Core::AppChanges >.
| void Core::CoreApplication::unref | ( | void | ) |
Decrements the reference count by one.
| bool Core::CoreApplication::unregisterCommandObserver | ( | CA_CommandObserver * | observer | ) |
Unregister an Observer for Commands.
|
protected |
Map of all documents.