|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 ** |
|
7 ** This file is part of the Qt Mobility Components. |
|
8 ** |
|
9 ** $QT_BEGIN_LICENSE:LGPL$ |
|
10 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
15 ** |
|
16 ** GNU Lesser General Public License Usage |
|
17 ** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 ** General Public License version 2.1 as published by the Free Software |
|
19 ** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 ** packaging of this file. Please review the following information to |
|
21 ** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 ** |
|
24 ** In addition, as a special exception, Nokia gives you certain additional |
|
25 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 ** |
|
28 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 |
1 #ifndef EVENTLOGGERENGINE_H |
42 #ifndef EVENTLOGGERENGINE_H |
2 #define EVENTLOGGERENGINE_H |
43 #define EVENTLOGGERENGINE_H |
3 #include "qmessageglobal.h" |
44 #include "qmessageglobal.h" |
4 #include "qmessagemanager.h" |
45 #include "qmessagemanager.h" |
5 #include "qmessageaccount.h" |
46 #include "qmessageaccount.h" |
14 #include "qmessagestore_p.h" |
55 #include "qmessagestore_p.h" |
15 #include "qmessage_p.h" |
56 #include "qmessage_p.h" |
16 #include "qmessagefilter.h" |
57 #include "qmessagefilter.h" |
17 #include "qmessagefilter_p.h" |
58 #include "qmessagefilter_p.h" |
18 #include "qmessagefolderfilter_p.h" |
59 #include "qmessagefolderfilter_p.h" |
|
60 #include <QThread> |
19 #include <QObject> |
61 #include <QObject> |
20 |
62 |
21 extern "C" { |
63 extern "C" { |
22 |
64 |
23 #include <glib.h> |
65 #include <glib.h> |
27 |
69 |
28 }; |
70 }; |
29 |
71 |
30 QTM_BEGIN_NAMESPACE |
72 QTM_BEGIN_NAMESPACE |
31 |
73 |
|
74 class EventLoggerEngine; |
32 |
75 |
33 class EventLoggerEngine |
76 class QueryThread : public QThread |
34 { |
77 { |
|
78 Q_OBJECT |
|
79 |
|
80 |
|
81 public: |
|
82 QueryThread(); |
|
83 void setArgs(EventLoggerEngine *parent, const QMessageFilter &filter, const QString &body, QMessageDataComparator::MatchFlags matchFlags, const QMessageSortOrder &sortOrder, uint limit, uint offset); |
|
84 void run(); |
|
85 |
|
86 signals: |
|
87 void completed(); |
|
88 public: |
|
89 EventLoggerEngine *_parent; |
|
90 QMessageFilter _filter; |
|
91 QString _body; |
|
92 QMessageDataComparator::MatchFlags _matchFlags; |
|
93 QMessageSortOrder _sortOrder; |
|
94 uint _limit; |
|
95 uint _offset; |
|
96 |
|
97 }; |
|
98 |
|
99 |
|
100 class EventLoggerEngine:public QObject |
|
101 { |
|
102 Q_OBJECT |
35 |
103 |
36 public: |
104 public: |
37 |
105 |
38 explicit EventLoggerEngine(QObject *parent = 0); |
106 explicit EventLoggerEngine(QObject *parent = 0); |
39 static EventLoggerEngine* instance(); |
107 static EventLoggerEngine* instance(); |
50 const char *local_uid,const char *remote_uid,const char *remote_ebook_uid, |
118 const char *local_uid,const char *remote_uid,const char *remote_ebook_uid, |
51 const char *group_uid,const char *service); |
119 const char *group_uid,const char *service); |
52 QMessageIdList filterAndOrderMessages(const QMessageFilter &filter, const QMessageSortOrder& sortOrder, |
120 QMessageIdList filterAndOrderMessages(const QMessageFilter &filter, const QMessageSortOrder& sortOrder, |
53 QString body, QMessageDataComparator::MatchFlags matchFlags); |
121 QString body, QMessageDataComparator::MatchFlags matchFlags); |
54 |
122 |
|
123 bool filterMessages(const QMessageFilter &filter, const QMessageSortOrder& sortOrder, |
|
124 QString body, QMessageDataComparator::MatchFlags matchFlags); |
|
125 |
|
126 QMessageIdList m_ids; |
|
127 |
|
128 |
55 signals: |
129 signals: |
56 |
130 void messagesFound(const QMessageIdList &,bool,bool); |
|
131 void stateChanged(QMessageService::State); |
57 public slots: |
132 public slots: |
58 |
133 void reportMatchingIds(); |
|
134 void messagesFound_(const QMessageIdList &ids); |
|
135 void completed(); |
59 private: |
136 private: |
|
137 bool active; |
|
138 QMessageService::State state; |
|
139 // EventLoggerThread queryThread; |
|
140 QueryThread *queryThread; |
60 QMessageStorePrivate* ipMessageStorePrivate; |
141 QMessageStorePrivate* ipMessageStorePrivate; |
61 void debugMessage(QMessage &message); |
142 void debugMessage(QMessage &message); |
62 RTComEl *el; |
143 RTComEl *el; |
63 DBusConnection * dbus; |
144 DBusConnection * dbus; |
64 bool iListenForNotifications; |
145 bool iListenForNotifications; |