summaryrefslogtreecommitdiff
path: root/noncore/graphics/drawpad/thumbnailview.h
blob: 94176554a3148857234aba74b3eb28cebb896e4b (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
/***************************************************************************
 *                                                                         *
 *   DrawPad - a drawing program for Opie Environment                      *
 *                                                                         *
 *   (C) 2002 by S. Prud'homme <prudhomme@laposte.net>                     *
 *                                                                         *
 *   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 THUMBNAILVIEW_H
#define THUMBNAILVIEW_H

#include <qwidget.h>
#include <qlistview.h>

class DrawPadCanvas;
class Page;

class PageListViewItem : public QListViewItem
{
public:
    PageListViewItem(Page* page, QListView* parent);
    ~PageListViewItem();

    Page* page() const;

private:
    Page* m_pPage;
};

class PageListView : public QListView
{
public:
    PageListView(DrawPadCanvas* drawPadCanvas, QWidget* parent = 0, const char* name = 0);
    ~PageListView();

    void updateView();

    void select(Page* page);
    Page* selected() const;

protected:
    void resizeEvent(QResizeEvent* e);

private:
    DrawPadCanvas* m_pDrawPadCanvas;
};

class ThumbnailView : public QWidget
{
    Q_OBJECT

public:
    ThumbnailView(DrawPadCanvas* drawPadCanvas, QWidget* parent = 0, const char* name = 0);
    ~ThumbnailView();
    
    void hide();
    void exec();

public slots:
    void deletePage();
    void changePage();

private:
    bool inLoop;
    DrawPadCanvas* m_pDrawPadCanvas;

    PageListView* m_pPageListView;
};

#endif // THUMBNAILVIEW_H