Cadabra
Computer algebra system for field theory problems
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GUIBase.hh
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <deque>
5 
6 #include "DataCell.hh"
7 
8 namespace cadabra {
9 
15 
16  class GUIBase {
17  public:
22 
23  virtual void update_cell(const DTree&, DTree::iterator)=0;
24 
26 
27  virtual void remove_cell(const DTree&, DTree::iterator)=0;
28 
31 
32  virtual void remove_all_cells()=0;
33 
42 
43  virtual void add_cell(const DTree&, DTree::iterator, bool visible)=0;
44 
47 
48  virtual void position_cursor(const DTree&, DTree::iterator, int)=0;
49 
51 
52  virtual size_t get_cursor_position(const DTree&, DTree::iterator)=0;
53 
58 
60 
61  virtual void on_connect()=0;
62  virtual void on_disconnect(const std::string& reason)=0;
63  virtual void on_network_error()=0;
64  virtual void on_kernel_runstatus(bool)=0;
65 
67 
74 
75  virtual void process_data()=0;
76 
77  };
78 
79 };
virtual void position_cursor(const DTree &, DTree::iterator, int)=0
Position the cursor in the current canvas in the widget corresponding to the indicated cell...
virtual void on_disconnect(const std::string &reason)=0
virtual void process_data()=0
When the ComputeThread needs to modify the document, it stores an ActionBase object on the stack (see...
virtual void remove_cell(const DTree &, DTree::iterator)=0
Remove a single cell.
virtual void update_cell(const DTree &, DTree::iterator)=0
The basic manipulations that a GUI needs to implement are adding, removing and updating (refreshing t...
Abstract base class with methods that need to be implemented by any GUI.
Definition: GUIBase.hh:16
virtual size_t get_cursor_position(const DTree &, DTree::iterator)=0
Retrieve the position of the cursor in the current cell.
virtual void on_connect()=0
Network status is propagated from the ComputeThread to the.
virtual void on_kernel_runstatus(bool)=0
tree< DataCell > DTree
Definition: DataCell.hh:106
virtual void on_network_error()=0
virtual void add_cell(const DTree &, DTree::iterator, bool visible)=0
Add a GUI cell corresponding to the document cell at the iterator.
virtual void remove_all_cells()=0
Remove all GUI cells from the display (used as a quick way to clear all before loading a new document...