72 { |
72 { |
73 public: |
73 public: |
74 QVersitContactImporterPrivate(); |
74 QVersitContactImporterPrivate(); |
75 ~QVersitContactImporterPrivate(); |
75 ~QVersitContactImporterPrivate(); |
76 |
76 |
77 QContact importContact(const QVersitDocument& versitDocument, int contactIndex); |
77 bool importContact(const QVersitDocument& versitDocument, int contactIndex, |
|
78 QContact* contact, QVersitContactImporter::Error* error); |
78 QList<QVersitProperty> unconvertedVersitProperties(); |
79 QList<QVersitProperty> unconvertedVersitProperties(); |
|
80 |
|
81 static QString synthesizedDisplayLabel(const QContact& contact); |
79 |
82 |
80 private: |
83 private: |
81 void importProperty(const QVersitDocument& document, const QVersitProperty& property, |
84 void importProperty(const QVersitDocument& document, const QVersitProperty& property, |
82 int contactIndex, QContact* contact) const; |
85 int contactIndex, QContact* contact) const; |
83 bool createName(const QVersitProperty& property, QContact* contact) const; |
86 bool createName(const QVersitProperty& property, QContact* contact) const; |
88 void setOrganizationLogo(QContactOrganization& org, const QVersitProperty& property) const; |
91 void setOrganizationLogo(QContactOrganization& org, const QVersitProperty& property) const; |
89 bool createTimeStamp(const QVersitProperty& property, QContact* contact) const; |
92 bool createTimeStamp(const QVersitProperty& property, QContact* contact) const; |
90 bool createAnniversary(const QVersitProperty& property, QContact* contact) const; |
93 bool createAnniversary(const QVersitProperty& property, QContact* contact) const; |
91 bool createBirthday(const QVersitProperty& property, QContact* contact) const; |
94 bool createBirthday(const QVersitProperty& property, QContact* contact) const; |
92 bool createNicknames(const QVersitProperty& property, QContact* contact) const; |
95 bool createNicknames(const QVersitProperty& property, QContact* contact) const; |
|
96 bool createTags(const QVersitProperty& property, QContact* contact) const; |
93 bool createOnlineAccount(const QVersitProperty& property, QContact* contact) const; |
97 bool createOnlineAccount(const QVersitProperty& property, QContact* contact) const; |
94 bool createAvatar(const QVersitProperty& property, const QString& subType, QContact* contact) const; |
98 bool createRingtone(const QVersitProperty& property, QContact* contact) const; |
|
99 bool createThumbnail(const QVersitProperty& property, QContact* contact) const; |
95 bool createGeoLocation(const QVersitProperty& property, QContact* contact) const; |
100 bool createGeoLocation(const QVersitProperty& property, QContact* contact) const; |
96 bool createFamily(const QVersitProperty& property, QContact* contact) const; |
101 bool createFamily(const QVersitProperty& property, QContact* contact) const; |
97 bool createNameValueDetail(const QVersitProperty& property, QContact* contact) const; |
102 bool createNameValueDetail(const QVersitProperty& property, QContact* contact) const; |
98 bool createLabel(const QVersitProperty& property, QContact* contact) const; |
103 bool createCustomLabel(const QVersitProperty& property, QContact* contact) const; |
99 QStringList extractContexts(const QVersitProperty& property) const; |
104 QStringList extractContexts(const QVersitProperty& property) const; |
100 QStringList extractSubTypes(const QVersitProperty& property) const; |
105 QStringList extractSubTypes(const QVersitProperty& property) const; |
101 QString takeFirst(QList<QString>& list) const; |
106 QString takeFirst(QList<QString>& list) const; |
102 QDateTime parseDateTime(const QString& text, const QString& format) const; |
107 QDateTime parseDateTime(const QString& text, const QString& format) const; |
103 QString saveContentToFile(const QVersitProperty& property, const QByteArray& data) const; |
108 QString saveContentToFile(const QVersitProperty& property, const QByteArray& data) const; |
104 bool saveDataFromProperty(const QVersitProperty& property, QString* location, QByteArray* data) const; |
109 bool saveDataFromProperty(const QVersitProperty& property, QString* location, QByteArray* data) const; |
105 void saveDetailWithContext( |
110 void saveDetailWithContext( |
106 QContact* contact, QContactDetail* detail, const QStringList& contexts) const; |
111 QContact* contact, QContactDetail* detail, const QStringList& contexts) const; |
107 |
112 |
108 public: // Data |
113 public: // Data |
|
114 QList<QContact> mContacts; |
|
115 QMap<int, QVersitContactImporter::Error> mErrors; |
109 QVersitContactImporterPropertyHandler* mPropertyHandler; |
116 QVersitContactImporterPropertyHandler* mPropertyHandler; |
110 QVersitDefaultResourceHandler* mDefaultResourceHandler; |
117 QVersitDefaultResourceHandler* mDefaultResourceHandler; |
111 QVersitResourceHandler* mResourceHandler; |
118 QVersitResourceHandler* mResourceHandler; |
112 |
119 |
113 private: // Data |
|
114 QHash<QString,QPair<QString,QString> > mDetailMappings; |
120 QHash<QString,QPair<QString,QString> > mDetailMappings; |
115 QHash<QString,QString> mContextMappings; |
121 QHash<QString,QString> mContextMappings; |
116 QHash<QString,QString> mSubTypeMappings; |
122 QHash<QString,QString> mSubTypeMappings; |
117 }; |
123 }; |
118 |
124 |