Buteo Synchronization Framework
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  const SyncResults *lastSuccessfulResults() const;
108 
114  void addResults(const SyncResults &aResults);
115 
116 private:
117 
118  SyncLog &operator=(const SyncLog &aRhs);
119 
120  SyncLogPrivate *d_ptr;
121 };
122 
123 }
124 
125 #endif // SYNCLOG_H
History of completed synchronization sessions and their results.
Definition: SyncLog.h:45
QString profileName() const
Gets the name of the profile that owns this log.
Definition: SyncLog.cpp:144
void setProfileName(const QString &aProfileName)
Sets the name of the profile that owns this log.
Definition: SyncLog.cpp:138
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:186
const SyncResults * lastResults() const
Gets the most recent results in the sync log.
Definition: SyncLog.cpp:166
QDomElement toXml(QDomDocument &aDoc) const
Exports the log to XML.
Definition: SyncLog.cpp:149
SyncLog(const QString &aProfileName)
Constructs an empty log with the given profile name.
Definition: SyncLog.cpp:106
const SyncResults * lastSuccessfulResults() const
Gets the last successful results in the sync log.
Definition: SyncLog.cpp:181
QList< const SyncResults * > allResults() const
Gets all results in the sync log.
Definition: SyncLog.cpp:176
~SyncLog()
Destructor.
Definition: SyncLog.cpp:132
Contains information about a completed synchronization session.
Definition: SyncResults.h:59
Definition: SyncBackupAdaptor.h:40