phonebookengines/cntlistmodel/inc/cntlistmodel.h
changeset 65 ae724a111993
parent 47 7cbcb2896f0e
child 72 6abfb1094884
equal deleted inserted replaced
59:a642906a277a 65:ae724a111993
    28 
    28 
    29 QTM_USE_NAMESPACE
    29 QTM_USE_NAMESPACE
    30 
    30 
    31 class CntListModelData;
    31 class CntListModelData;
    32 class XQSettingsKey;
    32 class XQSettingsKey;
       
    33 class CntDisplayTextFormatter;
    33 
    34 
    34 /*!
    35 /*!
    35  * CntListModel is a list model view for contacts database
    36  * CntListModel is a list model view for contacts database
    36  * content. It will cache contacts database entries to be
    37  * content. It will cache contacts database entries to be
    37  * displayed on the screen.
    38  * displayed on the screen.
    59     QVariant data(const QModelIndex &index, int role) const;
    60     QVariant data(const QModelIndex &index, int role) const;
    60     int rowCount(const QModelIndex &parent = QModelIndex()) const;
    61     int rowCount(const QModelIndex &parent = QModelIndex()) const;
    61 
    62 
    62 public:
    63 public:
    63 	QContact contact(const QModelIndex &index) const;
    64 	QContact contact(const QModelIndex &index) const;
       
    65     QContactLocalId contactId(const QModelIndex &index) const;
    64 	QModelIndex indexOfContact(const QContact &contact) const;
    66 	QModelIndex indexOfContact(const QContact &contact) const;
       
    67 	QModelIndex indexOfContactId(const QContactLocalId &contactId) const;
    65 	QContactManager& contactManager() const;
    68 	QContactManager& contactManager() const;
    66 	void setFilter(const QContactFilter& contactFilter = QContactFilter());
    69 	void setFilter(const QContactFilter& contactFilter = QContactFilter());
    67 	void showMyCard(bool enabled);
    70 	void showMyCard(bool enabled);
    68 	bool myCardStatus() const;
    71 	bool myCardStatus() const;
    69 	QContactLocalId myCardId() const;
    72 	QContactLocalId myCardId() const;
    70 	
    73 		
    71 private:
    74 private:
    72     // Construction helpers
    75     // Construction helpers
    73     int doConstruct();
    76     int doConstruct();
    74     int initializeData();
    77     int initializeData();
    75     void updateContactIdsArray();
    78     void updateContactIdsArray();
    79     QContact contact(int row) const;
    82     QContact contact(int row) const;
    80 
    83 
    81     // Utility
    84     // Utility
    82     bool validRowId(int row) const;
    85     bool validRowId(int row) const;
    83     int rowId(const QContactLocalId &contactId) const;
    86     int rowId(const QContactLocalId &contactId) const;
    84     QVariant dataForDisplayRole(int row) const;
    87     QVariant dataForRole(int row, int role) const;
    85     void updateRelationships();
    88     void updateRelationships();
    86 
    89 
    87 private slots:
    90 private slots:
    88     void handleAdded(const QList<QContactLocalId>& contactIds);
    91     void handleAdded(const QList<QContactLocalId>& contactIds);
    89     void handleChanged(const QList<QContactLocalId>& contactIds);
    92     void handleChanged(const QList<QContactLocalId>& contactIds);