25 #ifndef KONTACT_PROFILEMANAGER_H 26 #define KONTACT_PROFILEMANAGER_H 32 template < class T> class TQValueList; 42 friend class ProfileManager; 46 explicit Profile( const TQString& id, bool isLocal = false ); 50 TQString name() const; 52 TQString description() const; 56 void setName( const TQString& name ); 58 void setDescription( const TQString& description ); 60 bool operator==( const Kontact::Profile& other ) const; 62 TQString saveLocation() const; 67 DoNotCopyProfileFiles, 70 void setLocal( SetLocalMode mode ); 72 void setOriginalLocation( const TQString& path ); 73 void setId( const TQString& id ); 77 static void copyConfigFiles( const TQString& source, const TQString& dest ); 79 TQString localSaveLocation() const; 84 TQString m_description; 86 TQString m_originalLocation; 89 class ProfileManager : public TQObject 101 DirectoryDoesNotExist, 105 static ProfileManager* self(); 109 Kontact::Profile profileById( const TQString& id ) const; 111 bool addProfile( const Kontact::Profile& profile, bool syncConfig = true ); 113 void removeProfile( const Kontact::Profile& profile ); 115 void removeProfile( const TQString& id ); 117 void updateProfile( const Kontact::Profile& profile ); 119 void loadProfile( const TQString& id ); 121 void saveToProfile( const TQString& id ); 123 TQValueList<Kontact::Profile> profiles() const; 125 ExportError exportProfileToDirectory( const TQString& id, const TQString& path ); 127 ImportError importProfileFromDirectory( const TQString& path ); 129 TQString generateNewId() const; 132 void profileAdded( const TQString& id ); 134 void profileRemoved( const TQString& id ); 136 void profileUpdated( const TQString& id ); 138 void profileLoaded( const TQString& id ); 140 void saveToProfileRequested( const TQString& id ); 142 void profileImportFinished( ImportError status ); 145 static ProfileManager* m_self; 147 static Kontact::Profile readFromConfiguration( const TQString& configFile, bool isLocal ); 149 explicit ProfileManager( TQObject* parent = 0 ); 153 void writeConfig() const; 155 void writeProfileConfig( const Kontact::Profile& profile ) const; 158 TQMap<TQString, Kontact::Profile> m_profiles; 163 #endif // KONTACT_PROFILEMANAGER_H
|