workbook-private.h 2.66 KB
Newer Older
1 2 3
#ifndef GNUMERIC_WORKBOOK_PRIVATE_H
#define GNUMERIC_WORKBOOK_PRIVATE_H

4
#include "workbook.h"
Jody Goldberg's avatar
Jody Goldberg committed
5
#include <gnome.h>
6

7 8 9 10 11 12 13
/*
 * Here we should put all the variables that are internal
 * to the workbook and that must not be accessed but by code
 * that runs the Workbook
 *
 * The reason for this is that pretty much all the code
 * depends on workbook.h, so for internals and to avoid
14 15 16 17 18
 * recompilation, we put the code here.
 *
 * This is ending up being a transition object for the eventual move to a
 * seprate Model View and controller.  It holds pieces that will be part of the
 * eventual controller objects.
19
 */
20 21 22
#ifdef ENABLE_BONOBO
#   include <bonobo.h>
#endif
23
struct _WorkbookPrivate {
24 25 26 27 28
#ifdef ENABLE_BONOBO
	/* The base object for the Workbook */
	BonoboObject bonobo_object;

	/* A BonoboContainer */
4's avatar
4 committed
29
	BonoboItemContainer   *bonobo_container;
30 31 32 33 34 35 36 37 38

	BonoboPersistFile *persist_file;
	
	/* A list of EmbeddableGrids exported to the world */
	GList      *workbook_views;

	BonoboUIHandler *uih;
#endif

39
	gboolean during_destruction;
40

Michael Meeks's avatar
Michael Meeks committed
41 42
	GtkWidget  *main_vbox;

43 44 45
	GtkWidget  *table;
	GnomeCanvasItem  *auto_expr_label;

46 47 48 49 50
	/*
	 * Toolbars
	 */
	GtkWidget *standard_toolbar;
	GtkWidget *format_toolbar;
51
	GtkWidget *object_toolbar;
52

Jody Goldberg's avatar
Jody Goldberg committed
53 54
	GtkWidget *font_name_selector;
	GtkWidget *font_size_selector;
55

56 57 58 59 60
	/*
	 * GtkCombo for the zoomer
	 */
	GtkWidget *zoom_entry;

61
	/*
Jody Goldberg's avatar
Jody Goldberg committed
62
	 * Combos for the foreground, background, and borders
63
	 */
Jody Goldberg's avatar
Jody Goldberg committed
64
	GtkWidget *fore_combo, *back_combo, *border_combo;
65

66 67 68 69 70
	/*
	 * GtkComboStacks for Undo/Redo
	 */
	GtkWidget *undo_combo, *redo_combo;

71
	const char *current_font_name;
72

73
	/* Edit area */
Miguel de Icaza's avatar
Miguel de Icaza committed
74 75
	GtkWidget *selection_descriptor;	/* A GtkEntry */
	struct {
76 77 78
		GtkEntry *entry;		/* The real edit line */
		GtkEntry *temp_entry;		/* A tmp overlay eg from a guru */
		GtkWidget*guru;
Miguel de Icaza's avatar
Miguel de Icaza committed
79 80 81
		int       signal_changed;
	} edit_line;
	
82 83 84
	/* While editing these should be visible */
	GtkWidget *ok_button, *cancel_button;

85 86 87
	/* While not editing these should be visible */
	GtkWidget *func_button;

88 89 90
        /* The status bar */
        GnomeAppBar *appbar;

91 92 93
	/*
	 * GUI command context
	 */
94
	CommandContext *gui_context, *corba_context;
95

Miguel de Icaza's avatar
Miguel de Icaza committed
96 97 98 99 100 101 102 103 104 105
	/*
	 * Auto completion
	 */
	void            *auto_complete;         /* GtkType is (Complete *) */
	gboolean         auto_completing;
	char            *auto_complete_text;

	/* Used to detect if the user has backspaced, so we turn off auto-complete */
	int              auto_max_size;
	 
106
#ifndef ENABLE_BONOBO
107 108 109 110 111
	/* Menu items that get toggled */
	GtkWidget  *menu_item_undo;
	GtkWidget  *menu_item_redo;
	GtkWidget  *menu_item_paste_special;
#endif
112 113
};

114 115
WorkbookPrivate *workbook_private_new (void);
void             workbook_private_delete (WorkbookPrivate *wbp);
Miguel de Icaza's avatar
Miguel de Icaza committed
116

117
#endif /* GNUMERIC_WORKBOOK_PRIVATE_H */