tagging release
[dasher.git] / trunk / Src / Gtk2 / dasher_editor_internal.h
blobb8c0bc4cb0e3907e96bf7e3631103228729abc9b
1 #ifndef __dasher_editor_internal_h__
2 #define __dasher_editor_internal_h__
4 #include <glade/glade.h>
5 #include <glib.h>
6 #include <glib-object.h>
7 #include <gtk/gtk.h>
9 #include "DasherAppSettings.h"
10 #include "dasher_action.h"
11 #include "dasher_buffer_set.h"
13 /* Forward declaration */
14 typedef struct _DasherMain DasherMain;
15 struct _DasherMain;
17 typedef enum {
18 CLIPBOARD_CUT,
19 CLIPBOARD_COPY,
20 CLIPBOARD_PASTE,
21 CLIPBOARD_COPYALL,
22 CLIPBOARD_SELECTALL,
23 CLIPBOARD_CLEAR,
24 } clipboard_action;
26 G_BEGIN_DECLS
27 #define TYPE_DASHER_EDITOR_INTERNAL (dasher_editor_internal_get_type())
28 #define DASHER_EDITOR_INTERNAL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_DASHER_EDITOR_INTERNAL, DasherEditorInternal ))
29 #define DASHER_EDITOR_INTERNAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DASHER_EDITOR_INTERNAL, DasherEditorInternalClass ))
30 #define IS_DASHER_EDITOR_INTERNAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_DASHER_EDITOR_INTERNAL))
31 #define IS_DASHER_EDITOR_INTERNAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DASHER_EDITOR_INTERNAL))
32 #define DASHER_EDITOR_INTERNAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DASHER_EDITOR_INTERNAL, DasherEditorInternalClass))
34 typedef struct _DasherEditorInternal DasherEditorInternal;
35 typedef struct _DasherEditorInternalClass DasherEditorInternalClass;
37 struct _DasherEditorInternal {
38 GtkVBox box;
41 struct _DasherEditorInternalClass {
42 GtkVBoxClass parent_class;
44 void (*filename_changed)(DasherEditorInternal *pDasherEditorInternal);
45 void (*buffer_changed)(DasherEditorInternal *pDasherEditorInternal);
46 void (*context_changed)(DasherEditorInternal *pDasherEditorInternal);
49 DasherEditorInternal *dasher_editor_internal_new();
50 void dasher_editor_internal_initialise(DasherEditorInternal *pSelf, DasherAppSettings *pAppSettings, DasherMain *pDasherMain, GladeXML *pGladeXML, const gchar *szFullPath);
52 GType dasher_editor_internal_get_type();
54 /* Replace this with GTK text buffer */
55 //IDasherBufferSet *dasher_editor_internal_get_buffer_set(DasherEditorInternal *pSelf);
57 // TODO: Just have one 'handle event' method?
58 gboolean dasher_editor_internal_command(DasherEditorInternal *pSelf, const gchar *szCommand);
60 void dasher_editor_internal_handle_font(DasherEditorInternal *pSelf, const gchar *szFont);
62 /* To be obsoleted by movement to GTK buffers */
63 void dasher_editor_internal_output(DasherEditorInternal *pSelf, const gchar *szText, int iOffset);
64 void dasher_editor_internal_delete(DasherEditorInternal *pSelf, int iLength, int iOffset);
65 const gchar *dasher_editor_internal_get_context(DasherEditorInternal *pSelf, int iOffset, int iLength);
66 gint dasher_editor_internal_get_offset(DasherEditorInternal *pSelf);
68 /* Events proagated from main */
69 void dasher_editor_internal_handle_stop(DasherEditorInternal *pSelf);
70 void dasher_editor_internal_handle_start(DasherEditorInternal *pSelf);
71 void dasher_editor_internal_handle_control(DasherEditorInternal *pSelf, int iNodeID);
73 /* Action related methods - TODO: a lot of this should be moved to dasher_main (eg action on stop etc) - that way we get a better level of abstraction, and can incorporate commands from otehr modules too. Actions should only be externally visible as a list of string commands*/
74 void dasher_editor_internal_action_button(DasherEditorInternal *pSelf, DasherAction *pAction);
75 void dasher_editor_internal_actions_start(DasherEditorInternal *pSelf);
76 bool dasher_editor_internal_actions_more(DasherEditorInternal *pSelf);
77 void dasher_editor_internal_actions_get_next(DasherEditorInternal *pSelf, const gchar **szName, gint *iID, gboolean *bShow, gboolean *bControl, gboolean *bAuto);
78 void dasher_editor_internal_action_set_show(DasherEditorInternal *pSelf, int iActionID, bool bValue);
79 void dasher_editor_internal_action_set_control(DasherEditorInternal *pSelf, int iActionID, bool bValue);
80 void dasher_editor_internal_action_set_auto(DasherEditorInternal *pSelf, int iActionID, bool bValue);
82 void dasher_editor_internal_grab_focus(DasherEditorInternal *pSelf);
84 /* TODO: Tutorial editor should be a separate class */
85 //void dasher_editor_internal_start_tutorial(DasherEditorInternal *pSelf);
87 /* Todo: possibly tidy up the need to have this public (quit in dasher_main possibly too connected) */
88 gboolean dasher_editor_internal_file_changed(DasherEditorInternal *pSelf);
89 const gchar *dasher_editor_internal_get_filename(DasherEditorInternal *pSelf);
91 const gchar *dasher_editor_internal_get_all_text(DasherEditorInternal *pSelf);
92 const gchar *dasher_editor_internal_get_new_text(DasherEditorInternal *pSelf);
93 G_END_DECLS
95 #endif