FreeCAD C++
|
#include <Gui/Document.h>
The Gui Document This is the document on GUI level. Its main responsibility is keeping track off open windows for a document and warning on unsaved closes. All handled views on the document must inherit from MDIView
Public Member Functions | |
void | setModified (bool) |
Observer message from the App doc. | |
App::Document * | getDocument (void) const |
Getter for the App Document. | |
bool | canClose () |
handles the application close event | |
methods for View handling | |
Gui::MDIView * | getActiveView (void) const |
Getter for the active view. | |
void | setActiveWindow (Gui::MDIView *view) |
Gui::MDIView * | getEditingViewOfViewProvider (Gui::ViewProvider *) const |
Gui::MDIView * | getViewOfViewProvider (Gui::ViewProvider *) const |
Gui::MDIView * | getViewOfNode (SoNode *) const |
void | createView (const Base::Type &typeId) |
Create a new view. | |
Gui::MDIView * | cloneView (Gui::MDIView *) |
Create a clone of the given view. | |
bool | sendMsgToViews (const char *pMsg) |
send Messages to all views More... | |
bool | sendMsgToFirstView (const Base::Type &typeId, const char *pMsg, const char **ppReturn) |
void | attachView (Gui::BaseView *pcView, bool bPassiv=false) |
Attach a view (get called by the MDIView constructor) | |
void | detachView (Gui::BaseView *pcView, bool bPassiv=false) |
Detach a view (get called by the MDIView destructor) | |
ViewProvider * | getViewProviderByPathFromTail (SoPath *path) const |
helper for selection | |
void | onUpdate (void) |
call update on all attached views | |
void | onRelabel (void) |
call relabel to all attached views | |
std::list< MDIView * > | getMDIViews () const |
returns a list of all attached MDI views | |
std::list< MDIView * > | getMDIViewsOfType (const Base::Type &typeId) const |
returns a list of all MDI views of a certain type | |
View provider handling | |
ViewProvider * | getViewProvider (const App::DocumentObject *) const |
Get the view provider for that object. | |
void | setAnnotationViewProvider (const char *name, ViewProvider *pcProvider) |
set an annotation view provider | |
ViewProvider * | getAnnotationViewProvider (const char *name) const |
get an annotation view provider | |
void | removeAnnotationViewProvider (const char *name) |
remove an annotation view provider | |
bool | isShow (const char *name) |
test if the feature is in show | |
void | setShow (const char *name) |
put the feature in show | |
void | setHide (const char *name) |
set the feature in Noshow | |
void | setPos (const char *name, const Base::Matrix4D &rclMtrx) |
set the feature transformation (only viewing) | |
std::vector< ViewProvider * > | getViewProvidersOfType (const Base::Type &typeId) const |
ViewProvider * | getViewProviderByName (const char *name) const |
bool | setEdit (Gui::ViewProvider *p, int ModNum=0) |
set the ViewProvider in special edit mode | |
void | resetEdit (void) |
reset from edit mode | |
ViewProvider * | getInEdit (void) const |
get the in edit ViewProvider or NULL | |
methods for the UNDO REDO handling | |
void | openCommand (const char *sName=0) |
Open a new Undo transaction on the document. | |
void | commitCommand (void) |
Commit the Undo transaction on the document. | |
void | abortCommand (void) |
Abort the Undo transaction on the document. | |
bool | hasPendingCommand (void) const |
Check if an Undo transaction is open. | |
std::vector< std::string > | getUndoVector (void) const |
Get an Undo string vector with the Undo names. | |
std::vector< std::string > | getRedoVector (void) const |
Get an Redo string vector with the Redo names. | |
void | undo (int iSteps) |
Will UNDO one or more steps. | |
void | redo (int iSteps) |
Will REDO one or more steps. | |
![]() | |
BaseClass () | |
Construction. | |
virtual | ~BaseClass () |
Destruction. | |
Public Attributes | |
Signals of the document | |
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &)> | signalNewObject |
signal on new Object | |
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &)> | signalDeletedObject |
signal on deleted Object | |
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &, const App::Property &)> | signalChangedObject |
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &)> | signalRelabelObject |
signal on renamed Object | |
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &)> | signalActivatedObject |
signal on activated Object | |
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &)> | signalInEdit |
signal on entering in edit mode | |
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &)> | signalResetEdit |
signal on leaving edit mode | |
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &, const Gui::HighlightMode &, bool)> | signalHighlightObject |
signal on changed Object, the 2nd argument is the highlite mode to use | |
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &, const Gui::TreeItemMode &)> | signalExpandObject |
signal on changed Object, the 2nd argument is the highlite mode to use | |
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &)> | signalScrollToObject |
signal on scrolling to an object | |
boost::signals2::signal< void(const Gui::Document &doc)> | signalUndoDocument |
signal on undo Document | |
boost::signals2::signal< void(const Gui::Document &doc)> | signalRedoDocument |
signal on redo Document | |
boost::signals2::signal< void(const Gui::Document &doc)> | signalDeleteDocument |
signal on deleting Document | |
I/O of the document | |
unsigned int | getMemSize (void) const |
bool | save (void) |
Save the document. | |
bool | saveAs (void) |
Save the document under a new file name. | |
bool | saveCopy (void) |
Save a copy of the document under a new file name. | |
virtual void | Save (Base::Writer &writer) const |
This method is used to save properties or very small amounts of data to an XML document. | |
virtual void | Restore (Base::XMLReader &reader) |
This method is used to restore properties from an XML document. | |
virtual void | SaveDocFile (Base::Writer &writer) const |
This method is used to save large amounts of data to a binary file. | |
virtual void | RestoreDocFile (Base::Reader &reader) |
This method is used to restore large amounts of data from a binary file. | |
void | exportObjects (const std::vector< App::DocumentObject * > &, Base::Writer &) |
void | importObjects (const std::vector< App::DocumentObject * > &, Base::Reader &, const std::map< std::string, std::string > &nameMapping) |
void | addRootObjectsToGroup (const std::vector< App::DocumentObject * > &, App::DocumentObjectGroup *) |
Add all root objects of the given array to a group. | |
void | slotNewObject (const App::DocumentObject &) |
This slot is connected to the App::Document::signalNewObject(...) | |
void | slotDeletedObject (const App::DocumentObject &) |
void | slotChangedObject (const App::DocumentObject &, const App::Property &) |
void | slotRelabelObject (const App::DocumentObject &) |
void | slotTransactionAppend (const App::DocumentObject &, App::Transaction *) |
void | slotTransactionRemove (const App::DocumentObject &, App::Transaction *) |
void | slotActivatedObject (const App::DocumentObject &) |
void | slotStartRestoreDocument (const App::Document &) |
void | slotFinishRestoreDocument (const App::Document &) |
void | slotUndoDocument (const App::Document &) |
void | slotRedoDocument (const App::Document &) |
Additional Inherited Members | |
![]() | |
static std::string | encodeAttribute (const std::string &) |
Encodes an attribute upon saving. | |
bool Gui::Document::sendMsgToFirstView | ( | const Base::Type & | typeId, |
const char * | pMsg, | ||
const char ** | ppReturn | ||
) |
Sends the message pMsg to the views of type typeid and stops with the first view that supports the message and returns ppReturn. The very first checked view is the current active view. If a view supports the message true is returned and false otherwise.
bool Gui::Document::sendMsgToViews | ( | const char * | pMsg | ) |
send Messages to all views
send messages to the active view Send a specific massage to the active view and is able to receive a return message
|
mutable |
signal on changed Object, the 2nd argument is the changed property of the referenced document object, not of the view provider