libemailfunctions

idmapper.h
1 /*
2  This file is part of tdepim.
3 
4  Copyright (c) 2004 Tobias Koenig <tokoe@kde.org>
5  Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 #ifndef KPIM_IDMAPPER_H
23 #define KPIM_IDMAPPER_H
24 
25 #include <tqmap.h>
26 #include <tqvariant.h>
27 
28 #include <tdemacros.h>
29 
30 namespace KPIM {
31 
37 class TDE_EXPORT IdMapper
38 {
39  public:
44  IdMapper();
55  IdMapper( const TQString &path, const TQString &identifier = TQString() );
57  ~IdMapper();
58 
62  void setPath( const TQString &path );
66  TQString path() const { return mPath; }
67 
71  void setIdentifier( const TQString &identifier );
75  TQString identifier() const { return mIdentifier; }
76 
80  bool load();
81 
85  bool save();
86 
90  void clear();
91 
95  void setRemoteId( const TQString &localId, const TQString &remoteId );
96 
100  void removeRemoteId( const TQString &remoteId );
101 
105  TQString remoteId( const TQString &localId ) const;
106 
110  TQString localId( const TQString &remoteId ) const;
111 
112 
119  void setFingerprint( const TQString &localId, const TQString &fingerprint );
120 
127  const TQString &fingerprint( const TQString &localId ) const;
128 
129 
135  TQMap<TQString, TQString> remoteIdMap() const;
136 
141  TQString asString() const;
142 
143  protected:
147  TQString filename();
148 
149  private:
150  TQStringVariantMap mIdMap;
151  TQMap<TQString, TQString> mFingerprintMap;
152 
153  TQString mPath;
154  TQString mIdentifier;
155 };
156 
157 }
158 
159 #endif
An Id Mapper maps Ids.
Definition: idmapper.h:38
TQString identifier() const
Return id map identifier.
Definition: idmapper.h:75
TQString path() const
Return id map path.
Definition: idmapper.h:66
KPIM holds all kinds of functions specific to KDE PIM.
Definition: email.h:38