1 /**
2 * \file
3 *
4 * Abstract base class for all EditWidget implementations.
5 *
6 * Authors:
7 * Ralf Stephan <ralf@ark.in-berlin.de>
8 * John Bintz <jcoswell@coswellproductions.org>
9 *
10 * Copyright (C) 2006 John Bintz
11 * Copyright (C) 2005 Ralf Stephan
12 *
13 * Released under GNU GPL. Read the file 'COPYING' for more information.
14 */
16 #ifndef INKSCAPE_UI_VIEW_EDIT_WIDGET_IFACE_H
17 #define INKSCAPE_UI_VIEW_EDIT_WIDGET_IFACE_H
19 #include "gdk/gdktypes.h"
20 #include "libnr/nr-point.h"
21 #include "message.h"
23 namespace Inkscape {
24 namespace UI {
25 namespace View {
27 struct EditWidgetInterface
28 {
29 EditWidgetInterface() {}
30 virtual ~EditWidgetInterface() {}
32 /// Returns pointer to window UI object as void*
33 virtual void *getWindow() = 0;
35 /// Set the widget's title
36 virtual void setTitle (gchar const*) = 0;
38 /// Show all parts of widget the user wants to see.
39 virtual void layout() = 0;
41 /// Present widget to user
42 virtual void present() = 0;
44 /// Returns geometry of widget
45 virtual void getGeometry (gint &x, gint &y, gint &w, gint &h) = 0;
47 /// Change the widget's size
48 virtual void setSize (gint w, gint h) = 0;
50 /// Move widget to specified position
51 virtual void setPosition (NR::Point p) = 0;
53 /// Transientize widget
54 virtual void setTransient (void*, int) = 0;
56 /// Return mouse position in widget
57 virtual NR::Point getPointer() = 0;
59 /// Make widget iconified
60 virtual void setIconified() = 0;
62 /// Make widget maximized on screen
63 virtual void setMaximized() = 0;
65 /// Make widget fill screen and show it if possible.
66 virtual void setFullscreen() = 0;
68 /// Shuts down the desktop object for the view being closed. It checks
69 /// to see if the document has been edited, and if so prompts the user
70 /// to save, discard, or cancel. Returns TRUE if the shutdown operation
71 /// is cancelled or if the save is cancelled or fails, FALSE otherwise.
72 virtual bool shutdown() = 0;
74 /// Destroy and delete widget.
75 virtual void destroy() = 0;
78 /// Queue a redraw request with the canvas
79 virtual void requestCanvasUpdate() = 0;
81 /// Force a redraw of the canvas
82 virtual void requestCanvasUpdateAndWait() = 0;
84 /// Enable interaction on this desktop
85 virtual void enableInteraction() = 0;
87 /// Disable interaction on this desktop
88 virtual void disableInteraction() = 0;
90 /// Update the "active desktop" indicator
91 virtual void activateDesktop() = 0;
93 /// Update the "inactive desktop" indicator
94 virtual void deactivateDesktop() = 0;
96 /// Set rulers to position
97 virtual void viewSetPosition (NR::Point p) = 0;
99 /// Update rulers from current values
100 virtual void updateRulers() = 0;
102 /// Update scrollbars from current values
103 virtual void updateScrollbars (double scale) = 0;
105 /// Toggle rulers on/off and set preference value accordingly
106 virtual void toggleRulers() = 0;
108 /// Toggle scrollbars on/off and set preference value accordingly
109 virtual void toggleScrollbars() = 0;
111 /// Temporarily block signals and update zoom display
112 virtual void updateZoom() = 0;
114 /// The zoom display will get the keyboard focus.
115 virtual void letZoomGrabFocus() = 0;
117 /// In auxiliary toolbox, set focus to widget having specific id
118 virtual void setToolboxFocusTo (const gchar *) = 0;
120 /// In auxiliary toolbox, set value of adjustment with specific id
121 virtual void setToolboxAdjustmentValue (const gchar *, double) = 0;
123 /// In auxiliary toolbox, return true if specific togglebutton is active
124 virtual bool isToolboxButtonActive (gchar const*) = 0;
126 /// Set the coordinate display
127 virtual void setCoordinateStatus (NR::Point p) = 0;
129 /// Message widget will get no content
130 virtual void setMessage (Inkscape::MessageType type, gchar const* msg) = 0;
132 /// Open yes/no dialog with warning text and confirmation question.
133 virtual bool warnDialog (gchar*) = 0;
134 };
136 } // namespace View
137 } // namespace UI
138 } // namespace Inkscape
140 #endif // INKSCAPE_UI_VIEW_EDIT_WIDGET_IFACE_H
142 /*
143 Local Variables:
144 mode:c++
145 c-file-style:"stroustrup"
146 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
147 indent-tabs-mode:nil
148 fill-column:99
149 End:
150 */
151 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :