syncprocessmanager.h
00001 /* 00002 This file is part of KitchenSync. 00003 00004 Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00019 USA. 00020 */ 00021 #ifndef SYNCPROCESSMANAGER_H 00022 #define SYNCPROCESSMANAGER_H 00023 00024 #include <tqobject.h> 00025 00026 #include <libqopensync/group.h> 00027 00028 namespace QSync { 00029 class Environment; 00030 } 00031 00032 class SyncProcess; 00033 00034 class SyncProcessManager : public TQObject 00035 { 00036 Q_OBJECT 00037 00038 public: 00039 static SyncProcessManager *self(); 00040 00044 ~SyncProcessManager(); 00045 00049 QSync::Environment *environment() const { return mEnvironment; } 00050 00054 int count() const; 00055 00059 SyncProcess* at( int pos ) const; 00060 00064 SyncProcess* byGroup( const QSync::Group &group ); 00065 00069 SyncProcess* byGroupName( const TQString &name ); 00070 00074 void addGroup( const TQString &name ); 00075 00079 void remove( SyncProcess *syncProcess ); 00080 00084 QSync::Result addMember( SyncProcess *process, const QSync::Plugin &plugin ); 00085 00086 signals: 00087 void changed(); 00088 void syncProcessChanged( SyncProcess *process ); 00089 00090 private: 00091 SyncProcessManager(); 00092 00093 void init( QSync::Environment *environment ); 00094 00095 TQValueList<SyncProcess*> mProcesses; 00096 QSync::Environment *mEnvironment; 00097 00098 static SyncProcessManager *mSelf; 00099 }; 00100 00101 #endif