recents_plat/logs_engine_api/inc/logsabstractmodel.h
changeset 2 7119b73b84d6
parent 0 4a5361db8937
child 13 52d644758b05
child 16 c5af8598d22c
equal deleted inserted replaced
0:4a5361db8937 2:7119b73b84d6
    23 
    23 
    24 class LogsEvent;
    24 class LogsEvent;
    25 class LogsDbConnector;
    25 class LogsDbConnector;
    26 class LogsModelItemContainer;
    26 class LogsModelItemContainer;
    27 class HbIcon;
    27 class HbIcon;
       
    28 class LogsContact;
    28 
    29 
    29 /**
    30 /**
    30  * Abstract logs model.
    31  * Abstract logs model.
    31  *
    32  *
    32  */
    33  */
    49     };
    50     };
    50 
    51 
    51 public:
    52 public:
    52     
    53     
    53     ~LogsAbstractModel();
    54     ~LogsAbstractModel();
       
    55           
       
    56     /**
       
    57      * Factory method for creating a new contact object. Transfers ownership.
       
    58      */
       
    59     LOGSENGINE_EXPORT LogsContact* createContact(const QString& number);
    54     
    60     
       
    61     /**
       
    62      * Returns cenrep key status of predictive search feature. 
       
    63      * @return 0 - feature is permanently off and can't be turned on,
       
    64      *         1 - feature is on
       
    65      *         2 - feature is temporarily off and can be turned on 
       
    66      *         negative value indicates some error in fetching the key
       
    67      */
       
    68     LOGSENGINE_EXPORT int predictiveSearchStatus();
       
    69     
       
    70     /**
       
    71      * Allows to modify cenrep key value of predictive search features. 
       
    72      * However, this function can't be used if feature is set permanently off 
       
    73      * (see predictiveSearchStatus())
       
    74      * @param enabled, specify whether cenrep key will be set to 1 or 2
       
    75      * @ return 0 if cenrep key value modified succesfully,
       
    76      *          -1 in case of some error
       
    77      */
       
    78     LOGSENGINE_EXPORT int setPredictiveSearch(bool enabled);   
       
    79     
       
    80     LOGSENGINE_EXPORT bool isCommunicationPossible(const LogsEvent& event) const;
    55 public:
    81 public:
    56     
    82     
    57     static QString directionIconName(const LogsEvent& event);
    83     static QString directionIconName(const LogsEvent& event);
    58     static QString typeIconName(const LogsEvent& event);
    84     static QString typeIconName(const LogsEvent& event);
    59         
    85         
    63      * @param iconList, on return contains list of icons 
    89      * @param iconList, on return contains list of icons 
    64      */
    90      */
    65     void getDecorationData(const LogsEvent& event, QList<QVariant>& iconList) const;
    91     void getDecorationData(const LogsEvent& event, QList<QVariant>& iconList) const;
    66     
    92     
    67     LogsDbConnector* dbConnector();
    93     LogsDbConnector* dbConnector();
    68     
    94 
       
    95 protected slots:
       
    96 
       
    97     virtual void contactSavingCompleted(bool modified);
       
    98 
    69 protected:
    99 protected:
    70 
   100 
    71     QVariant doGetData(int role, const LogsModelItemContainer& item) const;
   101     QVariant doGetData(int role, const LogsModelItemContainer& item) const;
    72     
   102     
    73     virtual QVariant createCall(const LogsModelItemContainer& item) const;
   103     virtual QVariant createCall(const LogsModelItemContainer& item) const;
    74     virtual QVariant createMessage(const LogsModelItemContainer& item) const;
   104     virtual QVariant createMessage(const LogsModelItemContainer& item) const;
    75     virtual QVariant createContact(const LogsModelItemContainer& item) const;
   105     virtual QVariant createContact(const LogsModelItemContainer& item) const;
    76       
   106     virtual int doSetPredictiveSearch(bool enabled);
       
   107     
    77     explicit LogsAbstractModel();
   108     explicit LogsAbstractModel();
    78     
   109     
    79 protected: //data 
   110 protected: //data 
    80     
   111     
    81     LogsDbConnector* mDbConnector;
   112     LogsDbConnector* mDbConnector;