make sure to attach to the document also when a resize event is received prior of...
[kdegraphics.git] / kolourpaint / views / kpUnzoomedThumbnailView.h
blob3ca47dbadc659a706a714bc80e0f20e98cabc0f0
2 /*
3 Copyright (c) 2003-2007 Clarence Dang <dang@kde.org>
4 All rights reserved.
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
8 are met:
10 1. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
16 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #ifndef KP_UNZOOMED_THUMBNAIL_VIEW_H
30 #define KP_UNZOOMED_THUMBNAIL_VIEW_H
33 #include <kpThumbnailView.h>
36 class kpViewScrollableContainer;
39 /**
40 * @short Unzoomed thumbnail view of a document.
42 * This is an unzoomed thumbnail view of a document. Unlike
43 * @ref kpZoomedThumbnailView, it never changes the zoom level. And unlike
44 * @ref kpZoomedView, it never resizes itself. Instead, it changes its
45 * origin according to the main view's scrollable container so that the
46 * top-left most document pixel displayed in the scrollable container will
47 * be visible.
49 * Do not call setZoomLevel() nor setOrigin().
51 * This class is sealed. Do not derive from it.
53 * @author Clarence Dang <dang@kde.org>
55 /*sealed*/ class kpUnzoomedThumbnailView : public kpThumbnailView
57 Q_OBJECT
59 public:
60 /**
61 * Constructs an unzoomed thumbnail view.
63 kpUnzoomedThumbnailView (kpDocument *document,
64 kpToolToolBar *toolToolBar,
65 kpViewManager *viewManager,
66 kpView *buddyView,
67 kpViewScrollableContainer *scrollableContainer,
68 QWidget *parent);
70 /**
71 * Destructs an unzoomed thumbnail view.
73 virtual ~kpUnzoomedThumbnailView ();
76 /**
77 * Implements @ref kpThumbnailView.
79 QString caption () const;
82 public slots:
83 /**
84 * Changes its origin according to the main view's scrollable container
85 * so that the top-left most document pixel displayed in the scrollable
86 * container will be visible.
88 * It tries to maximise the used area of this view. Unused areas will
89 * be set to the widget background thanks to the mask.
91 * Call this if the size of the document changes.
92 * Already connected to buddyViewScrollableContainer()'s
93 * contentsMovingSoon(int,int) signal.
94 * Already called by @ref kpThumbnailView resizeEvent().
96 * Implements @ref kpView.
98 virtual void adjustToEnvironment ();
101 private:
102 struct kpUnzoomedThumbnailViewPrivate *d;
106 #endif // KP_UNZOOMED_THUMBNAIL_VIEW_H