summaryrefslogtreecommitdiffstats
path: root/tdeio/tdefile/tdefilemetapreview.h
blob: 24fe415a28863d756f4d0cdae98d4fb09ed9fb95 (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
48
49
50
51
52
53
54
55
56
/*
 * This file is part of the KDE project.
 * Copyright (C) 2003 Carsten Pfeiffer <pfeiffer@kde.org>
 *
 * You can Freely distribute this program under the GNU Library General Public
 * License. See the file "COPYING" for the exact licensing terms.
 */

#ifndef TDEFILEMETAPREVIEW_H
#define TDEFILEMETAPREVIEW_H

#include <tqdict.h>
#include <tqwidgetstack.h>

#include <kpreviewwidgetbase.h>
#include <kurl.h>

class TDEIO_EXPORT KFileMetaPreview : public KPreviewWidgetBase
{
    TQ_OBJECT

public:
    KFileMetaPreview(TQWidget *parent, const char *name = 0);
    ~KFileMetaPreview();

    virtual void addPreviewProvider( const TQString& mimeType,
                                     KPreviewWidgetBase *provider );
    virtual void clearPreviewProviders();

public slots:
    virtual void showPreview(const KURL &url);
    virtual void clearPreview();

protected:
    virtual KPreviewWidgetBase *previewProviderFor( const TQString& mimeType );

protected:
    virtual void virtual_hook( int id, void* data );
    
private:
    void initPreviewProviders();

    TQWidgetStack *m_stack;
    TQDict<KPreviewWidgetBase> m_previewProviders;
    bool haveAudioPreview;

    // may return 0L
    static KPreviewWidgetBase * createAudioPreview( TQWidget *parent );
    static bool s_tryAudioPreview;

private:
    class KFileMetaPreviewPrivate;
    KFileMetaPreviewPrivate *d;
};

#endif // TDEFILEMETAPREVIEW_H