summaryrefslogtreecommitdiffstats
path: root/ksquirrel/sq_fileiconviewbase.h
blob: 4111e39935b2f58a7f108ed31c0e844096970bd1 (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
/***************************************************************************
                          sq_fileiconviewbase.h  -  description
                             -------------------
    begin                : ??? Feb 22 2005
    copyright            : (C) 2005 by Baryshev Dmitry
    email                : ksquirrel.iv@gmail.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef SQ_FILEICONVIEWBASE_H
#define SQ_FILEICONVIEWBASE_H

#include <kfileiconview.h>

class KonqFileTip;

/*
 *  SQ_FileIconViewBase is a base class for icon view, list view and
 *  thumbnail view with drag-and-drop support.
 */

class SQ_FileIconViewBase : public KFileIconView
{
    Q_OBJECT
  TQ_OBJECT

    public: 
        SQ_FileIconViewBase(TQWidget *tqparent = 0, const char *name = 0);
        virtual ~SQ_FileIconViewBase();

        virtual void insertCdUpItem(const KURL &base) = 0;
        virtual void updateView(const KFileItem *i);

    protected:

        /*
         *  Get KFileIconViewItem by KFileItem. All KFileItems store
         *  a pointer to appropriate KFileIconViewItem as extra data.
         *  See also KFileItem::setExtraData() and insertItem().
         */
        KFileIconViewItem* viewItem(const KFileItem *item);
        /*
         *  Accept dragging.
         */
        virtual void dragEnterEvent(TQDragEnterEvent *);

        /*
         *  Handle double clicks.
         */
        virtual void contentsMouseDoubleClickEvent(TQMouseEvent *e);

        virtual bool eventFilter(TQObject *o, TQEvent *e);

        void initItemMy(KFileIconViewItem *item, const KFileItem *i, bool upd = false);

    signals:
        void invokeBrowser();

    public slots:
        void slotResetToolTip();

    protected slots:
        /*
         *  Show extended tooltip for 'item'.
         */
        void slotShowToolTip(TQIconViewItem *item);

        /*
         *  Remove tootip and stop timer.
         */
        void slotRemoveToolTip();

    private:
        /*
         *  Tooltip for file item.
         */
        KonqFileTip *toolTip;
};

#endif