src/versit/qversitcontactimporter.h
changeset 5 603d3f8b6302
parent 0 876b1a06bc25
equal deleted inserted replaced
3:e4ebb16b39ea 5:603d3f8b6302
    71 };
    71 };
    72 
    72 
    73 class Q_VERSIT_EXPORT QVersitContactImporterPropertyHandlerV2
    73 class Q_VERSIT_EXPORT QVersitContactImporterPropertyHandlerV2
    74 {
    74 {
    75 public:
    75 public:
    76     static QVersitContactImporterPropertyHandlerV2* createBackupHandler();
       
    77     virtual ~QVersitContactImporterPropertyHandlerV2() {}
    76     virtual ~QVersitContactImporterPropertyHandlerV2() {}
    78     virtual void propertyProcessed(const QVersitDocument& document,
    77     virtual void propertyProcessed(const QVersitDocument& document,
    79                                    const QVersitProperty& property,
    78                                    const QVersitProperty& property,
    80                                    bool alreadyProcessed,
       
    81                                    const QContact& contact,
    79                                    const QContact& contact,
       
    80                                    bool *alreadyProcessed,
    82                                    QList<QContactDetail>* updatedDetails) = 0;
    81                                    QList<QContactDetail>* updatedDetails) = 0;
    83     virtual void documentProcessed(const QVersitDocument& document,
    82     virtual void documentProcessed(const QVersitDocument& document,
    84                                    QContact* contact) = 0;
    83                                    QContact* contact) = 0;
    85     virtual int version() const { return 2; }
       
    86 };
    84 };
    87 
    85 
    88 class Q_VERSIT_EXPORT QVersitContactImporter
    86 class Q_VERSIT_EXPORT QVersitContactImporter
    89 {
    87 {
    90 public:
    88 public:
    93         InvalidDocumentError,
    91         InvalidDocumentError,
    94         EmptyDocumentError
    92         EmptyDocumentError
    95     };
    93     };
    96 
    94 
    97     QVersitContactImporter();
    95     QVersitContactImporter();
       
    96     QVersitContactImporter(const QString& profile);
    98     ~QVersitContactImporter();
    97     ~QVersitContactImporter();
    99 
    98 
   100     bool importDocuments(const QList<QVersitDocument>& documents);
    99     bool importDocuments(const QList<QVersitDocument>& documents);
   101     QList<QContact> contacts() const;
   100     QList<QContact> contacts() const;
   102     QMap<int, Error> errors() const;
   101     QMap<int, Error> errors() const;
   104     void setPropertyHandler(QVersitContactImporterPropertyHandlerV2* handler);
   103     void setPropertyHandler(QVersitContactImporterPropertyHandlerV2* handler);
   105 
   104 
   106     void setResourceHandler(QVersitResourceHandler* handler);
   105     void setResourceHandler(QVersitResourceHandler* handler);
   107     QVersitResourceHandler* resourceHandler() const;
   106     QVersitResourceHandler* resourceHandler() const;
   108 
   107 
   109     // Deprecated:
   108     /* deprecated and internal */
   110 
       
   111     QList<QContact> Q_DECL_DEPRECATED importContacts(const QList<QVersitDocument>& documents);
       
   112     void Q_DECL_DEPRECATED setPropertyHandler(QVersitContactImporterPropertyHandler* handler);
   109     void Q_DECL_DEPRECATED setPropertyHandler(QVersitContactImporterPropertyHandler* handler);
   113     /* deprecated and internal */
       
   114     Q_DECL_DEPRECATED QVersitContactImporterPropertyHandler* propertyHandler() const;
   110     Q_DECL_DEPRECATED QVersitContactImporterPropertyHandler* propertyHandler() const;
   115 
   111 
   116 private:
   112 private:
   117     QVersitContactImporterPrivate* d;
   113     QVersitContactImporterPrivate* d;
   118 };
   114 };