kitchensync
profilemanager.h
00001 /* 00002 This file is part of KitchenSync. 00003 00004 Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library 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 GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 */ 00021 #ifndef KSYNC_PROFILEMANAGER_H 00022 #define KSYNC_PROFILEMANAGER_H 00023 00024 #include "profileconfig.h" 00025 00026 #include <profile.h> 00027 00028 #include <qstring.h> 00029 00030 namespace KSync { 00031 00038 class ProfileManager 00039 { 00040 public: 00044 ProfileManager(); 00045 00049 ProfileManager( const Profile::List &list ); 00050 00054 ~ProfileManager(); 00055 00059 Profile currentProfile() const; 00060 00064 void setCurrentProfile( const Profile &profile ); 00065 00069 Profile::List profiles() const; 00070 00074 void setProfiles( const Profile::List &list ); 00075 00079 Profile byName( const QString &name ); 00080 00084 // FIXME: byName2 is not a very expressive name 00085 Profile::List byName2( const QString &name ); 00086 00087 /* 00088 * profile at index 00089 */ 00090 Profile profile( int index ) const; 00091 00095 int count() const; 00096 00100 void load(); 00101 00105 void save(); 00106 00110 void addProfile( const Profile & ); 00111 00115 void replaceProfile( const Profile & ); 00116 00120 void removeProfile( const Profile & ); 00121 00122 private: 00123 ProfileConfig mProfileConfig; 00124 00125 Profile mCurrentProfile; 00126 Profile::List mProfiles; 00127 }; 00128 00129 } 00130 00131 00132 #endif