~ubuntu-branches/ubuntu/precise/gwenview/precise-proposed

« back to all changes in this revision

Viewing changes to lib/documentview/documentviewcontainer.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-15 14:17:54 UTC
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: package-import@ubuntu.com-20111215141754-z043hyx69dulbggf
Tags: upstream-4.7.90
Import upstream version 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// vim: set tabstop=4 shiftwidth=4 noexpandtab:
 
1
// vim: set tabstop=4 shiftwidth=4 expandtab:
2
2
/*
3
3
Gwenview: an image viewer
4
4
Copyright 2011 Aurélien Gâteau <agateau@kde.org>
28
28
// KDE
29
29
 
30
30
// Qt
31
 
#include <QWidget>
 
31
#include <QGraphicsView>
32
32
 
33
 
namespace Gwenview {
 
33
namespace Gwenview
 
34
{
34
35
 
35
36
class DocumentView;
36
37
 
39
40
 * A container for DocumentViews which will arrange them to make best use of
40
41
 * available space.
41
42
 */
42
 
class GWENVIEWLIB_EXPORT DocumentViewContainer : public QWidget {
43
 
        Q_OBJECT
 
43
class GWENVIEWLIB_EXPORT DocumentViewContainer : public QGraphicsView
 
44
{
 
45
    Q_OBJECT
44
46
public:
45
 
        DocumentViewContainer(QWidget* parent=0);
46
 
        ~DocumentViewContainer();
47
 
 
48
 
        void addView(DocumentView* view);
 
47
    DocumentViewContainer(QWidget* parent = 0);
 
48
    ~DocumentViewContainer();
 
49
 
 
50
    /**
 
51
     * Create a DocumentView in the DocumentViewContainer scene
 
52
     */
 
53
    DocumentView* createView();
 
54
 
 
55
    /**
 
56
     * Delete view. Note that the view will first be faded to black before
 
57
     * being destroyed.
 
58
     */
 
59
    void deleteView(DocumentView* view);
 
60
 
 
61
    /**
 
62
     * Immediately delete all views
 
63
     */
 
64
    void reset();
 
65
 
 
66
public Q_SLOTS:
 
67
    void updateLayout();
49
68
 
50
69
protected:
51
 
        bool eventFilter(QObject*, QEvent*);
52
 
        void showEvent(QShowEvent*);
53
 
        void resizeEvent(QResizeEvent*);
 
70
    void showEvent(QShowEvent*);
 
71
    void resizeEvent(QResizeEvent*);
 
72
 
 
73
private:
 
74
    friend class ViewItem;
 
75
    DocumentViewContainerPrivate* const d;
54
76
 
55
77
private Q_SLOTS:
56
 
        void updateLayout();
57
 
 
58
 
private:
59
 
        DocumentViewContainerPrivate* const d;
 
78
    void slotViewAnimationFinished(DocumentView*);
60
79
};
61
80
 
62
 
 
63
81
} // namespace
64
82
 
65
83
#endif /* DOCUMENTVIEWCONTAINER_H */