equal
deleted
inserted
replaced
18 #ifndef LOGSABSTRACTMODEL_H |
18 #ifndef LOGSABSTRACTMODEL_H |
19 #define LOGSABSTRACTMODEL_H |
19 #define LOGSABSTRACTMODEL_H |
20 |
20 |
21 #include <QAbstractListModel> |
21 #include <QAbstractListModel> |
22 #include <logsexport.h> |
22 #include <logsexport.h> |
|
23 #include <hbextendedlocale.h> |
23 |
24 |
24 class LogsEvent; |
25 class LogsEvent; |
25 class LogsDbConnector; |
26 class LogsDbConnector; |
26 class LogsModelItemContainer; |
27 class LogsModelItemContainer; |
27 class HbIcon; |
28 class HbIcon; |
28 class LogsContact; |
29 class LogsContact; |
|
30 class LogsConfigurationParams; |
|
31 |
29 |
32 |
30 /** |
33 /** |
31 * Abstract logs model. |
34 * Abstract logs model. |
32 * |
35 * |
33 */ |
36 */ |
73 * (see predictiveSearchStatus()) |
76 * (see predictiveSearchStatus()) |
74 * @param enabled, specify whether cenrep key will be set to 1 or 2 |
77 * @param enabled, specify whether cenrep key will be set to 1 or 2 |
75 * @ return 0 if cenrep key value modified succesfully, |
78 * @ return 0 if cenrep key value modified succesfully, |
76 * -1 in case of some error |
79 * -1 in case of some error |
77 */ |
80 */ |
78 LOGSENGINE_EXPORT int setPredictiveSearch(bool enabled); |
81 LOGSENGINE_EXPORT int setPredictiveSearch(bool enabled); |
79 |
82 |
80 LOGSENGINE_EXPORT bool isCommunicationPossible(const LogsEvent& event) const; |
83 /** |
|
84 * Configuration. |
|
85 * @param configuration parameters |
|
86 * @return 0 if configured succesfully |
|
87 */ |
|
88 LOGSENGINE_EXPORT virtual int updateConfiguration(LogsConfigurationParams& params); |
|
89 |
81 public: |
90 public: |
82 |
91 |
83 static QString directionIconName(const LogsEvent& event); |
92 static QString directionIconName(const LogsEvent& event); |
84 static QString typeIconName(const LogsEvent& event); |
93 static QString typeIconName(const LogsEvent& event); |
85 |
94 |
89 * @param iconList, on return contains list of icons |
98 * @param iconList, on return contains list of icons |
90 */ |
99 */ |
91 void getDecorationData(const LogsEvent& event, QList<QVariant>& iconList) const; |
100 void getDecorationData(const LogsEvent& event, QList<QVariant>& iconList) const; |
92 |
101 |
93 LogsDbConnector* dbConnector(); |
102 LogsDbConnector* dbConnector(); |
|
103 |
|
104 /** |
|
105 * Construct a date and time string based on system locale |
|
106 */ |
|
107 QString dateAndTimeString(const QDateTime& dateTime) const; |
|
108 /** |
|
109 * Construct a duration string using separator from system locale |
|
110 */ |
|
111 QString durationString(const QTime& time) const; |
|
112 |
|
113 QString phoneNumString(const QString& number) const; |
|
114 |
94 |
115 |
95 protected slots: |
116 protected slots: |
96 |
117 |
97 virtual void contactSavingCompleted(bool modified); |
118 virtual void contactSavingCompleted(bool modified); |
|
119 virtual void updateModel(); |
98 |
120 |
99 protected: |
121 protected: |
100 |
122 |
101 QVariant doGetData(int role, const LogsModelItemContainer& item) const; |
123 QVariant doGetData(int role, const LogsModelItemContainer& item) const; |
102 |
124 |
109 |
131 |
110 protected: //data |
132 protected: //data |
111 |
133 |
112 LogsDbConnector* mDbConnector; |
134 LogsDbConnector* mDbConnector; |
113 QMap<QString, HbIcon*> mIcons; |
135 QMap<QString, HbIcon*> mIcons; |
|
136 HbExtendedLocale* mExtendedLocale; |
114 |
137 |
115 private: // Testing related friend definitions |
138 private: // Testing related friend definitions |
116 |
139 |
117 friend class UT_LogsModel; |
140 friend class UT_LogsModel; |
118 friend class UT_LogsDetailsModel; |
141 friend class UT_LogsDetailsModel; |