FreeCAD C++
Public Types | Public Member Functions | Protected Attributes | List of all members
Gui::MacroManager Class Reference

#include <Gui/Macro.h>

Detailed Description

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).

Author
Jürgen Riegel

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)
 
- Public Member Functions inherited from Base::Observer< const char * >
 Observer ()
 
virtual ~Observer ()
 
virtual void OnDestroy (Subject< const char * > &rCaller)
 
virtual const char * Name (void)
 

Protected Attributes

QStringList macroInProgress
 
QString macroName
 

Member Enumeration Documentation

◆ LineType

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

◆ MacroType

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

Member Function Documentation

◆ OnChange()

void Gui::MacroManager::OnChange ( Base::Subject< const char * > &  rCaller,
const char *  sReason 
)
virtual

Observes its parameter group.

Implements Base::Observer< const char * >.

◆ open()

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:

Parameters
eTypeType of the macro
sNameName or path of the macro
See also
commit()
cancel()

◆ setModule()

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.

Member Data Documentation

◆ macroInProgress

QStringList Gui::MacroManager::macroInProgress
protected

Container for the macro

◆ macroName

QString Gui::MacroManager::macroName
protected

name of the macro