Package muntjac :: Package terminal :: Module terminal
[hide private]
[frames] | no frames]

Source Code for Module muntjac.terminal.terminal

 1  # Copyright (C) 2012 Vaadin Ltd.  
 2  # Copyright (C) 2012 Richard Lincoln 
 3  #  
 4  # Licensed under the Apache License, Version 2.0 (the "License");  
 5  # you may not use this file except in compliance with the License.  
 6  # You may obtain a copy of the License at  
 7  #  
 8  #     http://www.apache.org/licenses/LICENSE-2.0  
 9  #  
10  # Unless required by applicable law or agreed to in writing, software  
11  # distributed under the License is distributed on an "AS IS" BASIS,  
12  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
13  # See the License for the specific language governing permissions and  
14  # limitations under the License. 
15   
16  """Defines an interface that provides information about the user's terminal. 
17  """ 
18   
19 -class ITerminal(object):
20 """An interface that provides information about the user's terminal. 21 Implementors typically provide additional information using methods 22 not in this interface. 23 24 @author: Vaadin Ltd. 25 @author: Richard Lincoln 26 @version: 1.1.2 27 """ 28
29 - def getDefaultTheme(self):
30 """Gets the name of the default theme for this terminal. 31 32 @return: the name of the theme that is used by default by this 33 terminal. 34 """ 35 raise NotImplementedError
36 37
38 - def getScreenWidth(self):
39 """Gets the width of the terminal screen in pixels. This is the 40 width of the screen and not the width available for the application. 41 42 Note that the screen width is typically not available in the 43 L{Application.init} method as this is called before the browser has 44 a chance to report the screen size to the server. 45 46 @return: the width of the terminal screen. 47 """ 48 raise NotImplementedError
49 50
51 - def getScreenHeight(self):
52 """Gets the height of the terminal screen in pixels. This is the 53 height of the screen and not the height available for the application. 54 55 Note that the screen height is typically not available in the 56 L{Application.init} method as this is called before the browser has 57 a chance to report the screen size to the server. 58 59 @return: the height of the terminal screen. 60 """ 61 raise NotImplementedError
62 63
64 -class IErrorEvent(object):
65 """An error event implementation for ITerminal.""" 66
67 - def getThrowable(self):
68 """Gets the contained throwable, the cause of the error.""" 69 pass
70 71
72 -class IErrorListener(object):
73 """Interface for listening to ITerminal errors.""" 74
75 - def terminalError(self, event):
76 """Invoked when a terminal error occurs. 77 78 @param event: 79 the fired event. 80 """ 81 pass
82