qtmobility/plugins/contacts/symbiansim/inc/cntsymbiansimengine.h
changeset 4 90517678cc4f
parent 1 2b40d63a9c3d
child 5 453da2cfceef
--- a/qtmobility/plugins/contacts/symbiansim/inc/cntsymbiansimengine.h	Fri Apr 16 15:51:22 2010 +0300
+++ b/qtmobility/plugins/contacts/symbiansim/inc/cntsymbiansimengine.h	Mon May 03 13:18:40 2010 +0300
@@ -52,15 +52,9 @@
 //
 // We mean it.
 //
+#include "qtcontactsglobal.h"
 #include "qcontactmanagerengine.h"
 #include "qcontactmanagerenginefactory.h"
-
-#ifdef SYMBIANSIM_BACKEND_USE_ETEL_TESTSERVER
-#include <etelmm_etel_test_server.h>
-#else
-#include <etelmm.h>
-#endif
-
 #include <flogger.h>
 #include <f32file.h>
 
@@ -87,11 +81,11 @@
 
 #define CNT_SYMBIANSIM_MANAGER_NAME "symbiansim"
 
-Q_DEFINE_LATIN1_LITERAL(KSimSyncTarget, "SIM");
-Q_DEFINE_LATIN1_LITERAL(KParameterKeySimStoreName, "store");
-Q_DEFINE_LATIN1_LITERAL(KParameterValueSimStoreNameAdn, "ADN");
-Q_DEFINE_LATIN1_LITERAL(KParameterValueSimStoreNameSdn, "SDN");
-Q_DEFINE_LATIN1_LITERAL(KParameterValueSimStoreNameFdn, "FDN");
+Q_DEFINE_LATIN1_CONSTANT(KSimSyncTarget, "SIM");
+Q_DEFINE_LATIN1_CONSTANT(KParameterKeySimStoreName, "store");
+Q_DEFINE_LATIN1_CONSTANT(KParameterValueSimStoreNameAdn, "ADN");
+Q_DEFINE_LATIN1_CONSTANT(KParameterValueSimStoreNameSdn, "SDN");
+Q_DEFINE_LATIN1_CONSTANT(KParameterValueSimStoreNameFdn, "FDN");
 
 class CntSimStore;
 class CntAbstractSimRequest;
@@ -111,29 +105,53 @@
     Q_OBJECT
 
 public:
-    CntSymbianSimEngine(const QMap<QString, QString>& parameters, QContactManager::Error& error);
+    CntSymbianSimEngine(const QMap<QString, QString>& parameters, QContactManager::Error* error);
     CntSymbianSimEngine(const CntSymbianSimEngine &other);
     ~CntSymbianSimEngine();
-    void deref();
+
     QString managerName() const;
 
+    QMap<QString, QString> managerParameters() const {return QMap<QString, QString>();}
+    int managerVersion() const { return 1;}
+
+    /* Defaulted functions - XXX check*/
+    QContact compatibleContact(const QContact&, QContactManager::Error* error) const {*error =  QContactManager::NotSupportedError;return QContact();}
+    bool validateContact(const QContact& contact, QContactManager::Error* error) const {return QContactManagerEngine::validateContact(contact, error);}
+    bool validateDefinition(const QContactDetailDefinition& def, QContactManager::Error* error) const {return QContactManagerEngine::validateDefinition(def, error);}
+    QContactDetailDefinition detailDefinition(const QString& definitionId, const QString& contactType, QContactManager::Error* error) const  {return QContactManagerEngine::detailDefinition(definitionId, contactType, error);}
+    bool saveDetailDefinition(const QContactDetailDefinition& def, const QString& contactType, QContactManager::Error* error) {return QContactManagerEngine::saveDetailDefinition(def, contactType, error);}
+    bool removeDetailDefinition(const QString& definitionId, const QString& contactType, QContactManager::Error* error)  {return QContactManagerEngine::removeDetailDefinition(definitionId, contactType, error);}
+    QList<QContactRelationship> relationships(const QString& relationshipType, const QContactId& participantId, QContactRelationship::Role role, QContactManager::Error* error) const
+    {
+        return QContactManagerEngine::relationships(relationshipType, participantId, role, error);
+    }
+    bool saveRelationships(QList<QContactRelationship>* relationships, QMap<int, QContactManager::Error>* errorMap, QContactManager::Error* error)
+    {
+        return QContactManagerEngine::saveRelationships(relationships, errorMap, error);
+    }
+    bool removeRelationships(const QList<QContactRelationship>& relationships, QMap<int, QContactManager::Error>* errorMap, QContactManager::Error* error)
+    {
+        return QContactManagerEngine::removeRelationships(relationships, errorMap, error);
+    }
+    bool isRelationshipTypeSupported(const QString&, const QString&) const  {return false;}
+    bool isFilterSupported(const QContactFilter&) const {return false;}
+    QList<QVariant::Type> supportedDataTypes() const {return QContactManagerEngine::supportedDataTypes();}
+    bool setSelfContactId(const QContactLocalId& contactId, QContactManager::Error* error) {return QContactManagerEngine::setSelfContactId(contactId, error);}
+    QContactLocalId selfContactId(QContactManager::Error* error) const {return QContactManagerEngine::selfContactId(error);}
+
     /* Contacts - Accessors and Mutators */
-    QList<QContactLocalId> contactIds(const QList<QContactSortOrder>& sortOrders, QContactManager::Error& error) const;
-    QList<QContactLocalId> contactIds(const QContactFilter& filter, const QList<QContactSortOrder>& sortOrders, QContactManager::Error& error) const;
-    QList<QContact> contacts(const QList<QContactSortOrder>& sortOrders, const QStringList& definitionRestrictions, QContactManager::Error& error) const;
-    QList<QContact> contacts(const QContactFilter& filter, const QList<QContactSortOrder>& sortOrders, const QStringList& definitionRestrictions, QContactManager::Error& error) const;
-    QContact contact(const QContactLocalId& contactId, const QStringList& definitionRestrictions, QContactManager::Error& error) const;
+    QList<QContactLocalId> contactIds(const QContactFilter& filter, const QList<QContactSortOrder>& sortOrders, QContactManager::Error* error) const;
+    QList<QContact> contacts(const QContactFilter& filter, const QList<QContactSortOrder>& sortOrders, const QContactFetchHint& fetchHint, QContactManager::Error* error) const;
+    QContact contact(const QContactLocalId& contactId, const QContactFetchHint& fetchHint, QContactManager::Error* error) const;
    
-    bool saveContact(QContact* contact, QContactManager::Error& error);
-    bool saveContacts(QList<QContact>* contacts, QMap<int, QContactManager::Error>* errorMap, QContactManager::Error& error);
-    bool removeContact(const QContactLocalId& contactId, QContactManager::Error& error);
-    bool removeContacts(QList<QContactLocalId>* contactIds, QMap<int, QContactManager::Error>* errorMap, QContactManager::Error& error);
+    bool saveContacts(QList<QContact>* contacts, QMap<int, QContactManager::Error>* errorMap, QContactManager::Error* error);
+    bool removeContacts(const QList<QContactLocalId>& contactIds, QMap<int, QContactManager::Error>* errorMap, QContactManager::Error* error);
 
     /* Synthesize the display label of a contact */
-    QString synthesizedDisplayLabel(const QContact& contact, QContactManager::Error& error) const;
+    QString synthesizedDisplayLabel(const QContact& contact, QContactManager::Error* error) const;
     
     /* Definitions - Accessors and Mutators */
-    QMap<QString, QContactDetailDefinition> detailDefinitions(const QString& contactType, QContactManager::Error& error) const;
+    QMap<QString, QContactDetailDefinition> detailDefinitions(const QString& contactType, QContactManager::Error* error) const;
 
     /* Asynchronous Request Support */
     void requestDestroyed(QContactAbstractRequest* req);
@@ -148,20 +166,21 @@
 public:
     void updateDisplayLabel(QContact& contact) const;
     CntSimStore* simStore() { return d->m_simStore; }
+    void setReadOnlyAccessConstraint(QContactDetail* detail) const;
 
 private:
-    bool executeRequest(QContactAbstractRequest *req, QContactManager::Error& qtError) const;
+    bool executeRequest(QContactAbstractRequest *req, QContactManager::Error* qtError) const;
 
 private:
     QExplicitlySharedDataPointer<CntSymbianSimEngineData> d;
 };
 
-class Q_DECL_EXPORT CntSymbianSimFactory : public QObject, public QContactManagerEngineFactory
+class CntSymbianSimFactory : public QObject, public QContactManagerEngineFactory
 {
     Q_OBJECT
     Q_INTERFACES(QtMobility::QContactManagerEngineFactory)
     public:
-        QContactManagerEngine* engine(const QMap<QString, QString>& parameters, QContactManager::Error& error);
+        QContactManagerEngine* engine(const QMap<QString, QString>& parameters, QContactManager::Error* error);
         QString managerName() const;
 };