1 /**
2 * \file
3 *
4 * Abstract base class for all EditWidget implementations.
5 *
6 * Authors:
7 * Ralf Stephan <ralf@ark.in-berlin.de>
8 *
9 * Copyright (C) 2005 Ralf Stephan
10 *
11 * Released under GNU GPL. Read the file 'COPYING' for more information.
12 */
14 #ifndef INKSCAPE_UI_VIEW_EDIT_WIDGET_IFACE_H
15 #define INKSCAPE_UI_VIEW_EDIT_WIDGET_IFACE_H
17 #include "gdk/gdktypes.h"
18 #include "libnr/nr-point.h"
19 #include "message.h"
21 namespace Inkscape {
22 namespace UI {
23 namespace View {
25 struct EditWidgetInterface
26 {
27 EditWidgetInterface() {}
28 virtual ~EditWidgetInterface() {}
30 /// Returns pointer to window UI object as void*
31 virtual void *getWindow() = 0;
33 /// Set the widget's title
34 virtual void setTitle (gchar const*) = 0;
36 /// Show all parts of widget the user wants to see.
37 virtual void layout() = 0;
39 /// Present widget to user
40 virtual void present() = 0;
42 /// Returns geometry of widget
43 virtual void getGeometry (gint &x, gint &y, gint &w, gint &h) = 0;
45 /// Change the widget's size
46 virtual void setSize (gint w, gint h) = 0;
48 /// Move widget to specified position
49 virtual void setPosition (NR::Point p) = 0;
51 /// Transientize widget
52 virtual void setTransient (void*, int) = 0;
54 /// Return mouse position in widget
55 virtual NR::Point getPointer() = 0;
57 /// Make widget fill screen and show it if possible.
58 virtual void setFullscreen() = 0;
60 /// Shuts down the desktop object for the view being closed. It checks
61 /// to see if the document has been edited, and if so prompts the user
62 /// to save, discard, or cancel. Returns TRUE if the shutdown operation
63 /// is cancelled or if the save is cancelled or fails, FALSE otherwise.
64 virtual bool shutdown() = 0;
66 /// Destroy and delete widget.
67 virtual void destroy() = 0;
70 /// Queue a redraw request with the canvas
71 virtual void requestCanvasUpdate() = 0;
73 /// Update the "active desktop" indicator
74 virtual void activateDesktop() = 0;
76 /// Update the "inactive desktop" indicator
77 virtual void deactivateDesktop() = 0;
79 /// Set rulers to position
80 virtual void viewSetPosition (NR::Point p) = 0;
82 /// Update rulers from current values
83 virtual void updateRulers() = 0;
85 /// Update scrollbars from current values
86 virtual void updateScrollbars (double scale) = 0;
88 /// Toggle rulers on/off and set preference value accordingly
89 virtual void toggleRulers() = 0;
91 /// Toggle scrollbars on/off and set preference value accordingly
92 virtual void toggleScrollbars() = 0;
94 /// Temporarily block signals and update zoom display
95 virtual void updateZoom() = 0;
97 /// The zoom display will get the keyboard focus.
98 virtual void letZoomGrabFocus() = 0;
100 /// In auxiliary toolbox, set focus to widget having specific id
101 virtual void setToolboxFocusTo (const gchar *) = 0;
103 /// In auxiliary toolbox, set value of adjustment with specific id
104 virtual void setToolboxAdjustmentValue (const gchar *, double) = 0;
106 /// In auxiliary toolbox, return true if specific togglebutton is active
107 virtual bool isToolboxButtonActive (gchar const*) = 0;
109 /// Set the coordinate display
110 virtual void setCoordinateStatus (NR::Point p) = 0;
112 /// Message widget will get no content
113 virtual void setMessage (Inkscape::MessageType type, gchar const* msg) = 0;
115 /// Open yes/no dialog with warning text and confirmation question.
116 virtual bool warnDialog (gchar*) = 0;
117 };
119 } // namespace View
120 } // namespace UI
121 } // namespace Inkscape
123 #endif // INKSCAPE_UI_VIEW_EDIT_WIDGET_IFACE_H
125 /*
126 Local Variables:
127 mode:c++
128 c-file-style:"stroustrup"
129 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
130 indent-tabs-mode:nil
131 fill-column:99
132 End:
133 */
134 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :