Cadabra
Computer algebra system for field theory problems
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 
30 
31  virtual void remove_cell(const DTree&, DTree::iterator)=0;
32 
35 
36  virtual void remove_all_cells()=0;
37 
46 
47  virtual void add_cell(const DTree&, DTree::iterator, bool visible)=0;
48 
51 
52  virtual void position_cursor(const DTree&, DTree::iterator, int)=0;
53 
55 
56  virtual size_t get_cursor_position(const DTree&, DTree::iterator)=0;
57 
62 
64 
65  virtual void on_connect()=0;
66  virtual void on_disconnect(const std::string& reason)=0;
67  virtual void on_network_error()=0;
68  virtual void on_kernel_runstatus(bool)=0;
69 
71 
78 
79  virtual void process_data()=0;
80 
81  };
82 
83  };
Abstract base class with methods that need to be implemented by any GUI.
Definition: GUIBase.hh:16
virtual void process_data()=0
When the ComputeThread needs to modify the document, it stores an ActionBase object on the stack (see...
virtual size_t get_cursor_position(const DTree &, DTree::iterator)=0
Retrieve the position of the cursor in the current cell.
virtual void on_network_error()=0
virtual void on_kernel_runstatus(bool)=0
virtual void on_disconnect(const std::string &reason)=0
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...
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...
virtual void remove_cell(const DTree &, DTree::iterator)=0
Remove a single cell together with all its child cells.
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 add_cell(const DTree &, DTree::iterator, bool visible)=0
Add a GUI cell corresponding to the document cell at the iterator.
virtual void on_connect()=0
Network status is propagated from the ComputeThread to the GUI using the following methods.
Functions to handle the exchange properties of two or more symbols in a product.
Definition: Adjform.cc:83
tree< DataCell > DTree
Definition: DataCell.hh:109