KVIrc  4.9.2
DeveloperAPIs
KviAvatarCache.h
Go to the documentation of this file.
1 #ifndef _KVI_AVATARCACHE_H_
2 #define _KVI_AVATARCACHE_H_
3 //=============================================================================
4 //
5 // File : KviAvatarCache.h
6 // Creation date : Sat 27 Dec 2003 21:19:47 by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2003-2010 Szymon Stefanek <pragma at kvirc dot net>
10 //
11 // This program is FREE software. You can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the HOPE that it will be USEFUL,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 // See the GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, write to the Free Software Foundation,
23 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //=============================================================================
26 
33 #include "kvi_settings.h"
34 #include "KviQString.h"
35 #include "KviTimeUtils.h"
36 #include "KviIrcMask.h"
37 #include "KviPointerHashTable.h"
38 
44 typedef struct _KviAvatarCacheEntry
45 {
46  QString szIdString;
49 
55 {
56 protected:
62 
66  ~KviAvatarCache();
67 
68 public:
70 
71 protected:
73 
74 public:
79  static void init();
80 
85  static void done();
86 
91  static KviAvatarCache * instance() { return m_pAvatarCacheInstance; };
92 
100  void replace(const QString & szIdString, const KviIrcMask & mask, const QString & szNetwork);
101 
108  void remove(const KviIrcMask & mask, const QString & szNetwork);
109 
116  const QString & lookup(const KviIrcMask & mask, const QString & szNetwork);
117 
122  void cleanup();
123 
129  void load(const QString & szFileName);
130 
136  void save(const QString & szFileName);
137 };
138 
139 #endif //_KVI_AVATARCACHE_H_
static KviAvatarCache * instance()
Returns the instance of the avatar cache.
Definition: KviAvatarCache.h:91
Irc user mask abstraction.
Avatar cache handling class.
Definition: KviAvatarCache.h:54
QString szIdString
Definition: KviAvatarCache.h:46
#define kvi_time_t
Definition: KviTimeUtils.h:43
Irc user mask handling.
Definition: KviIrcMask.h:45
struct _KviAvatarCacheEntry KviAvatarCacheEntry
Pointer Hash Table.
kvi_time_t tLastAccess
Definition: KviAvatarCache.h:47
void done()
Definition: KviKvs.cpp:50
Defines a struct for the avatar entry in the cache.
Definition: KviAvatarCache.h:44
bool save(KviThemeInfo &options, bool bSaveIcons)
Definition: KviOptions.cpp:986
Time management.
A fast pointer hash table implementation.
Definition: KviPointerHashTable.h:391
int init()
Definition: winamp.cpp:118
This file contains compile time settings.
KviPointerHashTable< QString, KviAvatarCacheEntry > * m_pAvatarDict
Definition: KviAvatarCache.h:69
#define KVILIB_API
Definition: kvi_settings.h:125
Helper functions for the QString class.
static KviAvatarCache * m_pAvatarCacheInstance
Definition: KviAvatarCache.h:72