summaryrefslogtreecommitdiffstats
path: root/src/kiconcanvas.h
blob: b177dd1003a92c718e81837f2419aa54de2b0cd9 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* vi: ts=8 sts=4 sw=4
 * kate: space-indent on; indent-width 4; mixedindent off; indent-mode cstyle;
 *
 * This file is part of the KDE project, module kfile.
 * Copyright (C) 2006 Luke Sandell <lasandell@gmail.com>
 *           (C) 2002 Carsten Pfeiffer <pfeiffer@kde.org>
 *           (C) 2000 Geert Jansen <jansen@kde.org>
 *           (C) 2000 Kurt Granroth <granroth@kde.org>
 *           (C) 1997 Christoph Neerfeld <chris@kde.org>
 *
 * This is free software; it comes under the GNU Library General
 * Public License, version 2. See the file "COPYING.LIB" for the
 * exact licensing terms.
 */

#ifndef _KICONCANVAS_H_
#define _KICONCANVAS_H_

#include <tqstring.h>
#include <tqstringlist.h>
#include <kiconview.h>

class TQTimer;
class KIconLoader;
class TQDragObject;
class TQIconLoader;

/**
 * Icon canvas for KIconDialog.
 */
class TDEIO_EXPORT KIconCanvas: public KIconView
/* NOTE: Why export this? */
{
    Q_OBJECT
  

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

    /**
     * Load icons into the canvas.
     */
    void loadFiles(const TQStringList& files);

    /**
     * Returns the current icon.
     */
    TQString getCurrent() const;

    void setIconLoader(KIconLoader *loader);

    void setGroupOrSize(int groupOrSize);

    void setStrictIconSize(bool strictIconSize);

public slots:
    void stopLoading();

signals:
    /**
     * Emitted when the current icon has changed.
     */
    void nameChanged(TQString);
    /* KDE 4: Make it const TQString */

    void startLoading(int);
    void progress(int);
    void finished();

private slots:
    void slotLoadFiles();
    void slotCurrentChanged(TQIconViewItem *item);

private:
    TQStringList mFiles;
    TQTimer *mpTimer;
    KIconLoader *mpLoader;

protected:
    virtual void virtual_hook( int id, void* data );
    virtual TQDragObject *dragObject();
    void loadIcon(const TQString &path);

private:
    class KIconCanvasPrivate;
    KIconCanvasPrivate *d;
};

#endif