diff options
Diffstat (limited to 'kitchensync/libqopensync/group.h')
-rw-r--r-- | kitchensync/libqopensync/group.h | 104 |
1 files changed, 31 insertions, 73 deletions
diff --git a/kitchensync/libqopensync/group.h b/kitchensync/libqopensync/group.h index 750e7c41c..1b1a532c3 100644 --- a/kitchensync/libqopensync/group.h +++ b/kitchensync/libqopensync/group.h @@ -25,35 +25,22 @@ #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 Environment; + friend class GroupEnv; public: enum LockType @@ -71,51 +58,6 @@ 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. */ @@ -145,17 +87,15 @@ class Group /** Unlocks the group. - - @param removeFile Whether the lock file shall be removed. */ - void unlock( bool removeFile = true ); + void unlock(); /** Adds a new member to the group. @returns the new member. */ - Member addMember(); + Member addMember( const QSync::Plugin &plugin ); /** Removes a member from the group. @@ -195,19 +135,37 @@ class Group bool isObjectTypeEnabled( const TQString &objectType ) const; /** - Saves the configuration to hard disc. + Sets whether this group uses the merger for synchronization. */ - Result save(); + 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. + */ + void setUseConverter( bool use ); /** - Returns the config object of this group. + Returns whether this group uses the converter for synchronization. + */ + bool useConverter() const; - Note: This method is only available for OpenSync 0.19 and 0.20. + /** + Saves the configuration to hard disc. */ - GroupConfig config() const; + Result save(); bool operator==( const Group &group ) const { return mGroup == group.mGroup; } + /** + Removes all group configurations from the hard disc. + */ + Result cleanup() const; + private: OSyncGroup *mGroup; }; |