# class ItemCreateJob

###

Module | akonadi
Namespace | Akonadi
Class | ItemCreateJob
Inherits | Akonadi::Job

Job that creates a new item in the Akonadi storage.

This job creates a new item with all the set properties in the given target collection.

Example:

    // Create a contact item in the root collection

    KABC.Addressee addr;
    addr.setNameFromString( "Joe Jr. Miller" );

    Akonadi.Item item;
    item.setMimeType( "text/directory" );
    item.setPayload<KABC.Addressee>( addr );

    Akonadi.Collection collection = Akonadi.Collection.root();

    Akonadi.ItemCreateJob *job = new Akonadi.ItemCreateJob( item, collection );

    if ( job->exec() )
    qDebug() << "Contact item created successfully";
    else
    qDebug() << "Error occurred";

Author Volker Krause <vkrause@kde.org>

### methods

- ItemCreateJob (item, collection, parent)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  item | Akonadi.Item |
  collection | Akonadi.Collection |
  parent | QObject | 0

  Creates a new item create job.

  item - The item to create. It must have a mime type set.

  collection - The parent collection where the new item shall be located in.

  parent - The parent object.

- doHandleResponse (tag, data)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  tag | QByteArray |
  data | QByteArray |

- doStart ( )

  returns Nothing

- item ( )

  returns Akonadi.Item

  Returns the created item with the new unique id, or an invalid item if the job failed.