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

Source Code for Module appModules.msnmsgr

 1  #coding=UTF-8 
 2  #appModules/_default.py 
 3  #A part of NonVisual Desktop Access (NVDA) 
 4  #Copyright (C) 2006-2007 NVDA Contributors <http://www.nvda-project.org/> 
 5  #This file is covered by the GNU General Public License. 
 6  #See the file COPYING for more details. 
 7   
 8  import config 
 9  import winUser 
10  from NVDAObjects.IAccessible import IAccessible  
11  import controlTypes 
12  import oleacc 
13  import textInfos 
14  import appModuleHandler 
15  import speech 
16  import cursorManager 
17   
18  lastMSNHistoryValue=None 
19  possibleHistoryWindowNames=frozenset([ 
20  u'History', 
21  u'Geskiedenis', 
22  u'Verlauf', 
23  u'Historia', 
24  u'Historial', 
25  u'Historique', 
26  u'Cronologia', 
27  u'Histórico', 
28  u'Histórico', 
29  u'História', 
30  u'Lược Sá', 
31  u'記éŒ', 
32  u'Historik', 
33  u'Előzmények', 
34  u'Geçmiş', 
35  u'المحفوظات', 
36  ]) 
37   
38 -class AppModule(appModuleHandler.AppModule):
39
40 - def chooseNVDAObjectOverlayClasses(self, obj, clsList):
41 if obj.windowClassName=="DirectUIHWND" and obj.role==controlTypes.ROLE_EDITABLETEXT and obj.name in possibleHistoryWindowNames: 42 from NVDAObjects.window import DisplayModelEditableText 43 clsList.remove(DisplayModelEditableText) 44 clsList.insert(0, OldMSNHistory) 45 elif obj.windowClassName==u'WLXDUI' and obj.role==controlTypes.ROLE_ALERT and obj.IAccessibleStates&oleacc.STATE_SYSTEM_ALERT_MEDIUM: 46 clsList.insert(0, MSNHistory)
47
48 -class OldMSNHistory(cursorManager.ReviewCursorManager,IAccessible):
49
50 - def _get_basicText(self):
51 return "%s - %s\r%s"%(self.name,self.description,self.value)
52
53 - def _get_value(self):
54 value=super(OldMSNHistory,self).value 55 if not isinstance(value,basestring): 56 value="" 57 return value
58
59 - def event_valueChange(self):
60 global lastMSNHistoryValue 61 if isinstance(self,OldMSNHistory) and winUser.isDescendantWindow(winUser.getForegroundWindow(),self.windowHandle): 62 value=self.value 63 if value!=lastMSNHistoryValue and config.conf["presentation"]["reportDynamicContentChanges"]: 64 speech.speakText(value) 65 lastMSNHistoryValue=value
66
67 - def event_gainFocus(self):
68 super(OldMSNHistory,self).event_gainFocus() 69 self.selection=self.makeTextInfo(textInfos.POSITION_LAST)
70
71 - def reportFocus(self):
73
74 -class MSNHistory(IAccessible):
75
76 - def _get_value(self):
77 try: 78 value=self.IAccessibleObject.accValue(self.IAccessibleChildID) 79 except COMError: 80 value=None 81 return value or ""
82
83 - def event_valueChange(self):
84 global lastMSNHistoryValue 85 if winUser.isDescendantWindow(winUser.getForegroundWindow(),self.windowHandle): 86 value=self.value 87 if value!=lastMSNHistoryValue and config.conf["presentation"]["reportDynamicContentChanges"]: 88 speech.speakText(value) 89 lastMSNHistoryValue=value
90