ButeoSynchronizationFramework
SyncLog.h
1 /*
2  * This file is part of buteo-syncfw package
3  *
4  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
5  *
6  * Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * version 2.1 as published by the Free Software Foundation.
11  *
12  * This library is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA
21  *
22  */
23 #ifndef SYNCLOG_H
24 #define SYNCLOG_H
25 
26 #include <QList>
27 #include <QString>
28 #include "SyncResults.h"
29 
30 class QDomDocument;
31 class QDomElement;
32 
33 namespace Buteo {
34 
35 class SyncLogPrivate;
36 class SyncLogTest;
37 
44 class SyncLog
45 {
46 public:
51  explicit SyncLog(const QString &aProfileName);
52 
57  explicit SyncLog(const QDomElement &aRoot);
58 
63  SyncLog(const SyncLog &aSource);
64 
68  ~SyncLog();
69 
72  void setProfileName(const QString& aProfileName);
73 
78  QString profileName() const;
79 
87  QDomElement toXml(QDomDocument &aDoc) const;
88 
93  const SyncResults *lastResults() const;
94 
101 
107  void addResults(const SyncResults &aResults);
108 
109 private:
110 
111  SyncLog& operator=(const SyncLog &aRhs);
112 
113  SyncLogPrivate *d_ptr;
114 };
115 
116 }
117 
118 #endif // SYNCLOG_H
SyncLog(const QString &aProfileName)
Constructs an empty log with the given profile name.
Definition: SyncLog.cpp:82
Contains information about a completed synchronization session.
Definition: SyncResults.h:58
void setProfileName(const QString &aProfileName)
Sets the name of the profile that owns this log.
Definition: SyncLog.cpp:114
Definition: AccountsHelper.h:31
QDomElement toXml(QDomDocument &aDoc) const
Exports the log to XML.
Definition: SyncLog.cpp:125
History of completed synchronization sessions and their results.
Definition: SyncLog.h:44
QString profileName() const
Gets the name of the profile that owns this log.
Definition: SyncLog.cpp:120
~SyncLog()
Destructor.
Definition: SyncLog.cpp:108
QList< const SyncResults * > allResults() const
Gets all results in the sync log.
Definition: SyncLog.cpp:148
const SyncResults * lastResults() const
Gets the most recent results in the sync log.
Definition: SyncLog.cpp:137
void addResults(const SyncResults &aResults)
Adds results to the sync log. Also makes sure that log size doesn't exceed given size limit...
Definition: SyncLog.cpp:153
Definition: SyncBackupAdaptor.h:40