Package appModules :: Module wlmail
[hide private]
[frames] | no frames]

Source Code for Module appModules.wlmail

 1  #appModules/wlmail.py 
 2  #A part of NonVisual Desktop Access (NVDA) 
 3  #Copyright (C) 2006-2010 NVDA Contributors <http://www.nvda-project.org/> 
 4  #This file is covered by the GNU General Public License. 
 5  #See the file COPYING for more details. 
 6   
 7  import appModuleHandler 
 8  import controlTypes 
 9  import api 
10  import winUser 
11  from keyboardHandler import KeyboardInputGesture 
12  from NVDAObjects.IAccessible.MSHTML import MSHTML 
13  import msimn  
14   
15 -class AboutBlankDocument(MSHTML):
16 """A document called about:blank which hosts the HTML message composer document using viewlink. 17 Unfortunately, there doesn't seem to be any way to access the real (editable) viewlink document. 18 Therefore, we need to ignore this about:blank document so the user can access the editable document. 19 """ 20 21 # Make sure a buffer doesn't get created for this document. 22 # Otherwise, the viewLink document beneath it will be treated as part of this buffer and won't be accessible. 23 role = controlTypes.ROLE_UNKNOWN 24
25 - def event_gainFocus(self):
26 # This document is useless to us, so don't bother to report it. 27 return
28
29 -class AppModule(appModuleHandler.AppModule):
30
31 - def chooseNVDAObjectOverlayClasses(self, obj, clsList):
32 if obj.windowClassName == "Internet Explorer_Server" and obj.role == controlTypes.ROLE_DOCUMENT and obj.HTMLNode and obj.HTMLNode.document.url=="about:blank": 33 clsList.insert(0, AboutBlankDocument) 34 elif obj.windowClassName=="SysListView32" and obj.windowControlID in (128,129,130) and obj.role==controlTypes.ROLE_LISTITEM: 35 clsList.insert(0,msimn.MessageRuleListItem) 36 elif obj.windowClassName=="SysListView32" and obj.role==controlTypes.ROLE_LISTITEM and obj.parent.name=="Outlook Express Message List": 37 clsList.insert(0,msimn.MessageListItem)
38
39 - def event_gainFocus(self,obj,nextHandler):
40 nextHandler() 41 #Force focus to move to something sane when landing on a plain text message window 42 if obj.windowClassName=="ME_DocHost" and obj.windowControlID==1000 and obj.role==controlTypes.ROLE_PANE: 43 firstChild=obj.firstChild 44 if firstChild: 45 firstChild=obj.firstChild 46 if firstChild: 47 firstChild.setFocus() 48 return 49 if obj.windowClassName=="ATH_Note" and obj.event_objectID==winUser.OBJID_CLIENT and obj.IAccessibleChildID==0: 50 api.processPendingEvents() 51 if obj==api.getFocusObject() and controlTypes.STATE_FOCUSED in obj.states: 52 return KeyboardInputGesture.fromName("shift+tab").send()
53