~ubuntu-branches/ubuntu/oneiric/kolourpaint/oneiric-proposed

« back to all changes in this revision

Viewing changes to views/kpZoomedView.h

  • Committer: Bazaar Package Importer
  • Author(s): Harald Sitter
  • Date: 2011-07-10 12:20:39 UTC
  • Revision ID: james.westby@ubuntu.com-20110710122039-a7bokz6isao1ldt2
Tags: upstream-4.6.90+repack
ImportĀ upstreamĀ versionĀ 4.6.90+repack

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/*
 
3
   Copyright (c) 2003-2007 Clarence Dang <dang@kde.org>
 
4
   All rights reserved.
 
5
 
 
6
   Redistribution and use in source and binary forms, with or without
 
7
   modification, are permitted provided that the following conditions
 
8
   are met:
 
9
 
 
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.
 
15
 
 
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.
 
26
*/
 
27
 
 
28
 
 
29
#ifndef KP_ZOOMED_VIEW_H
 
30
#define KP_ZOOMED_VIEW_H
 
31
 
 
32
 
 
33
#include <kpView.h>
 
34
 
 
35
 
 
36
/**
 
37
 * @short Zoomed view of a document.  Suitable as an ordinary editing view.
 
38
 *
 
39
 * This is a zoomed view of a document.  It resizes according to the size
 
40
 * of the document and the zoom level.  Do not manually call resize() for
 
41
 * this reason.
 
42
 *
 
43
 * It is suitable as an ordinary editing view.
 
44
 *
 
45
 * Do not call setOrigin().  REFACTOR: this is bad class design - derived classes should only add functionality - not remove
 
46
 *
 
47
 * This class is sealed.  Do not derive from it.  REFACTOR: this is also bad class design
 
48
 *
 
49
 * @author Clarence Dang <dang@kde.org>
 
50
 */
 
51
/*sealed*/ class kpZoomedView : public kpView
 
52
{
 
53
Q_OBJECT
 
54
 
 
55
public:
 
56
    /**
 
57
     * Constructs a zoomed view.
 
58
     */
 
59
    kpZoomedView (kpDocument *document,
 
60
                  kpToolToolBar *toolToolBar,
 
61
                  kpViewManager *viewManager,
 
62
                  kpView *buddyView,
 
63
                  kpViewScrollableContainer *scrollableContainer,
 
64
                  QWidget *parent);
 
65
 
 
66
    /**
 
67
     * Destructs an unzoomed view.
 
68
     */
 
69
    virtual ~kpZoomedView ();
 
70
 
 
71
 
 
72
    /**
 
73
     * Extends @kpView.  Calls adjustToEnvironment().
 
74
     */
 
75
    virtual void setZoomLevel (int hzoom, int vzoom);
 
76
 
 
77
 
 
78
public slots:
 
79
    /**
 
80
     * Resizes itself so that the entire document in the zoom level fits
 
81
     * almost perfectly.
 
82
     *
 
83
     * Call this if the size of the document changes.
 
84
     * Already called by setZoomLevel().
 
85
     *
 
86
     * Implements @ref kpView.
 
87
     */
 
88
    virtual void adjustToEnvironment ();
 
89
 
 
90
 
 
91
private:
 
92
    struct kpZoomedViewPrivate *d;
 
93
};
 
94
 
 
95
 
 
96
#endif  // KP_ZOOMED_VIEW_H