# class AgentInstanceCreateJob

###

Module | akonadi
Namespace | Akonadi
Class | AgentInstanceCreateJob
Inherits | KJob

Job for creating new agent instances.

This class encapsulates the procedure of creating a new agent instance and optionally configuring it immediately.

    MyClass.MyClass( QWidget *parent )
    : QWidget( parent )
    {
    // Get agent type object
    Akonadi.AgentType type = Akonadi.AgentManager.type( "akonadi_vcard_resource" );

    Akonadi.AgentInstanceCreateJob *job = new Akonadi.AgentInstanceCreateJob( type );
    connect( job, SIGNAL( result( KJob * ) ),
    this, SLOT( slotCreated( KJob * ) ) );

    // use this widget as parent for the config dialog
    job->configure( this );

    job->start();
    }

    ...

    void MyClass.slotCreated( KJob *job )
    {
    Akonadi.AgentInstanceCreateJob *createJob = static_cast<Akonadi.AgentInstanceCreateJob*>( job );

    qDebug() << "Created agent instance:" << createJob->instance().identifier();
    }

Author Volker Krause <vkrause@kde.org>

### methods

- AgentInstanceCreateJob (type, parent)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  type | Akonadi.AgentType |
  parent | QObject | 0

  Create a new agent instance creation job.

  type - The type of the agent to create.

  parent - The parent object.

- configure (parent)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  parent | QWidget | 0

  Setup the job to show agent configuration dialog once the agent instance has been successfully started.

  parent - The parent window for the configuration dialog.

- instance ( )

  returns Akonadi.AgentInstance

  Returns the AgentInstance object of the newly created agent instance.

- start ( )

  returns Nothing

  Starts the instance creation.