summaryrefslogtreecommitdiffstats
path: root/kuickshow/src/filecache.h
blob: 2152b5f986041559b944119020783c10a46b0958 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/****************************************************************************
** $Id: .emacs,v 1.3 2006/02/20 15:06:53 gis Exp $
**
** Created : 2006
**
** Copyright (C) 2006 Carsten Pfeiffer <pfeiffer@kde.org>
**
****************************************************************************/

#ifndef FILECACHE_H
#define FILECACHE_H

#include <tqcache.h>

#include "kuickfile.h"

class KTempDir;

class FileCache
{
public:
    static FileCache * self();
    static void shutdown();

    KuickFile * getFile( const KURL& url );
    void setLimit( int numFiles );
    int getLimit() const { return m_limit; }

    /**
     * @return the temporary directory or TQString() if none available
     */
    TQString tempDir();

private:
    static FileCache *s_self;
    FileCache();
    ~FileCache();

    KTempDir * createTempDir();
    TQCache<KuickFile> m_files;

    int m_limit;
    KTempDir *m_tempDir;

};

#endif // FILECACHE_H