ButeoSynchronizationFramework
TargetResults.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 TARGETRESULTS_H
24 #define TARGETRESULTS_H
25 
26 #include <QString>
27 
28 class QDomDocument;
29 class QDomElement;
30 
31 namespace Buteo {
32 
33 class TargetResultsPrivate;
34 
36 struct ItemCounts {
38  unsigned added;
39 
41  unsigned deleted;
42 
44  unsigned modified;
45 
47  ItemCounts() : added(0), deleted(0), modified(0) { };
48 
50  ItemCounts(unsigned aAdded, unsigned aDeleted, unsigned aModified)
51  : added(aAdded), deleted(aDeleted), modified(aModified) {}
52 };
53 
60 {
61 public:
66  TargetResults(const TargetResults &aSource);
67 
74  TargetResults(const QString &aTargetName, ItemCounts aLocalItems,
75  ItemCounts aRemoteItems);
76 
81  explicit TargetResults(const QDomElement &aRoot);
82 
86 
92 
100  QDomElement toXml(QDomDocument &aDoc) const;
101 
106  QString targetName() const;
107 
112  ItemCounts localItems() const;
113 
118  ItemCounts remoteItems() const;
119 
120 private:
121 
122  TargetResultsPrivate *d_ptr;
123 };
124 
125 }
126 
127 #endif // TARGETRESULTS_H
TargetResults & operator=(const TargetResults &aRhs)
Assignment operator.
Definition: TargetResults.cpp:102
QDomElement toXml(QDomDocument &aDoc) const
Exports the target results to XML.
Definition: TargetResults.cpp:113
Container for number of items added, deleted and modified.
Definition: TargetResults.h:36
ItemCounts(unsigned aAdded, unsigned aDeleted, unsigned aModified)
Constructor with 3 parameters.
Definition: TargetResults.h:50
Definition: AccountsHelper.h:31
TargetResults(const TargetResults &aSource)
Copy constructor.
Definition: TargetResults.cpp:60
~TargetResults()
Destructor.
Definition: TargetResults.cpp:96
unsigned modified
No. of Items modified.
Definition: TargetResults.h:44
unsigned deleted
No. of Items deleted.
Definition: TargetResults.h:41
ItemCounts()
Default Constructor.
Definition: TargetResults.h:47
Sync results for one target.
Definition: TargetResults.h:59
ItemCounts remoteItems() const
Gets the counts of items added, deleted and modified at remote.
Definition: TargetResults.cpp:143
ItemCounts localItems() const
Gets the counts of items added, deleted and modified locally.
Definition: TargetResults.cpp:138
unsigned added
No. of Items added.
Definition: TargetResults.h:38
QString targetName() const
Gets the target name.
Definition: TargetResults.cpp:133