summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/iconview.h
blob: bea35c21bc9bceadff4fc54953c531c0c97e8d8d (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
91
92
93
94
95
96
97
98
99
100
101
/*
 * GPLv2 zecke@handhelds.org
 * No WArranty...
 */

#ifndef PHUNK_ICON_VIEW_H
#define PHUNK_ICON_VIEW_H

#include <qvbox.h>


class QIconView;
class QIconViewItem;
class QComboBox;
class PIconViewItem;
class PDirLister;
class Ir;

namespace Opie {
namespace Core{
    class OConfig;
    class OKeyConfigManager;
}
}

class PIconView : public QVBox {
    Q_OBJECT
    friend class PIconViewItem;
    enum ActionIds {
        BeamItem, DeleteItem, ViewItem, InfoItem,SlideItem
    };
public:
    PIconView( QWidget* wid, Opie::Core::OConfig *cfg );
    ~PIconView();
    void resetView();
    Opie::Core::OKeyConfigManager* manager();

signals:
    void sig_showInfo( const QString& );
    void sig_display(const QString&);
    void sig_startslide(int timeout);

public slots:
    virtual void slotShowNext();
    virtual void slotShowPrev();
    virtual void slotShowLast();
    virtual bool slotShowFirst();

protected:
    void resizeEvent( QResizeEvent* );

private:
    void initKeys();
    QString currentFileName(bool &isDir)const;
    QString nextFileName(bool &isDir)const;
    QString prevFileName(bool &isDir)const;
    void loadViews();
    void calculateGrid();

private slots:
    void slotDirUp();
    void slotChangeDir(const QString&);
    void slotTrash();
    void slotViewChanged( int );
    void slotReloadDir();
    void slotRename();
    void slotBeam();
    void slotBeamDone( Ir* );

    void slotShowImage();
    void slotShowImage( const QString& );
    void slotImageInfo();
    void slotImageInfo( const QString& );
    void slotStartSlide();

    void slotStart();
    void slotEnd();

/* for performance reasons make it inline in the future */
    void addFolders(  const QStringList& );
    void addFiles( const QStringList& );
    void slotClicked(QIconViewItem* );
    void slotRetrun(QIconViewItem* );

/**/
    void slotThumbInfo(const QString&, const QString&);
    void slotThumbNail(const QString&, const QPixmap&);

    void  slotChangeMode( int );
private:
    Opie::Core::OKeyConfigManager *m_viewManager;
    Opie::Core::OConfig *m_cfg;
    QComboBox* m_views;
    QIconView* m_view;
    QString m_path;
    bool m_updatet : 1;
    int m_mode;
    bool m_internalReset:1;
};

#endif