Code

add interface for disabling interaction during long-running operations
[inkscape.git] / src / ui / view / edit-widget-interface.h
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;
34     
35     /// Set the widget's title
36     virtual void setTitle (gchar const*) = 0;
37     
38     /// Show all parts of widget the user wants to see.
39     virtual void layout() = 0;
40     
41     /// Present widget to user
42     virtual void present() = 0;
43     
44     /// Returns geometry of widget
45     virtual void getGeometry (gint &x, gint &y, gint &w, gint &h) = 0;
46     
47     /// Change the widget's size
48     virtual void setSize (gint w, gint h) = 0;
49     
50     /// Move widget to specified position
51     virtual void setPosition (NR::Point p) = 0;
52     
53     /// Transientize widget
54     virtual void setTransient (void*, int) = 0;
55     
56     /// Return mouse position in widget
57     virtual NR::Point getPointer() = 0;
58     
59     /// Make widget fill screen and show it if possible.
60     virtual void setFullscreen() = 0;
61     
62     /// Shuts down the desktop object for the view being closed.  It checks
63     /// to see if the document has been edited, and if so prompts the user
64     /// to save, discard, or cancel.  Returns TRUE if the shutdown operation
65     /// is cancelled or if the save is cancelled or fails, FALSE otherwise.
66     virtual bool shutdown() = 0;
67     
68     /// Destroy and delete widget.
69     virtual void destroy() = 0;
70     
71     
72     /// Queue a redraw request with the canvas
73     virtual void requestCanvasUpdate() = 0;
74     
75     /// Force a redraw of the canvas
76     virtual void requestCanvasUpdateAndWait() = 0;
77     
78     /// Enable interaction on this desktop
79     virtual void enableInteraction() = 0;
80     
81     /// Disable interaction on this desktop
82     virtual void disableInteraction() = 0;
83     
84     /// Update the "active desktop" indicator
85     virtual void activateDesktop() = 0;
86     
87     /// Update the "inactive desktop" indicator
88     virtual void deactivateDesktop() = 0;
89     
90     /// Set rulers to position
91     virtual void viewSetPosition (NR::Point p) = 0;
92     
93     /// Update rulers from current values
94     virtual void updateRulers() = 0;
95     
96     /// Update scrollbars from current values
97     virtual void updateScrollbars (double scale) = 0;
98     
99     /// Toggle rulers on/off and set preference value accordingly
100     virtual void toggleRulers() = 0;
101     
102     /// Toggle scrollbars on/off and set preference value accordingly
103     virtual void toggleScrollbars() = 0;
104     
105     /// Temporarily block signals and update zoom display
106     virtual void updateZoom() = 0;
107     
108     /// The zoom display will get the keyboard focus.
109     virtual void letZoomGrabFocus() = 0;
110     
111     /// In auxiliary toolbox, set focus to widget having specific id
112     virtual void setToolboxFocusTo (const gchar *) = 0;
113     
114     /// In auxiliary toolbox, set value of adjustment with specific id
115     virtual void setToolboxAdjustmentValue (const gchar *, double) = 0;
116     
117     /// In auxiliary toolbox, return true if specific togglebutton is active
118     virtual bool isToolboxButtonActive (gchar const*) = 0;
119     
120     /// Set the coordinate display
121     virtual void setCoordinateStatus (NR::Point p) = 0;
122     
123     /// Message widget will get no content
124     virtual void setMessage (Inkscape::MessageType type, gchar const* msg) = 0;
125     
126     /// Open yes/no dialog with warning text and confirmation question.
127     virtual bool warnDialog (gchar*) = 0;
128 };
130 } // namespace View
131 } // namespace UI
132 } // namespace Inkscape
134 #endif // INKSCAPE_UI_VIEW_EDIT_WIDGET_IFACE_H
136 /*
137   Local Variables:
138   mode:c++
139   c-file-style:"stroustrup"
140   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
141   indent-tabs-mode:nil
142   fill-column:99
143   End:
144 */
145 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :