summaryrefslogtreecommitdiff
path: root/alot/buffers/buffer.py
diff options
context:
space:
mode:
Diffstat (limited to 'alot/buffers/buffer.py')
-rw-r--r--alot/buffers/buffer.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/alot/buffers/buffer.py b/alot/buffers/buffer.py
new file mode 100644
index 00000000..fc0e7af7
--- /dev/null
+++ b/alot/buffers/buffer.py
@@ -0,0 +1,40 @@
+# Copyright (C) 2011-2018 Patrick Totzke <patricktotzke@gmail.com>
+# This file is released under the GNU GPL, version 3 or a later revision.
+# For further details see the COPYING file
+
+
+class Buffer(object):
+ """Abstract base class for buffers."""
+
+ modename = None # mode identifier for subclasses
+
+ def __init__(self, ui, widget):
+ self.ui = ui
+ self.body = widget
+
+ def __str__(self):
+ return '[%s]' % self.modename
+
+ def render(self, size, focus=False):
+ return self.body.render(size, focus)
+
+ def selectable(self):
+ return self.body.selectable()
+
+ def rebuild(self):
+ """tells the buffer to (re)construct its visible content."""
+ pass
+
+ def keypress(self, size, key):
+ return self.body.keypress(size, key)
+
+ def cleanup(self):
+ """called before buffer is closed"""
+ pass
+
+ def get_info(self):
+ """
+ return dict of meta infos about this buffer.
+ This can be requested to be displayed in the statusbar.
+ """
+ return {}