kexi

#include <manager.h>

Public Member Functions

KXMLGUIClient * guiClient () const
bool hasMacro (const TQString &macroname)
TDESharedPtr< Macro > getMacro (const TQString &macroname)
void addMacro (const TQString &macroname, TDESharedPtr< Macro > macro)
void removeMacro (const TQString &macroname)
TDESharedPtr< Macro > createMacro (const TQString &macroname)
TDESharedPtr< Action > action (const TQString &name) const
TQMap< TQString, TDESharedPtr< Action > > actions () const
TQStringList actionNames () const
void publishAction (TDESharedPtr< Action > action)
void publishObject (const TQString &name, TQObject *object)
TQGuardedPtr< TQObject > object (const TQString &name) const
TQMap< TQString, TQGuardedPtr< TQObject > > objects () const

Static Public Member Functions

static void init (KXMLGUIClient *xmlguiclient)
static Manager * self ()

Friends

class KStaticDeleter< ::KoMacro::Manager >

Detailed Description

The Manager class acts as window-wide manager for macros.

Example how KoMacro could be used.

// We have a class that inheritates from TQObject and
// implements some public signals and slots that will
// be accessible by Macros once a class-instance
// got published.
class PublishedObject : public TQObject {};
// Somewhere we have our TDEMainWindow.
TDEMainWindow* mainwindow = new TDEMainWindow();
// Create a new KoMacro::Manager instance to access the
// Macro-framework.
KoMacro::Manager* manager = new KoMacro::Manager( mainwindow );
// Now we like to publish a TQObject
PublishedObject* publishedobject = new PublishedObject();
manager->publishObject(publishedobject);
// ... here we are able to use manager->createAction() to
// create Action instances on the fly and work with them.
// Finally free the publishedobject instance we created. We
// need to free it manualy cause PublishedObject doesn't
// got a TQObject parent as argument.
delete publishedobject;
// Finally free the manager-instance. It's always needed
// to free the instance by yourself!
delete manager;
The Manager class acts as window-wide manager for macros.
Definition manager.h:76
void publishObject(const TQString &name, TQObject *object)
Publish the passed TQObject object.
Definition manager.cpp:156

Definition at line 75 of file manager.h.

Member Function Documentation

◆ action()

TDESharedPtr< Action > Manager::action ( const TQString & name) const
Returns
the Action which was published under the name name or returns an empty TDESharedPtr<Action> object if there was no such Action published.

Definition at line 132 of file manager.cpp.

◆ actionNames()

TQStringList Manager::actionNames ( ) const
Returns
a list of all published actions.

Definition at line 142 of file manager.cpp.

◆ actions()

Action::Map Manager::actions ( ) const
Returns
a map of all published actions.

Definition at line 137 of file manager.cpp.

◆ addMacro()

void Manager::addMacro ( const TQString & macroname,
TDESharedPtr< Macro > macro )

Add a new Macro to the list of known macros.

If there exists already a Macro instance with the defined macroname then the already existing one will be replace.

Parameters
macronameThe name the Macro will be accessible as.
macroThe Macro instance.

Definition at line 116 of file manager.cpp.

◆ createMacro()

TDESharedPtr< Macro > Manager::createMacro ( const TQString & macroname)

Factory function to create a new Macro instances.

The returned new Macro instance will not be added to the list of known macros. Use addMacro if you like to attach the returned new Macro to this Manager instance.

Definition at line 126 of file manager.cpp.

◆ getMacro()

TDESharedPtr< Macro > Manager::getMacro ( const TQString & macroname)
Returns
the Macro defined with macroname or NULL if we don't have such a Macro.

Definition at line 111 of file manager.cpp.

◆ guiClient()

KXMLGUIClient * Manager::guiClient ( ) const
Returns
the KXMLGUIClient instance this Manager is associated with.

Definition at line 101 of file manager.cpp.

◆ hasMacro()

bool Manager::hasMacro ( const TQString & macroname)
Returns
true if we carry a Macro with the defined macroname .

Definition at line 106 of file manager.cpp.

◆ init()

void Manager::init ( KXMLGUIClient * xmlguiclient)
static

Initialize this Manager singleton.

This function needs to be called exactly once to initialize the Manager singleton before self() got used.

Definition at line 65 of file manager.cpp.

◆ object()

TQGuardedPtr< TQObject > Manager::object ( const TQString & name) const
Returns
the publish TQObject defined with name name or NULL if there exists no such object.

Definition at line 162 of file manager.cpp.

◆ objects()

TQMap< TQString, TQGuardedPtr< TQObject > > Manager::objects ( ) const
Returns
a map of the published TQObject instances.

Definition at line 167 of file manager.cpp.

◆ publishAction()

void Manager::publishAction ( TDESharedPtr< Action > action)

Publish the Action action .

The published Action will be accessible via it's unique name.

Definition at line 147 of file manager.cpp.

◆ publishObject()

void Manager::publishObject ( const TQString & name,
TQObject * object )

Publish the passed TQObject object.

Those object will provide it's slots as callable functions.

Definition at line 156 of file manager.cpp.

◆ removeMacro()

void Manager::removeMacro ( const TQString & macroname)

Remove the Macro defined with macroname .

If we don't know about a Macro with that macroname nothing happens.

Definition at line 121 of file manager.cpp.

◆ self()

Manager * Manager::self ( )
static
Returns
a pointer to a Manager singleton-instance. The static method init() needs to be called exactly once before calling this method else we may return NULL .

Definition at line 76 of file manager.cpp.

◆ KStaticDeleter< ::KoMacro::Manager >

friend class KStaticDeleter< ::KoMacro::Manager >
friend

Definition at line 75 of file manager.h.


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