    #ifndef __kaddressbook_idl__
    #define __kaddressbook_idl__

    #include <openparts.idl>

    module KAddressBook
    {

      enum EntityType { EntityTypeEntity, EntityTypeGroup };

      //forward references
      interface AddressBook;
      interface Group;
      interface Entity;
      interface Field;

      typedef sequence<wstring> StringList;
      typedef sequence<Field>   FieldList;
      typedef wstring           Key;
      typedef sequence<char>    Data;

      interface Field
      {
        Key     key     ();
        wstring type    ();
        wstring subType ();
        Data    value   ();

        void setKey     (in Key k);
        void setType    (in wstring t);
        void setSubType (in wstring t);
        void setValue   (in Data v);
      };

      interface Entity : KOM::Component
      {
        Key         id            ();
        wstring     name          ();
        EntityType  type          ();
        Field       field         (in wstring n);
        FieldList   fieldList     ();

        bool        rename        (in wstring n);
        bool        add           (in Field f);
        bool        remove        (in Field f);
        bool        removeByName  (in wstring n);
      };

      interface Group : Entity
      {
        wstring     name          ();
        StringList  members       ();

        void        addEntity     (in Entity e);
        void        addGroup      (in Group g);

        void        removeEntity  (in Entity e);
        void        removeGroup   (in Group g);
      };

      interface AddressBook
      {
        Entity  entity        (in Key k);
        Group   group         (in Key k);

        bool    addEntity     (in Entity e);
        bool    addGroup      (in Group g);
        bool    addByKey      (in Key k);
        bool    remove        (in Key k);
        bool    replaceEntity (in Entity e);
        bool    replaceGroup  (in Group g);
      };
    };

    #endif