App::Application Class Reference

The Application The root of the whole application. More...

#include <Application.h>

List of all members.

Public Member Functions

const char * getExecutableName (void) const
const char * GetHomePath (void) const



void addExportType (const char *Type, const char *ModuleName)
 Register an export filetype and a module name.
std::map< std::string,
std::string > 
getExportFilters (void) const
 Return a list of all export filters.
std::map< std::string,
std::string > 
getExportFilters (const char *Type) const
 Return the export filters with modules of a given filetype.
std::vector< std::string > getExportModules () const
 Return a list of all modules.
std::vector< std::string > getExportModules (const char *Type) const
 Return a list of modules that support the given filetype.
std::vector< std::string > getExportTypes (void) const
 Return a list of all filetypes.
std::vector< std::string > getExportTypes (const char *Module) const
 Return a list of filetypes that are supported by a module.
methods for the open handler

With this facility a Application module can register a ending (filetype) which he can handle to open.

The ending and the module name are stored and if the file type is opened the module get loaded and need to register a OpenHandler class in the OpenHandlerFactorySingleton. After the module is loaded a OpenHandler of this type is created and the file get loaded.

See also:
OpenHandler
OpenHandlerFactorySingleton


void addImportType (const char *Type, const char *ModuleName)
 Register an import filetype and a module name.
std::map< std::string,
std::string > 
getImportFilters (void) const
 Return a list of all import filters.
std::map< std::string,
std::string > 
getImportFilters (const char *Type) const
 Return the import filters with modules of a given filetype.
std::vector< std::string > getImportModules () const
 Return a list of all modules.
std::vector< std::string > getImportModules (const char *Type) const
 Return a list of modules that support the given filetype.
std::vector< std::string > getImportTypes (void) const
 Return a list of all filetypes.
std::vector< std::string > getImportTypes (const char *Module) const
 Return a list of filetypes that are supported by a module.
methods for parameter handling



void AddParameterSet (const char *sName)
Base::Reference< ParameterGrpGetParameterGroupByPath (const char *sName)
 Gets a parameter group by a full qualified path It's an easy method to get a group:.
ParameterManagerGetParameterSet (const char *sName) const
const std::map< std::string,
ParameterManager * > & 
GetParameterSetList (void) const
ParameterManagerGetSystemParameter (void)
 returns the system parameter
ParameterManagerGetUserParameter (void)
 returns the user parameter
void RemoveParameterSet (const char *sName)
methods for document handling



void closeAllDocuments (void)
 close all documents (without saving)
bool closeDocument (const char *name)
 Closes the document name and removes it from the application.
App::DocumentgetActiveDocument (void) const
 Retrieve the active document.
App::DocumentgetDocument (const char *Name) const
 Retrieve a named document.
const char * getDocumentName (const App::Document *) const
 gets the (internal) name of the document
std::vector< App::Document * > getDocuments () const
 get a list of all documents in the application
std::string getUniqueDocumentName (const char *Name) const
 find a unique docuement name
App::DocumentnewDocument (const char *Name=0l, const char *UserName=0l)
 Creates a new document The first name is a the identifier and some kind of an internal (english) name.
App::DocumentopenDocument (const char *FileName=0l)
 Open an existing document from a file.
void setActiveDocument (const char *Name)
void setActiveDocument (App::Document *pDoc)
 Set the active document.

Static Public Member Functions

static std::string getHelpDir ()
static std::string getResourceDir ()
static std::string getUserAppDataDir ()

Public Attributes

Signals of the document

This signals are an agregation of all document.

If you only the signal of a special document connect to the document itself



boost::signal< void(const
App::DocumentObject &)> 
signalActivatedObject
 signal on activated Object
boost::signal< void(const
App::DocumentObject &, const
App::Property &)> 
signalChangedObject
 signal on changed Object
boost::signal< void(const
App::DocumentObject &)> 
signalDeletedObject
 signal on deleted Object
boost::signal< void(const
App::DocumentObject &)> 
signalNewObject
 signal on new Object
boost::signal< void(const
App::DocumentObject &)> 
signalRenamedObject
 signal on renamed Object
Signals of the Application



boost::signal< void(const
Document &)> 
signalActiveDocument
 signal on activating Document
boost::signal< void()> signalDeletedDocument
 signal on already deleted Document
boost::signal< void(const
Document &)> 
signalDeleteDocument
 signal on document getting deleted
boost::signal< void(const
Document &)> 
signalNewDocument
 signal on new Document
boost::signal< void(const
Document &)> 
signalRelabelDocument
 signal on relabeling Document (user name)
boost::signal< void(const
Document &)> 
signalRenameDocument
 signal on renaming Document (internal name)
boost::signal< void(const
Document &)> 
signalRestoreDocument
 signal on restoring Document
boost::signal< void(const
Document &)> 
signalSaveDocument
 signal on saving Document

Protected Member Functions

void renameDocument (const char *OldName, const char *NewName)
 get called by the document when the name is changing
I/O of the document

This slot get connected to all App::Documents created



void slotActivatedObject (const App::DocumentObject &)
void slotChangedObject (const App::DocumentObject &, const App::Property &Prop)
void slotDeletedObject (const App::DocumentObject &)
void slotNewObject (const App::DocumentObject &)
void slotRenamedObject (const App::DocumentObject &)

Friends

class App::Document
class ApplicationObserver

Init, Destruct an Access methods



ApplicationGetApplication (void)
 Singleton getter of the Applicaton.
static std::map< std::string,
std::string > & 
Config (void)
static void destruct (void)
static void destructObserver (void)
static int GetARGC (void)
static char ** GetARGV (void)
static void init (int argc, char **argv)
static void initTypes (void)
static void processCmdLineFiles (void)
static void runApplication (void)

Detailed Description

The Application The root of the whole application.

See also:
App::Document

Definition at line 57 of file App/Application.h.


Member Function Documentation

void Application::addExportType ( const char *  Type,
const char *  ModuleName 
)

Register an export filetype and a module name.

Definition at line 674 of file App/Application.cpp.

References Config(), RobotExample::pos, and Py::type().

void Application::addImportType ( const char *  Type,
const char *  ModuleName 
)

Register an import filetype and a module name.

Definition at line 561 of file App/Application.cpp.

References Config(), RobotExample::pos, and Py::type().

void Application::AddParameterSet ( const char *  sName  ) 

Definition at line 521 of file App/Application.cpp.

void Application::closeAllDocuments ( void   ) 

close all documents (without saving)

Definition at line 324 of file App/Application.cpp.

References closeDocument(), and RobotExample::pos.

Referenced by Gui::GUIApplication::commitData(), and main().

bool Application::closeDocument ( const char *  name  ) 

Closes the document name and removes it from the application.

Definition at line 299 of file App/Application.cpp.

References RobotExample::pos, setActiveDocument(), signalDeletedDocument, and signalDeleteDocument.

Referenced by CmdSandboxDocumentNoThread::activated(), closeAllDocuments(), and Gui::Application::tryClose().

static std::map<std::string,std::string>& App::Application::Config ( void   )  [inline, static]
void Application::destruct ( void   )  [static]
void Application::destructObserver ( void   )  [static]
Document * Application::getActiveDocument ( void   )  const

Retrieve the active document.

Definition at line 419 of file App/Application.cpp.

Referenced by PartDesignGui::ChamferWidget::accept(), PartGui::DlgRevolution::accept(), PartGui::DlgPrimitives::accept(), PartGui::DlgFilletEdges::accept(), PartGui::DlgBooleanOperation::accept(), StdCmdSelectAll::activated(), StdCmdDDuplicateSelection::activated(), StdCmdMergeProjects::activated(), CmdSketcherMapSketch::activated(), CmdSandboxMeshTestJob::activated(), CmdSandboxMeshLoaderFuture::activated(), CmdSandboxMeshLoaderBoost::activated(), CmdSandboxMeshLoader::activated(), CmdSandboxDocumentNoThread::activated(), CmdRaytracingNewPartSegment::activated(), CmdMeshFromGeometry::activated(), Gui::PropertyEditor::PropertyEditor::closeEditor(), Gui::TreeWidget::contextMenuEvent(), PartDesignGui::ChamferWidget::findShapes(), PartGui::DlgFilletEdges::findShapes(), PartGui::DlgExtrusion::findShapes(), Gui::SelectionSingleton::getDocument(), importer(), Gui::MainWindow::insertFromMimeData(), StdCmdMeasureDistance::isActive(), StdCmdHideObjects::isActive(), StdCmdShowObjects::isActive(), StdCmdToggleObjects::isActive(), StdCmdSelectAll::isActive(), CmdRaytracingWriteView::isActive(), CmdShapeInfo::isActive(), CmdMeshFillInteractiveHole::isActive(), CmdMeshRemoveCompByHand::isActive(), CmdMeshEvaluateFacet::isActive(), CmdMeshEvaluation::isActive(), CmdMeshVertexCurvatureInfo::isActive(), CmdMeshFromGeometry::isActive(), CmdInspectElement::isActive(), CmdVisualInspection::isActive(), CmdCreateImagePlane::isActive(), MeshGui::DlgRegularSolidImp::on_createSolidButton_clicked(), Gui::Application::open(), Sandbox::DocumentTestThread::run(), Sandbox::DocumentThread::run(), Gui::TaskView::TaskWatcherCommandsEmptyDoc::shouldShow(), show(), Gui::Application::sInsert(), MeshGui::ViewProviderMesh::splitMesh(), and InspectionGui::VisualInspection::VisualInspection().

static int App::Application::GetARGC ( void   )  [inline, static]

Definition at line 216 of file App/Application.h.

Referenced by Gui::Application::runApplication().

static char** App::Application::GetARGV ( void   )  [inline, static]

Definition at line 217 of file App/Application.h.

Referenced by Gui::Application::runApplication().

App::Document * Application::getDocument ( const char *  Name  )  const
const char * Application::getDocumentName ( const App::Document doc  )  const
std::vector< App::Document * > Application::getDocuments (  )  const
const char * Application::getExecutableName ( void   )  const

Definition at line 469 of file App/Application.cpp.

Referenced by App::Document::Document(), and App::Document::Restore().

std::map< std::string, std::string > Application::getExportFilters ( void   )  const

Return a list of all export filters.

Definition at line 777 of file App/Application.cpp.

std::map< std::string, std::string > Application::getExportFilters ( const char *  Type  )  const

Return the export filters with modules of a given filetype.

Definition at line 759 of file App/Application.cpp.

Referenced by StdCmdExport::activated(), and Gui::SelectModule::exportHandler().

std::vector< std::string > Application::getExportModules (  )  const

Return a list of all modules.

Definition at line 721 of file App/Application.cpp.

std::vector< std::string > Application::getExportModules ( const char *  Type  )  const

Return a list of modules that support the given filetype.

Definition at line 703 of file App/Application.cpp.

std::vector< std::string > Application::getExportTypes ( void   )  const

Return a list of all filetypes.

Definition at line 746 of file App/Application.cpp.

std::vector< std::string > Application::getExportTypes ( const char *  Module  )  const

Return a list of filetypes that are supported by a module.

Definition at line 731 of file App/Application.cpp.

Referenced by StdCmdExport::activated().

std::string Application::getHelpDir (  )  [static]
const char * Application::GetHomePath ( void   )  const
std::map< std::string, std::string > Application::getImportFilters ( void   )  const

Return a list of all import filters.

Definition at line 664 of file App/Application.cpp.

std::map< std::string, std::string > Application::getImportFilters ( const char *  Type  )  const

Return the import filters with modules of a given filetype.

Definition at line 646 of file App/Application.cpp.

Referenced by StdCmdImport::activated(), StdCmdOpen::activated(), and Gui::SelectModule::importHandler().

std::vector< std::string > Application::getImportModules (  )  const

Return a list of all modules.

Definition at line 608 of file App/Application.cpp.

std::vector< std::string > Application::getImportModules ( const char *  Type  )  const

Return a list of modules that support the given filetype.

Definition at line 590 of file App/Application.cpp.

Referenced by Gui::MainWindow::loadUrls(), and processCmdLineFiles().

std::vector< std::string > Application::getImportTypes ( void   )  const

Return a list of all filetypes.

Definition at line 633 of file App/Application.cpp.

std::vector< std::string > Application::getImportTypes ( const char *  Module  )  const

Return a list of filetypes that are supported by a module.

Definition at line 618 of file App/Application.cpp.

Referenced by StdCmdImport::activated(), and StdCmdOpen::activated().

Base::Reference< ParameterGrp > Application::GetParameterGroupByPath ( const char *  sName  ) 
ParameterManager * Application::GetParameterSet ( const char *  sName  )  const
const std::map< std::string, ParameterManager * > & Application::GetParameterSetList ( void   )  const

Definition at line 516 of file App/Application.cpp.

Referenced by Gui::Dialog::DlgParameterImp::DlgParameterImp().

std::string Application::getResourceDir (  )  [static]
ParameterManager & Application::GetSystemParameter ( void   ) 

returns the system parameter

Definition at line 497 of file App/Application.cpp.

std::string Application::getUniqueDocumentName ( const char *  Name  )  const

find a unique docuement name

Definition at line 360 of file App/Application.cpp.

References Base::Tools::getIdentifier(), Base::Tools::getUniqueName(), and RobotExample::pos.

Referenced by newDocument().

std::string Application::getUserAppDataDir (  )  [static]
ParameterManager & Application::GetUserParameter ( void   ) 
void Application::init ( int  argc,
char **  argv 
) [static]
void Application::initTypes ( void   )  [static]

Definition at line 949 of file App/Application.cpp.

References init().

Referenced by init().

Document * Application::newDocument ( const char *  Name = 0l,
const char *  UserName = 0l 
)

Creates a new document The first name is a the identifier and some kind of an internal (english) name.

It has to be like an identifier in a programming language, with no spaces and not starting with a number. This name gets also forced to be unique in this Application. You can avoid the renaming by using getUniqueDocumentName() to get a unique name before calling newDoucument(). The second name is a UTF8 name of any kind. It's that name normally shown to the user and stored in the App::Document::Name property.

Definition at line 259 of file App/Application.cpp.

References draftlibs::fcgeo::bind(), App::Document::getPyObject(), getUniqueDocumentName(), App::Document::Label, App::PropertyString::setValue(), App::Document::signalActivatedObject, App::Document::signalChangedObject, App::Document::signalDeletedObject, signalNewDocument, App::Document::signalNewObject, App::Document::signalRenamedObject, slotActivatedObject(), slotChangedObject(), slotDeletedObject(), slotNewObject(), and slotRenamedObject().

Referenced by CmdSandboxDocThreadWithFileDlg::activated(), CmdSandboxDocThreadWithDialog::activated(), CmdSandboxPythonThread::activated(), CmdSandboxDocumentNoThread::activated(), CmdSandboxDocThreadBusy::activated(), CmdSandboxDocThreadWithSeq::activated(), CmdSandboxDocumentTestThread::activated(), CmdSandboxDocumentThread::activated(), importer(), insert(), Gui::MainWindow::insertFromMimeData(), open(), openDocument(), Gui::Application::runApplication(), show(), Gui::Application::sInsert(), and Gui::Application::sOpen().

Document * Application::openDocument ( const char *  FileName = 0l  ) 
void Application::processCmdLineFiles ( void   )  [static]
void Application::RemoveParameterSet ( const char *  sName  ) 

Definition at line 529 of file App/Application.cpp.

void Application::renameDocument ( const char *  OldName,
const char *  NewName 
) [protected]

get called by the document when the name is changing

Definition at line 242 of file App/Application.cpp.

References RobotExample::pos, and signalRenameDocument.

void Application::runApplication ( void   )  [static]
void Application::setActiveDocument ( const char *  Name  ) 

Definition at line 443 of file App/Application.cpp.

References RobotExample::pos, and setActiveDocument().

void Application::setActiveDocument ( App::Document pDoc  ) 

Set the active document.

Definition at line 424 of file App/Application.cpp.

References App::Document::getPyObject(), Py::None(), and signalActiveDocument.

Referenced by closeDocument(), and setActiveDocument().

void Application::slotActivatedObject ( const App::DocumentObject O  )  [protected]

Definition at line 809 of file App/Application.cpp.

References signalActivatedObject.

Referenced by newDocument().

void Application::slotChangedObject ( const App::DocumentObject O,
const App::Property Prop 
) [protected]

Definition at line 799 of file App/Application.cpp.

References signalChangedObject.

Referenced by newDocument().

void Application::slotDeletedObject ( const App::DocumentObject O  )  [protected]

Definition at line 794 of file App/Application.cpp.

References signalDeletedObject.

Referenced by newDocument().

void Application::slotNewObject ( const App::DocumentObject O  )  [protected]

Definition at line 789 of file App/Application.cpp.

References signalNewObject.

Referenced by newDocument().

void Application::slotRenamedObject ( const App::DocumentObject O  )  [protected]

Definition at line 804 of file App/Application.cpp.

References signalRenamedObject.

Referenced by newDocument().


Friends And Related Function Documentation

friend class App::Document [friend]

Definition at line 226 of file App/Application.h.

friend class ApplicationObserver [friend]

Definition at line 292 of file App/Application.h.

Application& GetApplication ( void   )  [friend]

Singleton getter of the Applicaton.

Definition at line 340 of file App/Application.h.

Referenced by processCmdLineFiles().


Member Data Documentation

signal on activated Object

Definition at line 135 of file App/Application.h.

Referenced by slotActivatedObject().

boost::signal<void (const Document&)> App::Application::signalActiveDocument

signal on already deleted Document

Definition at line 106 of file App/Application.h.

Referenced by closeDocument(), and Gui::TaskView::TaskView::TaskView().

boost::signal<void (const Document&)> App::Application::signalDeleteDocument
boost::signal<void (const Document&)> App::Application::signalNewDocument
boost::signal<void (const Document&)> App::Application::signalRelabelDocument

signal on renamed Object

Definition at line 133 of file App/Application.h.

Referenced by Gui::SelectionSingleton::SelectionSingleton(), and slotRenamedObject().

boost::signal<void (const Document&)> App::Application::signalRenameDocument

signal on renaming Document (internal name)

Definition at line 110 of file App/Application.h.

Referenced by Gui::Application::Application(), and renameDocument().

boost::signal<void (const Document&)> App::Application::signalRestoreDocument

signal on restoring Document

Definition at line 116 of file App/Application.h.

Referenced by Gui::Document::Document(), and App::Document::restore().

boost::signal<void (const Document&)> App::Application::signalSaveDocument

signal on saving Document

Definition at line 114 of file App/Application.h.

Referenced by App::Document::save().


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

Generated on Wed Nov 23 19:01:42 2011 for FreeCAD by  doxygen 1.6.1