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

Source Code for Module appModules.openwith

 1  #appModules/openWith.py 
 2  #A part of NonVisual Desktop Access (NVDA) 
 3  #Copyright (C) 2006-2011 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  from comtypes import COMError 
 8  import appModuleHandler 
 9  import controlTypes 
10  from NVDAObjects.UIA import UIA 
11  from NVDAObjects.behaviors import Dialog 
12   
13  #win8hack: the nondefault items in the list of applications are not labeled 
14 -class NonDefaultAppTile(UIA):
15
16 - def _get_name(self):
17 firstChild=self.firstChild 18 if firstChild: 19 next=firstChild.next 20 if next: 21 return next.name 22 return super(NonDefaultAppTile,self).name
23
24 -class ImmersiveOpenWithFlyout(Dialog,UIA):
25 26 role=controlTypes.ROLE_DIALOG 27 28 #win8hack: This window never actually gets the physical focus thus tabbing etc goes to the original window 29 #So Force it to get focus
30 - def event_focusEntered(self):
33
34 -class AppModule(appModuleHandler.AppModule):
35
36 - def chooseNVDAObjectOverlayClasses(self,obj,clsList):
37 if isinstance(obj,UIA): 38 try: 39 automationID=obj.UIAElement.currentAutomationID 40 except COMError: 41 automationID=None 42 if automationID=="NonDefaultAppTile": 43 clsList.insert(0,NonDefaultAppTile) 44 elif automationID=="ImmersiveOpenWithFlyout": 45 clsList.insert(0,ImmersiveOpenWithFlyout)
46