QScintilla/MarkupProviders/MarkupBase.py

changeset 5394
b2c6179184f6
child 5398
1f4509cf8f35
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QScintilla/MarkupProviders/MarkupBase.py	Sun Jan 01 18:09:48 2017 +0100
@@ -0,0 +1,79 @@
+# -*- coding: utf-8 -*-
+
+# Copyright (c) 2017 Detlev Offenbach <detlev@die-offenbachs.de>
+#
+
+"""
+Module implementing the base class for the markup providers.
+"""
+
+from __future__ import unicode_literals
+
+
+class MarkupBase(object):
+    """
+    Class implementing the base class for the markup providers.
+    
+    Note: Derived classes need only implement those method they provide
+    functionality for. This base class implements do nothing variants for
+    all methods.
+    """
+    def __init__(self):
+        """
+        Constructor
+        """
+        pass
+    
+    def hasBold(self):
+        """
+        Public method to indicate the availability of bold markup.
+        
+        @return flag indicating the availability of bold markup
+        @rtype bool
+        """
+        return False
+    
+    def hasItalic(self):
+        """
+        Public method to indicate the availability of italic markup.
+        
+        @return flag indicating the availability of italic markup
+        @rtype bool
+        """
+        return False
+    
+    def hasStrikethrough(self):
+        """
+        Public method to indicate the availability of strikethrough markup.
+        
+        @return flag indicating the availability of strikethrough markup
+        @rtype bool
+        """
+        return False
+    
+    def bold(self, editor):
+        """
+        Public method to generate bold text.
+        
+        @param editor reference to the editor to work on
+        @type Editor
+        """
+        pass
+    
+    def italic(self, editor):
+        """
+        Public method to generate italic text.
+        
+        @param editor reference to the editor to work on
+        @type Editor
+        """
+        pass
+    
+    def strikethrough(self, editor):
+        """
+        Public method to generate strikethrough text.
+        
+        @param editor reference to the editor to work on
+        @type Editor
+        """
+        pass

eric ide

mercurial