compile
[kdegraphics.git] / kolourpaint / generic / kpAbstractScrollAreaUtils.h
blobb6c9e1ff6c88afa3167b9d8799446e4615be26c2
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 kpAbstractScrollAreaUtils_H
30 #define kpAbstractScrollAreaUtils_H
33 class Q3ScrollView;
34 class QAbstractScrollArea;
35 class QSize;
38 // TODO: Account for scroll areas' viewport margins (but they're 0 by default anyway).
39 namespace kpAbstractScrollAreaUtils
41 // Guesses the width of the vertical scrollbar of <scrollArea>.
42 // If it's not visible, this method guesses its width if it were visible.
43 int EstimateVerticalScrollBarWidth (QAbstractScrollArea *scrollArea);
44 int EstimateVerticalScrollBarWidth (Q3ScrollView *scrollArea);
46 // Guesses the height of the horizontal scrollbar of <scrollArea>.
47 // If it's not visible, this method guesses its height if it were visible.
48 int EstimateHorizontalScrollBarHeight (QAbstractScrollArea *scrollArea);
49 int EstimateHorizontalScrollBarHeight (Q3ScrollView *scrollArea);
51 // Guesses the size of the <scrollArea> minus the space the scrollbars
52 // take (if they are visible) or would take (if they are not visible).
54 // The is useful for implementing zoom-to-rectangle so that the
55 // automatic introduction of scrollbars doesn't cover any content that
56 // should be visible. Of course, if the scrollbars aren't automatically
57 // introduced, then <scrollArea> will display a little too much content,
58 // which is OK.
59 QSize EstimateUsableArea (QAbstractScrollArea *scrollArea);
60 QSize EstimateUsableArea (Q3ScrollView *scrollArea);
64 #endif // kpAbstractScrollAreaUtils_H