FreeCAD C++
|
#include <Gui/Macro.h>
Macro recording and play back management The purpos of this class is to handle record function calls from a command and save it in a macro file (so far).
Public Types | |
enum | MacroType { File, User, Doc } |
enum | LineType { App, Gui, Cmt } |
Public Member Functions | |
void | open (MacroType eType, const char *sName) |
void | commit (void) |
close (and save) the recording session | |
void | cancel (void) |
cancels the recording session | |
bool | isOpen (void) const |
indicates if a macro recording in in progress | |
void | addLine (LineType Type, const char *sLine) |
insert a new line in the macro | |
void | setModule (const char *sModule) |
PythonDebugger * | debugger () const |
Get the Python debugger. | |
void | OnChange (Base::Subject< const char * > &rCaller, const char *sReason) |
![]() | |
Observer () | |
virtual | ~Observer () |
virtual void | OnDestroy (Subject< const char * > &rCaller) |
virtual const char * | Name (void) |
Protected Attributes | |
QStringList | macroInProgress |
QString | macroName |
Line type enumeration
Enumerator | |
---|---|
App | The line effects only the document and Application (FreeCAD) |
Gui | The line effects the Gui (FreeCADGui) |
Cmt | The line is handled as a comment |
Macro type enumeration
Enumerator | |
---|---|
File | The macro will be saved in a file |
User | The macro belongs to the Application and will be saved in the UserParameter |
Doc | The macro belongs to the Document and will be saved and restored with the Document |
|
virtual |
Observes its parameter group.
Implements Base::Observer< const char * >.
void Gui::MacroManager::open | ( | MacroType | eType, |
const char * | sName | ||
) |
Opens a new Macro recording session Starts a session with the type and the name of the macro. All user interactions will be recorded as long as the commit() or cancel() isn't called. There is only one recording session possible. Trying to open a second one causes an exception:
eType | Type of the macro |
sName | Name or path of the macro |
void Gui::MacroManager::setModule | ( | const char * | sModule | ) |
Set the active module This is normally done by the workbench switch. It sets the actually active application module so when the macro gets started the right import can be issued.
|
protected |
Container for the macro
|
protected |
name of the macro