kitchensync

syncprocessmanager.h
1 /*
2  This file is part of KitchenSync.
3 
4  Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19  USA.
20 */
21 #ifndef SYNCPROCESSMANAGER_H
22 #define SYNCPROCESSMANAGER_H
23 
24 #include <tqobject.h>
25 
26 #include <libqopensync/group.h>
27 
28 namespace QSync {
29 class Environment;
30 }
31 
32 class SyncProcess;
33 
34 class SyncProcessManager : public TQObject
35 {
36  Q_OBJECT
37 
38  public:
39  static SyncProcessManager *self();
40 
44  ~SyncProcessManager();
45 
49  QSync::Environment *environment() const { return mEnvironment; }
50 
54  int count() const;
55 
59  SyncProcess* at( int pos ) const;
60 
64  SyncProcess* byGroup( const QSync::Group &group );
65 
69  SyncProcess* byGroupName( const TQString &name );
70 
74  void addGroup( const TQString &name );
75 
79  void remove( SyncProcess *syncProcess );
80 
84  QSync::Result addMember( SyncProcess *process, const QSync::Plugin &plugin );
85 
86  signals:
87  void changed();
88  void syncProcessChanged( SyncProcess *process );
89 
90  private:
91  SyncProcessManager();
92 
93  void init( QSync::Environment *environment );
94 
95  TQValueList<SyncProcess*> mProcesses;
96  QSync::Environment *mEnvironment;
97 
98  static SyncProcessManager *mSelf;
99 };
100 
101 #endif