summaryrefslogtreecommitdiffstats
path: root/kitchensync/libqopensync/group.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-08 01:37:34 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-08 01:37:34 +0000
commitd4f48636cc2631625434326e146d04f503d0247a (patch)
treea371a2337bddce3de3fa3fcac52275a8204570d9 /kitchensync/libqopensync/group.h
parentd8b40941f9d1a221add0b9094eb09405a91a8aab (diff)
downloadtdepim-d4f48636cc2631625434326e146d04f503d0247a.tar.gz
tdepim-d4f48636cc2631625434326e146d04f503d0247a.zip
Reverse OpenSync patch as it causes a build failure on Debian
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1172771 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kitchensync/libqopensync/group.h')
-rw-r--r--kitchensync/libqopensync/group.h104
1 files changed, 73 insertions, 31 deletions
diff --git a/kitchensync/libqopensync/group.h b/kitchensync/libqopensync/group.h
index 1b1a532c3..750e7c41c 100644
--- a/kitchensync/libqopensync/group.h
+++ b/kitchensync/libqopensync/group.h
@@ -25,22 +25,35 @@
#include <tqdatetime.h>
#include <tqstringlist.h>
+#include <libqopensync/filter.h>
+#include <libqopensync/member.h>
+
class OSyncGroup;
namespace QSync {
-class Filter;
-class Member;
-class Plugin;
-class Result;
-
/**
@internal
*/
+class GroupConfig
+{
+ friend class Group;
+
+ public:
+ GroupConfig();
+
+ TQStringList activeObjectTypes() const;
+ void setActiveObjectTypes( const TQStringList &objectTypes );
+
+ private:
+ OSyncGroup *mGroup;
+};
+
+
class Group
{
friend class Engine;
- friend class GroupEnv;
+ friend class Environment;
public:
enum LockType
@@ -58,6 +71,51 @@ class Group
*/
bool isValid() const;
+ class Iterator
+ {
+ friend class Group;
+
+ public:
+ Iterator( Group *group )
+ : mGroup( group ), mPos( -1 )
+ {
+ }
+
+ Iterator( const Iterator &it )
+ {
+ mGroup = it.mGroup;
+ mPos = it.mPos;
+ }
+
+ Member operator*()
+ {
+ return mGroup->memberAt( mPos );
+ }
+
+ Iterator &operator++() { mPos++; return *this; }
+ Iterator &operator++( int ) { mPos++; return *this; }
+ Iterator &operator--() { mPos--; return *this; }
+ Iterator &operator--( int ) { mPos--; return *this; }
+ bool operator==( const Iterator &it ) { return mGroup == it.mGroup && mPos == it.mPos; }
+ bool operator!=( const Iterator &it ) { return mGroup == it.mGroup && mPos != it.mPos; }
+
+ private:
+ Group *mGroup;
+ int mPos;
+ };
+
+ /**
+ Returns an iterator pointing to the first item in the member list.
+ This iterator equals end() if the member list is empty.
+ */
+ Iterator begin();
+
+ /**
+ Returns an iterator pointing past the last item in the member list.
+ This iterator equals begin() if the member list is empty.
+ */
+ Iterator end();
+
/**
Sets the name of the group.
*/
@@ -87,15 +145,17 @@ class Group
/**
Unlocks the group.
+
+ @param removeFile Whether the lock file shall be removed.
*/
- void unlock();
+ void unlock( bool removeFile = true );
/**
Adds a new member to the group.
@returns the new member.
*/
- Member addMember( const QSync::Plugin &plugin );
+ Member addMember();
/**
Removes a member from the group.
@@ -135,37 +195,19 @@ class Group
bool isObjectTypeEnabled( const TQString &objectType ) const;
/**
- Sets whether this group uses the merger for synchronization.
- */
- void setUseMerger( bool use );
-
- /**
- Returns whether this group uses the merger for synchronization.
- */
- bool useMerger() const;
-
- /**
- Sets whether this group uses the converter for synchronization.
+ Saves the configuration to hard disc.
*/
- void setUseConverter( bool use );
+ Result save();
/**
- Returns whether this group uses the converter for synchronization.
- */
- bool useConverter() const;
+ Returns the config object of this group.
- /**
- Saves the configuration to hard disc.
+ Note: This method is only available for OpenSync 0.19 and 0.20.
*/
- Result save();
+ GroupConfig config() const;
bool operator==( const Group &group ) const { return mGroup == group.mGroup; }
- /**
- Removes all group configurations from the hard disc.
- */
- Result cleanup() const;
-
private:
OSyncGroup *mGroup;
};