1 #ifndef __SP_SVG_VIEW_H__
2 #define __SP_SVG_VIEW_H__
4 /** \file
5 * SPSVGView, SPSVGSPViewWidget: Generic SVG view and widget
6 *
7 * Authors:
8 * Lauris Kaplinski <lauris@kaplinski.com>
9 * Ralf Stephan <ralf@ark.in-berlin.de>
10 *
11 * Copyright (C) 2001-2002 Lauris Kaplinski
12 * Copyright (C) 2001 Ximian, Inc.
13 *
14 * Released under GNU GPL, read the file 'COPYING' for more information
15 */
17 #include "ui/view/view.h"
19 class SPCanvasGroup;
20 class SPCanvasItem;
23 /**
24 * Generic SVG view.
25 */
26 class SPSVGView : public Inkscape::UI::View::View {
27 public:
28 unsigned int _dkey;
29 SPCanvasGroup *_parent;
30 SPCanvasItem *_drawing;
31 gdouble _hscale; ///< horizontal scale
32 gdouble _vscale; ///< vertical scale
33 bool _rescale; ///< whether to rescale automatically
34 bool _keepaspect;
35 gdouble _width;
36 gdouble _height;
39 SPSVGView (SPCanvasGroup* parent);
40 virtual ~SPSVGView();
42 /// Rescales SPSVGView to given proportions.
43 void setScale (gdouble hscale, gdouble vscale);
45 /// Rescales SPSVGView and keeps aspect ratio.
46 void setRescale (bool rescale, bool keepaspect, gdouble width, gdouble height);
48 void doRescale (bool event);
50 virtual void setDocument (SPDocument*);
51 virtual void mouseover();
52 virtual void mouseout();
53 virtual bool shutdown() { return true; }
55 private:
56 virtual void onPositionSet (double, double) {}
57 virtual void onResized (double, double) {}
58 virtual void onRedrawRequested() {}
59 virtual void onStatusMessage (Inkscape::MessageType type, gchar const *message) {}
60 virtual void onDocumentURISet (gchar const* uri) {}
61 virtual void onDocumentResized (double, double);
62 };
64 #endif
66 /*
67 Local Variables:
68 mode:c++
69 c-file-style:"stroustrup"
70 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
71 indent-tabs-mode:nil
72 fill-column:99
73 End:
74 */
75 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :