From f1f269207e315be19c0b9eadedcd5f47adb1e6a2 Mon Sep 17 00:00:00 2001 From: James Teh Date: Wed, 13 Sep 2017 13:09:55 +1000 Subject: [PATCH 01/25] Enhance nvwave to simplify accurate indexing for speech synthesizers. 1. Add an onDone argument to WavePlayer.feed which accepts a function to be called when the provided chunk of audio has finished playing. Speech synths can simply feed audio up to an index and use the onDone callback to be accurately notified when the index is reached. 2. Add a buffered argument to the WavePlayer constructor. If True, small chunks of audio will be buffered to prevent audio glitches. This avoids the need for tricky buffering across calls in the synth driver if the synth provides fixed size chunks and an index lands near the end of a previous chunk. It is also useful for synths which always provide very small chunks. --- source/nvwave.py | 60 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/source/nvwave.py b/source/nvwave.py index ca2b524ecf7..ab3b97c0664 100644 --- a/source/nvwave.py +++ b/source/nvwave.py @@ -97,11 +97,18 @@ class WavePlayer(object): """Synchronously play a stream of audio. To use, construct an instance and feed it waveform audio using L{feed}. """ + #: Minimum length of buffer (in ms) before audio is played. + MIN_BUFFER_MS = 300 + #: Flag used to signal that L{stop} has been called. + STOPPING = "stopping" #: A lock to prevent WaveOut* functions from being called simultaneously, as this can cause problems even if they are for different HWAVEOUTs. - _global_waveout_lock = threading.RLock() + _global_waveout_lock = threading.RLock() _audioDucker=None - def __init__(self, channels, samplesPerSec, bitsPerSample, outputDevice=WAVE_MAPPER, closeWhenIdle=True,wantDucking=True): + def __init__(self, channels, samplesPerSec, bitsPerSample, + outputDevice=WAVE_MAPPER, closeWhenIdle=True, wantDucking=True, + buffered=False + ): """Constructor. @param channels: The number of channels of audio; e.g. 2 for stereo, 1 for mono. @type channels: int @@ -115,6 +122,8 @@ def __init__(self, channels, samplesPerSec, bitsPerSample, outputDevice=WAVE_MAP @type closeWhenIdle: bool @param wantDucking: if true then background audio will be ducked on Windows 8 and higher @type wantDucking: bool + @param buffered: Whether to buffer small chunks of audio to prevent audio glitches. + @type buffered: bool @note: If C{outputDevice} is a name and no such device exists, the default device will be used. @raise WindowsError: If there was an error opening the audio output device. """ @@ -131,6 +140,15 @@ def __init__(self, channels, samplesPerSec, bitsPerSample, outputDevice=WAVE_MAP #: If C{True}, close the output device when no audio is being played. #: @type: bool self.closeWhenIdle = closeWhenIdle + if buffered: + #: Minimum size of the buffer before audio is played. + #: However, this is ignored if an C{onDone} callback is provided to L{feed}. + self._minBufferSize = samplesPerSec * channels * (bitsPerSample / 8) / 1000 * self.MIN_BUFFER_MS + self._buffer = "" + else: + self._minBufferSize = None + #: Function to call when the previous chunk of audio has finished playing. + self._prevOnDone = None self._waveout = None self._waveout_event = winKernel.kernel32.CreateEventW(None, False, False, None) self._waveout_lock = threading.RLock() @@ -158,15 +176,27 @@ def open(self): self._waveout = waveout.value self._prev_whdr = None - def feed(self, data): + def feed(self, data, onDone=None): """Feed a chunk of audio data to be played. This is normally synchronous. However, synchronisation occurs on the previous chunk, rather than the current chunk; i.e. calling this while no audio is playing will begin playing the chunk but return immediately. This allows for uninterrupted playback as long as a new chunk is fed before the previous chunk has finished playing. @param data: Waveform audio in the format specified when this instance was constructed. @type data: str + @param onDone: Function to call when this chunk has finished playing. + @type onDone: callable @raise WindowsError: If there was an error playing the audio. """ + if not self._minBufferSize: + return self._feedUnbuffered(data, onDone=onDone) + self._buffer += data + # If onDone was specified, we must play audio regardless of the minimum buffer size + # so we can accurately call onDone at the end of this chunk. + if onDone or len(self._buffer) > self._minBufferSize: + self._feedUnbuffered(self._buffer, onDone=onDone) + self._buffer = "" + + def _feedUnbuffered(self, data, onDone=None): if self._audioDucker and not self._audioDucker.enable(): return whdr = WAVEHDR() @@ -185,6 +215,10 @@ def feed(self, data): raise e self.sync() self._prev_whdr = whdr + # Don't call onDone if stop was called, + # as this chunk has been truncated in that case. + if self._prevOnDone is not self.STOPPING: + self._prevOnDone = onDone def sync(self): """Synchronise with playback. @@ -202,6 +236,12 @@ def sync(self): with self._global_waveout_lock: winmm.waveOutUnprepareHeader(self._waveout, LPWAVEHDR(self._prev_whdr), sizeof(WAVEHDR)) self._prev_whdr = None + if self._prevOnDone is not None and self._prevOnDone is not self.STOPPING: + try: + self._prevOnDone() + except: + log.exception("Error calling onDone") + self._prevOnDone = None def pause(self, switch): """Pause or unpause playback. @@ -229,6 +269,14 @@ def idle(self): If L{closeWhenIdle} is C{True}, the output device will be closed. A subsequent call to L{feed} will reopen it. """ + if not self._minBufferSize: + return self._idleUnbuffered() + if self._buffer: + self._feedUnbuffered(self._buffer) + self._buffer = "" + return self._idleUnbuffered() + + def _idleUnbuffered(self): with self._lock: self.sync() with self._waveout_lock: @@ -242,9 +290,12 @@ def stop(self): """Stop playback. """ if self._audioDucker: self._audioDucker.disable() + if self._minBufferSize: + self._buffer = "" with self._waveout_lock: if not self._waveout: return + self._prevOnDone = self.STOPPING try: with self._global_waveout_lock: # Pausing first seems to make waveOutReset respond faster on some systems. @@ -254,7 +305,8 @@ def stop(self): # waveOutReset seems to fail randomly on some systems. pass # Unprepare the previous buffer and close the output device if appropriate. - self.idle() + self._idleUnbuffered() + self._prevOnDone = None def close(self): """Close the output device. From 067675609d23680608cd9890d952896621d023ba Mon Sep 17 00:00:00 2001 From: James Teh Date: Wed, 13 Sep 2017 13:19:44 +1000 Subject: [PATCH 02/25] Enhancements to config profile triggers needed for profile switching within speech sequences. 1. Allow triggers to specify that handlers watching for config profile switches should not be notified. In the case of profile switches during speech sequences, we only want to apply speech settings, not switch braille displays. 2. Add some debug logging for when profiles are activated and deactivated. --- source/config/__init__.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/source/config/__init__.py b/source/config/__init__.py index b897da2a905..6f9e4ad7f59 100644 --- a/source/config/__init__.py +++ b/source/config/__init__.py @@ -330,7 +330,7 @@ def __init__(self): #: The names of all profiles that have been modified since they were last saved. self._dirtyProfiles = set() - def _handleProfileSwitch(self): + def _handleProfileSwitch(self, shouldNotify=True): if not self._shouldHandleProfileSwitch: self._pendingHandleProfileSwitch = True return @@ -340,7 +340,8 @@ def _handleProfileSwitch(self): if init: # We're still initialising, so don't notify anyone about this change. return - configProfileSwitched.notify() + if shouldNotify: + configProfileSwitched.notify() def _initBaseConf(self, factoryDefaults=False): fn = os.path.join(globalVars.appArgs.configPath, "nvda.ini") @@ -611,6 +612,7 @@ def _triggerProfileEnter(self, trigger): self._suspendedTriggers[trigger] = "enter" return + log.debug("Activating triggered profile %s" % trigger.profileName) try: profile = trigger._profile = self._getProfile(trigger.profileName) except: @@ -623,7 +625,7 @@ def _triggerProfileEnter(self, trigger): self.profiles.insert(-1, profile) else: self.profiles.append(profile) - self._handleProfileSwitch() + self._handleProfileSwitch(trigger._shouldNotifyProfileSwitch) def _triggerProfileExit(self, trigger): """Called by L{ProfileTrigger.exit}}}. @@ -642,6 +644,7 @@ def _triggerProfileExit(self, trigger): profile = trigger._profile if profile is None: return + log.debug("Deactivating triggered profile %s" % trigger.profileName) profile.triggered = False try: self.profiles.remove(profile) @@ -649,7 +652,7 @@ def _triggerProfileExit(self, trigger): # This is probably due to the user resetting the configuration. log.debugWarning("Profile not active when exiting trigger") return - self._handleProfileSwitch() + self._handleProfileSwitch(trigger._shouldNotifyProfileSwitch) @contextlib.contextmanager def atomicProfileSwitch(self): @@ -975,6 +978,12 @@ class ProfileTrigger(object): Alternatively, you can use this object as a context manager via the with statement; i.e. this trigger will apply only inside the with block. """ + #: Whether to notify handlers when activating a triggered profile. + #: This should usually be C{True}, but might be set to C{False} when + #: only specific settings should be applied. + #: For example, when switching profiles during a speech sequence, + #: we only want to apply speech settings, not switch braille displays. + _shouldNotifyProfileSwitch = True @baseObject.Getter def spec(self): @@ -984,6 +993,13 @@ def spec(self): """ raise NotImplementedError + @property + def hasProfile(self): + """Whether this trigger has an associated profile. + @rtype: bool + """ + return self.spec in conf.triggersToProfiles + def enter(self): """Signal that this trigger applies. The associated profile (if any) will be activated. From 504704d49c0febaed13701e0f589a7536bcc6987 Mon Sep 17 00:00:00 2001 From: James Teh Date: Wed, 13 Sep 2017 15:26:57 +1000 Subject: [PATCH 03/25] Add support for callbacks, beeps, sounds, profile switches and utterance splits during speech sequences, as well as prioritized queuing. Changes for synth drivers: - SynthDrivers must now accurately notify when the synth reaches an index or finishes speaking using the new `synthIndexReached` and `synthDoneSpeaking` extension points in the `synthDriverHandler` module. The `lastIndex` property is deprecated. See below regarding backwards compatibility for SynthDrivers which do not support these notifications. - SynthDrivers must now support `PitchCommand` if they which to support capital pitch change. - SynthDrivers now have `supportedCommands` and `supportedNotifications` attributes which specify what they support. - Because there are some speech commands which trigger behaviour unrelated to synthesizers (e.g. beeps, callbacks and profile switches), commands which are passed to synthesizers are now subclasses of `speech.SynthCommand`. Central speech manager: - The core of this new functionality is the `speech._SpeechManager` class. It is intended for internal use only. It is called by higher level functions such as `speech.speak`. - It manages queuing of speech utterances, calling callbacks at desired points in the speech, profile switching, prioritization, etc. It relies heavily on index reached and done speaking notifications from synths. These notifications alone trigger the next task in the flow. - It maintains separate queues (`speech._ManagerPriorityQueue`) for each priority. As well as holding the pending speech sequences for that priority, each queue holds other information necessary to restore state (profiles, etc.) when that queue is preempted by a higher priority queue. - See the docstring for the `speech._SpeechManager` class for a high level summary of the flow of control. New/enhanced speech commands: - `EndUtteranceCommand` ends the current utterance at this point in the speech. This allows you to have two utterances in a single speech sequence. - `CallbackCommand` calls a function when speech reaches the command. - `BeepCommand` produces a beep when speech reaches the command. - `WaveFileCommand` plays a wave file when speech reaches the command. - The above three commands are all subclasses of `BaseCallbackCommand`. You can subclass this to implement other commands which run a pre-defined function. - `ConfigProfileTriggerCommand` applies (or stops applying) a configuration profile trigger to subsequent speech. This is the basis for switching profiles (and thus synthesizers, speech rates, etc.) for specific languages, math, etc. - `PitchCommand`, `RateCommand` and `VolumeCommand` can now take either a multiplier or an offset. In addition, they can convert between the two on demand, which makes it easier to handle these commands in synth drivers based on the synth's requirements. They also have an `isDefault` attribute which specifies whether this is returning to the default value (as configured by the user). Speech priorities: `speech.speak` now accepts a `priority` argument specifying one of three priorities: `SPRI_NORMAL` (normal priority), `SPRI_NEXT` (speak after next utterance of lower priority)or `SPRI_NOW` (speech is very important and should be spoken right now, interrupting lower priority speech). Interrupted lower priority speech resumes after any higher priority speech is complete. Refactored functionality to use the new framework: - Rather than using a polling generator, spelling is now sent as a single speech sequence, including `EndUtteranceCommand`s, `BeepCommand`s and `PitchCommand`s as appropriate. This can be created and incorporated elsewhere using the `speech.getSpeechForSpelling` function. - Say all has been completely rewritten to use `CallbackCommand`s instead of a polling generator. The code should also be a lot more readable now, as it is now classes with methods for the various stages in the process. Backwards compatibility for old synths: - For synths that don't support index and done speaking notifications, we don't use the speech manager at all. This means none of the new functionality (callbacks, profile switching, etc.) will work. - This means we must fall back to the old code for speak spelling, say all, etc. This code is in the `speechCompat` module. - This compatibility fallback is considered deprecated and will be removed eventually. Synth drivers should be updated ASAP. Deprecated/removed: - `speech.getLastIndex` is deprecated and will simply return None. - `IndexCommand` should no longer be used in speech sequences passed to `speech.speak`. Use a subclass of `speech.BaseCallbackCommand` instead. - In the `speech` module, `speakMessage`, `speakText`, `speakTextInfo`, `speakObjectProperties` and `speakObject` no longer take an `index` argument. No add-ons in the official repository use this, so I figured it was safe to just remove it rather than having it do nothing. - `speech.SpeakWithoutPausesBreakCommand` has been removed. Use `speech.EndUtteranceCommand` instead. No add-ons in the official repository use this. - `speech.speakWithoutPauses.lastSentIndex` has been removed. Use a subclass of `speech.BaseCallbackCommand` instead. No add-ons in the official repository use this. --- source/sayAllHandler.py | 375 ++++++++------ source/speech.py | 927 ++++++++++++++++++++++++++++------- source/speechCompat.py | 270 ++++++++++ source/synthDriverHandler.py | 41 +- 4 files changed, 1267 insertions(+), 346 deletions(-) create mode 100644 source/speechCompat.py diff --git a/source/sayAllHandler.py b/source/sayAllHandler.py index b90ffbaea5a..85ddb6a7f67 100644 --- a/source/sayAllHandler.py +++ b/source/sayAllHandler.py @@ -1,188 +1,237 @@ -#sayAllHandler.py -#A part of NonVisual Desktop Access (NVDA) -#Copyright (C) 2006-2012 NVDA Contributors -#This file is covered by the GNU General Public License. -#See the file COPYING for more details. +# A part of NonVisual Desktop Access (NVDA) +# Copyright (C) 2006-2017 NV Access Limited +# This file may be used under the terms of the GNU General Public License, version 2 or later. +# For more details see: https://www.gnu.org/licenses/gpl-2.0.html -import itertools -import queueHandler -import config +import weakref import speech -import textInfos -import globalVars -import api -import tones -import time +import synthDriverHandler +from logHandler import log +import config import controlTypes +import api +import textInfos +import queueHandler -CURSOR_CARET=0 -CURSOR_REVIEW=1 - -_generatorID = None -lastSayAllMode=None +CURSOR_CARET = 0 +CURSOR_REVIEW = 1 -def _startGenerator(generator): - global _generatorID - stop() - _generatorID = queueHandler.registerGeneratorObject(generator) +lastSayAllMode = None +#: The active say all manager. +#: This is a weakref because the manager should be allowed to die once say all is complete. +_activeSayAll = lambda: None # Return None when called like a dead weakref. def stop(): - """Stop say all if a say all is in progress. - """ - global _generatorID - if _generatorID is None: - return - queueHandler.cancelGeneratorObject(_generatorID) - _generatorID = None + if speech.shouldUseCompatCodeForIndexing(): + # Import late to avoid circular import. + import speechCompat + return speechCompat.sayAll_stop() + active = _activeSayAll() + if active: + active.stop() def isRunning(): """Determine whether say all is currently running. @return: C{True} if say all is currently running, C{False} if not. @rtype: bool - @note: If say all completes and there is no call to L{stop} (which is called from L{speech.cancelSpeech}), this will incorrectly return C{True}. - This should not matter, but is worth noting nevertheless. """ - global _generatorID - return _generatorID is not None + if speech.shouldUseCompatCodeForIndexing(): + # Import late to avoid circular import. + import speechCompat + return speechCompat.sayAll_isRunning() + return bool(_activeSayAll()) def readObjects(obj): - _startGenerator(readObjectsHelper_generator(obj)) - -def generateObjectSubtreeSpeech(obj,indexGen): - index=indexGen.next() - speech.speakObject(obj,reason=controlTypes.REASON_SAYALL,index=index) - yield obj,index - child=obj.simpleFirstChild - while child: - childSpeech=generateObjectSubtreeSpeech(child,indexGen) - for r in childSpeech: - yield r - child=child.simpleNext - -def readObjectsHelper_generator(obj): - lastSentIndex=0 - lastReceivedIndex=0 - speechGen=generateObjectSubtreeSpeech(obj,itertools.count()) - objIndexMap={} - keepReading=True - while True: - # lastReceivedIndex might be None if other speech was interspersed with this say all. - # In this case, we want to send more text in case this was the last chunk spoken. - if lastReceivedIndex is None or (lastSentIndex-lastReceivedIndex)<=1: - if keepReading: - try: - o,lastSentIndex=speechGen.next() - except StopIteration: - keepReading=False - continue - objIndexMap[lastSentIndex]=o - receivedIndex=speech.getLastSpeechIndex() - if receivedIndex!=lastReceivedIndex and (lastReceivedIndex!=0 or receivedIndex!=None): - lastReceivedIndex=receivedIndex - lastReceivedObj=objIndexMap.get(lastReceivedIndex) - if lastReceivedObj is not None: - api.setNavigatorObject(lastReceivedObj) - #Clear old objects from the map - for i in objIndexMap.keys(): - if i<=lastReceivedIndex: - del objIndexMap[i] - while speech.isPaused: - yield - yield + if speech.shouldUseCompatCodeForIndexing(): + # Import late to avoid circular import. + import speechCompat + return speechCompat.sayAll_readObjects(obj) + global _activeSayAll + reader = _ObjectsReader(obj) + _activeSayAll = weakref.ref(reader) + reader.next() + +class _ObjectsReader(object): + + def __init__(self, root): + self.walker = self.walk(root) + self.prevObj = None + + def walk(self, obj): + yield obj + child=obj.simpleFirstChild + while child: + for descendant in self.walk(child): + yield descendant + child=child.simpleNext + + def next(self): + if not self.walker: + # We were stopped. + return + if self.prevObj: + # We just started speaking this object, so move the navigator to it. + api.setNavigatorObject(self.prevObj) + # Move onto the next object. + self.prevObj = obj = next(self.walker, None) + if not obj: + return + # Call this method again when we start speaking this object. + callbackCommand = speech.CallbackCommand(self.next) + speech.speakObject(obj, reason=controlTypes.REASON_SAYALL, _prefixSpeechCommand=callbackCommand) + + def stop(self): + self.walker = None def readText(cursor): - global lastSayAllMode + global lastSayAllMode, _activeSayAll lastSayAllMode=cursor - _startGenerator(readTextHelper_generator(cursor)) + # speechCompat: We have to enter the profile trigger here because it might change synths + # and we need to check whether we have to use compat code for the desired synth. + # Ideally, once the compat code is removed, the trigger would be + # managed entirely by _TextReader. + trigger = SayAllProfileTrigger() + trigger.enter() + if speech.shouldUseCompatCodeForIndexing(): + # Import late to avoid circular import. + import speechCompat + return speechCompat.sayAll_readText(cursor, trigger) + reader = _TextReader(cursor, trigger) + _activeSayAll = weakref.ref(reader) + reader.nextLine() + +class _TextReader(object): + """Manages continuous reading of text. + This is intended for internal use only. -def readTextHelper_generator(cursor): - if cursor==CURSOR_CARET: + The high level flow of control is as follows: + 1. The constructor sets things up. + 2. L{nextLine} is called to read the first line. + 3. When it speaks a line, L{nextLine} request that L{lineReached} be called + when we start speaking this line, providing the position and state at this point. + 4. When we start speaking a line, L{lineReached} is called + and moves the cursor to that line. + 5. L{lineReached} calls L{nextLine}. + 6. If there are more lines, L{nextLine} works as per steps 3 and 4. + 7. Otherwise, if the object doesn't support page turns, we're finished. + 8. If the object does support page turns, + we request that L{turnPage} be called when speech is finished. + 9. L{turnPage} tries to turn the page. + 10. If there are no more pages, we're finished. + 11. If there is another page, L{turnPage} calls L{nextLine}. + """ + MAX_BUFFERED_LINES = 10 + + def __init__(self, cursor, trigger): + self.cursor = cursor + self.trigger = trigger + # Start at the cursor. + if cursor == CURSOR_CARET: + try: + self.reader = api.getCaretObject().makeTextInfo(textInfos.POSITION_CARET) + except (NotImplementedError, RuntimeError): + return + else: + self.reader = api.getReviewPosition() + self.speakTextInfoState = speech.SpeakTextInfoState(self.reader.obj) + self.numBufferedLines = 0 + + def nextLine(self): + if not self.reader: + # We were stopped. + return + if not self.reader.obj: + # The object died, so we should too. + self.finish() + return + bookmark = self.reader.bookmark + # Expand to the current line. + # We use move end rather than expand + # because the user might start in the middle of a line + # and we don't want to read from the start of the line in that case. + # For lines after the first, it's also more efficient because + # we're already at the start of the line, so there's no need to search backwards. + delta = self.reader.move(textInfos.UNIT_READINGCHUNK, 1, endPoint="end") + if delta <= 0: + # No more text. + if isinstance(self.reader.obj, textInfos.DocumentWithPageTurns): + # Once the last line finishes reading, try turning the page. + cb = speech.CallbackCommand(self.turnPage) + speech.speakWithoutPauses([cb, speech.EndUtteranceCommand()]) + else: + self.finish() + return + # Call lineReached when we start speaking this line. + # lineReached will move the cursor and trigger reading of the next line. + cb = speech.CallbackCommand(lambda: self.lineReached(bookmark, self.speakTextInfoState.copy())) + spoke = speech.speakTextInfo(self.reader, unit=textInfos.UNIT_READINGCHUNK, + reason=controlTypes.REASON_SAYALL, _prefixSpeechCommand=cb, + useCache=self.speakTextInfoState) + # Collapse to the end of this line, ready to read the next. try: - reader=api.getCaretObject().makeTextInfo(textInfos.POSITION_CARET) - except (NotImplementedError, RuntimeError): + self.reader.collapse(end=True) + except RuntimeError: + # This occurs in Microsoft Word when the range covers the end of the document. + # without this exception to indicate that further collapsing is not possible, say all could enter an infinite loop. + self.finish() return - else: - reader=api.getReviewPosition() - - lastSentIndex=0 - lastReceivedIndex=0 - cursorIndexMap={} - keepReading=True - speakTextInfoState=speech.SpeakTextInfoState(reader.obj) - with SayAllProfileTrigger(): - while True: - if not reader.obj: - # The object died, so we should too. - return - # lastReceivedIndex might be None if other speech was interspersed with this say all. - # In this case, we want to send more text in case this was the last chunk spoken. - if lastReceivedIndex is None or (lastSentIndex-lastReceivedIndex)<=10: - if keepReading: - bookmark=reader.bookmark - index=lastSentIndex+1 - delta=reader.move(textInfos.UNIT_READINGCHUNK,1,endPoint="end") - if delta<=0: - speech.speakWithoutPauses(None) - keepReading=False - continue - speech.speakTextInfo(reader,unit=textInfos.UNIT_READINGCHUNK,reason=controlTypes.REASON_SAYALL,index=index,useCache=speakTextInfoState) - lastSentIndex=index - cursorIndexMap[index]=(bookmark,speakTextInfoState.copy()) - try: - reader.collapse(end=True) - except RuntimeError: #MS Word when range covers end of document - # Word specific: without this exception to indicate that further collapsing is not posible, say-all could enter an infinite loop. - speech.speakWithoutPauses(None) - keepReading=False + if not spoke: + # This line didn't include a natural pause, so nothing was spoken. + self.numBufferedLines += 1 + if self.numBufferedLines < self.MAX_BUFFERED_LINES: + # Move on to the next line. + # We queue this to allow the user a chance to stop say all. + queueHandler.queueFunction(queueHandler.eventQueue, self.nextLine) else: - # We'll wait for speech to catch up a bit before sending more text. - if speech.speakWithoutPauses.lastSentIndex is None or (lastSentIndex-speech.speakWithoutPauses.lastSentIndex)>=10: - # There is a large chunk of pending speech - # Force speakWithoutPauses to send text to the synth so we can move on. - speech.speakWithoutPauses(None) - receivedIndex=speech.getLastSpeechIndex() - if receivedIndex!=lastReceivedIndex and (lastReceivedIndex!=0 or receivedIndex!=None): - lastReceivedIndex=receivedIndex - bookmark,state=cursorIndexMap.get(receivedIndex,(None,None)) - if state: - state.updateObj() - if bookmark is not None: - updater=reader.obj.makeTextInfo(bookmark) - if cursor==CURSOR_CARET: - updater.updateCaret() - if cursor!=CURSOR_CARET or config.conf["reviewCursor"]["followCaret"]: - api.setReviewPosition(updater) - elif not keepReading and lastReceivedIndex==lastSentIndex: - # All text has been sent to the synth. - # Turn the page and start again if the object supports it. - if isinstance(reader.obj,textInfos.DocumentWithPageTurns): - try: - reader.obj.turnPage() - except RuntimeError: - break - else: - reader=reader.obj.makeTextInfo(textInfos.POSITION_FIRST) - keepReading=True - else: - break - - while speech.isPaused: - yield - yield - - # Wait until the synth has actually finished speaking. - # Otherwise, if there is a triggered profile with a different synth, - # we will switch too early and truncate speech (even up to several lines). - # Send another index and wait for it. - index=lastSentIndex+1 - speech.speak([speech.IndexCommand(index)]) - while speech.getLastSpeechIndex()1 else u"\u3001".join(charDesc) + else: + char=characterProcessing.processSpeechSymbol(locale,char) + if uppercase and synthConfig["sayCapForCapitals"]: + # Translators: cap will be spoken before the given letter when it is capitalized. + char=_("cap %s")%char + if uppercase and synth.isSupported("pitch") and synthConfig["capPitchChange"]: + yield PitchCommand(offset=synthConfig["capPitchChange"]) + if config.conf['speech']['autoLanguageSwitching']: + yield LangChangeCommand(locale) + if len(char) == 1 and synthConfig["useSpellingFunctionality"]: + if not charMode: + yield CharacterModeCommand(True) + charMode = True + elif charMode: + yield CharacterModeCommand(False) + charMode = False + if uppercase and synthConfig["beepForCapitals"]: + yield BeepCommand(2000, 50) + yield char + if uppercase and synth.isSupported("pitch") and synthConfig["capPitchChange"]: + yield PitchCommand() + yield EndUtteranceCommand() def getCharDescListFromText(text,locale): """This method prepares a list, which contains character and its description for all characters the text is made up of, by checking the presence of character descriptions in characterDescriptions.dic of that locale for all possible combination of consecutive characters in the text. @@ -202,59 +235,7 @@ def getCharDescListFromText(text,locale): i = i - 1 return charDescList -def _speakSpellingGen(text,locale,useCharacterDescriptions): - synth=getSynth() - synthConfig=config.conf["speech"][synth.name] - buf=[(text,locale,useCharacterDescriptions)] - for text,locale,useCharacterDescriptions in buf: - textLength=len(text) - count = 0 - localeHasConjuncts = True if locale.split('_',1)[0] in LANGS_WITH_CONJUNCT_CHARS else False - charDescList = getCharDescListFromText(text,locale) if localeHasConjuncts else text - for item in charDescList: - if localeHasConjuncts: - # item is a tuple containing character and its description - char = item[0] - charDesc = item[1] - else: - # item is just a character. - char = item - if useCharacterDescriptions: - charDesc=characterProcessing.getCharacterDescription(locale,char.lower()) - uppercase=char.isupper() - if useCharacterDescriptions and charDesc: - #Consider changing to multiple synth speech calls - char=charDesc[0] if textLength>1 else u"\u3001".join(charDesc) - else: - char=characterProcessing.processSpeechSymbol(locale,char) - if uppercase and synthConfig["sayCapForCapitals"]: - # Translators: cap will be spoken before the given letter when it is capitalized. - char=_("cap %s")%char - if uppercase and synth.isSupported("pitch") and synthConfig["capPitchChange"]: - oldPitch=synthConfig["pitch"] - synth.pitch=max(0,min(oldPitch+synthConfig["capPitchChange"],100)) - count = len(char) - index=count+1 - log.io("Speaking character %r"%char) - speechSequence=[LangChangeCommand(locale)] if config.conf['speech']['autoLanguageSwitching'] else [] - if len(char) == 1 and synthConfig["useSpellingFunctionality"]: - speechSequence.append(CharacterModeCommand(True)) - if index is not None: - speechSequence.append(IndexCommand(index)) - speechSequence.append(char) - synth.speak(speechSequence) - if uppercase and synth.isSupported("pitch") and synthConfig["capPitchChange"]: - synth.pitch=oldPitch - while textLength>1 and (isPaused or getLastSpeechIndex()!=index): - for x in xrange(2): - args=yield - if args: buf.append(args) - if uppercase and synthConfig["beepForCapitals"]: - tones.beep(2000,50) - args=yield - if args: buf.append(args) - -def speakObjectProperties(obj,reason=controlTypes.REASON_QUERY,index=None,**allowedProperties): +def speakObjectProperties(obj, reason=controlTypes.REASON_QUERY, _prefixSpeechCommand=None, **allowedProperties): #Fetch the values for all wanted properties newPropertyValues={} positionInfo=None @@ -311,7 +292,11 @@ def speakObjectProperties(obj,reason=controlTypes.REASON_QUERY,index=None,**allo #Get the speech text for the properties we want to speak, and then speak it text=getSpeechTextForProperties(reason,**newPropertyValues) if text: - speakText(text,index=index) + speechSequence = [] + if _prefixSpeechCommand is not None: + speechSequence.append(_prefixSpeechCommand) + speechSequence.append(text) + speak(speechSequence) def _speakPlaceholderIfEmpty(info, obj, reason): """ attempt to speak placeholder attribute if the textInfo 'info' is empty @@ -324,7 +309,7 @@ def _speakPlaceholderIfEmpty(info, obj, reason): return True return False -def speakObject(obj,reason=controlTypes.REASON_QUERY,index=None): +def speakObject(obj, reason=controlTypes.REASON_QUERY, _prefixSpeechCommand=None): from NVDAObjects import NVDAObjectTextInfo role=obj.role # Choose when we should report the content of this object's textInfo, rather than just the object's value @@ -373,7 +358,7 @@ def speakObject(obj,reason=controlTypes.REASON_QUERY,index=None): if shouldReportTextContent: allowProperties['value']=False - speakObjectProperties(obj,reason=reason,index=index,**allowProperties) + speakObjectProperties(obj, reason=reason, _prefixSpeechCommand=_prefixSpeechCommand, **allowProperties) if reason==controlTypes.REASON_ONLYCACHE: return if shouldReportTextContent: @@ -400,24 +385,19 @@ def speakObject(obj,reason=controlTypes.REASON_QUERY,index=None): except (NotImplementedError, LookupError): pass -def speakText(text,index=None,reason=controlTypes.REASON_MESSAGE,symbolLevel=None): +def speakText(text,reason=controlTypes.REASON_MESSAGE,symbolLevel=None): """Speaks some text. @param text: The text to speak. @type text: str - @param index: The index to mark this text with, which can be used later to determine whether this piece of text has been spoken. - @type index: int @param reason: The reason for this speech; one of the controlTypes.REASON_* constants. @param symbolLevel: The symbol verbosity level; C{None} (default) to use the user's configuration. """ - speechSequence=[] - if index is not None: - speechSequence.append(IndexCommand(index)) - if text is not None: - if isBlank(text): - # Translators: This is spoken when the line is considered blank. - text=_("blank") - speechSequence.append(text) - speak(speechSequence,symbolLevel=symbolLevel) + if text is None: + return + if isBlank(text): + # Translators: This is spoken when the line is considered blank. + text=_("blank") + speak([text],symbolLevel=symbolLevel) RE_INDENTATION_SPLIT = re.compile(r"^([^\S\r\n\f\v]*)(.*)$", re.UNICODE | re.DOTALL) def splitTextIndentation(text): @@ -479,10 +459,25 @@ def getIndentationSpeech(indentation, formatConfig): speak = True return (" ".join(res) if speak else "") -def speak(speechSequence,symbolLevel=None): +# Speech priorities. +#: Indicates that a speech sequence should have normal priority. +SPRI_NORMAL = 0 +#: Indicates that a speech sequence should be spoken after the next utterance of lower priority is complete. +SPRI_NEXT = 1 +#: Indicates that a speech sequence is very important and should be spoken right now, +#: interrupting low priority speech. +#: After it is spoken, interrupted speech will resume. +#: Note that this does not interrupt previously queued speech at the same priority. +SPRI_NOW = 2 +#: The speech priorities ordered from highest to lowest. +SPEECH_PRIORITIES = (SPRI_NOW, SPRI_NEXT, SPRI_NORMAL) + +def speak(speechSequence, symbolLevel=None, priority=SPRI_NORMAL): """Speaks a sequence of text and speech commands @param speechSequence: the sequence of text and L{SpeechCommand} objects to speak @param symbolLevel: The symbol verbosity level; C{None} (default) to use the user's configuration. + @param priority: The speech priority. + @type priority: One of the C{SPRI_*} constants. """ if not speechSequence: #Pointless - nothing to speak return @@ -543,7 +538,9 @@ def speak(speechSequence,symbolLevel=None): speechSequence[index]=processText(curLanguage,item,symbolLevel) if not inCharacterMode: speechSequence[index]+=CHUNK_SEPARATOR - getSynth().speak(speechSequence) + if shouldUseCompatCodeForIndexing(): + return getSynth().speak(speechSequence) + _manager.speak(speechSequence, priority) def speakSelectionMessage(message,text): if len(text) < 512: @@ -725,12 +722,12 @@ def _speakTextInfo_addMath(speechSequence, info, field): except (NotImplementedError, LookupError): return -def speakTextInfo(info,useCache=True,formatConfig=None,unit=None,reason=controlTypes.REASON_QUERY,index=None,onlyInitialFields=False,suppressBlanks=False): +def speakTextInfo(info, useCache=True, formatConfig=None, unit=None, reason=controlTypes.REASON_QUERY, _prefixSpeechCommand=None, onlyInitialFields=False, suppressBlanks=False): onlyCache=reason==controlTypes.REASON_ONLYCACHE if isinstance(useCache,SpeakTextInfoState): speakTextInfoState=useCache elif useCache: - speakTextInfoState=SpeakTextInfoState(info.obj) + speakTextInfoState=SpeakTextInfoState(info.obj) else: speakTextInfoState=None autoLanguageSwitching=config.conf['speech']['autoLanguageSwitching'] @@ -812,13 +809,12 @@ def speakTextInfo(info,useCache=True,formatConfig=None,unit=None,reason=controlT if not endingBlock and reason==controlTypes.REASON_SAYALL: endingBlock=bool(int(controlFieldStackCache[count].get('isBlock',0))) if endingBlock: - speechSequence.append(SpeakWithoutPausesBreakCommand()) + speechSequence.append(EndUtteranceCommand()) # The TextInfo should be considered blank if we are only exiting fields (i.e. we aren't entering any new fields and there is no text). isTextBlank=True - # Even when there's no speakable text, we still need to notify the synth of the index. - if index is not None: - speechSequence.append(IndexCommand(index)) + if _prefixSpeechCommand is not None: + speechSequence.append(_prefixSpeechCommand) #Get speech text for any fields that are in both controlFieldStacks, if extra detail is not requested if not extraDetail: @@ -969,9 +965,10 @@ def speakTextInfo(info,useCache=True,formatConfig=None,unit=None,reason=controlT if not onlyCache and speechSequence: if reason==controlTypes.REASON_SAYALL: - speakWithoutPauses(speechSequence) + return speakWithoutPauses(speechSequence) else: speak(speechSequence) + return True def getSpeechTextForProperties(reason=controlTypes.REASON_QUERY,**propertyValues): global oldTreeLevel, oldTableID, oldRowNumber, oldColumnNumber @@ -1650,20 +1647,25 @@ def getTableInfoSpeech(tableInfo,oldTableInfo,extraDetail=False): def speakWithoutPauses(speechSequence,detectBreaks=True): """ Speaks the speech sequences given over multiple calls, only sending to the synth at acceptable phrase or sentence boundaries, or when given None for the speech sequence. + @return: C{True} if something was actually spoken, + C{False} if only buffering occurred. + @rtype: bool """ lastStartIndex=0 #Break on all explicit break commands if detectBreaks and speechSequence: sequenceLen=len(speechSequence) + spoke = False for index in xrange(sequenceLen): - if isinstance(speechSequence[index],SpeakWithoutPausesBreakCommand): + if isinstance(speechSequence[index],EndUtteranceCommand): if index>0 and lastStartIndex self._curPriQueue.priority: + # Preempted by higher priority speech. + if self._curPriQueue.enteredProfileTriggers: + if not doneSpeaking: + # Wait for the synth to finish speaking. + # _handleDoneSpeaking will call us again. + self._shouldPushWhenDoneSpeaking = True + return + self._exitProfileTriggers(self._curPriQueue.enteredProfileTriggers) + self._curPriQueue = queue + elif queue.priority < self._curPriQueue.priority: + # Resuming a preempted, lower priority queue. + if queue.enteredProfileTriggers: + if not doneSpeaking: + # Wait for the synth to finish speaking. + # _handleDoneSpeaking will call us again. + self._shouldPushWhenDoneSpeaking = True + return + self._restoreProfileTriggers(queue.enteredProfileTriggers) + self._curPriQueue = queue + while queue.pendingSequences and isinstance(queue.pendingSequences[0][0], ConfigProfileTriggerCommand): + if not doneSpeaking: + # Wait for the synth to finish speaking. + # _handleDoneSpeaking will call us again. + self._shouldPushWhenDoneSpeaking = True + return + self._switchProfile() + if not queue.pendingSequences: + # The last commands in this queue were profile switches. + # Call this method again in case other queues are waiting. + return self._pushNextSpeech(True) + seq = self._buildNextUtterance() + if seq: + getSynth().speak(seq) + + def _getNextPriority(self): + """Get the highest priority queue containing pending speech. + """ + for priority in SPEECH_PRIORITIES: + queue = self._priQueues.get(priority) + if not queue: + continue + if queue.pendingSequences: + return queue + return None + + def _buildNextUtterance(self): + """Since an utterance might be split over several sequences, + build a complete utterance to pass to the synth. + """ + utterance = [] + # If this utterance was preempted by higher priority speech, + # apply any parameters changed before the preemption. + params = self._curPriQueue.paramTracker.getChanged() + utterance.extend(params) + for seq in self._curPriQueue.pendingSequences: + if isinstance(seq[0], EndUtteranceCommand): + # The utterance ends here. + break + utterance.extend(seq) + return utterance + + def _onSynthIndexReached(self, synth=None, index=None): + if synth != getSynth(): + return + # This needs to be handled in the main thread. + queueHandler.queueFunction(queueHandler.eventQueue, self._handleIndex, index) + + def _removeCompletedFromQueue(self, index): + """Removes completed speech sequences from the queue. + @param index: The index just reached indicating a completed sequence. + @return: Tuple of (valid, endOfUtterance), + where valid indicates whether the index was valid and + endOfUtterance indicates whether this sequence was the end of the current utterance. + @rtype: (bool, bool) + """ + # Find the sequence that just completed speaking. + if not self._curPriQueue: + # No speech in progress. Probably from a previous utterance which was cancelled. + return False, False + for seqIndex, seq in enumerate(self._curPriQueue.pendingSequences): + lastCommand = seq[-1] if isinstance(seq, list) else None + if isinstance(lastCommand, IndexCommand) and index >= lastCommand.index: + endOfUtterance = isinstance(self._curPriQueue.pendingSequences[seqIndex + 1][0], EndUtteranceCommand) + if endOfUtterance: + # Remove the EndUtteranceCommand as well. + seqIndex += 1 + break # Found it! + else: + # Unknown index. Probably from a previous utterance which was cancelled. + return False, False + if endOfUtterance: + # These params may not apply to the next utterance if it was queued separately, + # so reset the tracker. + # The next utterance will include the commands again if they do still apply. + self._curPriQueue.paramTracker = ParamChangeTracker() + else: + # Keep track of parameters changed so far. + # This is necessary in case this utterance is preempted by higher priority speech. + for seqIndex in xrange(seqIndex + 1): + seq = self._curPriQueue.pendingSequences[seqIndex] + for command in seq: + if isinstance(command, SynthParamCommand): + self._curPriQueue.paramTracker.update(command) + # This sequence is done, so we don't need to track it any more. + del self._curPriQueue.pendingSequences[:seqIndex + 1] + return True, endOfUtterance + + def _handleIndex(self, index): + valid, endOfUtterance = self._removeCompletedFromQueue(index) + if not valid: + return + callbackCommand = self._indexesToCallbacks.pop(index, None) + if callbackCommand: + try: + callbackCommand.run() + except: + log.exception("Error running speech callback") + if endOfUtterance: + self._pushNextSpeech(False) + + def _onSynthDoneSpeaking(self, synth=None): + if synth != getSynth(): + return + # This needs to be handled in the main thread. + queueHandler.queueFunction(queueHandler.eventQueue, self._handleDoneSpeaking) + + def _handleDoneSpeaking(self): + if self._shouldPushWhenDoneSpeaking: + self._shouldPushWhenDoneSpeaking = False + self._pushNextSpeech(True) + + def _switchProfile(self): + command = self._curPriQueue.pendingSequences.pop(0)[0] + assert isinstance(command, ConfigProfileTriggerCommand), "First pending command should be a ConfigProfileTriggerCommand" + if not command.enter and command.trigger not in self._curPriQueue.enteredProfileTriggers: + # speechCompat: We already exited this profile due to synth incompatibility. + return + if command.enter: + try: + command.trigger.enter() + except: + log.exception("Error entering new trigger %r" % command.trigger.spec) + self._curPriQueue.enteredProfileTriggers.append(command.trigger) + else: + try: + command.trigger.exit() + except: + log.exception("Error exiting active trigger %r" % command.trigger.spec) + self._curPriQueue.enteredProfileTriggers.remove(command.trigger) + synthDriverHandler.handleConfigProfileSwitch() + if command.enter and shouldUseCompatCodeForIndexing(): + log.debugWarning("Synth in new profile doesn't support indexing. Exiting trigger.") + try: + command.trigger.exit() + except: + log.exception("Error exiting trigger %r" % command.trigger.spec) + assert self._curPriQueue.enteredProfileTriggers[-1] is command.trigger, "Last profile trigger should be the trigger just entered" + del self._curPriQueue.enteredProfileTriggers[-1] + synthDriverHandler.handleConfigProfileSwitch() + + def _exitProfileTriggers(self, triggers): + for trigger in reversed(triggers): + try: + trigger.exit() + except: + log.exception("Error exiting profile trigger %r" % command.trigger.spec) + synthDriverHandler.handleConfigProfileSwitch() + + def _restoreProfileTriggers(self, triggers): + for trigger in triggers: + try: + trigger.enter() + except: + log.exception("Error entering profile trigger %r" % command.trigger.spec) + synthDriverHandler.handleConfigProfileSwitch() + + def cancel(self): + getSynth().cancel() + if self._curPriQueue and self._curPriQueue.enteredProfileTriggers: + self._exitProfileTriggers(self._curPriQueue.enteredProfileTriggers) + self._reset() + +#: The singleton _SpeechManager instance used for speech functions. +#: @type: L{_SpeechManager} +_manager = _SpeechManager() diff --git a/source/speechCompat.py b/source/speechCompat.py new file mode 100644 index 00000000000..72cc4fe17d9 --- /dev/null +++ b/source/speechCompat.py @@ -0,0 +1,270 @@ +# -*- coding: UTF-8 -*- +# A part of NonVisual Desktop Access (NVDA) +# Copyright (C) 2006-2017 NV Access Limited, Peter Vágner, Aleksey Sadovoy +# This file may be used under the terms of the GNU General Public License, version 2 or later. +# For more details see: https://www.gnu.org/licenses/gpl-2.0.html + +"""Speech code to support old synthesizers which don't support index and done speaking notifications, etc. +""" + +import itertools +import speech +from synthDriverHandler import getSynth +import tones +import queueHandler +import config +import characterProcessing +from logHandler import log +import textInfos +import api +import controlTypes +import sayAllHandler + +def getLastSpeechIndex(): + return getSynth().lastIndex + +_speakSpellingGenerator=None + +def speakSpelling(text,locale=None,useCharacterDescriptions=False): + global _speakSpellingGenerator + import speechViewer + if speechViewer.isActive: + speechViewer.appendText(text) + if speech.speechMode==speech.speechMode_off: + return + elif speech.speechMode==speech.speechMode_beeps: + tones.beep(config.conf["speech"]["beepSpeechModePitch"],speechMode_beeps_ms) + return + if speech.isPaused: + speech.cancelSpeech() + speech.beenCanceled=False + defaultLanguage=speech.getCurrentLanguage() + if not locale or (not config.conf['speech']['autoDialectSwitching'] and locale.split('_')[0]==defaultLanguage.split('_')[0]): + locale=defaultLanguage + + if not text: + # Translators: This is spoken when NVDA moves to an empty line. + return getSynth().speak((_("blank"),)) + if not text.isspace(): + text=text.rstrip() + if _speakSpellingGenerator and _speakSpellingGenerator.gi_frame: + _speakSpellingGenerator.send((text,locale,useCharacterDescriptions)) + else: + _speakSpellingGenerator=_speakSpellingGen(text,locale,useCharacterDescriptions) + try: + # Speak the first character before this function returns. + next(_speakSpellingGenerator) + except StopIteration: + return + queueHandler.registerGeneratorObject(_speakSpellingGenerator) + +def _speakSpellingGen(text,locale,useCharacterDescriptions): + synth=getSynth() + synthConfig=config.conf["speech"][synth.name] + buf=[(text,locale,useCharacterDescriptions)] + for text,locale,useCharacterDescriptions in buf: + textLength=len(text) + count = 0 + localeHasConjuncts = True if locale.split('_',1)[0] in speech.LANGS_WITH_CONJUNCT_CHARS else False + charDescList = speech.getCharDescListFromText(text,locale) if localeHasConjuncts else text + for item in charDescList: + if localeHasConjuncts: + # item is a tuple containing character and its description + char = item[0] + charDesc = item[1] + else: + # item is just a character. + char = item + if useCharacterDescriptions: + charDesc=characterProcessing.getCharacterDescription(locale,char.lower()) + uppercase=char.isupper() + if useCharacterDescriptions and charDesc: + #Consider changing to multiple synth speech calls + char=charDesc[0] if textLength>1 else u"\u3001".join(charDesc) + else: + char=characterProcessing.processSpeechSymbol(locale,char) + if uppercase and synthConfig["sayCapForCapitals"]: + # Translators: cap will be spoken before the given letter when it is capitalized. + char=_("cap %s")%char + if uppercase and synth.isSupported("pitch") and synthConfig["capPitchChange"]: + oldPitch=synthConfig["pitch"] + synth.pitch=max(0,min(oldPitch+synthConfig["capPitchChange"],100)) + count = len(char) + index=count+1 + log.io("Speaking character %r"%char) + speechSequence=[speech.LangChangeCommand(locale)] if config.conf['speech']['autoLanguageSwitching'] else [] + if len(char) == 1 and synthConfig["useSpellingFunctionality"]: + speechSequence.append(speech.CharacterModeCommand(True)) + if index is not None: + speechSequence.append(speech.IndexCommand(index)) + speechSequence.append(char) + synth.speak(speechSequence) + if uppercase and synth.isSupported("pitch") and synthConfig["capPitchChange"]: + synth.pitch=oldPitch + while textLength>1 and (speech.isPaused or getLastSpeechIndex()!=index): + for x in xrange(2): + args=yield + if args: buf.append(args) + if uppercase and synthConfig["beepForCapitals"]: + tones.beep(2000,50) + args=yield + if args: buf.append(args) + +_sayAll_generatorID = None + +def _sayAll_startGenerator(generator): + global _sayAll_generatorID + sayAll_stop() + _sayAll_generatorID = queueHandler.registerGeneratorObject(generator) + +def sayAll_stop(): + global _sayAll_generatorID + if _sayAll_generatorID is None: + return + queueHandler.cancelGeneratorObject(_sayAll_generatorID) + _sayAll_generatorID = None + +def sayAll_isRunning(): + return _sayAll_generatorID is not None + +def sayAll_readObjects(obj): + _sayAll_startGenerator(sayAll_readObjectsHelper_generator(obj)) + +def sayAll_generateObjectSubtreeSpeech(obj,indexGen): + index=indexGen.next() + indexCommand = speech.IndexCommand(index) + speech.speakObject(obj,reason=controlTypes.REASON_SAYALL,_prefixSpeechCommand=indexCommand) + yield obj,index + child=obj.simpleFirstChild + while child: + childSpeech=sayAll_generateObjectSubtreeSpeech(child,indexGen) + for r in childSpeech: + yield r + child=child.simpleNext + +def sayAll_readObjectsHelper_generator(obj): + lastSentIndex=0 + lastReceivedIndex=0 + speechGen=sayAll_generateObjectSubtreeSpeech(obj,itertools.count()) + objIndexMap={} + keepReading=True + while True: + # lastReceivedIndex might be None if other speech was interspersed with this say all. + # In this case, we want to send more text in case this was the last chunk spoken. + if lastReceivedIndex is None or (lastSentIndex-lastReceivedIndex)<=1: + if keepReading: + try: + o,lastSentIndex=speechGen.next() + except StopIteration: + keepReading=False + continue + objIndexMap[lastSentIndex]=o + receivedIndex=getLastSpeechIndex() + if receivedIndex!=lastReceivedIndex and (lastReceivedIndex!=0 or receivedIndex!=None): + lastReceivedIndex=receivedIndex + lastReceivedObj=objIndexMap.get(lastReceivedIndex) + if lastReceivedObj is not None: + api.setNavigatorObject(lastReceivedObj) + #Clear old objects from the map + for i in objIndexMap.keys(): + if i<=lastReceivedIndex: + del objIndexMap[i] + while speech.isPaused: + yield + yield + +def sayAll_readText(cursor, trigger): + _sayAll_startGenerator(sayAll_readTextHelper_generator(cursor, trigger)) + +def sayAll_readTextHelper_generator(cursor, trigger): + if cursor==sayAllHandler.CURSOR_CARET: + try: + reader=api.getCaretObject().makeTextInfo(textInfos.POSITION_CARET) + except (NotImplementedError, RuntimeError): + return + else: + reader=api.getReviewPosition() + + lastSentIndex=0 + lastReceivedIndex=0 + cursorIndexMap={} + keepReading=True + speakTextInfoState=speech.SpeakTextInfoState(reader.obj) + try: + while True: + if not reader.obj: + # The object died, so we should too. + return + # lastReceivedIndex might be None if other speech was interspersed with this say all. + # In this case, we want to send more text in case this was the last chunk spoken. + if lastReceivedIndex is None or (lastSentIndex-lastReceivedIndex)<=10: + if keepReading: + bookmark=reader.bookmark + index=lastSentIndex+1 + delta=reader.move(textInfos.UNIT_READINGCHUNK,1,endPoint="end") + if delta<=0: + speech.speakWithoutPauses(None) + keepReading=False + continue + indexCommand = speech.IndexCommand(index) + speech.speakTextInfo(reader,unit=textInfos.UNIT_READINGCHUNK,reason=controlTypes.REASON_SAYALL,_prefixSpeechCommand=indexCommand,useCache=speakTextInfoState) + lastSentIndex=index + cursorIndexMap[index]=(bookmark,speakTextInfoState.copy()) + try: + reader.collapse(end=True) + except RuntimeError: #MS Word when range covers end of document + # Word specific: without this exception to indicate that further collapsing is not posible, say-all could enter an infinite loop. + speech.speakWithoutPauses(None) + keepReading=False + else: + # We'll wait for speech to catch up a bit before sending more text. + if speech.speakWithoutPauses._lastSentIndex is None or (lastSentIndex-speech.speakWithoutPauses._lastSentIndex)>=10: + # There is a large chunk of pending speech + # Force speakWithoutPauses to send text to the synth so we can move on. + speech.speakWithoutPauses(None) + receivedIndex=getLastSpeechIndex() + if receivedIndex!=lastReceivedIndex and (lastReceivedIndex!=0 or receivedIndex!=None): + lastReceivedIndex=receivedIndex + bookmark,state=cursorIndexMap.get(receivedIndex,(None,None)) + if state: + state.updateObj() + if bookmark is not None: + updater=reader.obj.makeTextInfo(bookmark) + if cursor==sayAllHandler.CURSOR_CARET: + updater.updateCaret() + if cursor!=sayAllHandler.CURSOR_CARET or config.conf["reviewCursor"]["followCaret"]: + api.setReviewPosition(updater) + elif not keepReading and lastReceivedIndex==lastSentIndex: + # All text has been sent to the synth. + # Turn the page and start again if the object supports it. + if isinstance(reader.obj,textInfos.DocumentWithPageTurns): + try: + reader.obj.turnPage() + except RuntimeError: + break + else: + reader=reader.obj.makeTextInfo(textInfos.POSITION_FIRST) + keepReading=True + else: + break + + while speech.isPaused: + yield + yield + + # Wait until the synth has actually finished speaking. + # Otherwise, if there is a triggered profile with a different synth, + # we will switch too early and truncate speech (even up to several lines). + # Send another index and wait for it. + index=lastSentIndex+1 + speech.speak([speech.IndexCommand(index)]) + while getLastSpeechIndex() Date: Wed, 13 Sep 2017 15:27:40 +1000 Subject: [PATCH 04/25] Update the espeak synth driver to support the new speech framework. --- source/synthDrivers/_espeak.py | 58 +++++++++++++++++++++++++--------- source/synthDrivers/espeak.py | 26 +++++++++++---- 2 files changed, 62 insertions(+), 22 deletions(-) diff --git a/source/synthDrivers/_espeak.py b/source/synthDrivers/_espeak.py index 69a1e4b5311..b17ed49df07 100755 --- a/source/synthDrivers/_espeak.py +++ b/source/synthDrivers/_espeak.py @@ -1,7 +1,7 @@ # -*- coding: UTF-8 -*- #synthDrivers/_espeak.py #A part of NonVisual Desktop Access (NVDA) -#Copyright (C) 2007-2012 NV Access Limited, Peter Vágner +#Copyright (C) 2007-2017 NV Access Limited, Peter Vágner #This file is covered by the GNU General Public License. #See the file COPYING for more details. @@ -17,11 +17,14 @@ import codecs isSpeaking = False -lastIndex = None +onIndexReached = None bgThread=None bgQueue = None player = None espeakDLL=None +#: Keeps count of the number of bytes pushed for the current utterance. +#: This is necessary because index positions are given as ms since the start of the utterance. +_numBytesPushed = 0 #Parameter bounds minRate=80 @@ -120,23 +123,39 @@ def __eq__(self, other): @t_espeak_callback def callback(wav,numsamples,event): try: - global player, isSpeaking, lastIndex + global player, isSpeaking, _numBytesPushed if not isSpeaking: return 1 + indexes = [] for e in event: if e.type==espeakEVENT_MARK: - lastIndex=int(e.id.name) + indexNum = int(e.id.name) + # e.audio_position is ms since the start of this utterance. + # Convert to bytes since the start of the utterance. + # samplesPerSec * 2 bytes per sample / 1000 ms per sec gives us bytes per ms. + indexByte = e.audio_position * player.samplesPerSec * 2 / 1000 + # Subtract bytes in the utterance that have already been handled + # to give us the byte offset into the samples for this callback. + indexByte -= _numBytesPushed + indexes.append((indexNum, indexByte)) elif e.type==espeakEVENT_LIST_TERMINATED: break if not wav: player.idle() + onIndexReached(None) isSpeaking = False return 0 if numsamples > 0: - try: - player.feed(string_at(wav, numsamples * sizeof(c_short))) - except: - log.debugWarning("Error feeding audio to nvWave",exc_info=True) + wav = string_at(wav, numsamples * sizeof(c_short)) + prevByte = 0 + for indexNum, indexByte in indexes: + player.feed(wav[prevByte:indexByte], + onDone=lambda indexNum=indexNum: onIndexReached(indexNum)) + prevByte = indexByte + if not isSpeaking: + return 1 + player.feed(wav[prevByte:]) + _numBytesPushed += len(wav) return 0 except: log.error("callback", exc_info=True) @@ -170,10 +189,11 @@ def _execWhenDone(func, *args, **kwargs): func(*args, **kwargs) def _speak(text): - global isSpeaking + global isSpeaking, _numBytesPushed uniqueID=c_int() isSpeaking = True flags = espeakCHARS_WCHAR | espeakSSML | espeakPHONEMES + _numBytesPushed = 0 return espeakDLL.espeak_Synth(text,0,0,0,0,flags,byref(uniqueID),0) def speak(text): @@ -181,7 +201,7 @@ def speak(text): _execWhenDone(_speak, text, mustBeAsync=True) def stop(): - global isSpeaking, bgQueue, lastIndex + global isSpeaking, bgQueue # Kill all speech from now. # We still want parameter changes to occur, so requeue them. params = [] @@ -198,7 +218,6 @@ def stop(): bgQueue.put(item) isSpeaking = False player.stop() - lastIndex=None def pause(switch): global player @@ -270,8 +289,13 @@ def espeak_errcheck(res, func, args): raise RuntimeError("%s: code %d" % (func.__name__, res)) return res -def initialize(): - global espeakDLL, bgThread, bgQueue, player +def initialize(indexCallback=None): + """ + @param indexCallback: A function which is called when eSpeak reaches an index. + It is called with one argument: + the number of the index or C{None} when speech stops. + """ + global espeakDLL, bgThread, bgQueue, player, onIndexReached espeakDLL=cdll.LoadLibrary(r"synthDrivers\espeak.dll") espeakDLL.espeak_Info.restype=c_char_p espeakDLL.espeak_Synth.errcheck=espeak_errcheck @@ -286,14 +310,17 @@ def initialize(): os.path.abspath("synthDrivers"),0) if sampleRate<0: raise OSError("espeak_Initialize %d"%sampleRate) - player = nvwave.WavePlayer(channels=1, samplesPerSec=sampleRate, bitsPerSample=16, outputDevice=config.conf["speech"]["outputDevice"]) + player = nvwave.WavePlayer(channels=1, samplesPerSec=sampleRate, bitsPerSample=16, + outputDevice=config.conf["speech"]["outputDevice"], + buffered=True) espeakDLL.espeak_SetSynthCallback(callback) bgQueue = Queue.Queue() bgThread=BgThread() bgThread.start() + onIndexReached = indexCallback def terminate(): - global bgThread, bgQueue, player, espeakDLL + global bgThread, bgQueue, player, espeakDLL , onIndexReached stop() bgQueue.put((None, None, None)) bgThread.join() @@ -303,6 +330,7 @@ def terminate(): player.close() player=None espeakDLL=None + onIndexReached = None def info(): return espeakDLL.espeak_Info() diff --git a/source/synthDrivers/espeak.py b/source/synthDrivers/espeak.py index 12247e956fa..8060b219fc7 100644 --- a/source/synthDrivers/espeak.py +++ b/source/synthDrivers/espeak.py @@ -1,7 +1,7 @@ # -*- coding: UTF-8 -*- #synthDrivers/espeak.py #A part of NonVisual Desktop Access (NVDA) -#Copyright (C) 2007-2015 NV Access Limited, Peter Vágner, Aleksey Sadovoy +#Copyright (C) 2007-2017 NV Access Limited, Peter Vágner, Aleksey Sadovoy #This file is covered by the GNU General Public License. #See the file COPYING for more details. @@ -11,7 +11,7 @@ import Queue import threading import languageHandler -from synthDriverHandler import SynthDriver,VoiceInfo,BooleanSynthSetting +from synthDriverHandler import SynthDriver, VoiceInfo, BooleanSynthSetting, synthIndexReached, synthDoneSpeaking import speech from logHandler import log @@ -30,13 +30,24 @@ class SynthDriver(SynthDriver): SynthDriver.InflectionSetting(), SynthDriver.VolumeSetting(), ) + supportedCommands = { + speech.IndexCommand, + speech.CharacterModeCommand, + speech.LangChangeCommand, + speech.BreakCommand, + speech.PitchCommand, + speech.RateCommand, + speech.VolumeCommand, + speech.PhonemeCommand, + } + supportedNotifications = {synthIndexReached, synthDoneSpeaking} @classmethod def check(cls): return True def __init__(self): - _espeak.initialize() + _espeak.initialize(self._onIndexReached) log.info("Using eSpeak NG version %s" % _espeak.info()) lang=languageHandler.getLanguage() _espeak.setVoiceByLanguage(lang) @@ -124,8 +135,6 @@ def speak(self,speechSequence): log.debugWarning("Unknown character in IPA string: %s"%item.ipa) if item.text: textList.append(self._processText(item.text)) - elif isinstance(item,speech.SpeechCommand): - log.debugWarning("Unsupported speech command: %s"%item) else: log.error("Unknown speech: %s"%item) # Close any open tags. @@ -224,8 +233,11 @@ def _set_voice(self, identifier): raise self._language=super(SynthDriver,self).language - def _get_lastIndex(self): - return _espeak.lastIndex + def _onIndexReached(self, index): + if index is not None: + synthIndexReached.notify(synth=self, index=index) + else: + synthDoneSpeaking.notify(synth=self) def terminate(self): _espeak.terminate() From 1ebe910ec22f6538a2f92d0b4d4cefc6d276619e Mon Sep 17 00:00:00 2001 From: James Teh Date: Wed, 13 Sep 2017 15:27:57 +1000 Subject: [PATCH 05/25] Update the oneCore synth driver to support the new speech framework. --- source/synthDrivers/oneCore.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/source/synthDrivers/oneCore.py b/source/synthDrivers/oneCore.py index 8a7e9f2d8c4..c7da2390c4c 100644 --- a/source/synthDrivers/oneCore.py +++ b/source/synthDrivers/oneCore.py @@ -12,7 +12,7 @@ from collections import OrderedDict import ctypes import _winreg -from synthDriverHandler import SynthDriver, VoiceInfo +from synthDriverHandler import SynthDriver, VoiceInfo, synthIndexReached, synthDoneSpeaking from logHandler import log import config import nvwave @@ -89,6 +89,17 @@ class SynthDriver(SynthDriver): SynthDriver.PitchSetting(), SynthDriver.VolumeSetting(), ) + supportedCommands = { + speech.IndexCommand, + speech.CharacterModeCommand, + speech.LangChangeCommand, + speech.BreakCommand, + speech.PitchCommand, + speech.RateCommand, + speech.VolumeCommand, + speech.PhonemeCommand, + } + supportedNotifications = {synthIndexReached, synthDoneSpeaking} # These are all controlled via SSML, so we only need attributes, not properties. rate = None pitch = None @@ -162,6 +173,7 @@ def _processQueue(self): # so by the time this is done, there might be something queued. log.debug("Calling idle on audio player") self._player.idle() + synthDoneSpeaking.notify(synth=self) if self._queuedSpeech: item = self._queuedSpeech.pop(0) self._wasCancelled = False @@ -191,7 +203,6 @@ def _callback(self, bytes, len, markers): markers = markers.split('|') else: markers = [] - prevMarker = None prevPos = 0 # Push audio up to each marker so we can sync the audio with the markers. @@ -199,25 +210,20 @@ def _callback(self, bytes, len, markers): if self._wasCancelled: break name, pos = marker.split(':') + index = int(name) pos = int(pos) # pos is a time offset in 100-nanosecond units. # Convert this to a byte offset. # Order the equation so we don't have to do floating point. pos = pos * BYTES_PER_SEC / HUNDRED_NS_PER_SEC # Push audio up to this marker. - self._player.feed(data[prevPos:pos]) - # _player.feed blocks until the previous chunk of audio is complete, not the chunk we just pushed. - # Therefore, indicate that we've reached the previous marker. - if prevMarker: - self.lastIndex = prevMarker - prevMarker = int(name) + self._player.feed(data[prevPos:pos], + onDone=lambda index=index: synthIndexReached.notify(synth=self, index=index)) prevPos = pos if self._wasCancelled: log.debug("Cancelled, stopped pushing audio") else: self._player.feed(data[prevPos:]) - if prevMarker: - self.lastIndex = prevMarker log.debug("Done pushing audio") self._processQueue() From 9479237938dbd511304fd454f254f003c9e582c0 Mon Sep 17 00:00:00 2001 From: James Teh Date: Wed, 13 Sep 2017 15:30:58 +1000 Subject: [PATCH 06/25] Update comtypes to version 1.1.3. This is necessary to handle events from SAPI 5, as one of the parameters is a decimal which is not supported by our existing (very outdated) version of comtypes . comtypes has now been added as a separate git submodule. --- .gitmodules | 4 + include/comtypes | 1 + readme.md | 2 +- ...DE083_8FB8_45CF_BCB7_C477ACB2F897_0_1_0.py | 6072 +++++++++-------- source/sourceEnv.py | 1 + 5 files changed, 3118 insertions(+), 2962 deletions(-) create mode 160000 include/comtypes diff --git a/.gitmodules b/.gitmodules index 8aadfd6f1fb..14c1db39ec5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -18,3 +18,7 @@ path = include/pyserial url = https://github.com/pyserial/pyserial.git ignore = untracked +[submodule "include/comtypes"] + path = include/comtypes + url = https://github.com/enthought/comtypes/issues.git + ignore = untracked diff --git a/include/comtypes b/include/comtypes new file mode 160000 index 00000000000..d3fbdd0c293 --- /dev/null +++ b/include/comtypes @@ -0,0 +1 @@ +Subproject commit d3fbdd0c2933c9671e80d7407a0320925abc8bc5 diff --git a/readme.md b/readme.md index 19543e78582..9ec4c0c7a9f 100644 --- a/readme.md +++ b/readme.md @@ -51,7 +51,7 @@ If you aren't sure, run `git submodule update` after every git pull, merge or ch For reference, the following dependencies are included in Git submodules: -* [comtypes](http://sourceforge.net/projects/comtypes/), version 0.6.2 +* [comtypes](https://github.com/enthought/comtypes), version 1.1.3 * [wxPython](http://www.wxpython.org/), version 3.0.2.0 * [Python Windows Extensions](http://sourceforge.net/projects/pywin32/ ), build 218 * [eSpeak NG](https://github.com/espeak-ng/espeak-ng), commit 37121600 diff --git a/source/comInterfaces/_944DE083_8FB8_45CF_BCB7_C477ACB2F897_0_1_0.py b/source/comInterfaces/_944DE083_8FB8_45CF_BCB7_C477ACB2F897_0_1_0.py index ccbd43b25e9..9505f410c7e 100644 --- a/source/comInterfaces/_944DE083_8FB8_45CF_BCB7_C477ACB2F897_0_1_0.py +++ b/source/comInterfaces/_944DE083_8FB8_45CF_BCB7_C477ACB2F897_0_1_0.py @@ -1,67 +1,35 @@ # -*- coding: mbcs -*- -typelib_path = u'C:\\Windows\\SysWOW64\\UIAutomationCore.dll' +typelib_path = 'UIAutomationCore.dll' _lcid = 0 # change this if required from ctypes import * import comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0 from comtypes import GUID -from comtypes import BSTR from ctypes import HRESULT from comtypes import helpstring from comtypes import COMMETHOD from comtypes import dispid +from comtypes.automation import VARIANT +from comtypes import BSTR from comtypes.automation import _midlSAFEARRAY +from comtypes.automation import IDispatch +from comtypes import IUnknown +from ctypes.wintypes import tagRECT +from ctypes.wintypes import tagPOINT +WSTRING = c_wchar_p from ctypes.wintypes import tagPOINT -from comtypes.automation import VARIANT from ctypes.wintypes import tagRECT -from comtypes import IUnknown from comtypes import CoClass -WSTRING = c_wchar_p -from comtypes.automation import IDispatch -class IUIAutomationSpreadsheetPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +UIA_AnnotationObjectsAttributeId = 40032 # Constant c_int +class IUIAutomationTreeWalker(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{7517A7C8-FAAE-4DE9-9F08-29B91E8595C1}') + _iid_ = GUID('{4042C624-389C-4AFC-A630-9DF854A541FC}') _idlflags_ = [] class IUIAutomationElement(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True _iid_ = GUID('{D22108AA-8AC5-49A5-837B-37BBB3D7591E}') _idlflags_ = [] -IUIAutomationSpreadsheetPattern._methods_ = [ - COMMETHOD([], HRESULT, 'GetItemByName', - ( ['in'], BSTR, 'name' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), -] -################################################################ -## code template for IUIAutomationSpreadsheetPattern implementation -##class IUIAutomationSpreadsheetPattern_Impl(object): -## def GetItemByName(self, name): -## '-no docstring-' -## #return element -## - -UIA_IsPasswordPropertyId = 30019 # Constant c_int -UIA_CulturePropertyId = 30015 # Constant c_int -UIA_IsEnabledPropertyId = 30010 # Constant c_int -UIA_ClassNamePropertyId = 30012 # Constant c_int -UIA_IsValuePatternAvailablePropertyId = 30043 # Constant c_int -UIA_ClickablePointPropertyId = 30014 # Constant c_int -class IUIAutomation(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{30CBE57D-D9D0-452A-AB13-7AC5AC4825EE}') - _idlflags_ = [] -class IUIAutomation2(IUIAutomation): - _case_insensitive_ = True - _iid_ = GUID('{34723AFF-0C9D-49D0-9896-7AB52DF8CD8A}') - _idlflags_ = [] -class IUIAutomation3(IUIAutomation2): - _case_insensitive_ = True - _iid_ = GUID('{73D768DA-9B51-4B89-936E-C209290973E7}') - _idlflags_ = [] -class IUIAutomation4(IUIAutomation3): - _case_insensitive_ = True - _iid_ = GUID('{1189C02A-05F8-4319-8E21-E817E3DB2860}') - _idlflags_ = [] class IUIAutomationCacheRequest(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True _iid_ = GUID('{B32A92B5-BC25-4078-9C08-D7EE95C48E03}') @@ -70,606 +38,662 @@ class IUIAutomationCondition(comtypes.gen._00020430_0000_0000_C000_000000000046_ _case_insensitive_ = True _iid_ = GUID('{352FFBA8-0973-437C-A61F-F64CAFD81DF9}') _idlflags_ = [] -class IUIAutomationTreeWalker(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{4042C624-389C-4AFC-A630-9DF854A541FC}') - _idlflags_ = [] - -# values for enumeration 'PropertyConditionFlags' -PropertyConditionFlags_None = 0 -PropertyConditionFlags_IgnoreCase = 1 -PropertyConditionFlags = c_int # enum - -# values for enumeration 'TreeScope' -TreeScope_None = 0 -TreeScope_Element = 1 -TreeScope_Children = 2 -TreeScope_Descendants = 4 -TreeScope_Parent = 8 -TreeScope_Ancestors = 16 -TreeScope_Subtree = 7 -TreeScope = c_int # enum -class IUIAutomationEventHandler(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{146C3C17-F12E-4E22-8C27-F894B9B79C69}') - _idlflags_ = ['oleautomation'] -class IUIAutomationPropertyChangedEventHandler(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{40CD37D4-C756-4B0C-8C6F-BDDFEEB13B50}') - _idlflags_ = ['oleautomation'] -class IUIAutomationStructureChangedEventHandler(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{E81D1B4E-11C5-42F8-9754-E7036C79F054}') - _idlflags_ = ['oleautomation'] -class IUIAutomationFocusChangedEventHandler(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{C270F6B5-5C69-4290-9745-7A7F97169468}') - _idlflags_ = ['oleautomation'] -class IUIAutomationProxyFactory(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{85B94ECD-849D-42B6-B94D-D6DB23FDF5A4}') - _idlflags_ = [] -class IUIAutomationProxyFactoryEntry(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{D50E472E-B64B-490C-BCA1-D30696F9F289}') - _idlflags_ = [] -class IUIAutomationProxyFactoryMapping(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{09E31E18-872D-4873-93D1-1E541EC133FD}') - _idlflags_ = [] -class IAccessible(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IDispatch): - _case_insensitive_ = True - _iid_ = GUID('{618736E0-3C3D-11CF-810C-00AA00389B71}') - _idlflags_ = ['dual', 'oleautomation', 'hidden'] -IUIAutomation._methods_ = [ - COMMETHOD([], HRESULT, 'CompareElements', - ( ['in'], POINTER(IUIAutomationElement), 'el1' ), - ( ['in'], POINTER(IUIAutomationElement), 'el2' ), - ( ['retval', 'out'], POINTER(c_int), 'areSame' )), - COMMETHOD([], HRESULT, 'CompareRuntimeIds', - ( ['in'], _midlSAFEARRAY(c_int), 'runtimeId1' ), - ( ['in'], _midlSAFEARRAY(c_int), 'runtimeId2' ), - ( ['retval', 'out'], POINTER(c_int), 'areSame' )), - COMMETHOD([], HRESULT, 'GetRootElement', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'root' )), - COMMETHOD([], HRESULT, 'ElementFromHandle', - ( ['in'], c_void_p, 'hwnd' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), - COMMETHOD([], HRESULT, 'ElementFromPoint', - ( ['in'], tagPOINT, 'pt' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), - COMMETHOD([], HRESULT, 'GetFocusedElement', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), - COMMETHOD([], HRESULT, 'GetRootElementBuildCache', - ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'root' )), - COMMETHOD([], HRESULT, 'ElementFromHandleBuildCache', - ( ['in'], c_void_p, 'hwnd' ), - ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), - COMMETHOD([], HRESULT, 'ElementFromPointBuildCache', - ( ['in'], tagPOINT, 'pt' ), - ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), - COMMETHOD([], HRESULT, 'GetFocusedElementBuildCache', - ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), - COMMETHOD([], HRESULT, 'CreateTreeWalker', - ( ['in'], POINTER(IUIAutomationCondition), 'pCondition' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTreeWalker)), 'walker' )), - COMMETHOD(['propget'], HRESULT, 'ControlViewWalker', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTreeWalker)), 'walker' )), - COMMETHOD(['propget'], HRESULT, 'ContentViewWalker', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTreeWalker)), 'walker' )), - COMMETHOD(['propget'], HRESULT, 'RawViewWalker', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTreeWalker)), 'walker' )), - COMMETHOD(['propget'], HRESULT, 'RawViewCondition', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'condition' )), - COMMETHOD(['propget'], HRESULT, 'ControlViewCondition', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'condition' )), - COMMETHOD(['propget'], HRESULT, 'ContentViewCondition', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'condition' )), - COMMETHOD([], HRESULT, 'CreateCacheRequest', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCacheRequest)), 'cacheRequest' )), - COMMETHOD([], HRESULT, 'CreateTrueCondition', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), - COMMETHOD([], HRESULT, 'CreateFalseCondition', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), - COMMETHOD([], HRESULT, 'CreatePropertyCondition', - ( ['in'], c_int, 'propertyId' ), - ( ['in'], VARIANT, 'value' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), - COMMETHOD([], HRESULT, 'CreatePropertyConditionEx', - ( ['in'], c_int, 'propertyId' ), - ( ['in'], VARIANT, 'value' ), - ( ['in'], PropertyConditionFlags, 'flags' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), - COMMETHOD([], HRESULT, 'CreateAndCondition', - ( ['in'], POINTER(IUIAutomationCondition), 'condition1' ), - ( ['in'], POINTER(IUIAutomationCondition), 'condition2' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), - COMMETHOD([], HRESULT, 'CreateAndConditionFromArray', - ( ['in'], _midlSAFEARRAY(POINTER(IUIAutomationCondition)), 'conditions' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), - COMMETHOD([], HRESULT, 'CreateAndConditionFromNativeArray', - ( ['in'], POINTER(POINTER(IUIAutomationCondition)), 'conditions' ), - ( ['in'], c_int, 'conditionCount' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), - COMMETHOD([], HRESULT, 'CreateOrCondition', - ( ['in'], POINTER(IUIAutomationCondition), 'condition1' ), - ( ['in'], POINTER(IUIAutomationCondition), 'condition2' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), - COMMETHOD([], HRESULT, 'CreateOrConditionFromArray', - ( ['in'], _midlSAFEARRAY(POINTER(IUIAutomationCondition)), 'conditions' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), - COMMETHOD([], HRESULT, 'CreateOrConditionFromNativeArray', - ( ['in'], POINTER(POINTER(IUIAutomationCondition)), 'conditions' ), - ( ['in'], c_int, 'conditionCount' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), - COMMETHOD([], HRESULT, 'CreateNotCondition', - ( ['in'], POINTER(IUIAutomationCondition), 'condition' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), - COMMETHOD([], HRESULT, 'AddAutomationEventHandler', - ( ['in'], c_int, 'eventId' ), +IUIAutomationTreeWalker._methods_ = [ + COMMETHOD([], HRESULT, 'GetParentElement', ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['in'], TreeScope, 'scope' ), - ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['in'], POINTER(IUIAutomationEventHandler), 'handler' )), - COMMETHOD([], HRESULT, 'RemoveAutomationEventHandler', - ( ['in'], c_int, 'eventId' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'parent' )), + COMMETHOD([], HRESULT, 'GetFirstChildElement', ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['in'], POINTER(IUIAutomationEventHandler), 'handler' )), - COMMETHOD([], HRESULT, 'AddPropertyChangedEventHandlerNativeArray', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'first' )), + COMMETHOD([], HRESULT, 'GetLastChildElement', + ( ['in'], POINTER(IUIAutomationElement), 'element' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'last' )), + COMMETHOD([], HRESULT, 'GetNextSiblingElement', + ( ['in'], POINTER(IUIAutomationElement), 'element' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'next' )), + COMMETHOD([], HRESULT, 'GetPreviousSiblingElement', + ( ['in'], POINTER(IUIAutomationElement), 'element' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'previous' )), + COMMETHOD([], HRESULT, 'NormalizeElement', + ( ['in'], POINTER(IUIAutomationElement), 'element' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'normalized' )), + COMMETHOD([], HRESULT, 'GetParentElementBuildCache', ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['in'], TreeScope, 'scope' ), ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['in'], POINTER(IUIAutomationPropertyChangedEventHandler), 'handler' ), - ( ['in'], POINTER(c_int), 'propertyArray' ), - ( ['in'], c_int, 'propertyCount' )), - COMMETHOD([], HRESULT, 'AddPropertyChangedEventHandler', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'parent' )), + COMMETHOD([], HRESULT, 'GetFirstChildElementBuildCache', ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['in'], TreeScope, 'scope' ), ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['in'], POINTER(IUIAutomationPropertyChangedEventHandler), 'handler' ), - ( ['in'], _midlSAFEARRAY(c_int), 'propertyArray' )), - COMMETHOD([], HRESULT, 'RemovePropertyChangedEventHandler', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'first' )), + COMMETHOD([], HRESULT, 'GetLastChildElementBuildCache', ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['in'], POINTER(IUIAutomationPropertyChangedEventHandler), 'handler' )), - COMMETHOD([], HRESULT, 'AddStructureChangedEventHandler', + ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'last' )), + COMMETHOD([], HRESULT, 'GetNextSiblingElementBuildCache', ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['in'], TreeScope, 'scope' ), ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['in'], POINTER(IUIAutomationStructureChangedEventHandler), 'handler' )), - COMMETHOD([], HRESULT, 'RemoveStructureChangedEventHandler', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'next' )), + COMMETHOD([], HRESULT, 'GetPreviousSiblingElementBuildCache', ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['in'], POINTER(IUIAutomationStructureChangedEventHandler), 'handler' )), - COMMETHOD([], HRESULT, 'AddFocusChangedEventHandler', ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['in'], POINTER(IUIAutomationFocusChangedEventHandler), 'handler' )), - COMMETHOD([], HRESULT, 'RemoveFocusChangedEventHandler', - ( ['in'], POINTER(IUIAutomationFocusChangedEventHandler), 'handler' )), - COMMETHOD([], HRESULT, 'RemoveAllEventHandlers'), - COMMETHOD([], HRESULT, 'IntNativeArrayToSafeArray', - ( ['in'], POINTER(c_int), 'array' ), - ( ['in'], c_int, 'arrayCount' ), - ( ['retval', 'out'], POINTER(_midlSAFEARRAY(c_int)), 'safeArray' )), - COMMETHOD([], HRESULT, 'IntSafeArrayToNativeArray', - ( ['in'], _midlSAFEARRAY(c_int), 'intArray' ), - ( ['out'], POINTER(POINTER(c_int)), 'array' ), - ( ['retval', 'out'], POINTER(c_int), 'arrayCount' )), - COMMETHOD([], HRESULT, 'RectToVariant', - ( ['in'], tagRECT, 'rc' ), - ( ['retval', 'out'], POINTER(VARIANT), 'var' )), - COMMETHOD([], HRESULT, 'VariantToRect', - ( ['in'], VARIANT, 'var' ), - ( ['retval', 'out'], POINTER(tagRECT), 'rc' )), - COMMETHOD([], HRESULT, 'SafeArrayToRectNativeArray', - ( ['in'], _midlSAFEARRAY(c_double), 'rects' ), - ( ['out'], POINTER(POINTER(tagRECT)), 'rectArray' ), - ( ['retval', 'out'], POINTER(c_int), 'rectArrayCount' )), - COMMETHOD([], HRESULT, 'CreateProxyFactoryEntry', - ( ['in'], POINTER(IUIAutomationProxyFactory), 'factory' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationProxyFactoryEntry)), 'factoryEntry' )), - COMMETHOD(['propget'], HRESULT, 'ProxyFactoryMapping', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationProxyFactoryMapping)), 'factoryMapping' )), - COMMETHOD([], HRESULT, 'GetPropertyProgrammaticName', - ( ['in'], c_int, 'property' ), - ( ['retval', 'out'], POINTER(BSTR), 'name' )), - COMMETHOD([], HRESULT, 'GetPatternProgrammaticName', - ( ['in'], c_int, 'pattern' ), - ( ['retval', 'out'], POINTER(BSTR), 'name' )), - COMMETHOD([], HRESULT, 'PollForPotentialSupportedPatterns', - ( ['in'], POINTER(IUIAutomationElement), 'pElement' ), - ( ['out'], POINTER(_midlSAFEARRAY(c_int)), 'patternIds' ), - ( ['out'], POINTER(_midlSAFEARRAY(BSTR)), 'patternNames' )), - COMMETHOD([], HRESULT, 'PollForPotentialSupportedProperties', - ( ['in'], POINTER(IUIAutomationElement), 'pElement' ), - ( ['out'], POINTER(_midlSAFEARRAY(c_int)), 'propertyIds' ), - ( ['out'], POINTER(_midlSAFEARRAY(BSTR)), 'propertyNames' )), - COMMETHOD([], HRESULT, 'CheckNotSupported', - ( ['in'], VARIANT, 'value' ), - ( ['retval', 'out'], POINTER(c_int), 'isNotSupported' )), - COMMETHOD(['propget'], HRESULT, 'ReservedNotSupportedValue', - ( ['retval', 'out'], POINTER(POINTER(IUnknown)), 'notSupportedValue' )), - COMMETHOD(['propget'], HRESULT, 'ReservedMixedAttributeValue', - ( ['retval', 'out'], POINTER(POINTER(IUnknown)), 'mixedAttributeValue' )), - COMMETHOD([], HRESULT, 'ElementFromIAccessible', - ( ['in'], POINTER(IAccessible), 'accessible' ), - ( ['in'], c_int, 'childId' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), - COMMETHOD([], HRESULT, 'ElementFromIAccessibleBuildCache', - ( ['in'], POINTER(IAccessible), 'accessible' ), - ( ['in'], c_int, 'childId' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'previous' )), + COMMETHOD([], HRESULT, 'NormalizeElementBuildCache', + ( ['in'], POINTER(IUIAutomationElement), 'element' ), ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'normalized' )), + COMMETHOD(['propget'], HRESULT, 'condition', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'condition' )), ] ################################################################ -## code template for IUIAutomation implementation -##class IUIAutomation_Impl(object): -## def IntSafeArrayToNativeArray(self, intArray): -## '-no docstring-' -## #return array, arrayCount -## -## def AddPropertyChangedEventHandlerNativeArray(self, element, scope, cacheRequest, handler, propertyArray, propertyCount): -## '-no docstring-' -## #return -## -## def IntNativeArrayToSafeArray(self, array, arrayCount): +## code template for IUIAutomationTreeWalker implementation +##class IUIAutomationTreeWalker_Impl(object): +## def GetFirstChildElementBuildCache(self, element, cacheRequest): ## '-no docstring-' -## #return safeArray +## #return first ## -## def ElementFromHandleBuildCache(self, hwnd, cacheRequest): +## def GetParentElement(self, element): ## '-no docstring-' -## #return element +## #return parent ## -## def ElementFromHandle(self, hwnd): +## def GetLastChildElement(self, element): ## '-no docstring-' -## #return element +## #return last ## -## def CreateOrCondition(self, condition1, condition2): +## def GetPreviousSiblingElementBuildCache(self, element, cacheRequest): ## '-no docstring-' -## #return newCondition +## #return previous ## -## def PollForPotentialSupportedProperties(self, pElement): +## def GetParentElementBuildCache(self, element, cacheRequest): ## '-no docstring-' -## #return propertyIds, propertyNames +## #return parent ## -## @property -## def ContentViewWalker(self): +## def GetNextSiblingElementBuildCache(self, element, cacheRequest): ## '-no docstring-' -## #return walker +## #return next ## -## def CreateTrueCondition(self): +## def GetNextSiblingElement(self, element): ## '-no docstring-' -## #return newCondition +## #return next ## -## def AddAutomationEventHandler(self, eventId, element, scope, cacheRequest, handler): +## def GetPreviousSiblingElement(self, element): ## '-no docstring-' -## #return +## #return previous ## -## @property -## def ReservedNotSupportedValue(self): +## def GetLastChildElementBuildCache(self, element, cacheRequest): ## '-no docstring-' -## #return notSupportedValue +## #return last ## -## def CreatePropertyCondition(self, propertyId, value): +## def GetFirstChildElement(self, element): ## '-no docstring-' -## #return newCondition +## #return first ## -## def AddFocusChangedEventHandler(self, cacheRequest, handler): +## def NormalizeElementBuildCache(self, element, cacheRequest): ## '-no docstring-' -## #return +## #return normalized ## ## @property -## def RawViewCondition(self): +## def condition(self): ## '-no docstring-' ## #return condition ## -## def CreateAndConditionFromNativeArray(self, conditions, conditionCount): -## '-no docstring-' -## #return newCondition -## -## def CreateOrConditionFromNativeArray(self, conditions, conditionCount): -## '-no docstring-' -## #return newCondition -## -## def ElementFromIAccessibleBuildCache(self, accessible, childId, cacheRequest): -## '-no docstring-' -## #return element -## -## def CreateNotCondition(self, condition): -## '-no docstring-' -## #return newCondition -## -## def CreateOrConditionFromArray(self, conditions): -## '-no docstring-' -## #return newCondition -## -## def CreateAndConditionFromArray(self, conditions): -## '-no docstring-' -## #return newCondition -## -## def CheckNotSupported(self, value): -## '-no docstring-' -## #return isNotSupported -## -## def RemoveStructureChangedEventHandler(self, element, handler): -## '-no docstring-' -## #return -## -## def CreatePropertyConditionEx(self, propertyId, value, flags): -## '-no docstring-' -## #return newCondition -## -## def RemovePropertyChangedEventHandler(self, element, handler): -## '-no docstring-' -## #return -## -## def CreateTreeWalker(self, pCondition): -## '-no docstring-' -## #return walker -## -## def CreateCacheRequest(self): -## '-no docstring-' -## #return cacheRequest -## -## def ElementFromPointBuildCache(self, pt, cacheRequest): -## '-no docstring-' -## #return element -## -## def GetPatternProgrammaticName(self, pattern): -## '-no docstring-' -## #return name -## -## def RemoveAllEventHandlers(self): -## '-no docstring-' -## #return -## -## def ElementFromIAccessible(self, accessible, childId): -## '-no docstring-' -## #return element -## -## def AddStructureChangedEventHandler(self, element, scope, cacheRequest, handler): +## def NormalizeElement(self, element): ## '-no docstring-' -## #return +## #return normalized ## + +UIA_SummaryChangeId = 90000 # Constant c_int + +# values for enumeration 'ZoomUnit' +ZoomUnit_NoAmount = 0 +ZoomUnit_LargeDecrement = 1 +ZoomUnit_SmallDecrement = 2 +ZoomUnit_LargeIncrement = 3 +ZoomUnit_SmallIncrement = 4 +ZoomUnit = c_int # enum + +# values for enumeration 'TextEditChangeType' +TextEditChangeType_None = 0 +TextEditChangeType_AutoCorrect = 1 +TextEditChangeType_Composition = 2 +TextEditChangeType_CompositionFinalized = 3 +TextEditChangeType_AutoComplete = 4 +TextEditChangeType = c_int # enum +UIA_DragIsGrabbedPropertyId = 30138 # Constant c_int +UIA_TransformCanResizePropertyId = 30088 # Constant c_int +class UiaChangeInfo(Structure): + pass +UiaChangeInfo._fields_ = [ + ('uiaId', c_int), + ('payload', VARIANT), + ('extraInfo', VARIANT), +] +assert sizeof(UiaChangeInfo) == 40, sizeof(UiaChangeInfo) +assert alignment(UiaChangeInfo) == 8, alignment(UiaChangeInfo) +UIA_IsStylesPatternAvailablePropertyId = 30127 # Constant c_int +UIA_SpreadsheetItemFormulaPropertyId = 30129 # Constant c_int +class IUIAutomationDockPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{FDE5EF97-1464-48F6-90BF-43D0948E86EC}') + _idlflags_ = [] + +# values for enumeration 'DockPosition' +DockPosition_Top = 0 +DockPosition_Left = 1 +DockPosition_Bottom = 2 +DockPosition_Right = 3 +DockPosition_Fill = 4 +DockPosition_None = 5 +DockPosition = c_int # enum +IUIAutomationDockPattern._methods_ = [ + COMMETHOD([], HRESULT, 'SetDockPosition', + ( ['in'], DockPosition, 'dockPos' )), + COMMETHOD(['propget'], HRESULT, 'CurrentDockPosition', + ( ['retval', 'out'], POINTER(DockPosition), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedDockPosition', + ( ['retval', 'out'], POINTER(DockPosition), 'retVal' )), +] +################################################################ +## code template for IUIAutomationDockPattern implementation +##class IUIAutomationDockPattern_Impl(object): ## @property -## def ProxyFactoryMapping(self): -## '-no docstring-' -## #return factoryMapping -## -## def CreateProxyFactoryEntry(self, factory): +## def CachedDockPosition(self): ## '-no docstring-' -## #return factoryEntry +## #return retVal ## -## def CompareRuntimeIds(self, runtimeId1, runtimeId2): +## def SetDockPosition(self, dockPos): ## '-no docstring-' -## #return areSame +## #return ## ## @property -## def ControlViewWalker(self): -## '-no docstring-' -## #return walker -## -## def CreateAndCondition(self, condition1, condition2): -## '-no docstring-' -## #return newCondition -## -## def GetRootElementBuildCache(self, cacheRequest): +## def CurrentDockPosition(self): ## '-no docstring-' -## #return root +## #return retVal ## -## def RemoveFocusChangedEventHandler(self, handler): + +UIA_StylesFillPatternColorPropertyId = 30125 # Constant c_int +UIA_GridItemColumnPropertyId = 30065 # Constant c_int +UIA_WindowWindowVisualStatePropertyId = 30075 # Constant c_int + +# values for enumeration 'NotificationProcessing' +NotificationProcessing_ImportantAll = 0 +NotificationProcessing_ImportantMostRecent = 1 +NotificationProcessing_All = 2 +NotificationProcessing_MostRecent = 3 +NotificationProcessing_CurrentThenMostRecent = 4 +NotificationProcessing = c_int # enum +class IUIAutomationTextRange(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{A543CC6A-F4AE-494B-8239-C814481187A8}') + _idlflags_ = [] +class IUIAutomationTextRange2(IUIAutomationTextRange): + _case_insensitive_ = True + _iid_ = GUID('{BB9B40E0-5E04-46BD-9BE0-4B601B9AFAD4}') + _idlflags_ = [] + +# values for enumeration 'TextPatternRangeEndpoint' +TextPatternRangeEndpoint_Start = 0 +TextPatternRangeEndpoint_End = 1 +TextPatternRangeEndpoint = c_int # enum + +# values for enumeration 'TextUnit' +TextUnit_Character = 0 +TextUnit_Format = 1 +TextUnit_Word = 2 +TextUnit_Line = 3 +TextUnit_Paragraph = 4 +TextUnit_Page = 5 +TextUnit_Document = 6 +TextUnit = c_int # enum +class IUIAutomationElementArray(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{14314595-B4BC-4055-95F2-58F2E42C9855}') + _idlflags_ = [] +IUIAutomationTextRange._methods_ = [ + COMMETHOD([], HRESULT, 'Clone', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTextRange)), 'clonedRange' )), + COMMETHOD([], HRESULT, 'Compare', + ( ['in'], POINTER(IUIAutomationTextRange), 'range' ), + ( ['retval', 'out'], POINTER(c_int), 'areSame' )), + COMMETHOD([], HRESULT, 'CompareEndpoints', + ( ['in'], TextPatternRangeEndpoint, 'srcEndPoint' ), + ( ['in'], POINTER(IUIAutomationTextRange), 'range' ), + ( ['in'], TextPatternRangeEndpoint, 'targetEndPoint' ), + ( ['retval', 'out'], POINTER(c_int), 'compValue' )), + COMMETHOD([], HRESULT, 'ExpandToEnclosingUnit', + ( ['in'], TextUnit, 'TextUnit' )), + COMMETHOD([], HRESULT, 'FindAttribute', + ( ['in'], c_int, 'attr' ), + ( ['in'], VARIANT, 'val' ), + ( ['in'], c_int, 'backward' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTextRange)), 'found' )), + COMMETHOD([], HRESULT, 'FindText', + ( ['in'], BSTR, 'text' ), + ( ['in'], c_int, 'backward' ), + ( ['in'], c_int, 'ignoreCase' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTextRange)), 'found' )), + COMMETHOD([], HRESULT, 'GetAttributeValue', + ( ['in'], c_int, 'attr' ), + ( ['retval', 'out'], POINTER(VARIANT), 'value' )), + COMMETHOD([], HRESULT, 'GetBoundingRectangles', + ( ['retval', 'out'], POINTER(_midlSAFEARRAY(c_double)), 'boundingRects' )), + COMMETHOD([], HRESULT, 'GetEnclosingElement', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'enclosingElement' )), + COMMETHOD([], HRESULT, 'GetText', + ( ['in'], c_int, 'maxLength' ), + ( ['retval', 'out'], POINTER(BSTR), 'text' )), + COMMETHOD([], HRESULT, 'Move', + ( ['in'], TextUnit, 'unit' ), + ( ['in'], c_int, 'count' ), + ( ['retval', 'out'], POINTER(c_int), 'moved' )), + COMMETHOD([], HRESULT, 'MoveEndpointByUnit', + ( ['in'], TextPatternRangeEndpoint, 'endpoint' ), + ( ['in'], TextUnit, 'unit' ), + ( ['in'], c_int, 'count' ), + ( ['retval', 'out'], POINTER(c_int), 'moved' )), + COMMETHOD([], HRESULT, 'MoveEndpointByRange', + ( ['in'], TextPatternRangeEndpoint, 'srcEndPoint' ), + ( ['in'], POINTER(IUIAutomationTextRange), 'range' ), + ( ['in'], TextPatternRangeEndpoint, 'targetEndPoint' )), + COMMETHOD([], HRESULT, 'Select'), + COMMETHOD([], HRESULT, 'AddToSelection'), + COMMETHOD([], HRESULT, 'RemoveFromSelection'), + COMMETHOD([], HRESULT, 'ScrollIntoView', + ( ['in'], c_int, 'alignToTop' )), + COMMETHOD([], HRESULT, 'GetChildren', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'children' )), +] +################################################################ +## code template for IUIAutomationTextRange implementation +##class IUIAutomationTextRange_Impl(object): +## def CompareEndpoints(self, srcEndPoint, range, targetEndPoint): ## '-no docstring-' -## #return +## #return compValue ## -## def ElementFromPoint(self, pt): +## def Compare(self, range): ## '-no docstring-' -## #return element +## #return areSame ## -## def GetPropertyProgrammaticName(self, property): +## def MoveEndpointByUnit(self, endpoint, unit, count): ## '-no docstring-' -## #return name +## #return moved ## -## def VariantToRect(self, var): +## def ScrollIntoView(self, alignToTop): ## '-no docstring-' -## #return rc +## #return ## -## def GetRootElement(self): +## def AddToSelection(self): ## '-no docstring-' -## #return root +## #return ## -## def SafeArrayToRectNativeArray(self, rects): +## def FindAttribute(self, attr, val, backward): ## '-no docstring-' -## #return rectArray, rectArrayCount +## #return found ## -## def GetFocusedElementBuildCache(self, cacheRequest): +## def GetEnclosingElement(self): ## '-no docstring-' -## #return element +## #return enclosingElement ## -## @property -## def ReservedMixedAttributeValue(self): +## def ExpandToEnclosingUnit(self, TextUnit): ## '-no docstring-' -## #return mixedAttributeValue +## #return ## -## @property -## def RawViewWalker(self): +## def Clone(self): ## '-no docstring-' -## #return walker +## #return clonedRange ## -## @property -## def ControlViewCondition(self): +## def Move(self, unit, count): ## '-no docstring-' -## #return condition +## #return moved ## -## def GetFocusedElement(self): +## def FindText(self, text, backward, ignoreCase): ## '-no docstring-' -## #return element +## #return found ## -## def CompareElements(self, el1, el2): +## def GetText(self, maxLength): ## '-no docstring-' -## #return areSame +## #return text ## -## def RectToVariant(self, rc): +## def RemoveFromSelection(self): ## '-no docstring-' -## #return var +## #return ## -## def CreateFalseCondition(self): +## def GetChildren(self): ## '-no docstring-' -## #return newCondition +## #return children ## -## def AddPropertyChangedEventHandler(self, element, scope, cacheRequest, handler, propertyArray): +## def GetAttributeValue(self, attr): +## '-no docstring-' +## #return value +## +## def MoveEndpointByRange(self, srcEndPoint, range, targetEndPoint): ## '-no docstring-' ## #return ## -## @property -## def ContentViewCondition(self): +## def Select(self): ## '-no docstring-' -## #return condition +## #return ## -## def PollForPotentialSupportedPatterns(self, pElement): +## def GetBoundingRectangles(self): ## '-no docstring-' -## #return patternIds, patternNames +## #return boundingRects ## -## def RemoveAutomationEventHandler(self, eventId, element, handler): + +IUIAutomationTextRange2._methods_ = [ + COMMETHOD([], HRESULT, 'ShowContextMenu'), +] +################################################################ +## code template for IUIAutomationTextRange2 implementation +##class IUIAutomationTextRange2_Impl(object): +## def ShowContextMenu(self): ## '-no docstring-' ## #return ## -IUIAutomation2._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'AutoSetFocus', - ( ['retval', 'out'], POINTER(c_int), 'AutoSetFocus' )), - COMMETHOD(['propput'], HRESULT, 'AutoSetFocus', - ( ['in'], c_int, 'AutoSetFocus' )), - COMMETHOD(['propget'], HRESULT, 'ConnectionTimeout', - ( ['retval', 'out'], POINTER(c_ulong), 'timeout' )), - COMMETHOD(['propput'], HRESULT, 'ConnectionTimeout', - ( ['in'], c_ulong, 'timeout' )), - COMMETHOD(['propget'], HRESULT, 'TransactionTimeout', - ( ['retval', 'out'], POINTER(c_ulong), 'timeout' )), - COMMETHOD(['propput'], HRESULT, 'TransactionTimeout', - ( ['in'], c_ulong, 'timeout' )), +class IUIAutomationGridPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{414C3CDC-856B-4F5B-8538-3131C6302550}') + _idlflags_ = [] +IUIAutomationGridPattern._methods_ = [ + COMMETHOD([], HRESULT, 'GetItem', + ( ['in'], c_int, 'row' ), + ( ['in'], c_int, 'column' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), + COMMETHOD(['propget'], HRESULT, 'CurrentRowCount', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentColumnCount', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedRowCount', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedColumnCount', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), ] ################################################################ -## code template for IUIAutomation2 implementation -##class IUIAutomation2_Impl(object): -## def _get(self): -## '-no docstring-' -## #return timeout -## def _set(self, timeout): +## code template for IUIAutomationGridPattern implementation +##class IUIAutomationGridPattern_Impl(object): +## @property +## def CurrentColumnCount(self): ## '-no docstring-' -## ConnectionTimeout = property(_get, _set, doc = _set.__doc__) +## #return retVal ## -## def _get(self): +## @property +## def CurrentRowCount(self): ## '-no docstring-' -## #return timeout -## def _set(self, timeout): +## #return retVal +## +## @property +## def CachedColumnCount(self): ## '-no docstring-' -## TransactionTimeout = property(_get, _set, doc = _set.__doc__) +## #return retVal ## -## def _get(self): +## def GetItem(self, row, column): ## '-no docstring-' -## #return AutoSetFocus -## def _set(self, AutoSetFocus): +## #return element +## +## @property +## def CachedRowCount(self): ## '-no docstring-' -## AutoSetFocus = property(_get, _set, doc = _set.__doc__) +## #return retVal ## -# values for enumeration 'TextEditChangeType' -TextEditChangeType_None = 0 -TextEditChangeType_AutoCorrect = 1 -TextEditChangeType_Composition = 2 -TextEditChangeType_CompositionFinalized = 3 -TextEditChangeType_AutoComplete = 4 -TextEditChangeType = c_int # enum -class IUIAutomationTextEditTextChangedEventHandler(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +# values for enumeration 'NotificationKind' +NotificationKind_ItemAdded = 0 +NotificationKind_ItemRemoved = 1 +NotificationKind_ActionCompleted = 2 +NotificationKind_ActionAborted = 3 +NotificationKind_Other = 4 +NotificationKind = c_int # enum +UIA_LegacyIAccessibleChildIdPropertyId = 30091 # Constant c_int +class IUIAutomationInvokePattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{92FAA680-E704-4156-931A-E32D5BB38F3F}') - _idlflags_ = ['oleautomation'] -IUIAutomation3._methods_ = [ - COMMETHOD([], HRESULT, 'AddTextEditTextChangedEventHandler', - ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['in'], TreeScope, 'scope' ), - ( ['in'], TextEditChangeType, 'TextEditChangeType' ), - ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['in'], POINTER(IUIAutomationTextEditTextChangedEventHandler), 'handler' )), - COMMETHOD([], HRESULT, 'RemoveTextEditTextChangedEventHandler', - ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['in'], POINTER(IUIAutomationTextEditTextChangedEventHandler), 'handler' )), + _iid_ = GUID('{FB377FBE-8EA6-46D5-9C73-6499642D3059}') + _idlflags_ = [] +IUIAutomationInvokePattern._methods_ = [ + COMMETHOD([], HRESULT, 'Invoke'), ] ################################################################ -## code template for IUIAutomation3 implementation -##class IUIAutomation3_Impl(object): -## def AddTextEditTextChangedEventHandler(self, element, scope, TextEditChangeType, cacheRequest, handler): +## code template for IUIAutomationInvokePattern implementation +##class IUIAutomationInvokePattern_Impl(object): +## def Invoke(self): ## '-no docstring-' ## #return ## -## def RemoveTextEditTextChangedEventHandler(self, element, handler): + +UIA_MultipleViewSupportedViewsPropertyId = 30072 # Constant c_int +UIA_GridItemColumnSpanPropertyId = 30067 # Constant c_int +UIA_GridItemRowSpanPropertyId = 30066 # Constant c_int +UIA_LegacyIAccessibleDefaultActionPropertyId = 30100 # Constant c_int +UIA_WindowIsModalPropertyId = 30077 # Constant c_int +UIA_DockDockPositionPropertyId = 30069 # Constant c_int +UIA_WindowCanMinimizePropertyId = 30074 # Constant c_int +UIA_WindowCanMaximizePropertyId = 30073 # Constant c_int +UIA_GridItemContainingGridPropertyId = 30068 # Constant c_int +UIA_LegacyIAccessibleKeyboardShortcutPropertyId = 30098 # Constant c_int +UIA_WindowWindowInteractionStatePropertyId = 30076 # Constant c_int +UIA_StylesExtendedPropertiesPropertyId = 30126 # Constant c_int +UIA_LegacyIAccessibleRolePropertyId = 30095 # Constant c_int +UIA_MultipleViewCurrentViewPropertyId = 30071 # Constant c_int +UIA_IsVirtualizedItemPatternAvailablePropertyId = 30109 # Constant c_int +class IAccessible(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IDispatch): + _case_insensitive_ = True + _iid_ = GUID('{618736E0-3C3D-11CF-810C-00AA00389B71}') + _idlflags_ = ['dual', 'oleautomation', 'hidden'] +IAccessible._methods_ = [ + COMMETHOD([dispid(-5000), 'hidden', 'propget'], HRESULT, 'accParent', + ( ['retval', 'out'], POINTER(POINTER(IDispatch)), 'ppdispParent' )), + COMMETHOD([dispid(-5001), 'hidden', 'propget'], HRESULT, 'accChildCount', + ( ['retval', 'out'], POINTER(c_int), 'pcountChildren' )), + COMMETHOD([dispid(-5002), 'hidden', 'propget'], HRESULT, 'accChild', + ( ['in'], VARIANT, 'varChild' ), + ( ['retval', 'out'], POINTER(POINTER(IDispatch)), 'ppdispChild' )), + COMMETHOD([dispid(-5003), 'hidden', 'propget'], HRESULT, 'accName', + ( ['in', 'optional'], VARIANT, 'varChild' ), + ( ['retval', 'out'], POINTER(BSTR), 'pszName' )), + COMMETHOD([dispid(-5004), 'hidden', 'propget'], HRESULT, 'accValue', + ( ['in', 'optional'], VARIANT, 'varChild' ), + ( ['retval', 'out'], POINTER(BSTR), 'pszValue' )), + COMMETHOD([dispid(-5005), 'hidden', 'propget'], HRESULT, 'accDescription', + ( ['in', 'optional'], VARIANT, 'varChild' ), + ( ['retval', 'out'], POINTER(BSTR), 'pszDescription' )), + COMMETHOD([dispid(-5006), 'hidden', 'propget'], HRESULT, 'accRole', + ( ['in', 'optional'], VARIANT, 'varChild' ), + ( ['retval', 'out'], POINTER(VARIANT), 'pvarRole' )), + COMMETHOD([dispid(-5007), 'hidden', 'propget'], HRESULT, 'accState', + ( ['in', 'optional'], VARIANT, 'varChild' ), + ( ['retval', 'out'], POINTER(VARIANT), 'pvarState' )), + COMMETHOD([dispid(-5008), 'hidden', 'propget'], HRESULT, 'accHelp', + ( ['in', 'optional'], VARIANT, 'varChild' ), + ( ['retval', 'out'], POINTER(BSTR), 'pszHelp' )), + COMMETHOD([dispid(-5009), 'hidden', 'propget'], HRESULT, 'accHelpTopic', + ( ['out'], POINTER(BSTR), 'pszHelpFile' ), + ( ['in', 'optional'], VARIANT, 'varChild' ), + ( ['retval', 'out'], POINTER(c_int), 'pidTopic' )), + COMMETHOD([dispid(-5010), 'hidden', 'propget'], HRESULT, 'accKeyboardShortcut', + ( ['in', 'optional'], VARIANT, 'varChild' ), + ( ['retval', 'out'], POINTER(BSTR), 'pszKeyboardShortcut' )), + COMMETHOD([dispid(-5011), 'hidden', 'propget'], HRESULT, 'accFocus', + ( ['retval', 'out'], POINTER(VARIANT), 'pvarChild' )), + COMMETHOD([dispid(-5012), 'hidden', 'propget'], HRESULT, 'accSelection', + ( ['retval', 'out'], POINTER(VARIANT), 'pvarChildren' )), + COMMETHOD([dispid(-5013), 'hidden', 'propget'], HRESULT, 'accDefaultAction', + ( ['in', 'optional'], VARIANT, 'varChild' ), + ( ['retval', 'out'], POINTER(BSTR), 'pszDefaultAction' )), + COMMETHOD([dispid(-5014), 'hidden'], HRESULT, 'accSelect', + ( ['in'], c_int, 'flagsSelect' ), + ( ['in', 'optional'], VARIANT, 'varChild' )), + COMMETHOD([dispid(-5015), 'hidden'], HRESULT, 'accLocation', + ( ['out'], POINTER(c_int), 'pxLeft' ), + ( ['out'], POINTER(c_int), 'pyTop' ), + ( ['out'], POINTER(c_int), 'pcxWidth' ), + ( ['out'], POINTER(c_int), 'pcyHeight' ), + ( ['in', 'optional'], VARIANT, 'varChild' )), + COMMETHOD([dispid(-5016), 'hidden'], HRESULT, 'accNavigate', + ( ['in'], c_int, 'navDir' ), + ( ['in', 'optional'], VARIANT, 'varStart' ), + ( ['retval', 'out'], POINTER(VARIANT), 'pvarEndUpAt' )), + COMMETHOD([dispid(-5017), 'hidden'], HRESULT, 'accHitTest', + ( ['in'], c_int, 'xLeft' ), + ( ['in'], c_int, 'yTop' ), + ( ['retval', 'out'], POINTER(VARIANT), 'pvarChild' )), + COMMETHOD([dispid(-5018), 'hidden'], HRESULT, 'accDoDefaultAction', + ( ['in', 'optional'], VARIANT, 'varChild' )), + COMMETHOD([dispid(-5003), 'hidden', 'propput'], HRESULT, 'accName', + ( ['in', 'optional'], VARIANT, 'varChild' ), + ( ['in'], BSTR, 'pszName' )), + COMMETHOD([dispid(-5004), 'hidden', 'propput'], HRESULT, 'accValue', + ( ['in', 'optional'], VARIANT, 'varChild' ), + ( ['in'], BSTR, 'pszValue' )), +] +################################################################ +## code template for IAccessible implementation +##class IAccessible_Impl(object): +## @property +## def accRole(self, varChild): +## '-no docstring-' +## #return pvarRole +## +## @property +## def accDescription(self, varChild): +## '-no docstring-' +## #return pszDescription +## +## def accLocation(self, varChild): +## '-no docstring-' +## #return pxLeft, pyTop, pcxWidth, pcyHeight +## +## @property +## def accState(self, varChild): +## '-no docstring-' +## #return pvarState +## +## def accNavigate(self, navDir, varStart): +## '-no docstring-' +## #return pvarEndUpAt +## +## def accDoDefaultAction(self, varChild): +## '-no docstring-' +## #return +## +## @property +## def accChild(self, varChild): +## '-no docstring-' +## #return ppdispChild +## +## @property +## def accChildCount(self): +## '-no docstring-' +## #return pcountChildren +## +## @property +## def accHelp(self, varChild): +## '-no docstring-' +## #return pszHelp +## +## def _get(self, varChild): +## '-no docstring-' +## #return pszName +## def _set(self, varChild, pszName): +## '-no docstring-' +## accName = property(_get, _set, doc = _set.__doc__) +## +## def accSelect(self, flagsSelect, varChild): ## '-no docstring-' ## #return ## +## @property +## def accKeyboardShortcut(self, varChild): +## '-no docstring-' +## #return pszKeyboardShortcut +## +## def accHitTest(self, xLeft, yTop): +## '-no docstring-' +## #return pvarChild +## +## @property +## def accSelection(self): +## '-no docstring-' +## #return pvarChildren +## +## @property +## def accDefaultAction(self, varChild): +## '-no docstring-' +## #return pszDefaultAction +## +## @property +## def accParent(self): +## '-no docstring-' +## #return ppdispParent +## +## @property +## def accHelpTopic(self, varChild): +## '-no docstring-' +## #return pszHelpFile, pidTopic +## +## def _get(self, varChild): +## '-no docstring-' +## #return pszValue +## def _set(self, varChild, pszValue): +## '-no docstring-' +## accValue = property(_get, _set, doc = _set.__doc__) +## +## @property +## def accFocus(self): +## '-no docstring-' +## #return pvarChild +## +UIA_SelectionItemIsSelectedPropertyId = 30079 # Constant c_int +UIA_ExpandCollapseExpandCollapseStatePropertyId = 30070 # Constant c_int +UIA_TransformCanRotatePropertyId = 30089 # Constant c_int +UIA_LegacyIAccessibleDescriptionPropertyId = 30094 # Constant c_int +UIA_TableItemRowHeaderItemsPropertyId = 30084 # Constant c_int +UIA_SelectionItemSelectionContainerPropertyId = 30080 # Constant c_int +UIA_TableRowHeadersPropertyId = 30081 # Constant c_int class IUIAutomationChangesEventHandler(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True _iid_ = GUID('{58EDCA55-2C3E-4980-B1B9-56C17F27A2A0}') _idlflags_ = ['oleautomation'] -IUIAutomation4._methods_ = [ - COMMETHOD([], HRESULT, 'AddChangesEventHandler', - ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['in'], TreeScope, 'scope' ), - ( ['in'], POINTER(c_int), 'changeTypes' ), - ( ['in'], c_int, 'changesCount' ), - ( ['in'], POINTER(IUIAutomationCacheRequest), 'pCacheRequest' ), - ( ['in'], POINTER(IUIAutomationChangesEventHandler), 'handler' )), - COMMETHOD([], HRESULT, 'RemoveChangesEventHandler', - ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['in'], POINTER(IUIAutomationChangesEventHandler), 'handler' )), +IUIAutomationChangesEventHandler._methods_ = [ + COMMETHOD([], HRESULT, 'HandleChangesEvent', + ( ['in'], POINTER(IUIAutomationElement), 'sender' ), + ( ['in'], POINTER(UiaChangeInfo), 'uiaChanges' ), + ( ['in'], c_int, 'changesCount' )), ] ################################################################ -## code template for IUIAutomation4 implementation -##class IUIAutomation4_Impl(object): -## def RemoveChangesEventHandler(self, element, handler): -## '-no docstring-' -## #return -## -## def AddChangesEventHandler(self, element, scope, changeTypes, changesCount, pCacheRequest, handler): +## code template for IUIAutomationChangesEventHandler implementation +##class IUIAutomationChangesEventHandler_Impl(object): +## def HandleChangesEvent(self, sender, uiaChanges, changesCount): ## '-no docstring-' ## #return ## -UIA_IsContentElementPropertyId = 30017 # Constant c_int -UIA_LabeledByPropertyId = 30018 # Constant c_int -UIA_IsControlElementPropertyId = 30016 # Constant c_int -UIA_NativeWindowHandlePropertyId = 30020 # Constant c_int -class CUIAutomation(CoClass): - u'The Central Class for UIAutomation' - _reg_clsid_ = GUID('{FF48DBA4-60EF-4201-AA87-54103EEF594E}') - _idlflags_ = [] - _typelib_path_ = typelib_path - _reg_typelib_ = ('{944DE083-8FB8-45CF-BCB7-C477ACB2F897}', 1, 0) -CUIAutomation._com_interfaces_ = [IUIAutomation] - - -# values for enumeration 'WindowVisualState' -WindowVisualState_Normal = 0 -WindowVisualState_Maximized = 1 -WindowVisualState_Minimized = 2 -WindowVisualState = c_int # enum - -# values for enumeration 'OrientationType' -OrientationType_None = 0 -OrientationType_Horizontal = 1 -OrientationType_Vertical = 2 -OrientationType = c_int # enum +UIA_TableColumnHeadersPropertyId = 30082 # Constant c_int +UIA_TableRowOrColumnMajorPropertyId = 30083 # Constant c_int +UIA_AnnotationDateTimePropertyId = 30116 # Constant c_int class IUIAutomationElement2(IUIAutomationElement): _case_insensitive_ = True _iid_ = GUID('{6749C683-F70D-4487-A698-5F79D55290D6}') _idlflags_ = [] -class IUIAutomationElementArray(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +class IUIAutomationElement3(IUIAutomationElement2): _case_insensitive_ = True - _iid_ = GUID('{14314595-B4BC-4055-95F2-58F2E42C9855}') + _iid_ = GUID('{8471DF34-AEE0-4A01-A7DE-7DB9AF12C296}') _idlflags_ = [] + +# values for enumeration 'TreeScope' +TreeScope_None = 0 +TreeScope_Element = 1 +TreeScope_Children = 2 +TreeScope_Descendants = 4 +TreeScope_Parent = 8 +TreeScope_Ancestors = 16 +TreeScope_Subtree = 7 +TreeScope = c_int # enum + +# values for enumeration 'OrientationType' +OrientationType_None = 0 +OrientationType_Horizontal = 1 +OrientationType_Vertical = 2 +OrientationType = c_int # enum IUIAutomationElement._methods_ = [ COMMETHOD([], HRESULT, 'SetFocus'), COMMETHOD([], HRESULT, 'GetRuntimeId', @@ -1309,57 +1333,6 @@ class IUIAutomationElementArray(comtypes.gen._00020430_0000_0000_C000_0000000000 ## #return retVal ## -UIA_SelectionSelectionPropertyId = 30059 # Constant c_int -UIA_IsKeyboardFocusablePropertyId = 30009 # Constant c_int -UIA_HasKeyboardFocusPropertyId = 30008 # Constant c_int -UIA_ProcessIdPropertyId = 30002 # Constant c_int -UIA_BoundingRectanglePropertyId = 30001 # Constant c_int -UIA_Selection_InvalidatedEventId = 20013 # Constant c_int -UIA_SelectionItem_ElementAddedToSelectionEventId = 20010 # Constant c_int -UIA_ChangesEventId = 20034 # Constant c_int -UIA_ControlTypePropertyId = 30003 # Constant c_int -UIA_NamePropertyId = 30005 # Constant c_int -UIA_LocalizedControlTypePropertyId = 30004 # Constant c_int -UIA_AccessKeyPropertyId = 30007 # Constant c_int -UIA_AutomationPropertyChangedEventId = 20004 # Constant c_int -UIA_RuntimeIdPropertyId = 30000 # Constant c_int -UIA_MultipleViewCurrentViewPropertyId = 30071 # Constant c_int -UIA_DropTarget_DragEnterEventId = 20029 # Constant c_int -UIA_TextEdit_ConversionTargetChangedEventId = 20033 # Constant c_int -UIA_AcceleratorKeyPropertyId = 30006 # Constant c_int -UIA_MenuModeStartEventId = 20018 # Constant c_int -UIA_SelectionItem_ElementRemovedFromSelectionEventId = 20011 # Constant c_int -UIA_SummaryChangeId = 90000 # Constant c_int -UIA_InputReachedTargetEventId = 20020 # Constant c_int -UIA_SystemAlertEventId = 20023 # Constant c_int -UIA_Window_WindowOpenedEventId = 20016 # Constant c_int -UIA_InputDiscardedEventId = 20022 # Constant c_int -UIA_Text_TextChangedEventId = 20015 # Constant c_int -UIA_Invoke_InvokedEventId = 20009 # Constant c_int -UIA_MenuOpenedEventId = 20003 # Constant c_int -UIA_MenuClosedEventId = 20007 # Constant c_int -UIA_SelectionItemPatternId = 10010 # Constant c_int -UIA_Window_WindowClosedEventId = 20017 # Constant c_int -class IUIAutomationElement3(IUIAutomationElement2): - _case_insensitive_ = True - _iid_ = GUID('{8471DF34-AEE0-4A01-A7DE-7DB9AF12C296}') - _idlflags_ = [] -class IUIAutomationElement4(IUIAutomationElement3): - _case_insensitive_ = True - _iid_ = GUID('{3B6E233C-52FB-4063-A4C9-77C075C2A06B}') - _idlflags_ = [] -class IUIAutomationElement5(IUIAutomationElement4): - _case_insensitive_ = True - _iid_ = GUID('{98141C1D-0D0E-4175-BBE2-6BFF455842A7}') - _idlflags_ = [] -class IUIAutomationElement6(IUIAutomationElement5): - _case_insensitive_ = True - _iid_ = GUID('{4780D450-8BCA-4977-AFA5-A4A517F555E3}') - _idlflags_ = [] -class IUIAutomationElement7(IUIAutomationElement6): - _case_insensitive_ = True - _iid_ = GUID('{204E8572-CFC3-4C11-B0C8-7DA7420750B7}') - _idlflags_ = [] IUIAutomationElement3._methods_ = [ COMMETHOD([], HRESULT, 'ShowContextMenu'), COMMETHOD(['propget'], HRESULT, 'CurrentIsPeripheral', @@ -1385,209 +1358,187 @@ class IUIAutomationElement7(IUIAutomationElement6): ## #return ## -IUIAutomationElement4._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'CurrentPositionInSet', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentSizeOfSet', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentLevel', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentAnnotationTypes', - ( ['retval', 'out'], POINTER(_midlSAFEARRAY(c_int)), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentAnnotationObjects', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedPositionInSet', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedSizeOfSet', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedLevel', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedAnnotationTypes', - ( ['retval', 'out'], POINTER(_midlSAFEARRAY(c_int)), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedAnnotationObjects', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), +UIA_AnnotationAnnotationTypeNamePropertyId = 30114 # Constant c_int +UIA_DragGrabbedItemsPropertyId = 30144 # Constant c_int +UIA_LegacyIAccessibleNamePropertyId = 30092 # Constant c_int +UIA_TransformCanMovePropertyId = 30087 # Constant c_int +UIA_LegacyIAccessibleStatePropertyId = 30096 # Constant c_int +UIA_TableItemColumnHeaderItemsPropertyId = 30085 # Constant c_int +UIA_ControllerForPropertyId = 30104 # Constant c_int +UIA_LegacyIAccessibleHelpPropertyId = 30097 # Constant c_int +UIA_LegacyIAccessibleSelectionPropertyId = 30099 # Constant c_int +UIA_AriaPropertiesPropertyId = 30102 # Constant c_int +class IUIAutomationLegacyIAccessiblePattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{828055AD-355B-4435-86D5-3B51C14A9B1B}') + _idlflags_ = [] +IUIAutomationLegacyIAccessiblePattern._methods_ = [ + COMMETHOD([], HRESULT, 'Select', + ( [], c_int, 'flagsSelect' )), + COMMETHOD([], HRESULT, 'DoDefaultAction'), + COMMETHOD([], HRESULT, 'SetValue', + ( [], WSTRING, 'szValue' )), + COMMETHOD(['propget'], HRESULT, 'CurrentChildId', + ( ['retval', 'out'], POINTER(c_int), 'pRetVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentName', + ( ['retval', 'out'], POINTER(BSTR), 'pszName' )), + COMMETHOD(['propget'], HRESULT, 'CurrentValue', + ( ['retval', 'out'], POINTER(BSTR), 'pszValue' )), + COMMETHOD(['propget'], HRESULT, 'CurrentDescription', + ( ['retval', 'out'], POINTER(BSTR), 'pszDescription' )), + COMMETHOD(['propget'], HRESULT, 'CurrentRole', + ( ['retval', 'out'], POINTER(c_ulong), 'pdwRole' )), + COMMETHOD(['propget'], HRESULT, 'CurrentState', + ( ['retval', 'out'], POINTER(c_ulong), 'pdwState' )), + COMMETHOD(['propget'], HRESULT, 'CurrentHelp', + ( ['retval', 'out'], POINTER(BSTR), 'pszHelp' )), + COMMETHOD(['propget'], HRESULT, 'CurrentKeyboardShortcut', + ( ['retval', 'out'], POINTER(BSTR), 'pszKeyboardShortcut' )), + COMMETHOD([], HRESULT, 'GetCurrentSelection', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'pvarSelectedChildren' )), + COMMETHOD(['propget'], HRESULT, 'CurrentDefaultAction', + ( ['retval', 'out'], POINTER(BSTR), 'pszDefaultAction' )), + COMMETHOD(['propget'], HRESULT, 'CachedChildId', + ( ['retval', 'out'], POINTER(c_int), 'pRetVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedName', + ( ['retval', 'out'], POINTER(BSTR), 'pszName' )), + COMMETHOD(['propget'], HRESULT, 'CachedValue', + ( ['retval', 'out'], POINTER(BSTR), 'pszValue' )), + COMMETHOD(['propget'], HRESULT, 'CachedDescription', + ( ['retval', 'out'], POINTER(BSTR), 'pszDescription' )), + COMMETHOD(['propget'], HRESULT, 'CachedRole', + ( ['retval', 'out'], POINTER(c_ulong), 'pdwRole' )), + COMMETHOD(['propget'], HRESULT, 'CachedState', + ( ['retval', 'out'], POINTER(c_ulong), 'pdwState' )), + COMMETHOD(['propget'], HRESULT, 'CachedHelp', + ( ['retval', 'out'], POINTER(BSTR), 'pszHelp' )), + COMMETHOD(['propget'], HRESULT, 'CachedKeyboardShortcut', + ( ['retval', 'out'], POINTER(BSTR), 'pszKeyboardShortcut' )), + COMMETHOD([], HRESULT, 'GetCachedSelection', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'pvarSelectedChildren' )), + COMMETHOD(['propget'], HRESULT, 'CachedDefaultAction', + ( ['retval', 'out'], POINTER(BSTR), 'pszDefaultAction' )), + COMMETHOD([], HRESULT, 'GetIAccessible', + ( ['retval', 'out'], POINTER(POINTER(IAccessible)), 'ppAccessible' )), ] ################################################################ -## code template for IUIAutomationElement4 implementation -##class IUIAutomationElement4_Impl(object): +## code template for IUIAutomationLegacyIAccessiblePattern implementation +##class IUIAutomationLegacyIAccessiblePattern_Impl(object): ## @property -## def CachedPositionInSet(self): +## def CurrentDescription(self): ## '-no docstring-' -## #return retVal +## #return pszDescription ## ## @property -## def CurrentLevel(self): +## def CurrentHelp(self): ## '-no docstring-' -## #return retVal +## #return pszHelp ## ## @property -## def CachedSizeOfSet(self): +## def CachedValue(self): ## '-no docstring-' -## #return retVal +## #return pszValue ## -## @property -## def CurrentSizeOfSet(self): +## def GetCachedSelection(self): ## '-no docstring-' -## #return retVal +## #return pvarSelectedChildren ## ## @property -## def CachedAnnotationObjects(self): +## def CurrentState(self): ## '-no docstring-' -## #return retVal +## #return pdwState ## ## @property -## def CachedLevel(self): +## def CurrentValue(self): ## '-no docstring-' -## #return retVal +## #return pszValue ## ## @property -## def CurrentAnnotationObjects(self): +## def CachedName(self): ## '-no docstring-' -## #return retVal +## #return pszName ## ## @property -## def CurrentPositionInSet(self): +## def CurrentName(self): ## '-no docstring-' -## #return retVal +## #return pszName ## ## @property -## def CachedAnnotationTypes(self): +## def CachedDescription(self): ## '-no docstring-' -## #return retVal +## #return pszDescription ## -## @property -## def CurrentAnnotationTypes(self): +## def GetIAccessible(self): ## '-no docstring-' -## #return retVal +## #return ppAccessible ## - -IUIAutomationElement5._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'CurrentLandmarkType', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentLocalizedLandmarkType', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedLandmarkType', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedLocalizedLandmarkType', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), -] -################################################################ -## code template for IUIAutomationElement5 implementation -##class IUIAutomationElement5_Impl(object): ## @property -## def CachedLandmarkType(self): +## def CachedRole(self): ## '-no docstring-' -## #return retVal +## #return pdwRole ## ## @property -## def CachedLocalizedLandmarkType(self): +## def CurrentChildId(self): ## '-no docstring-' -## #return retVal +## #return pRetVal +## +## def DoDefaultAction(self): +## '-no docstring-' +## #return ## ## @property -## def CurrentLandmarkType(self): +## def CachedChildId(self): ## '-no docstring-' -## #return retVal +## #return pRetVal ## ## @property -## def CurrentLocalizedLandmarkType(self): +## def CachedHelp(self): ## '-no docstring-' -## #return retVal +## #return pszHelp ## - -IUIAutomationElement6._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'CurrentFullDescription', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedFullDescription', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), -] -################################################################ -## code template for IUIAutomationElement6 implementation -##class IUIAutomationElement6_Impl(object): ## @property -## def CachedFullDescription(self): +## def CurrentRole(self): ## '-no docstring-' -## #return retVal +## #return pdwRole +## +## def SetValue(self, szValue): +## '-no docstring-' +## #return +## +## def GetCurrentSelection(self): +## '-no docstring-' +## #return pvarSelectedChildren ## ## @property -## def CurrentFullDescription(self): +## def CachedDefaultAction(self): ## '-no docstring-' -## #return retVal +## #return pszDefaultAction ## - - -# values for enumeration 'TreeTraversalOptions' -TreeTraversalOptions_Default = 0 -TreeTraversalOptions_PostOrder = 1 -TreeTraversalOptions_LastToFirstOrder = 2 -TreeTraversalOptions = c_int # enum -IUIAutomationElement7._methods_ = [ - COMMETHOD([], HRESULT, 'FindFirstWithOptions', - ( ['in'], TreeScope, 'scope' ), - ( ['in'], POINTER(IUIAutomationCondition), 'condition' ), - ( ['in'], TreeTraversalOptions, 'traversalOptions' ), - ( ['in'], POINTER(IUIAutomationElement), 'root' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'found' )), - COMMETHOD([], HRESULT, 'FindAllWithOptions', - ( ['in'], TreeScope, 'scope' ), - ( ['in'], POINTER(IUIAutomationCondition), 'condition' ), - ( ['in'], TreeTraversalOptions, 'traversalOptions' ), - ( ['in'], POINTER(IUIAutomationElement), 'root' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'found' )), - COMMETHOD([], HRESULT, 'FindFirstWithOptionsBuildCache', - ( ['in'], TreeScope, 'scope' ), - ( ['in'], POINTER(IUIAutomationCondition), 'condition' ), - ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['in'], TreeTraversalOptions, 'traversalOptions' ), - ( ['in'], POINTER(IUIAutomationElement), 'root' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'found' )), - COMMETHOD([], HRESULT, 'FindAllWithOptionsBuildCache', - ( ['in'], TreeScope, 'scope' ), - ( ['in'], POINTER(IUIAutomationCondition), 'condition' ), - ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['in'], TreeTraversalOptions, 'traversalOptions' ), - ( ['in'], POINTER(IUIAutomationElement), 'root' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'found' )), - COMMETHOD([], HRESULT, 'GetCurrentMetadataValue', - ( ['in'], c_int, 'targetId' ), - ( ['in'], c_int, 'metadataId' ), - ( ['retval', 'out'], POINTER(VARIANT), 'returnVal' )), -] -################################################################ -## code template for IUIAutomationElement7 implementation -##class IUIAutomationElement7_Impl(object): -## def FindAllWithOptionsBuildCache(self, scope, condition, cacheRequest, traversalOptions, root): +## @property +## def CachedState(self): ## '-no docstring-' -## #return found +## #return pdwState ## -## def GetCurrentMetadataValue(self, targetId, metadataId): +## @property +## def CurrentDefaultAction(self): ## '-no docstring-' -## #return returnVal +## #return pszDefaultAction ## -## def FindFirstWithOptions(self, scope, condition, traversalOptions, root): +## @property +## def CachedKeyboardShortcut(self): ## '-no docstring-' -## #return found +## #return pszKeyboardShortcut ## -## def FindAllWithOptions(self, scope, condition, traversalOptions, root): +## def Select(self, flagsSelect): ## '-no docstring-' -## #return found +## #return ## -## def FindFirstWithOptionsBuildCache(self, scope, condition, cacheRequest, traversalOptions, root): +## @property +## def CurrentKeyboardShortcut(self): ## '-no docstring-' -## #return found +## #return pszKeyboardShortcut ## -UIA_MenuModeEndEventId = 20019 # Constant c_int -UIA_AutomationFocusChangedEventId = 20005 # Constant c_int -UIA_AsyncContentLoadedEventId = 20006 # Constant c_int -UIA_LayoutInvalidatedEventId = 20008 # Constant c_int -UIA_DropTarget_DragLeaveEventId = 20030 # Constant c_int -UIA_LiveRegionChangedEventId = 20024 # Constant c_int -UIA_HostedFragmentRootsInvalidatedEventId = 20025 # Constant c_int -UIA_InputReachedOtherElementEventId = 20021 # Constant c_int -UIA_Drag_DragCompleteEventId = 20028 # Constant c_int -UIA_GridRowCountPropertyId = 30062 # Constant c_int -UIA_StructureChangedEventId = 20002 # Constant c_int # values for enumeration 'ExpandCollapseState' ExpandCollapseState_Collapsed = 0 @@ -1595,1477 +1546,1689 @@ class IUIAutomationElement7(IUIAutomationElement6): ExpandCollapseState_PartiallyExpanded = 2 ExpandCollapseState_LeafNode = 3 ExpandCollapseState = c_int # enum -UIA_CustomNavigationPatternId = 10033 # Constant c_int -UIA_ToolTipClosedEventId = 20001 # Constant c_int -UIA_VirtualizedItemPatternId = 10020 # Constant c_int -UIA_TransformPattern2Id = 10028 # Constant c_int -UIA_DropTarget_DroppedEventId = 20031 # Constant c_int -UIA_SynchronizedInputPatternId = 10021 # Constant c_int -UIA_ObjectModelPatternId = 10022 # Constant c_int -UIA_DropTargetPatternId = 10031 # Constant c_int -UIA_TextChildPatternId = 10029 # Constant c_int -UIA_SpreadsheetItemPatternId = 10027 # Constant c_int -UIA_StylesPatternId = 10025 # Constant c_int -UIA_TextPattern2Id = 10024 # Constant c_int -UIA_AnnotationPatternId = 10023 # Constant c_int -class IUIAutomationTextRange(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +UIA_IsDataValidForFormPropertyId = 30103 # Constant c_int +UIA_FlowsToPropertyId = 30106 # Constant c_int +UIA_DescribedByPropertyId = 30105 # Constant c_int +UIA_ProviderDescriptionPropertyId = 30107 # Constant c_int +UIA_IsObjectModelPatternAvailablePropertyId = 30112 # Constant c_int +UIA_IsSynchronizedInputPatternAvailablePropertyId = 30110 # Constant c_int +UIA_ToggleToggleStatePropertyId = 30086 # Constant c_int +class IUIAutomationElement4(IUIAutomationElement3): _case_insensitive_ = True - _iid_ = GUID('{A543CC6A-F4AE-494B-8239-C814481187A8}') + _iid_ = GUID('{3B6E233C-52FB-4063-A4C9-77C075C2A06B}') _idlflags_ = [] - -# values for enumeration 'TextPatternRangeEndpoint' -TextPatternRangeEndpoint_Start = 0 -TextPatternRangeEndpoint_End = 1 -TextPatternRangeEndpoint = c_int # enum - -# values for enumeration 'TextUnit' -TextUnit_Character = 0 -TextUnit_Format = 1 -TextUnit_Word = 2 -TextUnit_Line = 3 -TextUnit_Paragraph = 4 -TextUnit_Page = 5 -TextUnit_Document = 6 -TextUnit = c_int # enum -IUIAutomationTextRange._methods_ = [ - COMMETHOD([], HRESULT, 'Clone', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTextRange)), 'clonedRange' )), - COMMETHOD([], HRESULT, 'Compare', - ( ['in'], POINTER(IUIAutomationTextRange), 'range' ), - ( ['retval', 'out'], POINTER(c_int), 'areSame' )), - COMMETHOD([], HRESULT, 'CompareEndpoints', - ( ['in'], TextPatternRangeEndpoint, 'srcEndPoint' ), - ( ['in'], POINTER(IUIAutomationTextRange), 'range' ), - ( ['in'], TextPatternRangeEndpoint, 'targetEndPoint' ), - ( ['retval', 'out'], POINTER(c_int), 'compValue' )), - COMMETHOD([], HRESULT, 'ExpandToEnclosingUnit', - ( ['in'], TextUnit, 'TextUnit' )), - COMMETHOD([], HRESULT, 'FindAttribute', - ( ['in'], c_int, 'attr' ), - ( ['in'], VARIANT, 'val' ), - ( ['in'], c_int, 'backward' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTextRange)), 'found' )), - COMMETHOD([], HRESULT, 'FindText', - ( ['in'], BSTR, 'text' ), - ( ['in'], c_int, 'backward' ), - ( ['in'], c_int, 'ignoreCase' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTextRange)), 'found' )), - COMMETHOD([], HRESULT, 'GetAttributeValue', - ( ['in'], c_int, 'attr' ), - ( ['retval', 'out'], POINTER(VARIANT), 'value' )), - COMMETHOD([], HRESULT, 'GetBoundingRectangles', - ( ['retval', 'out'], POINTER(_midlSAFEARRAY(c_double)), 'boundingRects' )), - COMMETHOD([], HRESULT, 'GetEnclosingElement', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'enclosingElement' )), - COMMETHOD([], HRESULT, 'GetText', - ( ['in'], c_int, 'maxLength' ), - ( ['retval', 'out'], POINTER(BSTR), 'text' )), - COMMETHOD([], HRESULT, 'Move', - ( ['in'], TextUnit, 'unit' ), - ( ['in'], c_int, 'count' ), - ( ['retval', 'out'], POINTER(c_int), 'moved' )), - COMMETHOD([], HRESULT, 'MoveEndpointByUnit', - ( ['in'], TextPatternRangeEndpoint, 'endpoint' ), - ( ['in'], TextUnit, 'unit' ), - ( ['in'], c_int, 'count' ), - ( ['retval', 'out'], POINTER(c_int), 'moved' )), - COMMETHOD([], HRESULT, 'MoveEndpointByRange', - ( ['in'], TextPatternRangeEndpoint, 'srcEndPoint' ), - ( ['in'], POINTER(IUIAutomationTextRange), 'range' ), - ( ['in'], TextPatternRangeEndpoint, 'targetEndPoint' )), - COMMETHOD([], HRESULT, 'Select'), - COMMETHOD([], HRESULT, 'AddToSelection'), - COMMETHOD([], HRESULT, 'RemoveFromSelection'), - COMMETHOD([], HRESULT, 'ScrollIntoView', - ( ['in'], c_int, 'alignToTop' )), - COMMETHOD([], HRESULT, 'GetChildren', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'children' )), +IUIAutomationElement4._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'CurrentPositionInSet', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentSizeOfSet', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentLevel', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentAnnotationTypes', + ( ['retval', 'out'], POINTER(_midlSAFEARRAY(c_int)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentAnnotationObjects', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedPositionInSet', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedSizeOfSet', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedLevel', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedAnnotationTypes', + ( ['retval', 'out'], POINTER(_midlSAFEARRAY(c_int)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedAnnotationObjects', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), ] ################################################################ -## code template for IUIAutomationTextRange implementation -##class IUIAutomationTextRange_Impl(object): -## def CompareEndpoints(self, srcEndPoint, range, targetEndPoint): -## '-no docstring-' -## #return compValue -## -## def Compare(self, range): -## '-no docstring-' -## #return areSame -## -## def MoveEndpointByUnit(self, endpoint, unit, count): -## '-no docstring-' -## #return moved -## -## def ScrollIntoView(self, alignToTop): +## code template for IUIAutomationElement4 implementation +##class IUIAutomationElement4_Impl(object): +## @property +## def CachedPositionInSet(self): ## '-no docstring-' -## #return +## #return retVal ## -## def AddToSelection(self): +## @property +## def CurrentLevel(self): ## '-no docstring-' -## #return +## #return retVal ## -## def FindAttribute(self, attr, val, backward): +## @property +## def CachedSizeOfSet(self): ## '-no docstring-' -## #return found +## #return retVal ## -## def GetEnclosingElement(self): +## @property +## def CurrentSizeOfSet(self): ## '-no docstring-' -## #return enclosingElement +## #return retVal ## -## def ExpandToEnclosingUnit(self, TextUnit): +## @property +## def CachedAnnotationObjects(self): ## '-no docstring-' -## #return +## #return retVal ## -## def Clone(self): +## @property +## def CachedLevel(self): ## '-no docstring-' -## #return clonedRange +## #return retVal ## -## def Move(self, unit, count): +## @property +## def CurrentAnnotationObjects(self): ## '-no docstring-' -## #return moved +## #return retVal ## -## def FindText(self, text, backward, ignoreCase): +## @property +## def CurrentPositionInSet(self): ## '-no docstring-' -## #return found +## #return retVal ## -## def GetText(self, maxLength): +## @property +## def CachedAnnotationTypes(self): ## '-no docstring-' -## #return text +## #return retVal ## -## def RemoveFromSelection(self): +## @property +## def CurrentAnnotationTypes(self): ## '-no docstring-' -## #return +## #return retVal ## -## def GetChildren(self): -## '-no docstring-' -## #return children -## -## def GetAttributeValue(self, attr): -## '-no docstring-' -## #return value -## -## def MoveEndpointByRange(self, srcEndPoint, range, targetEndPoint): + +class IUIAutomationStructureChangedEventHandler(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{E81D1B4E-11C5-42F8-9754-E7036C79F054}') + _idlflags_ = ['oleautomation'] + +# values for enumeration 'StructureChangeType' +StructureChangeType_ChildAdded = 0 +StructureChangeType_ChildRemoved = 1 +StructureChangeType_ChildrenInvalidated = 2 +StructureChangeType_ChildrenBulkAdded = 3 +StructureChangeType_ChildrenBulkRemoved = 4 +StructureChangeType_ChildrenReordered = 5 +StructureChangeType = c_int # enum +IUIAutomationStructureChangedEventHandler._methods_ = [ + COMMETHOD([], HRESULT, 'HandleStructureChangedEvent', + ( ['in'], POINTER(IUIAutomationElement), 'sender' ), + ( ['in'], StructureChangeType, 'changeType' ), + ( ['in'], _midlSAFEARRAY(c_int), 'runtimeId' )), +] +################################################################ +## code template for IUIAutomationStructureChangedEventHandler implementation +##class IUIAutomationStructureChangedEventHandler_Impl(object): +## def HandleStructureChangedEvent(self, sender, changeType, runtimeId): ## '-no docstring-' ## #return ## -## def Select(self): + +UIA_OptimizeForVisualContentPropertyId = 30111 # Constant c_int +class IUIAutomationNotificationEventHandler(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{C7CB2637-E6C2-4D0C-85DE-4948C02175C7}') + _idlflags_ = ['oleautomation'] +IUIAutomationNotificationEventHandler._methods_ = [ + COMMETHOD([], HRESULT, 'HandleNotificationEvent', + ( ['in'], POINTER(IUIAutomationElement), 'sender' ), + ( [], NotificationKind, 'NotificationKind' ), + ( [], NotificationProcessing, 'NotificationProcessing' ), + ( ['in'], BSTR, 'displayString' ), + ( ['in'], BSTR, 'activityId' )), +] +################################################################ +## code template for IUIAutomationNotificationEventHandler implementation +##class IUIAutomationNotificationEventHandler_Impl(object): +## def HandleNotificationEvent(self, sender, NotificationKind, NotificationProcessing, displayString, activityId): ## '-no docstring-' ## #return ## -## def GetBoundingRectangles(self): -## '-no docstring-' -## #return boundingRects -## -UIA_ItemContainerPatternId = 10019 # Constant c_int -UIA_DragPatternId = 10030 # Constant c_int -UIA_TextEditPatternId = 10032 # Constant c_int -UIA_ScrollItemPatternId = 10017 # Constant c_int -UIA_LegacyIAccessiblePatternId = 10018 # Constant c_int -UIA_ToolTipOpenedEventId = 20000 # Constant c_int -UIA_TextEdit_TextChangedEventId = 20032 # Constant c_int -UIA_IsOffscreenPropertyId = 30022 # Constant c_int -UIA_TransformPatternId = 10016 # Constant c_int -UIA_GridItemColumnPropertyId = 30065 # Constant c_int -UIA_TogglePatternId = 10015 # Constant c_int -UIA_ItemStatusPropertyId = 30026 # Constant c_int -UIA_WindowPatternId = 10009 # Constant c_int -UIA_TextPatternId = 10014 # Constant c_int -UIA_TableItemPatternId = 10013 # Constant c_int -UIA_InvokePatternId = 10000 # Constant c_int -UIA_OrientationPropertyId = 30023 # Constant c_int -UIA_IsRequiredForFormPropertyId = 30025 # Constant c_int -UIA_DockPatternId = 10011 # Constant c_int -UIA_IsDockPatternAvailablePropertyId = 30027 # Constant c_int -UIA_FrameworkIdPropertyId = 30024 # Constant c_int -class IUIAutomationValuePattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +class IUIAutomationAndCondition(IUIAutomationCondition): _case_insensitive_ = True - _iid_ = GUID('{A94CD8B1-0844-4CD6-9D2D-640537AB39E9}') + _iid_ = GUID('{A7D0AF36-B912-45FE-9855-091DDC174AEC}') _idlflags_ = [] -IUIAutomationValuePattern._methods_ = [ - COMMETHOD([], HRESULT, 'SetValue', - ( ['in'], BSTR, 'val' )), - COMMETHOD(['propget'], HRESULT, 'CurrentValue', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentIsReadOnly', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedValue', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedIsReadOnly', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), +IUIAutomationCondition._methods_ = [ ] ################################################################ -## code template for IUIAutomationValuePattern implementation -##class IUIAutomationValuePattern_Impl(object): -## @property -## def CachedIsReadOnly(self): -## '-no docstring-' -## #return retVal -## -## @property -## def CurrentValue(self): -## '-no docstring-' -## #return retVal -## -## def SetValue(self, val): +## code template for IUIAutomationCondition implementation +##class IUIAutomationCondition_Impl(object): + +IUIAutomationAndCondition._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'ChildCount', + ( ['retval', 'out'], POINTER(c_int), 'ChildCount' )), + COMMETHOD([], HRESULT, 'GetChildrenAsNativeArray', + ( ['out'], POINTER(POINTER(POINTER(IUIAutomationCondition))), 'childArray' ), + ( ['out'], POINTER(c_int), 'childArrayCount' )), + COMMETHOD([], HRESULT, 'GetChildren', + ( ['retval', 'out'], POINTER(_midlSAFEARRAY(POINTER(IUIAutomationCondition))), 'childArray' )), +] +################################################################ +## code template for IUIAutomationAndCondition implementation +##class IUIAutomationAndCondition_Impl(object): +## def GetChildren(self): ## '-no docstring-' -## #return +## #return childArray ## -## @property -## def CurrentIsReadOnly(self): +## def GetChildrenAsNativeArray(self): ## '-no docstring-' -## #return retVal +## #return childArray, childArrayCount ## ## @property -## def CachedValue(self): +## def ChildCount(self): ## '-no docstring-' -## #return retVal +## #return ChildCount ## -class IUIAutomationSelectionPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +UIA_AnnotationAuthorPropertyId = 30115 # Constant c_int + +# values for enumeration 'PropertyConditionFlags' +PropertyConditionFlags_None = 0 +PropertyConditionFlags_IgnoreCase = 1 +PropertyConditionFlags = c_int # enum +UIA_IsCustomNavigationPatternAvailablePropertyId = 30151 # Constant c_int +class IUIAutomationElement5(IUIAutomationElement4): _case_insensitive_ = True - _iid_ = GUID('{5ED5202E-B2AC-47A6-B638-4B0BF140D78E}') + _iid_ = GUID('{98141C1D-0D0E-4175-BBE2-6BFF455842A7}') _idlflags_ = [] -IUIAutomationSelectionPattern._methods_ = [ - COMMETHOD([], HRESULT, 'GetCurrentSelection', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentCanSelectMultiple', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentIsSelectionRequired', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD([], HRESULT, 'GetCachedSelection', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedCanSelectMultiple', +IUIAutomationElement5._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'CurrentLandmarkType', ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedIsSelectionRequired', + COMMETHOD(['propget'], HRESULT, 'CurrentLocalizedLandmarkType', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedLandmarkType', ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedLocalizedLandmarkType', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), ] ################################################################ -## code template for IUIAutomationSelectionPattern implementation -##class IUIAutomationSelectionPattern_Impl(object): -## def GetCurrentSelection(self): -## '-no docstring-' -## #return retVal -## +## code template for IUIAutomationElement5 implementation +##class IUIAutomationElement5_Impl(object): ## @property -## def CurrentIsSelectionRequired(self): +## def CachedLandmarkType(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CachedIsSelectionRequired(self): -## '-no docstring-' -## #return retVal -## -## def GetCachedSelection(self): +## def CachedLocalizedLandmarkType(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CachedCanSelectMultiple(self): +## def CurrentLandmarkType(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CurrentCanSelectMultiple(self): +## def CurrentLocalizedLandmarkType(self): ## '-no docstring-' ## #return retVal ## -class IUIAutomationAnnotationPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +class IUIAutomationProxyFactoryMapping(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{9A175B21-339E-41B1-8E8B-623F6B681098}') + _iid_ = GUID('{09E31E18-872D-4873-93D1-1E541EC133FD}') _idlflags_ = [] -IUIAutomationAnnotationPattern._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'CurrentAnnotationTypeId', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentAnnotationTypeName', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentAuthor', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentDateTime', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentTarget', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedAnnotationTypeId', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedAnnotationTypeName', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedAuthor', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedDateTime', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedTarget', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'retVal' )), +class IUIAutomationProxyFactoryEntry(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{D50E472E-B64B-490C-BCA1-D30696F9F289}') + _idlflags_ = [] +IUIAutomationProxyFactoryMapping._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'count', + ( ['retval', 'out'], POINTER(c_uint), 'count' )), + COMMETHOD([], HRESULT, 'GetTable', + ( ['retval', 'out'], POINTER(_midlSAFEARRAY(POINTER(IUIAutomationProxyFactoryEntry))), 'table' )), + COMMETHOD([], HRESULT, 'GetEntry', + ( ['in'], c_uint, 'index' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationProxyFactoryEntry)), 'entry' )), + COMMETHOD([], HRESULT, 'SetTable', + ( ['in'], _midlSAFEARRAY(POINTER(IUIAutomationProxyFactoryEntry)), 'factoryList' )), + COMMETHOD([], HRESULT, 'InsertEntries', + ( ['in'], c_uint, 'before' ), + ( ['in'], _midlSAFEARRAY(POINTER(IUIAutomationProxyFactoryEntry)), 'factoryList' )), + COMMETHOD([], HRESULT, 'InsertEntry', + ( ['in'], c_uint, 'before' ), + ( ['in'], POINTER(IUIAutomationProxyFactoryEntry), 'factory' )), + COMMETHOD([], HRESULT, 'RemoveEntry', + ( ['in'], c_uint, 'index' )), + COMMETHOD([], HRESULT, 'ClearTable'), + COMMETHOD([], HRESULT, 'RestoreDefaultTable'), ] ################################################################ -## code template for IUIAutomationAnnotationPattern implementation -##class IUIAutomationAnnotationPattern_Impl(object): +## code template for IUIAutomationProxyFactoryMapping implementation +##class IUIAutomationProxyFactoryMapping_Impl(object): ## @property -## def CachedTarget(self): +## def count(self): ## '-no docstring-' -## #return retVal +## #return count ## -## @property -## def CachedAuthor(self): +## def ClearTable(self): ## '-no docstring-' -## #return retVal +## #return ## -## @property -## def CachedAnnotationTypeId(self): +## def GetEntry(self, index): ## '-no docstring-' -## #return retVal +## #return entry ## -## @property -## def CurrentAnnotationTypeName(self): +## def InsertEntries(self, before, factoryList): ## '-no docstring-' -## #return retVal +## #return ## -## @property -## def CurrentAuthor(self): +## def RestoreDefaultTable(self): ## '-no docstring-' -## #return retVal +## #return ## -## @property -## def CachedAnnotationTypeName(self): +## def SetTable(self, factoryList): ## '-no docstring-' -## #return retVal +## #return ## -## @property -## def CachedDateTime(self): +## def GetTable(self): ## '-no docstring-' -## #return retVal +## #return table ## -## @property -## def CurrentTarget(self): +## def InsertEntry(self, before, factory): ## '-no docstring-' -## #return retVal +## #return ## -## @property -## def CurrentAnnotationTypeId(self): +## def RemoveEntry(self, index): ## '-no docstring-' -## #return retVal +## #return +## + +UIA_IsTextPattern2AvailablePropertyId = 30119 # Constant c_int +class IUIAutomationOrCondition(IUIAutomationCondition): + _case_insensitive_ = True + _iid_ = GUID('{8753F032-3DB1-47B5-A1FC-6E34A266C712}') + _idlflags_ = [] +IUIAutomationOrCondition._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'ChildCount', + ( ['retval', 'out'], POINTER(c_int), 'ChildCount' )), + COMMETHOD([], HRESULT, 'GetChildrenAsNativeArray', + ( ['out'], POINTER(POINTER(POINTER(IUIAutomationCondition))), 'childArray' ), + ( ['out'], POINTER(c_int), 'childArrayCount' )), + COMMETHOD([], HRESULT, 'GetChildren', + ( ['retval', 'out'], POINTER(_midlSAFEARRAY(POINTER(IUIAutomationCondition))), 'childArray' )), +] +################################################################ +## code template for IUIAutomationOrCondition implementation +##class IUIAutomationOrCondition_Impl(object): +## def GetChildren(self): +## '-no docstring-' +## #return childArray +## +## def GetChildrenAsNativeArray(self): +## '-no docstring-' +## #return childArray, childArrayCount ## ## @property -## def CurrentDateTime(self): +## def ChildCount(self): ## '-no docstring-' -## #return retVal +## #return ChildCount ## -class IUIAutomationScrollItemPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +UIA_IsAnnotationPatternAvailablePropertyId = 30118 # Constant c_int +UIA_AnnotationAnnotationTypeIdPropertyId = 30113 # Constant c_int +UIA_StylesStyleIdPropertyId = 30120 # Constant c_int +class IUIAutomationEventHandler(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{B488300F-D015-4F19-9C29-BB595E3645EF}') - _idlflags_ = [] -IUIAutomationScrollItemPattern._methods_ = [ - COMMETHOD([], HRESULT, 'ScrollIntoView'), + _iid_ = GUID('{146C3C17-F12E-4E22-8C27-F894B9B79C69}') + _idlflags_ = ['oleautomation'] +IUIAutomationEventHandler._methods_ = [ + COMMETHOD([], HRESULT, 'HandleAutomationEvent', + ( ['in'], POINTER(IUIAutomationElement), 'sender' ), + ( ['in'], c_int, 'eventId' )), ] ################################################################ -## code template for IUIAutomationScrollItemPattern implementation -##class IUIAutomationScrollItemPattern_Impl(object): -## def ScrollIntoView(self): +## code template for IUIAutomationEventHandler implementation +##class IUIAutomationEventHandler_Impl(object): +## def HandleAutomationEvent(self, sender, eventId): ## '-no docstring-' ## #return ## -UIA_HyperlinkControlTypeId = 50005 # Constant c_int -UIA_ItemTypePropertyId = 30021 # Constant c_int - -# values for enumeration 'NavigateDirection' -NavigateDirection_Parent = 0 -NavigateDirection_NextSibling = 1 -NavigateDirection_PreviousSibling = 2 -NavigateDirection_FirstChild = 3 -NavigateDirection_LastChild = 4 -NavigateDirection = c_int # enum -UIA_MenuBarControlTypeId = 50010 # Constant c_int -UIA_ForegroundColorAttributeId = 40008 # Constant c_int -class ExtendedProperty(Structure): - pass -ExtendedProperty._fields_ = [ - ('PropertyName', BSTR), - ('PropertyValue', BSTR), -] -assert sizeof(ExtendedProperty) == 8, sizeof(ExtendedProperty) -assert alignment(ExtendedProperty) == 4, alignment(ExtendedProperty) - -# values for enumeration 'ScrollAmount' -ScrollAmount_LargeDecrement = 0 -ScrollAmount_SmallDecrement = 1 -ScrollAmount_NoAmount = 2 -ScrollAmount_LargeIncrement = 3 -ScrollAmount_SmallIncrement = 4 -ScrollAmount = c_int # enum -UIA_IsScrollPatternAvailablePropertyId = 30034 # Constant c_int -class IUIAutomationTextChildPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +UIA_AnnotationTargetPropertyId = 30117 # Constant c_int +UIA_StylesStyleNamePropertyId = 30121 # Constant c_int +UIA_StylesFillPatternStylePropertyId = 30123 # Constant c_int +UIA_StylesShapePropertyId = 30124 # Constant c_int +StyleId_Normal = 70012 # Constant c_int +UIA_CustomLandmarkTypeId = 80000 # Constant c_int +StyleId_Quote = 70014 # Constant c_int +StyleId_Title = 70010 # Constant c_int +AnnotationType_UnsyncedChange = 60015 # Constant c_int +AnnotationType_EditingLockedChange = 60016 # Constant c_int +AnnotationType_ExternalChange = 60017 # Constant c_int +AnnotationType_ConflictingChange = 60018 # Constant c_int +AnnotationType_Author = 60019 # Constant c_int +AnnotationType_AdvancedProofingIssue = 60020 # Constant c_int +AnnotationType_DataValidationError = 60021 # Constant c_int +AnnotationType_CircularReferenceError = 60022 # Constant c_int +AnnotationType_Mathematics = 60023 # Constant c_int +StyleId_Custom = 70000 # Constant c_int +class IUIAutomationProxyFactory(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{6552B038-AE05-40C8-ABFD-AA08352AAB86}') + _iid_ = GUID('{85B94ECD-849D-42B6-B94D-D6DB23FDF5A4}') _idlflags_ = [] -IUIAutomationTextChildPattern._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'TextContainer', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'container' )), - COMMETHOD(['propget'], HRESULT, 'TextRange', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTextRange)), 'range' )), +IUIAutomationProxyFactoryEntry._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'ProxyFactory', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationProxyFactory)), 'factory' )), + COMMETHOD(['propget'], HRESULT, 'ClassName', + ( ['retval', 'out'], POINTER(BSTR), 'ClassName' )), + COMMETHOD(['propget'], HRESULT, 'ImageName', + ( ['retval', 'out'], POINTER(BSTR), 'ImageName' )), + COMMETHOD(['propget'], HRESULT, 'AllowSubstringMatch', + ( ['retval', 'out'], POINTER(c_int), 'AllowSubstringMatch' )), + COMMETHOD(['propget'], HRESULT, 'CanCheckBaseClass', + ( ['retval', 'out'], POINTER(c_int), 'CanCheckBaseClass' )), + COMMETHOD(['propget'], HRESULT, 'NeedsAdviseEvents', + ( ['retval', 'out'], POINTER(c_int), 'adviseEvents' )), + COMMETHOD(['propput'], HRESULT, 'ClassName', + ( ['in'], WSTRING, 'ClassName' )), + COMMETHOD(['propput'], HRESULT, 'ImageName', + ( ['in'], WSTRING, 'ImageName' )), + COMMETHOD(['propput'], HRESULT, 'AllowSubstringMatch', + ( ['in'], c_int, 'AllowSubstringMatch' )), + COMMETHOD(['propput'], HRESULT, 'CanCheckBaseClass', + ( ['in'], c_int, 'CanCheckBaseClass' )), + COMMETHOD(['propput'], HRESULT, 'NeedsAdviseEvents', + ( ['in'], c_int, 'adviseEvents' )), + COMMETHOD([], HRESULT, 'SetWinEventsForAutomationEvent', + ( ['in'], c_int, 'eventId' ), + ( ['in'], c_int, 'propertyId' ), + ( ['in'], _midlSAFEARRAY(c_uint), 'winEvents' )), + COMMETHOD([], HRESULT, 'GetWinEventsForAutomationEvent', + ( ['in'], c_int, 'eventId' ), + ( ['in'], c_int, 'propertyId' ), + ( ['retval', 'out'], POINTER(_midlSAFEARRAY(c_uint)), 'winEvents' )), ] ################################################################ -## code template for IUIAutomationTextChildPattern implementation -##class IUIAutomationTextChildPattern_Impl(object): -## @property -## def TextContainer(self): +## code template for IUIAutomationProxyFactoryEntry implementation +##class IUIAutomationProxyFactoryEntry_Impl(object): +## def _get(self): ## '-no docstring-' -## #return container +## #return CanCheckBaseClass +## def _set(self, CanCheckBaseClass): +## '-no docstring-' +## CanCheckBaseClass = property(_get, _set, doc = _set.__doc__) +## +## def _get(self): +## '-no docstring-' +## #return ClassName +## def _set(self, ClassName): +## '-no docstring-' +## ClassName = property(_get, _set, doc = _set.__doc__) +## +## def _get(self): +## '-no docstring-' +## #return ImageName +## def _set(self, ImageName): +## '-no docstring-' +## ImageName = property(_get, _set, doc = _set.__doc__) ## ## @property -## def TextRange(self): +## def ProxyFactory(self): ## '-no docstring-' -## #return range +## #return factory +## +## def SetWinEventsForAutomationEvent(self, eventId, propertyId, winEvents): +## '-no docstring-' +## #return +## +## def _get(self): +## '-no docstring-' +## #return adviseEvents +## def _set(self, adviseEvents): +## '-no docstring-' +## NeedsAdviseEvents = property(_get, _set, doc = _set.__doc__) +## +## def _get(self): +## '-no docstring-' +## #return AllowSubstringMatch +## def _set(self, AllowSubstringMatch): +## '-no docstring-' +## AllowSubstringMatch = property(_get, _set, doc = _set.__doc__) +## +## def GetWinEventsForAutomationEvent(self, eventId, propertyId): +## '-no docstring-' +## #return winEvents ## -UIA_ScrollHorizontalViewSizePropertyId = 30054 # Constant c_int -IUIAutomationCondition._methods_ = [ -] -################################################################ -## code template for IUIAutomationCondition implementation -##class IUIAutomationCondition_Impl(object): - -UIA_IsTransformPatternAvailablePropertyId = 30042 # Constant c_int -class IUIAutomationSpreadsheetItemPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +class IUIAutomationMultipleViewPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{7D4FB86C-8D34-40E1-8E83-62C15204E335}') + _iid_ = GUID('{8D253C91-1DC5-4BB5-B18F-ADE16FA495E8}') _idlflags_ = [] -IUIAutomationSpreadsheetItemPattern._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'CurrentFormula', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD([], HRESULT, 'GetCurrentAnnotationObjects', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), - COMMETHOD([], HRESULT, 'GetCurrentAnnotationTypes', +IUIAutomationMultipleViewPattern._methods_ = [ + COMMETHOD([], HRESULT, 'GetViewName', + ( ['in'], c_int, 'view' ), + ( ['retval', 'out'], POINTER(BSTR), 'name' )), + COMMETHOD([], HRESULT, 'SetCurrentView', + ( ['in'], c_int, 'view' )), + COMMETHOD(['propget'], HRESULT, 'CurrentCurrentView', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD([], HRESULT, 'GetCurrentSupportedViews', ( ['retval', 'out'], POINTER(_midlSAFEARRAY(c_int)), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedFormula', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD([], HRESULT, 'GetCachedAnnotationObjects', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), - COMMETHOD([], HRESULT, 'GetCachedAnnotationTypes', + COMMETHOD(['propget'], HRESULT, 'CachedCurrentView', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD([], HRESULT, 'GetCachedSupportedViews', ( ['retval', 'out'], POINTER(_midlSAFEARRAY(c_int)), 'retVal' )), ] ################################################################ -## code template for IUIAutomationSpreadsheetItemPattern implementation -##class IUIAutomationSpreadsheetItemPattern_Impl(object): -## @property -## def CurrentFormula(self): +## code template for IUIAutomationMultipleViewPattern implementation +##class IUIAutomationMultipleViewPattern_Impl(object): +## def SetCurrentView(self, view): ## '-no docstring-' -## #return retVal +## #return ## -## @property -## def CachedFormula(self): +## def GetCurrentSupportedViews(self): ## '-no docstring-' ## #return retVal ## -## def GetCachedAnnotationTypes(self): +## def GetCachedSupportedViews(self): ## '-no docstring-' ## #return retVal ## -## def GetCurrentAnnotationTypes(self): +## @property +## def CurrentCurrentView(self): ## '-no docstring-' ## #return retVal ## -## def GetCurrentAnnotationObjects(self): +## def GetViewName(self, view): ## '-no docstring-' -## #return retVal +## #return name ## -## def GetCachedAnnotationObjects(self): +## @property +## def CachedCurrentView(self): ## '-no docstring-' ## #return retVal ## -class IUIAutomationObjectModelPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +StyleId_Heading1 = 70001 # Constant c_int +StyleId_Heading2 = 70002 # Constant c_int +StyleId_Heading3 = 70003 # Constant c_int +StyleId_Heading4 = 70004 # Constant c_int +StyleId_Heading5 = 70005 # Constant c_int +StyleId_Heading6 = 70006 # Constant c_int +StyleId_Heading7 = 70007 # Constant c_int +StyleId_Heading8 = 70008 # Constant c_int +UIA_FlowsFromPropertyId = 30148 # Constant c_int +StyleId_Subtitle = 70011 # Constant c_int +StyleId_Emphasis = 70013 # Constant c_int +UIA_LevelPropertyId = 30154 # Constant c_int +class IUIAutomationNotCondition(IUIAutomationCondition): _case_insensitive_ = True - _iid_ = GUID('{71C284B3-C14D-4D14-981E-19751B0D756D}') + _iid_ = GUID('{F528B657-847B-498C-8896-D52B565407A1}') _idlflags_ = [] -IUIAutomationObjectModelPattern._methods_ = [ - COMMETHOD([], HRESULT, 'GetUnderlyingObjectModel', - ( ['retval', 'out'], POINTER(POINTER(IUnknown)), 'retVal' )), +IUIAutomationNotCondition._methods_ = [ + COMMETHOD([], HRESULT, 'GetChild', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'condition' )), ] ################################################################ -## code template for IUIAutomationObjectModelPattern implementation -##class IUIAutomationObjectModelPattern_Impl(object): -## def GetUnderlyingObjectModel(self): +## code template for IUIAutomationNotCondition implementation +##class IUIAutomationNotCondition_Impl(object): +## def GetChild(self): ## '-no docstring-' -## #return retVal +## #return condition ## -StyleId_Emphasis = 70013 # Constant c_int -class IUIAutomationStylesPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +StyleId_BulletedList = 70015 # Constant c_int +StyleId_NumberedList = 70016 # Constant c_int +UIA_FormLandmarkTypeId = 80001 # Constant c_int +UIA_MainLandmarkTypeId = 80002 # Constant c_int + +# values for enumeration 'TreeTraversalOptions' +TreeTraversalOptions_Default = 0 +TreeTraversalOptions_PostOrder = 1 +TreeTraversalOptions_LastToFirstOrder = 2 +TreeTraversalOptions = c_int # enum +UIA_SearchLandmarkTypeId = 80004 # Constant c_int +UIA_IsTransformPattern2AvailablePropertyId = 30134 # Constant c_int +UIA_SayAsInterpretAsMetadataId = 100000 # Constant c_int +UIA_SpreadsheetItemAnnotationTypesPropertyId = 30131 # Constant c_int +class IUIAutomationScrollPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{85B5F0A2-BD79-484A-AD2B-388C9838D5FB}') + _iid_ = GUID('{88F4D42A-E881-459D-A77C-73BBBB7E02DC}') _idlflags_ = [] -IUIAutomationStylesPattern._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'CurrentStyleId', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentStyleName', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentFillColor', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentFillPatternStyle', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentShape', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentFillPatternColor', + +# values for enumeration 'ScrollAmount' +ScrollAmount_LargeDecrement = 0 +ScrollAmount_SmallDecrement = 1 +ScrollAmount_NoAmount = 2 +ScrollAmount_LargeIncrement = 3 +ScrollAmount_SmallIncrement = 4 +ScrollAmount = c_int # enum +IUIAutomationScrollPattern._methods_ = [ + COMMETHOD([], HRESULT, 'Scroll', + ( ['in'], ScrollAmount, 'horizontalAmount' ), + ( ['in'], ScrollAmount, 'verticalAmount' )), + COMMETHOD([], HRESULT, 'SetScrollPercent', + ( ['in'], c_double, 'horizontalPercent' ), + ( ['in'], c_double, 'verticalPercent' )), + COMMETHOD(['propget'], HRESULT, 'CurrentHorizontalScrollPercent', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentVerticalScrollPercent', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentHorizontalViewSize', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentVerticalViewSize', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentHorizontallyScrollable', ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentExtendedProperties', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD([], HRESULT, 'GetCurrentExtendedPropertiesAsArray', - ( ['out'], POINTER(POINTER(ExtendedProperty)), 'propertyArray' ), - ( ['out'], POINTER(c_int), 'propertyCount' )), - COMMETHOD(['propget'], HRESULT, 'CachedStyleId', + COMMETHOD(['propget'], HRESULT, 'CurrentVerticallyScrollable', ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedStyleName', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedFillColor', + COMMETHOD(['propget'], HRESULT, 'CachedHorizontalScrollPercent', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedVerticalScrollPercent', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedHorizontalViewSize', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedVerticalViewSize', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedHorizontallyScrollable', ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedFillPatternStyle', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedShape', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedFillPatternColor', + COMMETHOD(['propget'], HRESULT, 'CachedVerticallyScrollable', ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedExtendedProperties', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD([], HRESULT, 'GetCachedExtendedPropertiesAsArray', - ( ['out'], POINTER(POINTER(ExtendedProperty)), 'propertyArray' ), - ( ['out'], POINTER(c_int), 'propertyCount' )), ] ################################################################ -## code template for IUIAutomationStylesPattern implementation -##class IUIAutomationStylesPattern_Impl(object): +## code template for IUIAutomationScrollPattern implementation +##class IUIAutomationScrollPattern_Impl(object): ## @property -## def CurrentFillPatternColor(self): +## def CachedVerticalScrollPercent(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CachedStyleName(self): +## def CachedHorizontalViewSize(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CachedFillPatternColor(self): +## def CachedVerticalViewSize(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CurrentFillColor(self): +## def CurrentHorizontalViewSize(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CurrentFillPatternStyle(self): +## def CachedHorizontalScrollPercent(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CurrentStyleId(self): +## def CachedHorizontallyScrollable(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CurrentShape(self): +## def CurrentHorizontalScrollPercent(self): ## '-no docstring-' ## #return retVal ## -## def GetCachedExtendedPropertiesAsArray(self): -## '-no docstring-' -## #return propertyArray, propertyCount -## -## @property -## def CachedExtendedProperties(self): +## def Scroll(self, horizontalAmount, verticalAmount): ## '-no docstring-' -## #return retVal +## #return ## ## @property -## def CachedFillPatternStyle(self): +## def CurrentHorizontallyScrollable(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CachedShape(self): +## def CurrentVerticalViewSize(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CurrentStyleName(self): +## def CurrentVerticallyScrollable(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CachedStyleId(self): +## def CachedVerticallyScrollable(self): ## '-no docstring-' ## #return retVal ## -## @property -## def CachedFillColor(self): +## def SetScrollPercent(self, horizontalPercent, verticalPercent): ## '-no docstring-' -## #return retVal +## #return ## ## @property -## def CurrentExtendedProperties(self): +## def CurrentVerticalScrollPercent(self): ## '-no docstring-' ## #return retVal ## -## def GetCurrentExtendedPropertiesAsArray(self): -## '-no docstring-' -## #return propertyArray, propertyCount -## -UIA_IsMultipleViewPatternAvailablePropertyId = 30032 # Constant c_int -class IUIAutomationTransformPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +class IUIAutomationSelectionPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{A9B55844-A55D-4EF0-926D-569C16FF89BB}') + _iid_ = GUID('{5ED5202E-B2AC-47A6-B638-4B0BF140D78E}') _idlflags_ = [] -class IUIAutomationTransformPattern2(IUIAutomationTransformPattern): +class IUIAutomationSelectionPattern2(IUIAutomationSelectionPattern): _case_insensitive_ = True - _iid_ = GUID('{6D74D017-6ECB-4381-B38B-3C17A48FF1C2}') + _iid_ = GUID('{0532BFAE-C011-4E32-A343-6D642D798555}') _idlflags_ = [] -IUIAutomationTransformPattern._methods_ = [ - COMMETHOD([], HRESULT, 'Move', - ( ['in'], c_double, 'x' ), - ( ['in'], c_double, 'y' )), - COMMETHOD([], HRESULT, 'Resize', - ( ['in'], c_double, 'width' ), - ( ['in'], c_double, 'height' )), - COMMETHOD([], HRESULT, 'Rotate', - ( ['in'], c_double, 'degrees' )), - COMMETHOD(['propget'], HRESULT, 'CurrentCanMove', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentCanResize', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentCanRotate', +IUIAutomationSelectionPattern._methods_ = [ + COMMETHOD([], HRESULT, 'GetCurrentSelection', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentCanSelectMultiple', ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedCanMove', + COMMETHOD(['propget'], HRESULT, 'CurrentIsSelectionRequired', ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedCanResize', + COMMETHOD([], HRESULT, 'GetCachedSelection', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedCanSelectMultiple', ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedCanRotate', + COMMETHOD(['propget'], HRESULT, 'CachedIsSelectionRequired', ( ['retval', 'out'], POINTER(c_int), 'retVal' )), ] ################################################################ -## code template for IUIAutomationTransformPattern implementation -##class IUIAutomationTransformPattern_Impl(object): +## code template for IUIAutomationSelectionPattern implementation +##class IUIAutomationSelectionPattern_Impl(object): +## def GetCurrentSelection(self): +## '-no docstring-' +## #return retVal +## ## @property -## def CachedCanMove(self): +## def CurrentIsSelectionRequired(self): ## '-no docstring-' ## #return retVal ## -## def Rotate(self, degrees): +## @property +## def CachedIsSelectionRequired(self): ## '-no docstring-' -## #return +## #return retVal +## +## def GetCachedSelection(self): +## '-no docstring-' +## #return retVal ## ## @property -## def CachedCanRotate(self): +## def CachedCanSelectMultiple(self): ## '-no docstring-' ## #return retVal ## -## def Move(self, x, y): +## @property +## def CurrentCanSelectMultiple(self): ## '-no docstring-' -## #return +## #return retVal ## + +IUIAutomationSelectionPattern2._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'CurrentFirstSelectedItem', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentLastSelectedItem', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentCurrentSelectedItem', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentItemCount', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedFirstSelectedItem', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedLastSelectedItem', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedCurrentSelectedItem', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedItemCount', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), +] +################################################################ +## code template for IUIAutomationSelectionPattern2 implementation +##class IUIAutomationSelectionPattern2_Impl(object): ## @property -## def CurrentCanRotate(self): +## def CachedFirstSelectedItem(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CurrentCanMove(self): +## def CachedCurrentSelectedItem(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CachedCanResize(self): +## def CurrentCurrentSelectedItem(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CurrentCanResize(self): +## def CachedLastSelectedItem(self): ## '-no docstring-' ## #return retVal ## -## def Resize(self, width, height): +## @property +## def CurrentItemCount(self): ## '-no docstring-' -## #return +## #return retVal +## +## @property +## def CachedItemCount(self): +## '-no docstring-' +## #return retVal +## +## @property +## def CurrentFirstSelectedItem(self): +## '-no docstring-' +## #return retVal +## +## @property +## def CurrentLastSelectedItem(self): +## '-no docstring-' +## #return retVal ## - -# values for enumeration 'ZoomUnit' -ZoomUnit_NoAmount = 0 -ZoomUnit_LargeDecrement = 1 -ZoomUnit_SmallDecrement = 2 -ZoomUnit_LargeIncrement = 3 -ZoomUnit_SmallIncrement = 4 -ZoomUnit = c_int # enum -IUIAutomationTransformPattern2._methods_ = [ - COMMETHOD([], HRESULT, 'Zoom', - ( ['in'], c_double, 'zoomValue' )), - COMMETHOD([], HRESULT, 'ZoomByUnit', - ( ['in'], ZoomUnit, 'ZoomUnit' )), - COMMETHOD(['propget'], HRESULT, 'CurrentCanZoom', +class IUIAutomationDragPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{1DC7B570-1F54-4BAD-BCDA-D36A722FB7BD}') + _idlflags_ = [] +IUIAutomationDragPattern._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'CurrentIsGrabbed', ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedCanZoom', + COMMETHOD(['propget'], HRESULT, 'CachedIsGrabbed', ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentZoomLevel', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedZoomLevel', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentZoomMinimum', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedZoomMinimum', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentZoomMaximum', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedZoomMaximum', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentDropEffect', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedDropEffect', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentDropEffects', + ( ['retval', 'out'], POINTER(_midlSAFEARRAY(BSTR)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedDropEffects', + ( ['retval', 'out'], POINTER(_midlSAFEARRAY(BSTR)), 'retVal' )), + COMMETHOD([], HRESULT, 'GetCurrentGrabbedItems', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), + COMMETHOD([], HRESULT, 'GetCachedGrabbedItems', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), ] ################################################################ -## code template for IUIAutomationTransformPattern2 implementation -##class IUIAutomationTransformPattern2_Impl(object): +## code template for IUIAutomationDragPattern implementation +##class IUIAutomationDragPattern_Impl(object): ## @property -## def CachedZoomMinimum(self): +## def CurrentIsGrabbed(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CurrentZoomMinimum(self): +## def CurrentDropEffects(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CachedCanZoom(self): +## def CurrentDropEffect(self): ## '-no docstring-' ## #return retVal ## -## @property -## def CachedZoomMaximum(self): +## def GetCachedGrabbedItems(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CurrentCanZoom(self): +## def CachedDropEffect(self): ## '-no docstring-' ## #return retVal ## -## def ZoomByUnit(self, ZoomUnit): -## '-no docstring-' -## #return -## ## @property -## def CachedZoomLevel(self): +## def CachedIsGrabbed(self): ## '-no docstring-' ## #return retVal ## -## def Zoom(self, zoomValue): -## '-no docstring-' -## #return -## ## @property -## def CurrentZoomLevel(self): +## def CachedDropEffects(self): ## '-no docstring-' ## #return retVal ## -## @property -## def CurrentZoomMaximum(self): +## def GetCurrentGrabbedItems(self): ## '-no docstring-' ## #return retVal ## -UIA_TablePatternId = 10012 # Constant c_int -class IUIAutomationRangeValuePattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +class IUIAutomationSpreadsheetPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{59213F4F-7346-49E5-B120-80555987A148}') + _iid_ = GUID('{7517A7C8-FAAE-4DE9-9F08-29B91E8595C1}') _idlflags_ = [] -IUIAutomationRangeValuePattern._methods_ = [ - COMMETHOD([], HRESULT, 'SetValue', - ( ['in'], c_double, 'val' )), - COMMETHOD(['propget'], HRESULT, 'CurrentValue', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentIsReadOnly', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentMaximum', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentMinimum', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentLargeChange', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentSmallChange', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedValue', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedIsReadOnly', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedMaximum', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedMinimum', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedLargeChange', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedSmallChange', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), +IUIAutomationSpreadsheetPattern._methods_ = [ + COMMETHOD([], HRESULT, 'GetItemByName', + ( ['in'], BSTR, 'name' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), ] ################################################################ -## code template for IUIAutomationRangeValuePattern implementation -##class IUIAutomationRangeValuePattern_Impl(object): -## @property -## def CachedIsReadOnly(self): +## code template for IUIAutomationSpreadsheetPattern implementation +##class IUIAutomationSpreadsheetPattern_Impl(object): +## def GetItemByName(self, name): ## '-no docstring-' -## #return retVal +## #return element ## + +class IRawElementProviderSimple(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{D6DD68D1-86FD-4332-8666-9ABEDEA2D24C}') + _idlflags_ = ['oleautomation'] + +# values for enumeration 'ProviderOptions' +ProviderOptions_ClientSideProvider = 1 +ProviderOptions_ServerSideProvider = 2 +ProviderOptions_NonClientAreaProvider = 4 +ProviderOptions_OverrideProvider = 8 +ProviderOptions_ProviderOwnsSetFocus = 16 +ProviderOptions_UseComThreading = 32 +ProviderOptions_RefuseNonClientSupport = 64 +ProviderOptions_HasNativeIAccessible = 128 +ProviderOptions_UseClientCoordinates = 256 +ProviderOptions = c_int # enum +IRawElementProviderSimple._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'ProviderOptions', + ( ['retval', 'out'], POINTER(ProviderOptions), 'pRetVal' )), + COMMETHOD([], HRESULT, 'GetPatternProvider', + ( ['in'], c_int, 'patternId' ), + ( ['retval', 'out'], POINTER(POINTER(IUnknown)), 'pRetVal' )), + COMMETHOD([], HRESULT, 'GetPropertyValue', + ( ['in'], c_int, 'propertyId' ), + ( ['retval', 'out'], POINTER(VARIANT), 'pRetVal' )), + COMMETHOD(['propget'], HRESULT, 'HostRawElementProvider', + ( ['retval', 'out'], POINTER(POINTER(IRawElementProviderSimple)), 'pRetVal' )), +] +################################################################ +## code template for IRawElementProviderSimple implementation +##class IRawElementProviderSimple_Impl(object): ## @property -## def CurrentValue(self): +## def ProviderOptions(self): ## '-no docstring-' -## #return retVal +## #return pRetVal ## -## def SetValue(self, val): +## def GetPatternProvider(self, patternId): ## '-no docstring-' -## #return +## #return pRetVal ## ## @property -## def CurrentMaximum(self): +## def HostRawElementProvider(self): ## '-no docstring-' -## #return retVal +## #return pRetVal ## -## @property -## def CurrentSmallChange(self): +## def GetPropertyValue(self, propertyId): ## '-no docstring-' -## #return retVal +## #return pRetVal ## + +IUIAutomationElementArray._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'Length', + ( ['retval', 'out'], POINTER(c_int), 'Length' )), + COMMETHOD([], HRESULT, 'GetElement', + ( ['in'], c_int, 'index' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), +] +################################################################ +## code template for IUIAutomationElementArray implementation +##class IUIAutomationElementArray_Impl(object): ## @property -## def CachedValue(self): +## def Length(self): ## '-no docstring-' -## #return retVal +## #return Length ## -## @property -## def CurrentIsReadOnly(self): +## def GetElement(self, index): ## '-no docstring-' -## #return retVal +## #return element ## -## @property -## def CurrentLargeChange(self): + +UIA_Transform2CanZoomPropertyId = 30133 # Constant c_int +UIA_DropTargetDropTargetEffectPropertyId = 30142 # Constant c_int +UIA_DropTargetDropTargetEffectsPropertyId = 30143 # Constant c_int +UIA_DragDropEffectsPropertyId = 30140 # Constant c_int +UIA_LiveSettingPropertyId = 30135 # Constant c_int + +# values for enumeration 'AutomationElementMode' +AutomationElementMode_None = 0 +AutomationElementMode_Full = 1 +AutomationElementMode = c_int # enum +IUIAutomationCacheRequest._methods_ = [ + COMMETHOD([], HRESULT, 'AddProperty', + ( ['in'], c_int, 'propertyId' )), + COMMETHOD([], HRESULT, 'AddPattern', + ( ['in'], c_int, 'patternId' )), + COMMETHOD([], HRESULT, 'Clone', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCacheRequest)), 'clonedRequest' )), + COMMETHOD(['propget'], HRESULT, 'TreeScope', + ( ['retval', 'out'], POINTER(TreeScope), 'scope' )), + COMMETHOD(['propput'], HRESULT, 'TreeScope', + ( ['in'], TreeScope, 'scope' )), + COMMETHOD(['propget'], HRESULT, 'TreeFilter', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'filter' )), + COMMETHOD(['propput'], HRESULT, 'TreeFilter', + ( ['in'], POINTER(IUIAutomationCondition), 'filter' )), + COMMETHOD(['propget'], HRESULT, 'AutomationElementMode', + ( ['retval', 'out'], POINTER(AutomationElementMode), 'mode' )), + COMMETHOD(['propput'], HRESULT, 'AutomationElementMode', + ( ['in'], AutomationElementMode, 'mode' )), +] +################################################################ +## code template for IUIAutomationCacheRequest implementation +##class IUIAutomationCacheRequest_Impl(object): +## def AddPattern(self, patternId): ## '-no docstring-' -## #return retVal +## #return ## -## @property -## def CachedSmallChange(self): +## def AddProperty(self, propertyId): ## '-no docstring-' -## #return retVal +## #return ## -## @property -## def CurrentMinimum(self): +## def Clone(self): ## '-no docstring-' -## #return retVal +## #return clonedRequest ## -## @property -## def CachedMinimum(self): +## def _get(self): ## '-no docstring-' -## #return retVal -## -## @property -## def CachedMaximum(self): +## #return scope +## def _set(self, scope): ## '-no docstring-' -## #return retVal +## TreeScope = property(_get, _set, doc = _set.__doc__) ## -## @property -## def CachedLargeChange(self): +## def _get(self): ## '-no docstring-' -## #return retVal -## - -UIA_IsTableItemPatternAvailablePropertyId = 30039 # Constant c_int -UIA_LocalizedLandmarkTypePropertyId = 30158 # Constant c_int -class IUIAutomationTextRange2(IUIAutomationTextRange): - _case_insensitive_ = True - _iid_ = GUID('{BB9B40E0-5E04-46BD-9BE0-4B601B9AFAD4}') - _idlflags_ = [] -class IUIAutomationTextRange3(IUIAutomationTextRange2): - _case_insensitive_ = True - _iid_ = GUID('{6A315D69-5512-4C2E-85F0-53FCE6DD4BC2}') - _idlflags_ = [] -IUIAutomationTextRange2._methods_ = [ - COMMETHOD([], HRESULT, 'ShowContextMenu'), -] -################################################################ -## code template for IUIAutomationTextRange2 implementation -##class IUIAutomationTextRange2_Impl(object): -## def ShowContextMenu(self): +## #return mode +## def _set(self, mode): ## '-no docstring-' -## #return +## AutomationElementMode = property(_get, _set, doc = _set.__doc__) ## - -IUIAutomationTextRange3._methods_ = [ - COMMETHOD([], HRESULT, 'GetEnclosingElementBuildCache', - ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'enclosingElement' )), - COMMETHOD([], HRESULT, 'GetChildrenBuildCache', - ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'children' )), - COMMETHOD([], HRESULT, 'GetAttributeValues', - ( ['in'], POINTER(c_int), 'attributeIds' ), - ( ['in'], c_int, 'attributeIdCount' ), - ( ['retval', 'out'], POINTER(_midlSAFEARRAY(VARIANT)), 'attributeValues' )), -] -################################################################ -## code template for IUIAutomationTextRange3 implementation -##class IUIAutomationTextRange3_Impl(object): -## def GetEnclosingElementBuildCache(self, cacheRequest): +## def _get(self): ## '-no docstring-' -## #return enclosingElement -## -## def GetAttributeValues(self, attributeIds, attributeIdCount): +## #return filter +## def _set(self, filter): ## '-no docstring-' -## #return attributeValues +## TreeFilter = property(_get, _set, doc = _set.__doc__) ## -## def GetChildrenBuildCache(self, cacheRequest): + +class IUIAutomationScrollItemPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{B488300F-D015-4F19-9C29-BB595E3645EF}') + _idlflags_ = [] +IUIAutomationScrollItemPattern._methods_ = [ + COMMETHOD([], HRESULT, 'ScrollIntoView'), +] +################################################################ +## code template for IUIAutomationScrollItemPattern implementation +##class IUIAutomationScrollItemPattern_Impl(object): +## def ScrollIntoView(self): ## '-no docstring-' -## #return children +## #return ## -UIA_CustomLandmarkTypeId = 80000 # Constant c_int -UIA_StylesExtendedPropertiesPropertyId = 30126 # Constant c_int -UIA_StylesShapePropertyId = 30124 # Constant c_int -class IUIAutomationTablePattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +UIA_IsDragPatternAvailablePropertyId = 30137 # Constant c_int +UIA_SizeOfSetPropertyId = 30153 # Constant c_int +UIA_DragDropEffectPropertyId = 30139 # Constant c_int +UIA_IsTextChildPatternAvailablePropertyId = 30136 # Constant c_int +UIA_IsDropTargetPatternAvailablePropertyId = 30141 # Constant c_int +class IUIAutomationValuePattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{620E691C-EA96-4710-A850-754B24CE2417}') + _iid_ = GUID('{A94CD8B1-0844-4CD6-9D2D-640537AB39E9}') _idlflags_ = [] - -# values for enumeration 'RowOrColumnMajor' -RowOrColumnMajor_RowMajor = 0 -RowOrColumnMajor_ColumnMajor = 1 -RowOrColumnMajor_Indeterminate = 2 -RowOrColumnMajor = c_int # enum -IUIAutomationTablePattern._methods_ = [ - COMMETHOD([], HRESULT, 'GetCurrentRowHeaders', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), - COMMETHOD([], HRESULT, 'GetCurrentColumnHeaders', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentRowOrColumnMajor', - ( ['retval', 'out'], POINTER(RowOrColumnMajor), 'retVal' )), - COMMETHOD([], HRESULT, 'GetCachedRowHeaders', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), - COMMETHOD([], HRESULT, 'GetCachedColumnHeaders', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedRowOrColumnMajor', - ( ['retval', 'out'], POINTER(RowOrColumnMajor), 'retVal' )), +IUIAutomationValuePattern._methods_ = [ + COMMETHOD([], HRESULT, 'SetValue', + ( ['in'], BSTR, 'val' )), + COMMETHOD(['propget'], HRESULT, 'CurrentValue', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentIsReadOnly', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedValue', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedIsReadOnly', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), ] ################################################################ -## code template for IUIAutomationTablePattern implementation -##class IUIAutomationTablePattern_Impl(object): +## code template for IUIAutomationValuePattern implementation +##class IUIAutomationValuePattern_Impl(object): ## @property -## def CachedRowOrColumnMajor(self): -## '-no docstring-' -## #return retVal -## -## def GetCachedColumnHeaders(self): +## def CachedIsReadOnly(self): ## '-no docstring-' ## #return retVal ## -## def GetCachedRowHeaders(self): +## @property +## def CurrentValue(self): ## '-no docstring-' ## #return retVal ## -## def GetCurrentColumnHeaders(self): +## def SetValue(self, val): ## '-no docstring-' -## #return retVal +## #return ## ## @property -## def CurrentRowOrColumnMajor(self): +## def CurrentIsReadOnly(self): ## '-no docstring-' ## #return retVal ## -## def GetCurrentRowHeaders(self): +## @property +## def CachedValue(self): ## '-no docstring-' ## #return retVal ## -UIA_StylesFillPatternColorPropertyId = 30125 # Constant c_int -UIA_DragDropEffectPropertyId = 30139 # Constant c_int -StyleId_Title = 70010 # Constant c_int - -# values for enumeration 'ProviderOptions' -ProviderOptions_ClientSideProvider = 1 -ProviderOptions_ServerSideProvider = 2 -ProviderOptions_NonClientAreaProvider = 4 -ProviderOptions_OverrideProvider = 8 -ProviderOptions_ProviderOwnsSetFocus = 16 -ProviderOptions_UseComThreading = 32 -ProviderOptions_RefuseNonClientSupport = 64 -ProviderOptions_HasNativeIAccessible = 128 -ProviderOptions_UseClientCoordinates = 256 -ProviderOptions = c_int # enum -UIA_LegacyIAccessibleHelpPropertyId = 30097 # Constant c_int -class IUIAutomationVirtualizedItemPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +UIA_IsLegacyIAccessiblePatternAvailablePropertyId = 30090 # Constant c_int +class IUIAutomationTextChildPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{6BA3D7A6-04CF-4F11-8793-A8D1CDE9969F}') + _iid_ = GUID('{6552B038-AE05-40C8-ABFD-AA08352AAB86}') _idlflags_ = [] -IUIAutomationVirtualizedItemPattern._methods_ = [ - COMMETHOD([], HRESULT, 'Realize'), +IUIAutomationTextChildPattern._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'TextContainer', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'container' )), + COMMETHOD(['propget'], HRESULT, 'TextRange', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTextRange)), 'range' )), ] ################################################################ -## code template for IUIAutomationVirtualizedItemPattern implementation -##class IUIAutomationVirtualizedItemPattern_Impl(object): -## def Realize(self): +## code template for IUIAutomationTextChildPattern implementation +##class IUIAutomationTextChildPattern_Impl(object): +## @property +## def TextContainer(self): ## '-no docstring-' -## #return +## #return container +## +## @property +## def TextRange(self): +## '-no docstring-' +## #return range ## -UIA_Transform2CanZoomPropertyId = 30133 # Constant c_int -UIA_LegacyIAccessibleDefaultActionPropertyId = 30100 # Constant c_int -UIA_LegacyIAccessibleStatePropertyId = 30096 # Constant c_int -UIA_LegacyIAccessibleRolePropertyId = 30095 # Constant c_int -UIA_ToggleToggleStatePropertyId = 30086 # Constant c_int -UIA_IsItemContainerPatternAvailablePropertyId = 30108 # Constant c_int -UIA_LegacyIAccessibleDescriptionPropertyId = 30094 # Constant c_int -UIA_DescribedByPropertyId = 30105 # Constant c_int -UIA_LegacyIAccessibleNamePropertyId = 30092 # Constant c_int -UIA_TableItemColumnHeaderItemsPropertyId = 30085 # Constant c_int -UIA_AriaRolePropertyId = 30101 # Constant c_int -UIA_TableItemRowHeaderItemsPropertyId = 30084 # Constant c_int -IUIAutomationProxyFactoryMapping._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'count', - ( ['retval', 'out'], POINTER(c_uint), 'count' )), - COMMETHOD([], HRESULT, 'GetTable', - ( ['retval', 'out'], POINTER(_midlSAFEARRAY(POINTER(IUIAutomationProxyFactoryEntry))), 'table' )), - COMMETHOD([], HRESULT, 'GetEntry', - ( ['in'], c_uint, 'index' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationProxyFactoryEntry)), 'entry' )), - COMMETHOD([], HRESULT, 'SetTable', - ( ['in'], _midlSAFEARRAY(POINTER(IUIAutomationProxyFactoryEntry)), 'factoryList' )), - COMMETHOD([], HRESULT, 'InsertEntries', - ( ['in'], c_uint, 'before' ), - ( ['in'], _midlSAFEARRAY(POINTER(IUIAutomationProxyFactoryEntry)), 'factoryList' )), - COMMETHOD([], HRESULT, 'InsertEntry', - ( ['in'], c_uint, 'before' ), - ( ['in'], POINTER(IUIAutomationProxyFactoryEntry), 'factory' )), - COMMETHOD([], HRESULT, 'RemoveEntry', - ( ['in'], c_uint, 'index' )), - COMMETHOD([], HRESULT, 'ClearTable'), - COMMETHOD([], HRESULT, 'RestoreDefaultTable'), +UIA_Transform2ZoomMinimumPropertyId = 30146 # Constant c_int +class ExtendedProperty(Structure): + pass +ExtendedProperty._fields_ = [ + ('PropertyName', BSTR), + ('PropertyValue', BSTR), +] +assert sizeof(ExtendedProperty) == 8, sizeof(ExtendedProperty) +assert alignment(ExtendedProperty) == 4, alignment(ExtendedProperty) +class IUIAutomationDropTargetPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{69A095F7-EEE4-430E-A46B-FB73B1AE39A5}') + _idlflags_ = [] +IUIAutomationDropTargetPattern._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'CurrentDropTargetEffect', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedDropTargetEffect', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentDropTargetEffects', + ( ['retval', 'out'], POINTER(_midlSAFEARRAY(BSTR)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedDropTargetEffects', + ( ['retval', 'out'], POINTER(_midlSAFEARRAY(BSTR)), 'retVal' )), ] ################################################################ -## code template for IUIAutomationProxyFactoryMapping implementation -##class IUIAutomationProxyFactoryMapping_Impl(object): +## code template for IUIAutomationDropTargetPattern implementation +##class IUIAutomationDropTargetPattern_Impl(object): ## @property -## def count(self): -## '-no docstring-' -## #return count -## -## def ClearTable(self): -## '-no docstring-' -## #return -## -## def GetEntry(self, index): -## '-no docstring-' -## #return entry -## -## def InsertEntries(self, before, factoryList): +## def CachedDropTargetEffects(self): ## '-no docstring-' -## #return +## #return retVal ## -## def RestoreDefaultTable(self): +## @property +## def CurrentDropTargetEffect(self): ## '-no docstring-' -## #return +## #return retVal ## -## def SetTable(self, factoryList): +## @property +## def CachedDropTargetEffect(self): ## '-no docstring-' -## #return +## #return retVal ## -## def GetTable(self): +## @property +## def CurrentDropTargetEffects(self): ## '-no docstring-' -## #return table -## -## def InsertEntry(self, before, factory): -## '-no docstring-' -## #return -## -## def RemoveEntry(self, index): -## '-no docstring-' -## #return +## #return retVal ## -UIA_ProviderDescriptionPropertyId = 30107 # Constant c_int -UIA_TransformCanResizePropertyId = 30088 # Constant c_int -UIA_TransformCanMovePropertyId = 30087 # Constant c_int -UIA_TransformCanRotatePropertyId = 30089 # Constant c_int -UIA_IsLegacyIAccessiblePatternAvailablePropertyId = 30090 # Constant c_int -UIA_LegacyIAccessibleChildIdPropertyId = 30091 # Constant c_int -UIA_AriaPropertiesPropertyId = 30102 # Constant c_int -UIA_TableRowOrColumnMajorPropertyId = 30083 # Constant c_int -UIA_TableRowHeadersPropertyId = 30081 # Constant c_int -UIA_TableColumnHeadersPropertyId = 30082 # Constant c_int -UIA_ControllerForPropertyId = 30104 # Constant c_int -UIA_IsGridPatternAvailablePropertyId = 30030 # Constant c_int -UIA_AnnotationDateTimePropertyId = 30116 # Constant c_int -UIA_IsCustomNavigationPatternAvailablePropertyId = 30151 # Constant c_int -UIA_Transform2ZoomMinimumPropertyId = 30146 # Constant c_int -UIA_FlowsFromPropertyId = 30148 # Constant c_int -UIA_FlowsToPropertyId = 30106 # Constant c_int -UIA_IsObjectModelPatternAvailablePropertyId = 30112 # Constant c_int -UIA_IsVirtualizedItemPatternAvailablePropertyId = 30109 # Constant c_int -UIA_IsPeripheralPropertyId = 30150 # Constant c_int -class IUIAutomationLegacyIAccessiblePattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +UIA_TextPatternId = 10014 # Constant c_int +UIA_WindowPatternId = 10009 # Constant c_int +UIA_BackgroundColorAttributeId = 40001 # Constant c_int +UIA_MultipleViewPatternId = 10008 # Constant c_int +UIA_GridPatternId = 10006 # Constant c_int +UIA_GridItemPatternId = 10007 # Constant c_int +UIA_ScrollPatternId = 10004 # Constant c_int +UIA_ExpandCollapsePatternId = 10005 # Constant c_int +UIA_SelectionItemPatternId = 10010 # Constant c_int +UIA_ValuePatternId = 10002 # Constant c_int +UIA_RangeValuePatternId = 10003 # Constant c_int +UIA_TableItemPatternId = 10013 # Constant c_int +UIA_InvokePatternId = 10000 # Constant c_int +UIA_SelectionPatternId = 10001 # Constant c_int +UIA_DockPatternId = 10011 # Constant c_int +UIA_TablePatternId = 10012 # Constant c_int +UIA_TogglePatternId = 10015 # Constant c_int +class Library(object): + name = u'UIAutomationClient' + _reg_typelib_ = ('{944DE083-8FB8-45CF-BCB7-C477ACB2F897}', 1, 0) + +class IUIAutomation(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{828055AD-355B-4435-86D5-3B51C14A9B1B}') + _iid_ = GUID('{30CBE57D-D9D0-452A-AB13-7AC5AC4825EE}') _idlflags_ = [] -IUIAutomationLegacyIAccessiblePattern._methods_ = [ - COMMETHOD([], HRESULT, 'Select', - ( [], c_int, 'flagsSelect' )), - COMMETHOD([], HRESULT, 'DoDefaultAction'), - COMMETHOD([], HRESULT, 'SetValue', - ( [], WSTRING, 'szValue' )), - COMMETHOD(['propget'], HRESULT, 'CurrentChildId', - ( ['retval', 'out'], POINTER(c_int), 'pRetVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentName', - ( ['retval', 'out'], POINTER(BSTR), 'pszName' )), - COMMETHOD(['propget'], HRESULT, 'CurrentValue', - ( ['retval', 'out'], POINTER(BSTR), 'pszValue' )), - COMMETHOD(['propget'], HRESULT, 'CurrentDescription', - ( ['retval', 'out'], POINTER(BSTR), 'pszDescription' )), - COMMETHOD(['propget'], HRESULT, 'CurrentRole', - ( ['retval', 'out'], POINTER(c_ulong), 'pdwRole' )), - COMMETHOD(['propget'], HRESULT, 'CurrentState', - ( ['retval', 'out'], POINTER(c_ulong), 'pdwState' )), - COMMETHOD(['propget'], HRESULT, 'CurrentHelp', - ( ['retval', 'out'], POINTER(BSTR), 'pszHelp' )), - COMMETHOD(['propget'], HRESULT, 'CurrentKeyboardShortcut', - ( ['retval', 'out'], POINTER(BSTR), 'pszKeyboardShortcut' )), - COMMETHOD([], HRESULT, 'GetCurrentSelection', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'pvarSelectedChildren' )), - COMMETHOD(['propget'], HRESULT, 'CurrentDefaultAction', - ( ['retval', 'out'], POINTER(BSTR), 'pszDefaultAction' )), - COMMETHOD(['propget'], HRESULT, 'CachedChildId', - ( ['retval', 'out'], POINTER(c_int), 'pRetVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedName', - ( ['retval', 'out'], POINTER(BSTR), 'pszName' )), - COMMETHOD(['propget'], HRESULT, 'CachedValue', - ( ['retval', 'out'], POINTER(BSTR), 'pszValue' )), - COMMETHOD(['propget'], HRESULT, 'CachedDescription', - ( ['retval', 'out'], POINTER(BSTR), 'pszDescription' )), - COMMETHOD(['propget'], HRESULT, 'CachedRole', - ( ['retval', 'out'], POINTER(c_ulong), 'pdwRole' )), - COMMETHOD(['propget'], HRESULT, 'CachedState', - ( ['retval', 'out'], POINTER(c_ulong), 'pdwState' )), - COMMETHOD(['propget'], HRESULT, 'CachedHelp', - ( ['retval', 'out'], POINTER(BSTR), 'pszHelp' )), - COMMETHOD(['propget'], HRESULT, 'CachedKeyboardShortcut', - ( ['retval', 'out'], POINTER(BSTR), 'pszKeyboardShortcut' )), - COMMETHOD([], HRESULT, 'GetCachedSelection', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'pvarSelectedChildren' )), - COMMETHOD(['propget'], HRESULT, 'CachedDefaultAction', - ( ['retval', 'out'], POINTER(BSTR), 'pszDefaultAction' )), - COMMETHOD([], HRESULT, 'GetIAccessible', - ( ['retval', 'out'], POINTER(POINTER(IAccessible)), 'ppAccessible' )), +class IUIAutomation2(IUIAutomation): + _case_insensitive_ = True + _iid_ = GUID('{34723AFF-0C9D-49D0-9896-7AB52DF8CD8A}') + _idlflags_ = [] +class IUIAutomationPropertyChangedEventHandler(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{40CD37D4-C756-4B0C-8C6F-BDDFEEB13B50}') + _idlflags_ = ['oleautomation'] +class IUIAutomationFocusChangedEventHandler(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{C270F6B5-5C69-4290-9745-7A7F97169468}') + _idlflags_ = ['oleautomation'] +IUIAutomation._methods_ = [ + COMMETHOD([], HRESULT, 'CompareElements', + ( ['in'], POINTER(IUIAutomationElement), 'el1' ), + ( ['in'], POINTER(IUIAutomationElement), 'el2' ), + ( ['retval', 'out'], POINTER(c_int), 'areSame' )), + COMMETHOD([], HRESULT, 'CompareRuntimeIds', + ( ['in'], _midlSAFEARRAY(c_int), 'runtimeId1' ), + ( ['in'], _midlSAFEARRAY(c_int), 'runtimeId2' ), + ( ['retval', 'out'], POINTER(c_int), 'areSame' )), + COMMETHOD([], HRESULT, 'GetRootElement', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'root' )), + COMMETHOD([], HRESULT, 'ElementFromHandle', + ( ['in'], c_void_p, 'hwnd' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), + COMMETHOD([], HRESULT, 'ElementFromPoint', + ( ['in'], tagPOINT, 'pt' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), + COMMETHOD([], HRESULT, 'GetFocusedElement', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), + COMMETHOD([], HRESULT, 'GetRootElementBuildCache', + ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'root' )), + COMMETHOD([], HRESULT, 'ElementFromHandleBuildCache', + ( ['in'], c_void_p, 'hwnd' ), + ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), + COMMETHOD([], HRESULT, 'ElementFromPointBuildCache', + ( ['in'], tagPOINT, 'pt' ), + ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), + COMMETHOD([], HRESULT, 'GetFocusedElementBuildCache', + ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), + COMMETHOD([], HRESULT, 'CreateTreeWalker', + ( ['in'], POINTER(IUIAutomationCondition), 'pCondition' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTreeWalker)), 'walker' )), + COMMETHOD(['propget'], HRESULT, 'ControlViewWalker', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTreeWalker)), 'walker' )), + COMMETHOD(['propget'], HRESULT, 'ContentViewWalker', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTreeWalker)), 'walker' )), + COMMETHOD(['propget'], HRESULT, 'RawViewWalker', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTreeWalker)), 'walker' )), + COMMETHOD(['propget'], HRESULT, 'RawViewCondition', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'condition' )), + COMMETHOD(['propget'], HRESULT, 'ControlViewCondition', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'condition' )), + COMMETHOD(['propget'], HRESULT, 'ContentViewCondition', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'condition' )), + COMMETHOD([], HRESULT, 'CreateCacheRequest', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCacheRequest)), 'cacheRequest' )), + COMMETHOD([], HRESULT, 'CreateTrueCondition', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), + COMMETHOD([], HRESULT, 'CreateFalseCondition', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), + COMMETHOD([], HRESULT, 'CreatePropertyCondition', + ( ['in'], c_int, 'propertyId' ), + ( ['in'], VARIANT, 'value' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), + COMMETHOD([], HRESULT, 'CreatePropertyConditionEx', + ( ['in'], c_int, 'propertyId' ), + ( ['in'], VARIANT, 'value' ), + ( ['in'], PropertyConditionFlags, 'flags' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), + COMMETHOD([], HRESULT, 'CreateAndCondition', + ( ['in'], POINTER(IUIAutomationCondition), 'condition1' ), + ( ['in'], POINTER(IUIAutomationCondition), 'condition2' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), + COMMETHOD([], HRESULT, 'CreateAndConditionFromArray', + ( ['in'], _midlSAFEARRAY(POINTER(IUIAutomationCondition)), 'conditions' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), + COMMETHOD([], HRESULT, 'CreateAndConditionFromNativeArray', + ( ['in'], POINTER(POINTER(IUIAutomationCondition)), 'conditions' ), + ( ['in'], c_int, 'conditionCount' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), + COMMETHOD([], HRESULT, 'CreateOrCondition', + ( ['in'], POINTER(IUIAutomationCondition), 'condition1' ), + ( ['in'], POINTER(IUIAutomationCondition), 'condition2' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), + COMMETHOD([], HRESULT, 'CreateOrConditionFromArray', + ( ['in'], _midlSAFEARRAY(POINTER(IUIAutomationCondition)), 'conditions' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), + COMMETHOD([], HRESULT, 'CreateOrConditionFromNativeArray', + ( ['in'], POINTER(POINTER(IUIAutomationCondition)), 'conditions' ), + ( ['in'], c_int, 'conditionCount' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), + COMMETHOD([], HRESULT, 'CreateNotCondition', + ( ['in'], POINTER(IUIAutomationCondition), 'condition' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'newCondition' )), + COMMETHOD([], HRESULT, 'AddAutomationEventHandler', + ( ['in'], c_int, 'eventId' ), + ( ['in'], POINTER(IUIAutomationElement), 'element' ), + ( ['in'], TreeScope, 'scope' ), + ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), + ( ['in'], POINTER(IUIAutomationEventHandler), 'handler' )), + COMMETHOD([], HRESULT, 'RemoveAutomationEventHandler', + ( ['in'], c_int, 'eventId' ), + ( ['in'], POINTER(IUIAutomationElement), 'element' ), + ( ['in'], POINTER(IUIAutomationEventHandler), 'handler' )), + COMMETHOD([], HRESULT, 'AddPropertyChangedEventHandlerNativeArray', + ( ['in'], POINTER(IUIAutomationElement), 'element' ), + ( ['in'], TreeScope, 'scope' ), + ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), + ( ['in'], POINTER(IUIAutomationPropertyChangedEventHandler), 'handler' ), + ( ['in'], POINTER(c_int), 'propertyArray' ), + ( ['in'], c_int, 'propertyCount' )), + COMMETHOD([], HRESULT, 'AddPropertyChangedEventHandler', + ( ['in'], POINTER(IUIAutomationElement), 'element' ), + ( ['in'], TreeScope, 'scope' ), + ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), + ( ['in'], POINTER(IUIAutomationPropertyChangedEventHandler), 'handler' ), + ( ['in'], _midlSAFEARRAY(c_int), 'propertyArray' )), + COMMETHOD([], HRESULT, 'RemovePropertyChangedEventHandler', + ( ['in'], POINTER(IUIAutomationElement), 'element' ), + ( ['in'], POINTER(IUIAutomationPropertyChangedEventHandler), 'handler' )), + COMMETHOD([], HRESULT, 'AddStructureChangedEventHandler', + ( ['in'], POINTER(IUIAutomationElement), 'element' ), + ( ['in'], TreeScope, 'scope' ), + ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), + ( ['in'], POINTER(IUIAutomationStructureChangedEventHandler), 'handler' )), + COMMETHOD([], HRESULT, 'RemoveStructureChangedEventHandler', + ( ['in'], POINTER(IUIAutomationElement), 'element' ), + ( ['in'], POINTER(IUIAutomationStructureChangedEventHandler), 'handler' )), + COMMETHOD([], HRESULT, 'AddFocusChangedEventHandler', + ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), + ( ['in'], POINTER(IUIAutomationFocusChangedEventHandler), 'handler' )), + COMMETHOD([], HRESULT, 'RemoveFocusChangedEventHandler', + ( ['in'], POINTER(IUIAutomationFocusChangedEventHandler), 'handler' )), + COMMETHOD([], HRESULT, 'RemoveAllEventHandlers'), + COMMETHOD([], HRESULT, 'IntNativeArrayToSafeArray', + ( ['in'], POINTER(c_int), 'array' ), + ( ['in'], c_int, 'arrayCount' ), + ( ['retval', 'out'], POINTER(_midlSAFEARRAY(c_int)), 'safeArray' )), + COMMETHOD([], HRESULT, 'IntSafeArrayToNativeArray', + ( ['in'], _midlSAFEARRAY(c_int), 'intArray' ), + ( ['out'], POINTER(POINTER(c_int)), 'array' ), + ( ['retval', 'out'], POINTER(c_int), 'arrayCount' )), + COMMETHOD([], HRESULT, 'RectToVariant', + ( ['in'], tagRECT, 'rc' ), + ( ['retval', 'out'], POINTER(VARIANT), 'var' )), + COMMETHOD([], HRESULT, 'VariantToRect', + ( ['in'], VARIANT, 'var' ), + ( ['retval', 'out'], POINTER(tagRECT), 'rc' )), + COMMETHOD([], HRESULT, 'SafeArrayToRectNativeArray', + ( ['in'], _midlSAFEARRAY(c_double), 'rects' ), + ( ['out'], POINTER(POINTER(tagRECT)), 'rectArray' ), + ( ['retval', 'out'], POINTER(c_int), 'rectArrayCount' )), + COMMETHOD([], HRESULT, 'CreateProxyFactoryEntry', + ( ['in'], POINTER(IUIAutomationProxyFactory), 'factory' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationProxyFactoryEntry)), 'factoryEntry' )), + COMMETHOD(['propget'], HRESULT, 'ProxyFactoryMapping', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationProxyFactoryMapping)), 'factoryMapping' )), + COMMETHOD([], HRESULT, 'GetPropertyProgrammaticName', + ( ['in'], c_int, 'property' ), + ( ['retval', 'out'], POINTER(BSTR), 'name' )), + COMMETHOD([], HRESULT, 'GetPatternProgrammaticName', + ( ['in'], c_int, 'pattern' ), + ( ['retval', 'out'], POINTER(BSTR), 'name' )), + COMMETHOD([], HRESULT, 'PollForPotentialSupportedPatterns', + ( ['in'], POINTER(IUIAutomationElement), 'pElement' ), + ( ['out'], POINTER(_midlSAFEARRAY(c_int)), 'patternIds' ), + ( ['out'], POINTER(_midlSAFEARRAY(BSTR)), 'patternNames' )), + COMMETHOD([], HRESULT, 'PollForPotentialSupportedProperties', + ( ['in'], POINTER(IUIAutomationElement), 'pElement' ), + ( ['out'], POINTER(_midlSAFEARRAY(c_int)), 'propertyIds' ), + ( ['out'], POINTER(_midlSAFEARRAY(BSTR)), 'propertyNames' )), + COMMETHOD([], HRESULT, 'CheckNotSupported', + ( ['in'], VARIANT, 'value' ), + ( ['retval', 'out'], POINTER(c_int), 'isNotSupported' )), + COMMETHOD(['propget'], HRESULT, 'ReservedNotSupportedValue', + ( ['retval', 'out'], POINTER(POINTER(IUnknown)), 'notSupportedValue' )), + COMMETHOD(['propget'], HRESULT, 'ReservedMixedAttributeValue', + ( ['retval', 'out'], POINTER(POINTER(IUnknown)), 'mixedAttributeValue' )), + COMMETHOD([], HRESULT, 'ElementFromIAccessible', + ( ['in'], POINTER(IAccessible), 'accessible' ), + ( ['in'], c_int, 'childId' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), + COMMETHOD([], HRESULT, 'ElementFromIAccessibleBuildCache', + ( ['in'], POINTER(IAccessible), 'accessible' ), + ( ['in'], c_int, 'childId' ), + ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), ] ################################################################ -## code template for IUIAutomationLegacyIAccessiblePattern implementation -##class IUIAutomationLegacyIAccessiblePattern_Impl(object): -## @property -## def CurrentDescription(self): +## code template for IUIAutomation implementation +##class IUIAutomation_Impl(object): +## def IntSafeArrayToNativeArray(self, intArray): ## '-no docstring-' -## #return pszDescription +## #return array, arrayCount ## -## @property -## def CurrentHelp(self): +## def AddPropertyChangedEventHandlerNativeArray(self, element, scope, cacheRequest, handler, propertyArray, propertyCount): ## '-no docstring-' -## #return pszHelp +## #return ## -## @property -## def CachedValue(self): +## def IntNativeArrayToSafeArray(self, array, arrayCount): ## '-no docstring-' -## #return pszValue +## #return safeArray ## -## def GetCachedSelection(self): +## def ElementFromHandleBuildCache(self, hwnd, cacheRequest): ## '-no docstring-' -## #return pvarSelectedChildren +## #return element ## -## @property -## def CurrentState(self): +## def ElementFromHandle(self, hwnd): ## '-no docstring-' -## #return pdwState +## #return element +## +## def CreateOrCondition(self, condition1, condition2): +## '-no docstring-' +## #return newCondition +## +## def PollForPotentialSupportedProperties(self, pElement): +## '-no docstring-' +## #return propertyIds, propertyNames ## ## @property -## def CurrentValue(self): +## def ContentViewWalker(self): ## '-no docstring-' -## #return pszValue +## #return walker +## +## def CreateTrueCondition(self): +## '-no docstring-' +## #return newCondition +## +## def AddAutomationEventHandler(self, eventId, element, scope, cacheRequest, handler): +## '-no docstring-' +## #return ## ## @property -## def CachedName(self): +## def ReservedNotSupportedValue(self): ## '-no docstring-' -## #return pszName +## #return notSupportedValue +## +## def CreatePropertyCondition(self, propertyId, value): +## '-no docstring-' +## #return newCondition +## +## def AddFocusChangedEventHandler(self, cacheRequest, handler): +## '-no docstring-' +## #return ## ## @property -## def CurrentName(self): +## def RawViewCondition(self): ## '-no docstring-' -## #return pszName +## #return condition +## +## def CreateAndConditionFromNativeArray(self, conditions, conditionCount): +## '-no docstring-' +## #return newCondition +## +## def CreateOrConditionFromNativeArray(self, conditions, conditionCount): +## '-no docstring-' +## #return newCondition +## +## def ElementFromIAccessibleBuildCache(self, accessible, childId, cacheRequest): +## '-no docstring-' +## #return element +## +## def CreateNotCondition(self, condition): +## '-no docstring-' +## #return newCondition +## +## def CreateOrConditionFromArray(self, conditions): +## '-no docstring-' +## #return newCondition +## +## def CreateAndConditionFromArray(self, conditions): +## '-no docstring-' +## #return newCondition +## +## def CheckNotSupported(self, value): +## '-no docstring-' +## #return isNotSupported +## +## def RemoveStructureChangedEventHandler(self, element, handler): +## '-no docstring-' +## #return +## +## def CreatePropertyConditionEx(self, propertyId, value, flags): +## '-no docstring-' +## #return newCondition +## +## def RemovePropertyChangedEventHandler(self, element, handler): +## '-no docstring-' +## #return +## +## def CreateTreeWalker(self, pCondition): +## '-no docstring-' +## #return walker +## +## def CreateCacheRequest(self): +## '-no docstring-' +## #return cacheRequest +## +## def ElementFromPointBuildCache(self, pt, cacheRequest): +## '-no docstring-' +## #return element +## +## def GetPatternProgrammaticName(self, pattern): +## '-no docstring-' +## #return name +## +## def RemoveAllEventHandlers(self): +## '-no docstring-' +## #return +## +## def ElementFromIAccessible(self, accessible, childId): +## '-no docstring-' +## #return element +## +## def AddStructureChangedEventHandler(self, element, scope, cacheRequest, handler): +## '-no docstring-' +## #return ## ## @property -## def CachedDescription(self): +## def ProxyFactoryMapping(self): ## '-no docstring-' -## #return pszDescription +## #return factoryMapping ## -## def GetIAccessible(self): +## def CreateProxyFactoryEntry(self, factory): +## '-no docstring-' +## #return factoryEntry +## +## def CompareRuntimeIds(self, runtimeId1, runtimeId2): ## '-no docstring-' -## #return ppAccessible +## #return areSame ## ## @property -## def CachedRole(self): +## def ControlViewWalker(self): ## '-no docstring-' -## #return pdwRole +## #return walker ## -## @property -## def CurrentChildId(self): +## def CreateAndCondition(self, condition1, condition2): ## '-no docstring-' -## #return pRetVal +## #return newCondition ## -## def DoDefaultAction(self): +## def GetRootElementBuildCache(self, cacheRequest): +## '-no docstring-' +## #return root +## +## def RemoveFocusChangedEventHandler(self, handler): ## '-no docstring-' ## #return ## -## @property -## def CachedChildId(self): +## def ElementFromPoint(self, pt): ## '-no docstring-' -## #return pRetVal +## #return element ## -## @property -## def CachedHelp(self): +## def GetPropertyProgrammaticName(self, property): ## '-no docstring-' -## #return pszHelp +## #return name ## -## @property -## def CurrentRole(self): +## def VariantToRect(self, var): ## '-no docstring-' -## #return pdwRole +## #return rc ## -## def SetValue(self, szValue): +## def GetRootElement(self): ## '-no docstring-' -## #return +## #return root ## -## def GetCurrentSelection(self): +## def SafeArrayToRectNativeArray(self, rects): ## '-no docstring-' -## #return pvarSelectedChildren +## #return rectArray, rectArrayCount ## -## @property -## def CachedDefaultAction(self): +## def GetFocusedElementBuildCache(self, cacheRequest): ## '-no docstring-' -## #return pszDefaultAction +## #return element ## ## @property -## def CachedState(self): +## def ReservedMixedAttributeValue(self): ## '-no docstring-' -## #return pdwState +## #return mixedAttributeValue ## ## @property -## def CurrentDefaultAction(self): +## def RawViewWalker(self): ## '-no docstring-' -## #return pszDefaultAction +## #return walker ## ## @property -## def CachedKeyboardShortcut(self): +## def ControlViewCondition(self): ## '-no docstring-' -## #return pszKeyboardShortcut +## #return condition ## -## def Select(self, flagsSelect): +## def GetFocusedElement(self): ## '-no docstring-' -## #return +## #return element ## -## @property -## def CurrentKeyboardShortcut(self): +## def CompareElements(self, el1, el2): ## '-no docstring-' -## #return pszKeyboardShortcut +## #return areSame ## - -UIA_IsTextPattern2AvailablePropertyId = 30119 # Constant c_int -UIA_StylesFillColorPropertyId = 30122 # Constant c_int -UIA_IsSynchronizedInputPatternAvailablePropertyId = 30110 # Constant c_int -class IRawElementProviderSimple(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{D6DD68D1-86FD-4332-8666-9ABEDEA2D24C}') - _idlflags_ = ['oleautomation'] -IRawElementProviderSimple._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'ProviderOptions', - ( ['retval', 'out'], POINTER(ProviderOptions), 'pRetVal' )), - COMMETHOD([], HRESULT, 'GetPatternProvider', - ( ['in'], c_int, 'patternId' ), - ( ['retval', 'out'], POINTER(POINTER(IUnknown)), 'pRetVal' )), - COMMETHOD([], HRESULT, 'GetPropertyValue', - ( ['in'], c_int, 'propertyId' ), - ( ['retval', 'out'], POINTER(VARIANT), 'pRetVal' )), - COMMETHOD(['propget'], HRESULT, 'HostRawElementProvider', - ( ['retval', 'out'], POINTER(POINTER(IRawElementProviderSimple)), 'pRetVal' )), -] -################################################################ -## code template for IRawElementProviderSimple implementation -##class IRawElementProviderSimple_Impl(object): -## @property -## def ProviderOptions(self): +## def RectToVariant(self, rc): ## '-no docstring-' -## #return pRetVal +## #return var ## -## def GetPatternProvider(self, patternId): +## def CreateFalseCondition(self): ## '-no docstring-' -## #return pRetVal +## #return newCondition ## -## @property -## def HostRawElementProvider(self): +## def AddPropertyChangedEventHandler(self, element, scope, cacheRequest, handler, propertyArray): ## '-no docstring-' -## #return pRetVal +## #return ## -## def GetPropertyValue(self, propertyId): +## @property +## def ContentViewCondition(self): ## '-no docstring-' -## #return pRetVal +## #return condition ## - -class IUIAutomationSynchronizedInputPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{2233BE0B-AFB7-448B-9FDA-3B378AA5EAE1}') - _idlflags_ = [] - -# values for enumeration 'SynchronizedInputType' -SynchronizedInputType_KeyUp = 1 -SynchronizedInputType_KeyDown = 2 -SynchronizedInputType_LeftMouseUp = 4 -SynchronizedInputType_LeftMouseDown = 8 -SynchronizedInputType_RightMouseUp = 16 -SynchronizedInputType_RightMouseDown = 32 -SynchronizedInputType = c_int # enum -IUIAutomationSynchronizedInputPattern._methods_ = [ - COMMETHOD([], HRESULT, 'StartListening', - ( ['in'], SynchronizedInputType, 'inputType' )), - COMMETHOD([], HRESULT, 'Cancel'), -] -################################################################ -## code template for IUIAutomationSynchronizedInputPattern implementation -##class IUIAutomationSynchronizedInputPattern_Impl(object): -## def Cancel(self): +## def PollForPotentialSupportedPatterns(self, pElement): ## '-no docstring-' -## #return +## #return patternIds, patternNames ## -## def StartListening(self, inputType): +## def RemoveAutomationEventHandler(self, eventId, element, handler): ## '-no docstring-' ## #return ## -class IUIAutomationTableItemPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{0B964EB3-EF2E-4464-9C79-61D61737A27E}') - _idlflags_ = [] -IUIAutomationTableItemPattern._methods_ = [ - COMMETHOD([], HRESULT, 'GetCurrentRowHeaderItems', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), - COMMETHOD([], HRESULT, 'GetCurrentColumnHeaderItems', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), - COMMETHOD([], HRESULT, 'GetCachedRowHeaderItems', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), - COMMETHOD([], HRESULT, 'GetCachedColumnHeaderItems', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), +IUIAutomation2._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'AutoSetFocus', + ( ['retval', 'out'], POINTER(c_int), 'AutoSetFocus' )), + COMMETHOD(['propput'], HRESULT, 'AutoSetFocus', + ( ['in'], c_int, 'AutoSetFocus' )), + COMMETHOD(['propget'], HRESULT, 'ConnectionTimeout', + ( ['retval', 'out'], POINTER(c_ulong), 'timeout' )), + COMMETHOD(['propput'], HRESULT, 'ConnectionTimeout', + ( ['in'], c_ulong, 'timeout' )), + COMMETHOD(['propget'], HRESULT, 'TransactionTimeout', + ( ['retval', 'out'], POINTER(c_ulong), 'timeout' )), + COMMETHOD(['propput'], HRESULT, 'TransactionTimeout', + ( ['in'], c_ulong, 'timeout' )), ] ################################################################ -## code template for IUIAutomationTableItemPattern implementation -##class IUIAutomationTableItemPattern_Impl(object): -## def GetCachedRowHeaderItems(self): +## code template for IUIAutomation2 implementation +##class IUIAutomation2_Impl(object): +## def _get(self): ## '-no docstring-' -## #return retVal -## -## def GetCurrentColumnHeaderItems(self): +## #return timeout +## def _set(self, timeout): ## '-no docstring-' -## #return retVal +## ConnectionTimeout = property(_get, _set, doc = _set.__doc__) ## -## def GetCachedColumnHeaderItems(self): +## def _get(self): ## '-no docstring-' -## #return retVal +## #return timeout +## def _set(self, timeout): +## '-no docstring-' +## TransactionTimeout = property(_get, _set, doc = _set.__doc__) ## -## def GetCurrentRowHeaderItems(self): +## def _get(self): ## '-no docstring-' -## #return retVal +## #return AutoSetFocus +## def _set(self, AutoSetFocus): +## '-no docstring-' +## AutoSetFocus = property(_get, _set, doc = _set.__doc__) ## -UIA_IsAnnotationPatternAvailablePropertyId = 30118 # Constant c_int -class IUIAutomationDragPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +class IUIAutomation3(IUIAutomation2): _case_insensitive_ = True - _iid_ = GUID('{1DC7B570-1F54-4BAD-BCDA-D36A722FB7BD}') + _iid_ = GUID('{73D768DA-9B51-4B89-936E-C209290973E7}') _idlflags_ = [] -IUIAutomationDragPattern._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'CurrentIsGrabbed', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedIsGrabbed', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentDropEffect', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedDropEffect', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentDropEffects', - ( ['retval', 'out'], POINTER(_midlSAFEARRAY(BSTR)), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedDropEffects', - ( ['retval', 'out'], POINTER(_midlSAFEARRAY(BSTR)), 'retVal' )), - COMMETHOD([], HRESULT, 'GetCurrentGrabbedItems', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), - COMMETHOD([], HRESULT, 'GetCachedGrabbedItems', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), +class IUIAutomationTextEditTextChangedEventHandler(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{92FAA680-E704-4156-931A-E32D5BB38F3F}') + _idlflags_ = ['oleautomation'] +IUIAutomation3._methods_ = [ + COMMETHOD([], HRESULT, 'AddTextEditTextChangedEventHandler', + ( ['in'], POINTER(IUIAutomationElement), 'element' ), + ( ['in'], TreeScope, 'scope' ), + ( ['in'], TextEditChangeType, 'TextEditChangeType' ), + ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), + ( ['in'], POINTER(IUIAutomationTextEditTextChangedEventHandler), 'handler' )), + COMMETHOD([], HRESULT, 'RemoveTextEditTextChangedEventHandler', + ( ['in'], POINTER(IUIAutomationElement), 'element' ), + ( ['in'], POINTER(IUIAutomationTextEditTextChangedEventHandler), 'handler' )), ] ################################################################ -## code template for IUIAutomationDragPattern implementation -##class IUIAutomationDragPattern_Impl(object): -## @property -## def CurrentIsGrabbed(self): -## '-no docstring-' -## #return retVal -## -## @property -## def CurrentDropEffects(self): -## '-no docstring-' -## #return retVal -## -## @property -## def CurrentDropEffect(self): -## '-no docstring-' -## #return retVal -## -## def GetCachedGrabbedItems(self): -## '-no docstring-' -## #return retVal -## -## @property -## def CachedDropEffect(self): +## code template for IUIAutomation3 implementation +##class IUIAutomation3_Impl(object): +## def AddTextEditTextChangedEventHandler(self, element, scope, TextEditChangeType, cacheRequest, handler): ## '-no docstring-' -## #return retVal +## #return ## -## @property -## def CachedIsGrabbed(self): +## def RemoveTextEditTextChangedEventHandler(self, element, handler): ## '-no docstring-' -## #return retVal +## #return ## -## @property -## def CachedDropEffects(self): + +class IUIAutomationSynchronizedInputPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{2233BE0B-AFB7-448B-9FDA-3B378AA5EAE1}') + _idlflags_ = [] + +# values for enumeration 'SynchronizedInputType' +SynchronizedInputType_KeyUp = 1 +SynchronizedInputType_KeyDown = 2 +SynchronizedInputType_LeftMouseUp = 4 +SynchronizedInputType_LeftMouseDown = 8 +SynchronizedInputType_RightMouseUp = 16 +SynchronizedInputType_RightMouseDown = 32 +SynchronizedInputType = c_int # enum +IUIAutomationSynchronizedInputPattern._methods_ = [ + COMMETHOD([], HRESULT, 'StartListening', + ( ['in'], SynchronizedInputType, 'inputType' )), + COMMETHOD([], HRESULT, 'Cancel'), +] +################################################################ +## code template for IUIAutomationSynchronizedInputPattern implementation +##class IUIAutomationSynchronizedInputPattern_Impl(object): +## def Cancel(self): ## '-no docstring-' -## #return retVal +## #return ## -## def GetCurrentGrabbedItems(self): +## def StartListening(self, inputType): ## '-no docstring-' -## #return retVal +## #return ## -UIA_StylesFillPatternStylePropertyId = 30123 # Constant c_int -UIA_GridItemColumnSpanPropertyId = 30067 # Constant c_int -UIA_AnnotationAnnotationTypeIdPropertyId = 30113 # Constant c_int -UIA_DragIsGrabbedPropertyId = 30138 # Constant c_int -UIA_MainLandmarkTypeId = 80002 # Constant c_int -UIA_AnnotationAuthorPropertyId = 30115 # Constant c_int -UIA_AnnotationTargetPropertyId = 30117 # Constant c_int -UIA_ScrollVerticallyScrollablePropertyId = 30058 # Constant c_int -StyleId_Quote = 70014 # Constant c_int -UIA_SpreadsheetItemFormulaPropertyId = 30129 # Constant c_int -UIA_StylesStyleIdPropertyId = 30120 # Constant c_int -UIA_StylesStyleNamePropertyId = 30121 # Constant c_int -UIA_WindowWindowVisualStatePropertyId = 30075 # Constant c_int -UIA_IsWindowPatternAvailablePropertyId = 30044 # Constant c_int class IUIAutomationWindowPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True _iid_ = GUID('{0FAEF453-9208-43EF-BBB2-3B485177864F}') _idlflags_ = [] +# values for enumeration 'WindowVisualState' +WindowVisualState_Normal = 0 +WindowVisualState_Maximized = 1 +WindowVisualState_Minimized = 2 +WindowVisualState = c_int # enum + # values for enumeration 'WindowInteractionState' WindowInteractionState_Running = 0 WindowInteractionState_Closing = 1 @@ -3181,404 +3344,336 @@ class IUIAutomationWindowPattern(comtypes.gen._00020430_0000_0000_C000_000000000 ## #return retVal ## -UIA_SelectionItemIsSelectedPropertyId = 30079 # Constant c_int -UIA_SpreadsheetItemAnnotationTypesPropertyId = 30131 # Constant c_int -UIA_WindowWindowInteractionStatePropertyId = 30076 # Constant c_int -UIA_WindowIsModalPropertyId = 30077 # Constant c_int -UIA_WindowIsTopmostPropertyId = 30078 # Constant c_int -UIA_SelectionItemSelectionContainerPropertyId = 30080 # Constant c_int -StyleId_Heading1 = 70001 # Constant c_int -UIA_LiveSettingPropertyId = 30135 # Constant c_int -UIA_IsTextChildPatternAvailablePropertyId = 30136 # Constant c_int -UIA_IsDragPatternAvailablePropertyId = 30137 # Constant c_int -UIA_DropTargetDropTargetEffectPropertyId = 30142 # Constant c_int -UIA_IsDropTargetPatternAvailablePropertyId = 30141 # Constant c_int -UIA_GridItemRowPropertyId = 30064 # Constant c_int -UIA_GridItemContainingGridPropertyId = 30068 # Constant c_int -UIA_IsScrollItemPatternAvailablePropertyId = 30035 # Constant c_int -UIA_GridItemRowSpanPropertyId = 30066 # Constant c_int -UIA_SayAsInterpretAsMetadataId = 100000 # Constant c_int -UIA_SearchLandmarkTypeId = 80004 # Constant c_int -UIA_DockDockPositionPropertyId = 30069 # Constant c_int -IUIAutomationProxyFactory._methods_ = [ - COMMETHOD([], HRESULT, 'CreateProvider', - ( ['in'], c_void_p, 'hwnd' ), - ( ['in'], c_int, 'idObject' ), - ( ['in'], c_int, 'idChild' ), - ( ['retval', 'out'], POINTER(POINTER(IRawElementProviderSimple)), 'provider' )), - COMMETHOD(['propget'], HRESULT, 'ProxyFactoryId', - ( ['retval', 'out'], POINTER(BSTR), 'factoryId' )), +class IUIAutomation4(IUIAutomation3): + _case_insensitive_ = True + _iid_ = GUID('{1189C02A-05F8-4319-8E21-E817E3DB2860}') + _idlflags_ = [] +class IUIAutomation5(IUIAutomation4): + _case_insensitive_ = True + _iid_ = GUID('{25F700C8-D816-4057-A9DC-3CBDEE77E256}') + _idlflags_ = [] +IUIAutomation4._methods_ = [ + COMMETHOD([], HRESULT, 'AddChangesEventHandler', + ( ['in'], POINTER(IUIAutomationElement), 'element' ), + ( ['in'], TreeScope, 'scope' ), + ( ['in'], POINTER(c_int), 'changeTypes' ), + ( ['in'], c_int, 'changesCount' ), + ( ['in'], POINTER(IUIAutomationCacheRequest), 'pCacheRequest' ), + ( ['in'], POINTER(IUIAutomationChangesEventHandler), 'handler' )), + COMMETHOD([], HRESULT, 'RemoveChangesEventHandler', + ( ['in'], POINTER(IUIAutomationElement), 'element' ), + ( ['in'], POINTER(IUIAutomationChangesEventHandler), 'handler' )), ] ################################################################ -## code template for IUIAutomationProxyFactory implementation -##class IUIAutomationProxyFactory_Impl(object): -## def CreateProvider(self, hwnd, idObject, idChild): +## code template for IUIAutomation4 implementation +##class IUIAutomation4_Impl(object): +## def RemoveChangesEventHandler(self, element, handler): ## '-no docstring-' -## #return provider +## #return ## -## @property -## def ProxyFactoryId(self): +## def AddChangesEventHandler(self, element, scope, changeTypes, changesCount, pCacheRequest, handler): ## '-no docstring-' -## #return factoryId +## #return ## -StyleId_Heading3 = 70003 # Constant c_int -UIA_Transform2ZoomLevelPropertyId = 30145 # Constant c_int -UIA_RangeValueLargeChangePropertyId = 30051 # Constant c_int -StyleId_Subtitle = 70011 # Constant c_int -UIA_MultipleViewSupportedViewsPropertyId = 30072 # Constant c_int -UIA_WindowCanMaximizePropertyId = 30073 # Constant c_int -IAccessible._methods_ = [ - COMMETHOD([dispid(-5000), 'hidden', 'propget'], HRESULT, 'accParent', - ( ['retval', 'out'], POINTER(POINTER(IDispatch)), 'ppdispParent' )), - COMMETHOD([dispid(-5001), 'hidden', 'propget'], HRESULT, 'accChildCount', - ( ['retval', 'out'], POINTER(c_int), 'pcountChildren' )), - COMMETHOD([dispid(-5002), 'hidden', 'propget'], HRESULT, 'accChild', - ( ['in'], VARIANT, 'varChild' ), - ( ['retval', 'out'], POINTER(POINTER(IDispatch)), 'ppdispChild' )), - COMMETHOD([dispid(-5003), 'hidden', 'propget'], HRESULT, 'accName', - ( ['in', 'optional'], VARIANT, 'varChild' ), - ( ['retval', 'out'], POINTER(BSTR), 'pszName' )), - COMMETHOD([dispid(-5004), 'hidden', 'propget'], HRESULT, 'accValue', - ( ['in', 'optional'], VARIANT, 'varChild' ), - ( ['retval', 'out'], POINTER(BSTR), 'pszValue' )), - COMMETHOD([dispid(-5005), 'hidden', 'propget'], HRESULT, 'accDescription', - ( ['in', 'optional'], VARIANT, 'varChild' ), - ( ['retval', 'out'], POINTER(BSTR), 'pszDescription' )), - COMMETHOD([dispid(-5006), 'hidden', 'propget'], HRESULT, 'accRole', - ( ['in', 'optional'], VARIANT, 'varChild' ), - ( ['retval', 'out'], POINTER(VARIANT), 'pvarRole' )), - COMMETHOD([dispid(-5007), 'hidden', 'propget'], HRESULT, 'accState', - ( ['in', 'optional'], VARIANT, 'varChild' ), - ( ['retval', 'out'], POINTER(VARIANT), 'pvarState' )), - COMMETHOD([dispid(-5008), 'hidden', 'propget'], HRESULT, 'accHelp', - ( ['in', 'optional'], VARIANT, 'varChild' ), - ( ['retval', 'out'], POINTER(BSTR), 'pszHelp' )), - COMMETHOD([dispid(-5009), 'hidden', 'propget'], HRESULT, 'accHelpTopic', - ( ['out'], POINTER(BSTR), 'pszHelpFile' ), - ( ['in', 'optional'], VARIANT, 'varChild' ), - ( ['retval', 'out'], POINTER(c_int), 'pidTopic' )), - COMMETHOD([dispid(-5010), 'hidden', 'propget'], HRESULT, 'accKeyboardShortcut', - ( ['in', 'optional'], VARIANT, 'varChild' ), - ( ['retval', 'out'], POINTER(BSTR), 'pszKeyboardShortcut' )), - COMMETHOD([dispid(-5011), 'hidden', 'propget'], HRESULT, 'accFocus', - ( ['retval', 'out'], POINTER(VARIANT), 'pvarChild' )), - COMMETHOD([dispid(-5012), 'hidden', 'propget'], HRESULT, 'accSelection', - ( ['retval', 'out'], POINTER(VARIANT), 'pvarChildren' )), - COMMETHOD([dispid(-5013), 'hidden', 'propget'], HRESULT, 'accDefaultAction', - ( ['in', 'optional'], VARIANT, 'varChild' ), - ( ['retval', 'out'], POINTER(BSTR), 'pszDefaultAction' )), - COMMETHOD([dispid(-5014), 'hidden'], HRESULT, 'accSelect', - ( ['in'], c_int, 'flagsSelect' ), - ( ['in', 'optional'], VARIANT, 'varChild' )), - COMMETHOD([dispid(-5015), 'hidden'], HRESULT, 'accLocation', - ( ['out'], POINTER(c_int), 'pxLeft' ), - ( ['out'], POINTER(c_int), 'pyTop' ), - ( ['out'], POINTER(c_int), 'pcxWidth' ), - ( ['out'], POINTER(c_int), 'pcyHeight' ), - ( ['in', 'optional'], VARIANT, 'varChild' )), - COMMETHOD([dispid(-5016), 'hidden'], HRESULT, 'accNavigate', - ( ['in'], c_int, 'navDir' ), - ( ['in', 'optional'], VARIANT, 'varStart' ), - ( ['retval', 'out'], POINTER(VARIANT), 'pvarEndUpAt' )), - COMMETHOD([dispid(-5017), 'hidden'], HRESULT, 'accHitTest', - ( ['in'], c_int, 'xLeft' ), - ( ['in'], c_int, 'yTop' ), - ( ['retval', 'out'], POINTER(VARIANT), 'pvarChild' )), - COMMETHOD([dispid(-5018), 'hidden'], HRESULT, 'accDoDefaultAction', - ( ['in', 'optional'], VARIANT, 'varChild' )), - COMMETHOD([dispid(-5003), 'hidden', 'propput'], HRESULT, 'accName', - ( ['in', 'optional'], VARIANT, 'varChild' ), - ( ['in'], BSTR, 'pszName' )), - COMMETHOD([dispid(-5004), 'hidden', 'propput'], HRESULT, 'accValue', - ( ['in', 'optional'], VARIANT, 'varChild' ), - ( ['in'], BSTR, 'pszValue' )), +IUIAutomation5._methods_ = [ + COMMETHOD([], HRESULT, 'AddNotificationEventHandler', + ( ['in'], POINTER(IUIAutomationElement), 'element' ), + ( ['in'], TreeScope, 'scope' ), + ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), + ( ['in'], POINTER(IUIAutomationNotificationEventHandler), 'handler' )), + COMMETHOD([], HRESULT, 'RemoveNotificationEventHandler', + ( ['in'], POINTER(IUIAutomationElement), 'element' ), + ( ['in'], POINTER(IUIAutomationNotificationEventHandler), 'handler' )), ] ################################################################ -## code template for IAccessible implementation -##class IAccessible_Impl(object): -## @property -## def accRole(self, varChild): -## '-no docstring-' -## #return pvarRole -## -## @property -## def accDescription(self, varChild): -## '-no docstring-' -## #return pszDescription -## -## def accLocation(self, varChild): -## '-no docstring-' -## #return pxLeft, pyTop, pcxWidth, pcyHeight -## -## @property -## def accState(self, varChild): -## '-no docstring-' -## #return pvarState -## -## def accNavigate(self, navDir, varStart): -## '-no docstring-' -## #return pvarEndUpAt -## -## def accDoDefaultAction(self, varChild): +## code template for IUIAutomation5 implementation +##class IUIAutomation5_Impl(object): +## def AddNotificationEventHandler(self, element, scope, cacheRequest, handler): ## '-no docstring-' ## #return ## -## @property -## def accChild(self, varChild): -## '-no docstring-' -## #return ppdispChild -## -## @property -## def accChildCount(self): -## '-no docstring-' -## #return pcountChildren -## -## @property -## def accHelp(self, varChild): -## '-no docstring-' -## #return pszHelp -## -## def _get(self, varChild): +## def RemoveNotificationEventHandler(self, element, handler): ## '-no docstring-' -## #return pszName -## def _set(self, varChild, pszName): -## '-no docstring-' -## accName = property(_get, _set, doc = _set.__doc__) +## #return ## -## def accSelect(self, flagsSelect, varChild): + +class IUIAutomationTablePattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{620E691C-EA96-4710-A850-754B24CE2417}') + _idlflags_ = [] + +# values for enumeration 'RowOrColumnMajor' +RowOrColumnMajor_RowMajor = 0 +RowOrColumnMajor_ColumnMajor = 1 +RowOrColumnMajor_Indeterminate = 2 +RowOrColumnMajor = c_int # enum +IUIAutomationTablePattern._methods_ = [ + COMMETHOD([], HRESULT, 'GetCurrentRowHeaders', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), + COMMETHOD([], HRESULT, 'GetCurrentColumnHeaders', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentRowOrColumnMajor', + ( ['retval', 'out'], POINTER(RowOrColumnMajor), 'retVal' )), + COMMETHOD([], HRESULT, 'GetCachedRowHeaders', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), + COMMETHOD([], HRESULT, 'GetCachedColumnHeaders', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedRowOrColumnMajor', + ( ['retval', 'out'], POINTER(RowOrColumnMajor), 'retVal' )), +] +################################################################ +## code template for IUIAutomationTablePattern implementation +##class IUIAutomationTablePattern_Impl(object): +## @property +## def CachedRowOrColumnMajor(self): ## '-no docstring-' -## #return +## #return retVal ## -## @property -## def accKeyboardShortcut(self, varChild): +## def GetCachedColumnHeaders(self): ## '-no docstring-' -## #return pszKeyboardShortcut +## #return retVal ## -## def accHitTest(self, xLeft, yTop): +## def GetCachedRowHeaders(self): ## '-no docstring-' -## #return pvarChild +## #return retVal ## -## @property -## def accSelection(self): +## def GetCurrentColumnHeaders(self): ## '-no docstring-' -## #return pvarChildren +## #return retVal ## ## @property -## def accDefaultAction(self, varChild): +## def CurrentRowOrColumnMajor(self): ## '-no docstring-' -## #return pszDefaultAction +## #return retVal ## -## @property -## def accParent(self): +## def GetCurrentRowHeaders(self): ## '-no docstring-' -## #return ppdispParent +## #return retVal ## + +class CUIAutomation8(CoClass): + u'The Central Class for UIAutomation8' + _reg_clsid_ = GUID('{E22AD333-B25F-460C-83D0-0581107395C9}') + _idlflags_ = [] + _typelib_path_ = typelib_path + _reg_typelib_ = ('{944DE083-8FB8-45CF-BCB7-C477ACB2F897}', 1, 0) +CUIAutomation8._com_interfaces_ = [IUIAutomation2, IUIAutomation3, IUIAutomation4, IUIAutomation5] + +class IUIAutomationTogglePattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{94CF8058-9B8D-4AB9-8BFD-4CD0A33C8C70}') + _idlflags_ = [] + +# values for enumeration 'ToggleState' +ToggleState_Off = 0 +ToggleState_On = 1 +ToggleState_Indeterminate = 2 +ToggleState = c_int # enum +IUIAutomationTogglePattern._methods_ = [ + COMMETHOD([], HRESULT, 'Toggle'), + COMMETHOD(['propget'], HRESULT, 'CurrentToggleState', + ( ['retval', 'out'], POINTER(ToggleState), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedToggleState', + ( ['retval', 'out'], POINTER(ToggleState), 'retVal' )), +] +################################################################ +## code template for IUIAutomationTogglePattern implementation +##class IUIAutomationTogglePattern_Impl(object): ## @property -## def accHelpTopic(self, varChild): +## def CurrentToggleState(self): ## '-no docstring-' -## #return pszHelpFile, pidTopic +## #return retVal ## -## def _get(self, varChild): -## '-no docstring-' -## #return pszValue -## def _set(self, varChild, pszValue): +## def Toggle(self): ## '-no docstring-' -## accValue = property(_get, _set, doc = _set.__doc__) +## #return ## ## @property -## def accFocus(self): +## def CachedToggleState(self): ## '-no docstring-' -## #return pvarChild +## #return retVal ## -StyleId_Heading4 = 70004 # Constant c_int -StyleId_Custom = 70000 # Constant c_int -UIA_IsSelectionPatternAvailablePropertyId = 30037 # Constant c_int -UIA_GridColumnCountPropertyId = 30063 # Constant c_int -UIA_IsGridItemPatternAvailablePropertyId = 30029 # Constant c_int -UIA_Transform2ZoomMaximumPropertyId = 30147 # Constant c_int -UIA_RangeValueValuePropertyId = 30047 # Constant c_int -class IUIAutomationBoolCondition(IUIAutomationCondition): +class IUIAutomationVirtualizedItemPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{1B4E1F2E-75EB-4D0B-8952-5A69988E2307}') + _iid_ = GUID('{6BA3D7A6-04CF-4F11-8793-A8D1CDE9969F}') _idlflags_ = [] -IUIAutomationBoolCondition._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'BooleanValue', - ( ['retval', 'out'], POINTER(c_int), 'boolVal' )), +IUIAutomationVirtualizedItemPattern._methods_ = [ + COMMETHOD([], HRESULT, 'Realize'), ] ################################################################ -## code template for IUIAutomationBoolCondition implementation -##class IUIAutomationBoolCondition_Impl(object): -## @property -## def BooleanValue(self): +## code template for IUIAutomationVirtualizedItemPattern implementation +##class IUIAutomationVirtualizedItemPattern_Impl(object): +## def Realize(self): ## '-no docstring-' -## #return boolVal +## #return ## -UIA_RangeValueMaximumPropertyId = 30050 # Constant c_int -UIA_RangeValueMinimumPropertyId = 30049 # Constant c_int -UIA_IsTextPatternAvailablePropertyId = 30040 # Constant c_int -UIA_IsTablePatternAvailablePropertyId = 30038 # Constant c_int -UIA_RangeValueSmallChangePropertyId = 30052 # Constant c_int -UIA_ValueIsReadOnlyPropertyId = 30046 # Constant c_int -UIA_IsTogglePatternAvailablePropertyId = 30041 # Constant c_int -UIA_ScrollHorizontalScrollPercentPropertyId = 30053 # Constant c_int -StyleId_BulletedList = 70015 # Constant c_int -StyleId_Heading7 = 70007 # Constant c_int -StyleId_Heading6 = 70006 # Constant c_int -UIA_ScrollVerticalViewSizePropertyId = 30056 # Constant c_int -UIA_ScrollHorizontallyScrollablePropertyId = 30057 # Constant c_int -UIA_ValueValuePropertyId = 30045 # Constant c_int -StyleId_Heading9 = 70009 # Constant c_int -UIA_IsSelectionItemPatternAvailablePropertyId = 30036 # Constant c_int -StyleId_Heading5 = 70005 # Constant c_int -UIA_RangeValueIsReadOnlyPropertyId = 30048 # Constant c_int -class IUIAutomationAndCondition(IUIAutomationCondition): +class CUIAutomation(CoClass): + u'The Central Class for UIAutomation' + _reg_clsid_ = GUID('{FF48DBA4-60EF-4201-AA87-54103EEF594E}') + _idlflags_ = [] + _typelib_path_ = typelib_path + _reg_typelib_ = ('{944DE083-8FB8-45CF-BCB7-C477ACB2F897}', 1, 0) +CUIAutomation._com_interfaces_ = [IUIAutomation] + +UIA_OverlineColorAttributeId = 40023 # Constant c_int +class IUIAutomationTableItemPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{A7D0AF36-B912-45FE-9855-091DDC174AEC}') + _iid_ = GUID('{0B964EB3-EF2E-4464-9C79-61D61737A27E}') _idlflags_ = [] -IUIAutomationAndCondition._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'ChildCount', - ( ['retval', 'out'], POINTER(c_int), 'ChildCount' )), - COMMETHOD([], HRESULT, 'GetChildrenAsNativeArray', - ( ['out'], POINTER(POINTER(POINTER(IUIAutomationCondition))), 'childArray' ), - ( ['out'], POINTER(c_int), 'childArrayCount' )), - COMMETHOD([], HRESULT, 'GetChildren', - ( ['retval', 'out'], POINTER(_midlSAFEARRAY(POINTER(IUIAutomationCondition))), 'childArray' )), +IUIAutomationTableItemPattern._methods_ = [ + COMMETHOD([], HRESULT, 'GetCurrentRowHeaderItems', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), + COMMETHOD([], HRESULT, 'GetCurrentColumnHeaderItems', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), + COMMETHOD([], HRESULT, 'GetCachedRowHeaderItems', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), + COMMETHOD([], HRESULT, 'GetCachedColumnHeaderItems', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), ] ################################################################ -## code template for IUIAutomationAndCondition implementation -##class IUIAutomationAndCondition_Impl(object): -## def GetChildren(self): +## code template for IUIAutomationTableItemPattern implementation +##class IUIAutomationTableItemPattern_Impl(object): +## def GetCachedRowHeaderItems(self): ## '-no docstring-' -## #return childArray +## #return retVal ## -## def GetChildrenAsNativeArray(self): +## def GetCurrentColumnHeaderItems(self): ## '-no docstring-' -## #return childArray, childArrayCount +## #return retVal ## -## @property -## def ChildCount(self): +## def GetCachedColumnHeaderItems(self): ## '-no docstring-' -## #return ChildCount +## #return retVal ## - -IUIAutomationEventHandler._methods_ = [ - COMMETHOD([], HRESULT, 'HandleAutomationEvent', - ( ['in'], POINTER(IUIAutomationElement), 'sender' ), - ( ['in'], c_int, 'eventId' )), -] -################################################################ -## code template for IUIAutomationEventHandler implementation -##class IUIAutomationEventHandler_Impl(object): -## def HandleAutomationEvent(self, sender, eventId): +## def GetCurrentRowHeaderItems(self): ## '-no docstring-' -## #return +## #return retVal ## -IUIAutomationTextEditTextChangedEventHandler._methods_ = [ - COMMETHOD([], HRESULT, 'HandleTextEditTextChangedEvent', - ( ['in'], POINTER(IUIAutomationElement), 'sender' ), - ( ['in'], TextEditChangeType, 'TextEditChangeType' ), - ( ['in'], _midlSAFEARRAY(BSTR), 'eventStrings' )), +class IUIAutomationExpandCollapsePattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{619BE086-1F4E-4EE4-BAFA-210128738730}') + _idlflags_ = [] +IUIAutomationExpandCollapsePattern._methods_ = [ + COMMETHOD([], HRESULT, 'Expand'), + COMMETHOD([], HRESULT, 'Collapse'), + COMMETHOD(['propget'], HRESULT, 'CurrentExpandCollapseState', + ( ['retval', 'out'], POINTER(ExpandCollapseState), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedExpandCollapseState', + ( ['retval', 'out'], POINTER(ExpandCollapseState), 'retVal' )), ] ################################################################ -## code template for IUIAutomationTextEditTextChangedEventHandler implementation -##class IUIAutomationTextEditTextChangedEventHandler_Impl(object): -## def HandleTextEditTextChangedEvent(self, sender, TextEditChangeType, eventStrings): +## code template for IUIAutomationExpandCollapsePattern implementation +##class IUIAutomationExpandCollapsePattern_Impl(object): +## @property +## def CachedExpandCollapseState(self): +## '-no docstring-' +## #return retVal +## +## def Collapse(self): ## '-no docstring-' ## #return ## - -class UiaChangeInfo(Structure): - pass -IUIAutomationChangesEventHandler._methods_ = [ - COMMETHOD([], HRESULT, 'HandleChangesEvent', - ( ['in'], POINTER(IUIAutomationElement), 'sender' ), - ( ['in'], POINTER(UiaChangeInfo), 'uiaChanges' ), - ( ['in'], c_int, 'changesCount' )), -] -################################################################ -## code template for IUIAutomationChangesEventHandler implementation -##class IUIAutomationChangesEventHandler_Impl(object): -## def HandleChangesEvent(self, sender, uiaChanges, changesCount): +## def Expand(self): ## '-no docstring-' ## #return ## +## @property +## def CurrentExpandCollapseState(self): +## '-no docstring-' +## #return retVal +## -UIA_Text_TextSelectionChangedEventId = 20014 # Constant c_int -class IUIAutomationSelectionItemPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +UIA_Transform2ZoomLevelPropertyId = 30145 # Constant c_int +class IUIAutomationTransformPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{A8EFA66A-0FDA-421A-9194-38021F3578EA}') + _iid_ = GUID('{A9B55844-A55D-4EF0-926D-569C16FF89BB}') _idlflags_ = [] -IUIAutomationSelectionItemPattern._methods_ = [ - COMMETHOD([], HRESULT, 'Select'), - COMMETHOD([], HRESULT, 'AddToSelection'), - COMMETHOD([], HRESULT, 'RemoveFromSelection'), - COMMETHOD(['propget'], HRESULT, 'CurrentIsSelected', +IUIAutomationTransformPattern._methods_ = [ + COMMETHOD([], HRESULT, 'Move', + ( ['in'], c_double, 'x' ), + ( ['in'], c_double, 'y' )), + COMMETHOD([], HRESULT, 'Resize', + ( ['in'], c_double, 'width' ), + ( ['in'], c_double, 'height' )), + COMMETHOD([], HRESULT, 'Rotate', + ( ['in'], c_double, 'degrees' )), + COMMETHOD(['propget'], HRESULT, 'CurrentCanMove', ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentSelectionContainer', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedIsSelected', + COMMETHOD(['propget'], HRESULT, 'CurrentCanResize', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentCanRotate', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedCanMove', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedCanResize', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedCanRotate', ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedSelectionContainer', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'retVal' )), ] ################################################################ -## code template for IUIAutomationSelectionItemPattern implementation -##class IUIAutomationSelectionItemPattern_Impl(object): -## def RemoveFromSelection(self): +## code template for IUIAutomationTransformPattern implementation +##class IUIAutomationTransformPattern_Impl(object): +## @property +## def CachedCanMove(self): +## '-no docstring-' +## #return retVal +## +## def Rotate(self, degrees): ## '-no docstring-' ## #return ## ## @property -## def CachedSelectionContainer(self): +## def CachedCanRotate(self): ## '-no docstring-' ## #return retVal ## -## @property -## def CachedIsSelected(self): +## def Move(self, x, y): ## '-no docstring-' -## #return retVal +## #return ## ## @property -## def CurrentIsSelected(self): +## def CurrentCanRotate(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CurrentSelectionContainer(self): +## def CurrentCanMove(self): ## '-no docstring-' ## #return retVal ## -## def AddToSelection(self): +## @property +## def CachedCanResize(self): ## '-no docstring-' -## #return +## #return retVal ## -## def Select(self): +## @property +## def CurrentCanResize(self): ## '-no docstring-' -## #return +## #return retVal ## - -IUIAutomationPropertyChangedEventHandler._methods_ = [ - COMMETHOD([], HRESULT, 'HandlePropertyChangedEvent', - ( ['in'], POINTER(IUIAutomationElement), 'sender' ), - ( ['in'], c_int, 'propertyId' ), - ( ['in'], VARIANT, 'newValue' )), -] -################################################################ -## code template for IUIAutomationPropertyChangedEventHandler implementation -##class IUIAutomationPropertyChangedEventHandler_Impl(object): -## def HandlePropertyChangedEvent(self, sender, propertyId, newValue): +## def Resize(self, width, height): ## '-no docstring-' ## #return ## +UIA_WindowIsTopmostPropertyId = 30078 # Constant c_int +UIA_PositionInSetPropertyId = 30152 # Constant c_int class IUIAutomationCustomNavigationPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True _iid_ = GUID('{01EA217A-1766-47ED-A6CC-ACF492854B1F}') _idlflags_ = [] + +# values for enumeration 'NavigateDirection' +NavigateDirection_Parent = 0 +NavigateDirection_NextSibling = 1 +NavigateDirection_PreviousSibling = 2 +NavigateDirection_FirstChild = 3 +NavigateDirection_LastChild = 4 +NavigateDirection = c_int # enum IUIAutomationCustomNavigationPattern._methods_ = [ COMMETHOD([], HRESULT, 'Navigate', ( ['in'], NavigateDirection, 'direction' ), @@ -3592,455 +3687,378 @@ class IUIAutomationCustomNavigationPattern(comtypes.gen._00020430_0000_0000_C000 ## #return pRetVal ## -UIA_RangeValuePatternId = 10003 # Constant c_int - -# values for enumeration 'StructureChangeType' -StructureChangeType_ChildAdded = 0 -StructureChangeType_ChildRemoved = 1 -StructureChangeType_ChildrenInvalidated = 2 -StructureChangeType_ChildrenBulkAdded = 3 -StructureChangeType_ChildrenBulkRemoved = 4 -StructureChangeType_ChildrenReordered = 5 -StructureChangeType = c_int # enum -IUIAutomationStructureChangedEventHandler._methods_ = [ - COMMETHOD([], HRESULT, 'HandleStructureChangedEvent', - ( ['in'], POINTER(IUIAutomationElement), 'sender' ), - ( ['in'], StructureChangeType, 'changeType' ), - ( ['in'], _midlSAFEARRAY(c_int), 'runtimeId' )), -] -################################################################ -## code template for IUIAutomationStructureChangedEventHandler implementation -##class IUIAutomationStructureChangedEventHandler_Impl(object): -## def HandleStructureChangedEvent(self, sender, changeType, runtimeId): -## '-no docstring-' -## #return -## - -IUIAutomationElementArray._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'Length', - ( ['retval', 'out'], POINTER(c_int), 'Length' )), - COMMETHOD([], HRESULT, 'GetElement', - ( ['in'], c_int, 'index' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), +class IUIAutomationTransformPattern2(IUIAutomationTransformPattern): + _case_insensitive_ = True + _iid_ = GUID('{6D74D017-6ECB-4381-B38B-3C17A48FF1C2}') + _idlflags_ = [] +IUIAutomationTransformPattern2._methods_ = [ + COMMETHOD([], HRESULT, 'Zoom', + ( ['in'], c_double, 'zoomValue' )), + COMMETHOD([], HRESULT, 'ZoomByUnit', + ( ['in'], ZoomUnit, 'ZoomUnit' )), + COMMETHOD(['propget'], HRESULT, 'CurrentCanZoom', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedCanZoom', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentZoomLevel', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedZoomLevel', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentZoomMinimum', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedZoomMinimum', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentZoomMaximum', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedZoomMaximum', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), ] ################################################################ -## code template for IUIAutomationElementArray implementation -##class IUIAutomationElementArray_Impl(object): +## code template for IUIAutomationTransformPattern2 implementation +##class IUIAutomationTransformPattern2_Impl(object): ## @property -## def Length(self): -## '-no docstring-' -## #return Length -## -## def GetElement(self, index): -## '-no docstring-' -## #return element -## - -UIA_Drag_DragStartEventId = 20026 # Constant c_int -IUIAutomationTreeWalker._methods_ = [ - COMMETHOD([], HRESULT, 'GetParentElement', - ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'parent' )), - COMMETHOD([], HRESULT, 'GetFirstChildElement', - ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'first' )), - COMMETHOD([], HRESULT, 'GetLastChildElement', - ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'last' )), - COMMETHOD([], HRESULT, 'GetNextSiblingElement', - ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'next' )), - COMMETHOD([], HRESULT, 'GetPreviousSiblingElement', - ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'previous' )), - COMMETHOD([], HRESULT, 'NormalizeElement', - ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'normalized' )), - COMMETHOD([], HRESULT, 'GetParentElementBuildCache', - ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'parent' )), - COMMETHOD([], HRESULT, 'GetFirstChildElementBuildCache', - ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'first' )), - COMMETHOD([], HRESULT, 'GetLastChildElementBuildCache', - ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'last' )), - COMMETHOD([], HRESULT, 'GetNextSiblingElementBuildCache', - ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'next' )), - COMMETHOD([], HRESULT, 'GetPreviousSiblingElementBuildCache', - ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'previous' )), - COMMETHOD([], HRESULT, 'NormalizeElementBuildCache', - ( ['in'], POINTER(IUIAutomationElement), 'element' ), - ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'normalized' )), - COMMETHOD(['propget'], HRESULT, 'condition', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'condition' )), -] -################################################################ -## code template for IUIAutomationTreeWalker implementation -##class IUIAutomationTreeWalker_Impl(object): -## def GetFirstChildElementBuildCache(self, element, cacheRequest): -## '-no docstring-' -## #return first -## -## def GetParentElement(self, element): -## '-no docstring-' -## #return parent -## -## def GetLastChildElement(self, element): -## '-no docstring-' -## #return last -## -## def GetPreviousSiblingElementBuildCache(self, element, cacheRequest): -## '-no docstring-' -## #return previous -## -## def GetParentElementBuildCache(self, element, cacheRequest): -## '-no docstring-' -## #return parent -## -## def GetNextSiblingElementBuildCache(self, element, cacheRequest): -## '-no docstring-' -## #return next -## -## def GetNextSiblingElement(self, element): -## '-no docstring-' -## #return next -## -## def GetPreviousSiblingElement(self, element): +## def CachedZoomMinimum(self): ## '-no docstring-' -## #return previous +## #return retVal ## -## def GetLastChildElementBuildCache(self, element, cacheRequest): +## @property +## def CurrentZoomMinimum(self): ## '-no docstring-' -## #return last +## #return retVal ## -## def GetFirstChildElement(self, element): +## @property +## def CachedCanZoom(self): ## '-no docstring-' -## #return first +## #return retVal ## -## def NormalizeElementBuildCache(self, element, cacheRequest): +## @property +## def CachedZoomMaximum(self): ## '-no docstring-' -## #return normalized +## #return retVal ## ## @property -## def condition(self): +## def CurrentCanZoom(self): ## '-no docstring-' -## #return condition +## #return retVal ## -## def NormalizeElement(self, element): +## def ZoomByUnit(self, ZoomUnit): ## '-no docstring-' -## #return normalized +## #return ## - -class IUIAutomationPropertyCondition(IUIAutomationCondition): - _case_insensitive_ = True - _iid_ = GUID('{99EBF2CB-5578-4267-9AD4-AFD6EA77E94B}') - _idlflags_ = [] -IUIAutomationPropertyCondition._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'propertyId', - ( ['retval', 'out'], POINTER(c_int), 'propertyId' )), - COMMETHOD(['propget'], HRESULT, 'PropertyValue', - ( ['retval', 'out'], POINTER(VARIANT), 'PropertyValue' )), - COMMETHOD(['propget'], HRESULT, 'PropertyConditionFlags', - ( ['retval', 'out'], POINTER(PropertyConditionFlags), 'flags' )), -] -################################################################ -## code template for IUIAutomationPropertyCondition implementation -##class IUIAutomationPropertyCondition_Impl(object): ## @property -## def PropertyConditionFlags(self): +## def CachedZoomLevel(self): ## '-no docstring-' -## #return flags +## #return retVal ## -## @property -## def propertyId(self): +## def Zoom(self, zoomValue): ## '-no docstring-' -## #return propertyId +## #return ## ## @property -## def PropertyValue(self): +## def CurrentZoomLevel(self): ## '-no docstring-' -## #return PropertyValue +## #return retVal ## - -IUIAutomationFocusChangedEventHandler._methods_ = [ - COMMETHOD([], HRESULT, 'HandleFocusChangedEvent', - ( ['in'], POINTER(IUIAutomationElement), 'sender' )), -] -################################################################ -## code template for IUIAutomationFocusChangedEventHandler implementation -##class IUIAutomationFocusChangedEventHandler_Impl(object): -## def HandleFocusChangedEvent(self, sender): +## @property +## def CurrentZoomMaximum(self): ## '-no docstring-' -## #return +## #return retVal ## -class IUIAutomationGridPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +UIA_LegacyIAccessibleValuePropertyId = 30093 # Constant c_int +UIA_IsSpreadsheetItemPatternAvailablePropertyId = 30132 # Constant c_int +UIA_IsSpreadsheetPatternAvailablePropertyId = 30128 # Constant c_int +AnnotationType_InsertionChange = 60011 # Constant c_int +AnnotationType_FormatChange = 60014 # Constant c_int +AnnotationType_MoveChange = 60013 # Constant c_int +AnnotationType_Endnote = 60009 # Constant c_int +UIA_SpreadsheetItemAnnotationObjectsPropertyId = 30130 # Constant c_int +AnnotationType_DeletionChange = 60012 # Constant c_int +UIA_VisualEffectsPropertyId = 30163 # Constant c_int +UIA_OutlineThicknessPropertyId = 30164 # Constant c_int +UIA_CenterPointPropertyId = 30165 # Constant c_int +UIA_RotationPropertyId = 30166 # Constant c_int +UIA_SizePropertyId = 30167 # Constant c_int +UIA_IsSelectionPattern2AvailablePropertyId = 30168 # Constant c_int +UIA_Selection2FirstSelectedItemPropertyId = 30169 # Constant c_int +UIA_Selection2LastSelectedItemPropertyId = 30170 # Constant c_int +UIA_Selection2CurrentSelectedItemPropertyId = 30171 # Constant c_int +UIA_Selection2ItemCountPropertyId = 30172 # Constant c_int +AnnotationType_Footnote = 60010 # Constant c_int +UIA_BulletStyleAttributeId = 40002 # Constant c_int +UIA_CapStyleAttributeId = 40003 # Constant c_int +UIA_CultureAttributeId = 40004 # Constant c_int +UIA_FontNameAttributeId = 40005 # Constant c_int +UIA_FontSizeAttributeId = 40006 # Constant c_int +UIA_FontWeightAttributeId = 40007 # Constant c_int +UIA_ForegroundColorAttributeId = 40008 # Constant c_int +UIA_HorizontalTextAlignmentAttributeId = 40009 # Constant c_int +UIA_IndentationFirstLineAttributeId = 40010 # Constant c_int +UIA_IndentationLeadingAttributeId = 40011 # Constant c_int +UIA_IndentationTrailingAttributeId = 40012 # Constant c_int +UIA_IsHiddenAttributeId = 40013 # Constant c_int +UIA_IsItalicAttributeId = 40014 # Constant c_int +UIA_IsReadOnlyAttributeId = 40015 # Constant c_int +UIA_IsSubscriptAttributeId = 40016 # Constant c_int +UIA_IsSuperscriptAttributeId = 40017 # Constant c_int +UIA_MarginBottomAttributeId = 40018 # Constant c_int +UIA_MarginLeadingAttributeId = 40019 # Constant c_int +UIA_MarginTopAttributeId = 40020 # Constant c_int +UIA_MarginTrailingAttributeId = 40021 # Constant c_int +UIA_OutlineStylesAttributeId = 40022 # Constant c_int +class IUIAutomationSelectionItemPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{414C3CDC-856B-4F5B-8538-3131C6302550}') + _iid_ = GUID('{A8EFA66A-0FDA-421A-9194-38021F3578EA}') _idlflags_ = [] -IUIAutomationGridPattern._methods_ = [ - COMMETHOD([], HRESULT, 'GetItem', - ( ['in'], c_int, 'row' ), - ( ['in'], c_int, 'column' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'element' )), - COMMETHOD(['propget'], HRESULT, 'CurrentRowCount', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentColumnCount', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedRowCount', +IUIAutomationSelectionItemPattern._methods_ = [ + COMMETHOD([], HRESULT, 'Select'), + COMMETHOD([], HRESULT, 'AddToSelection'), + COMMETHOD([], HRESULT, 'RemoveFromSelection'), + COMMETHOD(['propget'], HRESULT, 'CurrentIsSelected', ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedColumnCount', + COMMETHOD(['propget'], HRESULT, 'CurrentSelectionContainer', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedIsSelected', ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedSelectionContainer', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'retVal' )), ] ################################################################ -## code template for IUIAutomationGridPattern implementation -##class IUIAutomationGridPattern_Impl(object): -## @property -## def CurrentColumnCount(self): +## code template for IUIAutomationSelectionItemPattern implementation +##class IUIAutomationSelectionItemPattern_Impl(object): +## def RemoveFromSelection(self): ## '-no docstring-' -## #return retVal +## #return ## ## @property -## def CurrentRowCount(self): +## def CachedSelectionContainer(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CachedColumnCount(self): +## def CachedIsSelected(self): ## '-no docstring-' ## #return retVal ## -## def GetItem(self, row, column): +## @property +## def CurrentIsSelected(self): ## '-no docstring-' -## #return element +## #return retVal ## ## @property -## def CachedRowCount(self): +## def CurrentSelectionContainer(self): ## '-no docstring-' ## #return retVal ## - -UIA_SelectionItem_ElementSelectedEventId = 20012 # Constant c_int -UIA_IsExpandCollapsePatternAvailablePropertyId = 30028 # Constant c_int -class IUIAutomationInvokePattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{FB377FBE-8EA6-46D5-9C73-6499642D3059}') - _idlflags_ = [] -IUIAutomationInvokePattern._methods_ = [ - COMMETHOD([], HRESULT, 'Invoke'), -] -################################################################ -## code template for IUIAutomationInvokePattern implementation -##class IUIAutomationInvokePattern_Impl(object): -## def Invoke(self): +## def AddToSelection(self): ## '-no docstring-' ## #return ## - -class IUIAutomationNotCondition(IUIAutomationCondition): - _case_insensitive_ = True - _iid_ = GUID('{F528B657-847B-498C-8896-D52B565407A1}') - _idlflags_ = [] -IUIAutomationNotCondition._methods_ = [ - COMMETHOD([], HRESULT, 'GetChild', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'condition' )), -] -################################################################ -## code template for IUIAutomationNotCondition implementation -##class IUIAutomationNotCondition_Impl(object): -## def GetChild(self): +## def Select(self): ## '-no docstring-' -## #return condition +## #return ## -UIA_Drag_DragCancelEventId = 20027 # Constant c_int -UIA_IsSpreadsheetPatternAvailablePropertyId = 30128 # Constant c_int -UIA_DragGrabbedItemsPropertyId = 30144 # Constant c_int -UIA_SpreadsheetPatternId = 10026 # Constant c_int -UIA_IsTextEditPatternAvailablePropertyId = 30149 # Constant c_int -UIA_ScrollPatternId = 10004 # Constant c_int -UIA_ScrollVerticalScrollPercentPropertyId = 30055 # Constant c_int -UIA_IsStylesPatternAvailablePropertyId = 30127 # Constant c_int -UIA_LegacyIAccessibleValuePropertyId = 30093 # Constant c_int -UIA_LegacyIAccessibleKeyboardShortcutPropertyId = 30098 # Constant c_int -UIA_MultipleViewPatternId = 10008 # Constant c_int -UIA_ValuePatternId = 10002 # Constant c_int -UIA_OptimizeForVisualContentPropertyId = 30111 # Constant c_int -UIA_GridPatternId = 10006 # Constant c_int -UIA_FontNameAttributeId = 40005 # Constant c_int -UIA_SelectionPatternId = 10001 # Constant c_int -UIA_ExpandCollapsePatternId = 10005 # Constant c_int - -# values for enumeration 'AutomationElementMode' -AutomationElementMode_None = 0 -AutomationElementMode_Full = 1 -AutomationElementMode = c_int # enum -StyleId_Normal = 70012 # Constant c_int -class IUIAutomationDockPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +UIA_OverlineStyleAttributeId = 40024 # Constant c_int +UIA_StrikethroughColorAttributeId = 40025 # Constant c_int +UIA_StrikethroughStyleAttributeId = 40026 # Constant c_int +UIA_TabsAttributeId = 40027 # Constant c_int +UIA_TextFlowDirectionsAttributeId = 40028 # Constant c_int +UIA_UnderlineColorAttributeId = 40029 # Constant c_int +UIA_UnderlineStyleAttributeId = 40030 # Constant c_int +UIA_AnnotationTypesAttributeId = 40031 # Constant c_int +UIA_AriaRolePropertyId = 30101 # Constant c_int +UIA_StyleNameAttributeId = 40033 # Constant c_int +UIA_StyleIdAttributeId = 40034 # Constant c_int +UIA_LinkAttributeId = 40035 # Constant c_int +UIA_IsActiveAttributeId = 40036 # Constant c_int +UIA_SelectionActiveEndAttributeId = 40037 # Constant c_int +UIA_CaretPositionAttributeId = 40038 # Constant c_int +UIA_CaretBidiModeAttributeId = 40039 # Constant c_int +UIA_LineSpacingAttributeId = 40040 # Constant c_int +UIA_BeforeParagraphSpacingAttributeId = 40041 # Constant c_int +UIA_AfterParagraphSpacingAttributeId = 40042 # Constant c_int +UIA_SayAsInterpretAsAttributeId = 40043 # Constant c_int +UIA_ButtonControlTypeId = 50000 # Constant c_int +UIA_CalendarControlTypeId = 50001 # Constant c_int +UIA_CheckBoxControlTypeId = 50002 # Constant c_int +UIA_ComboBoxControlTypeId = 50003 # Constant c_int +UIA_EditControlTypeId = 50004 # Constant c_int +UIA_HyperlinkControlTypeId = 50005 # Constant c_int +UIA_ImageControlTypeId = 50006 # Constant c_int +UIA_ListItemControlTypeId = 50007 # Constant c_int +UIA_ListControlTypeId = 50008 # Constant c_int +UIA_MenuControlTypeId = 50009 # Constant c_int +UIA_MenuBarControlTypeId = 50010 # Constant c_int +UIA_MenuItemControlTypeId = 50011 # Constant c_int +UIA_ProgressBarControlTypeId = 50012 # Constant c_int +UIA_RadioButtonControlTypeId = 50013 # Constant c_int +UIA_ScrollBarControlTypeId = 50014 # Constant c_int +UIA_SliderControlTypeId = 50015 # Constant c_int +UIA_SpinnerControlTypeId = 50016 # Constant c_int +UIA_StatusBarControlTypeId = 50017 # Constant c_int +UIA_TabControlTypeId = 50018 # Constant c_int +UIA_TabItemControlTypeId = 50019 # Constant c_int +UIA_TextControlTypeId = 50020 # Constant c_int +UIA_ToolBarControlTypeId = 50021 # Constant c_int +UIA_ToolTipControlTypeId = 50022 # Constant c_int +UIA_TreeControlTypeId = 50023 # Constant c_int +UIA_TreeItemControlTypeId = 50024 # Constant c_int +UIA_CustomControlTypeId = 50025 # Constant c_int +UIA_GroupControlTypeId = 50026 # Constant c_int +UIA_ThumbControlTypeId = 50027 # Constant c_int +UIA_DataGridControlTypeId = 50028 # Constant c_int +UIA_DataItemControlTypeId = 50029 # Constant c_int +UIA_DocumentControlTypeId = 50030 # Constant c_int +UIA_SplitButtonControlTypeId = 50031 # Constant c_int +UIA_WindowControlTypeId = 50032 # Constant c_int +UIA_PaneControlTypeId = 50033 # Constant c_int +UIA_HeaderControlTypeId = 50034 # Constant c_int +UIA_HeaderItemControlTypeId = 50035 # Constant c_int +UIA_TableControlTypeId = 50036 # Constant c_int +UIA_TitleBarControlTypeId = 50037 # Constant c_int +UIA_SeparatorControlTypeId = 50038 # Constant c_int +UIA_SemanticZoomControlTypeId = 50039 # Constant c_int +UIA_AppBarControlTypeId = 50040 # Constant c_int +AnnotationType_Unknown = 60000 # Constant c_int +AnnotationType_SpellingError = 60001 # Constant c_int +UIA_AutomationPropertyChangedEventId = 20004 # Constant c_int +AnnotationType_GrammarError = 60002 # Constant c_int +AnnotationType_Comment = 60003 # Constant c_int +AnnotationType_FormulaError = 60004 # Constant c_int +AnnotationType_TrackChanges = 60005 # Constant c_int +AnnotationType_Header = 60006 # Constant c_int +AnnotationType_Footer = 60007 # Constant c_int +AnnotationType_Highlighted = 60008 # Constant c_int +class IUIAutomationGridItemPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{FDE5EF97-1464-48F6-90BF-43D0948E86EC}') + _iid_ = GUID('{78F8EF57-66C3-4E09-BD7C-E79B2004894D}') _idlflags_ = [] - -# values for enumeration 'DockPosition' -DockPosition_Top = 0 -DockPosition_Left = 1 -DockPosition_Bottom = 2 -DockPosition_Right = 3 -DockPosition_Fill = 4 -DockPosition_None = 5 -DockPosition = c_int # enum -IUIAutomationDockPattern._methods_ = [ - COMMETHOD([], HRESULT, 'SetDockPosition', - ( ['in'], DockPosition, 'dockPos' )), - COMMETHOD(['propget'], HRESULT, 'CurrentDockPosition', - ( ['retval', 'out'], POINTER(DockPosition), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedDockPosition', - ( ['retval', 'out'], POINTER(DockPosition), 'retVal' )), +IUIAutomationGridItemPattern._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'CurrentContainingGrid', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentRow', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentColumn', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentRowSpan', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentColumnSpan', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedContainingGrid', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedRow', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedColumn', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedRowSpan', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedColumnSpan', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), ] ################################################################ -## code template for IUIAutomationDockPattern implementation -##class IUIAutomationDockPattern_Impl(object): +## code template for IUIAutomationGridItemPattern implementation +##class IUIAutomationGridItemPattern_Impl(object): ## @property -## def CachedDockPosition(self): +## def CurrentColumn(self): ## '-no docstring-' ## #return retVal ## -## def SetDockPosition(self, dockPos): +## @property +## def CurrentRow(self): ## '-no docstring-' -## #return +## #return retVal ## ## @property -## def CurrentDockPosition(self): +## def CachedColumn(self): ## '-no docstring-' ## #return retVal ## - -UIA_SelectionCanSelectMultiplePropertyId = 30060 # Constant c_int -UIA_FormLandmarkTypeId = 80001 # Constant c_int -UIA_IsDataValidForFormPropertyId = 30103 # Constant c_int -UIA_BackgroundColorAttributeId = 40001 # Constant c_int -UIA_LegacyIAccessibleSelectionPropertyId = 30099 # Constant c_int -class Library(object): - name = u'UIAutomationClient' - _reg_typelib_ = ('{944DE083-8FB8-45CF-BCB7-C477ACB2F897}', 1, 0) - -class IUIAutomationDropTargetPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{69A095F7-EEE4-430E-A46B-FB73B1AE39A5}') - _idlflags_ = [] -IUIAutomationDropTargetPattern._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'CurrentDropTargetEffect', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedDropTargetEffect', - ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentDropTargetEffects', - ( ['retval', 'out'], POINTER(_midlSAFEARRAY(BSTR)), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedDropTargetEffects', - ( ['retval', 'out'], POINTER(_midlSAFEARRAY(BSTR)), 'retVal' )), -] -################################################################ -## code template for IUIAutomationDropTargetPattern implementation -##class IUIAutomationDropTargetPattern_Impl(object): ## @property -## def CachedDropTargetEffects(self): +## def CurrentContainingGrid(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CurrentDropTargetEffect(self): +## def CachedRowSpan(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CachedDropTargetEffect(self): +## def CachedColumnSpan(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CurrentDropTargetEffects(self): +## def CachedContainingGrid(self): ## '-no docstring-' ## #return retVal ## - -UIA_DropTargetDropTargetEffectsPropertyId = 30143 # Constant c_int -AnnotationType_Author = 60019 # Constant c_int -UIA_NavigationLandmarkTypeId = 80003 # Constant c_int -UIA_GridItemPatternId = 10007 # Constant c_int -IUIAutomationCacheRequest._methods_ = [ - COMMETHOD([], HRESULT, 'AddProperty', - ( ['in'], c_int, 'propertyId' )), - COMMETHOD([], HRESULT, 'AddPattern', - ( ['in'], c_int, 'patternId' )), - COMMETHOD([], HRESULT, 'Clone', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCacheRequest)), 'clonedRequest' )), - COMMETHOD(['propget'], HRESULT, 'TreeScope', - ( ['retval', 'out'], POINTER(TreeScope), 'scope' )), - COMMETHOD(['propput'], HRESULT, 'TreeScope', - ( ['in'], TreeScope, 'scope' )), - COMMETHOD(['propget'], HRESULT, 'TreeFilter', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationCondition)), 'filter' )), - COMMETHOD(['propput'], HRESULT, 'TreeFilter', - ( ['in'], POINTER(IUIAutomationCondition), 'filter' )), - COMMETHOD(['propget'], HRESULT, 'AutomationElementMode', - ( ['retval', 'out'], POINTER(AutomationElementMode), 'mode' )), - COMMETHOD(['propput'], HRESULT, 'AutomationElementMode', - ( ['in'], AutomationElementMode, 'mode' )), -] -################################################################ -## code template for IUIAutomationCacheRequest implementation -##class IUIAutomationCacheRequest_Impl(object): -## def AddPattern(self, patternId): +## @property +## def CurrentRowSpan(self): ## '-no docstring-' -## #return +## #return retVal ## -## def AddProperty(self, propertyId): +## @property +## def CurrentColumnSpan(self): ## '-no docstring-' -## #return +## #return retVal ## -## def Clone(self): +## @property +## def CachedRow(self): ## '-no docstring-' -## #return clonedRequest +## #return retVal ## -## def _get(self): -## '-no docstring-' -## #return scope -## def _set(self, scope): + +IUIAutomationFocusChangedEventHandler._methods_ = [ + COMMETHOD([], HRESULT, 'HandleFocusChangedEvent', + ( ['in'], POINTER(IUIAutomationElement), 'sender' )), +] +################################################################ +## code template for IUIAutomationFocusChangedEventHandler implementation +##class IUIAutomationFocusChangedEventHandler_Impl(object): +## def HandleFocusChangedEvent(self, sender): ## '-no docstring-' -## TreeScope = property(_get, _set, doc = _set.__doc__) +## #return ## -## def _get(self): -## '-no docstring-' -## #return mode -## def _set(self, mode): + +class IUIAutomationTextRange3(IUIAutomationTextRange2): + _case_insensitive_ = True + _iid_ = GUID('{6A315D69-5512-4C2E-85F0-53FCE6DD4BC2}') + _idlflags_ = [] +IUIAutomationTextRange3._methods_ = [ + COMMETHOD([], HRESULT, 'GetEnclosingElementBuildCache', + ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'enclosingElement' )), + COMMETHOD([], HRESULT, 'GetChildrenBuildCache', + ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'children' )), + COMMETHOD([], HRESULT, 'GetAttributeValues', + ( ['in'], POINTER(c_int), 'attributeIds' ), + ( ['in'], c_int, 'attributeIdCount' ), + ( ['retval', 'out'], POINTER(_midlSAFEARRAY(VARIANT)), 'attributeValues' )), +] +################################################################ +## code template for IUIAutomationTextRange3 implementation +##class IUIAutomationTextRange3_Impl(object): +## def GetEnclosingElementBuildCache(self, cacheRequest): ## '-no docstring-' -## AutomationElementMode = property(_get, _set, doc = _set.__doc__) +## #return enclosingElement ## -## def _get(self): +## def GetAttributeValues(self, attributeIds, attributeIdCount): ## '-no docstring-' -## #return filter -## def _set(self, filter): +## #return attributeValues +## +## def GetChildrenBuildCache(self, cacheRequest): ## '-no docstring-' -## TreeFilter = property(_get, _set, doc = _set.__doc__) +## #return children ## -UIA_ExpandCollapseExpandCollapseStatePropertyId = 30070 # Constant c_int +UIA_IsTablePatternAvailablePropertyId = 30038 # Constant c_int class IUIAutomationTextPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True _iid_ = GUID('{32EBA289-3583-42C9-9C59-3B6D9A1E9B6A}') _idlflags_ = [] -class IUIAutomationTextPattern2(IUIAutomationTextPattern): - _case_insensitive_ = True - _iid_ = GUID('{506A921A-FCC9-409F-B23B-37EB74106872}') - _idlflags_ = [] class IUIAutomationTextRangeArray(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True _iid_ = GUID('{CE4AE76A-E717-4C98-81EA-47371D028EB6}') @@ -4094,9 +4112,119 @@ class IUIAutomationTextRangeArray(comtypes.gen._00020430_0000_0000_C000_00000000 ## ## def RangeFromPoint(self, pt): ## '-no docstring-' -## #return range +## #return range +## + +class IUIAutomationBoolCondition(IUIAutomationCondition): + _case_insensitive_ = True + _iid_ = GUID('{1B4E1F2E-75EB-4D0B-8952-5A69988E2307}') + _idlflags_ = [] +IUIAutomationBoolCondition._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'BooleanValue', + ( ['retval', 'out'], POINTER(c_int), 'boolVal' )), +] +################################################################ +## code template for IUIAutomationBoolCondition implementation +##class IUIAutomationBoolCondition_Impl(object): +## @property +## def BooleanValue(self): +## '-no docstring-' +## #return boolVal +## + +IUIAutomationTextRangeArray._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'Length', + ( ['retval', 'out'], POINTER(c_int), 'Length' )), + COMMETHOD([], HRESULT, 'GetElement', + ( ['in'], c_int, 'index' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTextRange)), 'element' )), +] +################################################################ +## code template for IUIAutomationTextRangeArray implementation +##class IUIAutomationTextRangeArray_Impl(object): +## @property +## def Length(self): +## '-no docstring-' +## #return Length +## +## def GetElement(self, index): +## '-no docstring-' +## #return element +## + +class IUIAutomationTextEditPattern(IUIAutomationTextPattern): + _case_insensitive_ = True + _iid_ = GUID('{17E21576-996C-4870-99D9-BFF323380C06}') + _idlflags_ = [] +IUIAutomationTextEditPattern._methods_ = [ + COMMETHOD([], HRESULT, 'GetActiveComposition', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTextRange)), 'range' )), + COMMETHOD([], HRESULT, 'GetConversionTarget', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTextRange)), 'range' )), +] +################################################################ +## code template for IUIAutomationTextEditPattern implementation +##class IUIAutomationTextEditPattern_Impl(object): +## def GetActiveComposition(self): +## '-no docstring-' +## #return range +## +## def GetConversionTarget(self): +## '-no docstring-' +## #return range +## + +class IUIAutomationPropertyCondition(IUIAutomationCondition): + _case_insensitive_ = True + _iid_ = GUID('{99EBF2CB-5578-4267-9AD4-AFD6EA77E94B}') + _idlflags_ = [] +IUIAutomationPropertyCondition._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'propertyId', + ( ['retval', 'out'], POINTER(c_int), 'propertyId' )), + COMMETHOD(['propget'], HRESULT, 'PropertyValue', + ( ['retval', 'out'], POINTER(VARIANT), 'PropertyValue' )), + COMMETHOD(['propget'], HRESULT, 'PropertyConditionFlags', + ( ['retval', 'out'], POINTER(PropertyConditionFlags), 'flags' )), +] +################################################################ +## code template for IUIAutomationPropertyCondition implementation +##class IUIAutomationPropertyCondition_Impl(object): +## @property +## def PropertyConditionFlags(self): +## '-no docstring-' +## #return flags +## +## @property +## def propertyId(self): +## '-no docstring-' +## #return propertyId +## +## @property +## def PropertyValue(self): +## '-no docstring-' +## #return PropertyValue +## + +IUIAutomationTextEditTextChangedEventHandler._methods_ = [ + COMMETHOD([], HRESULT, 'HandleTextEditTextChangedEvent', + ( ['in'], POINTER(IUIAutomationElement), 'sender' ), + ( ['in'], TextEditChangeType, 'TextEditChangeType' ), + ( ['in'], _midlSAFEARRAY(BSTR), 'eventStrings' )), +] +################################################################ +## code template for IUIAutomationTextEditTextChangedEventHandler implementation +##class IUIAutomationTextEditTextChangedEventHandler_Impl(object): +## def HandleTextEditTextChangedEvent(self, sender, TextEditChangeType, eventStrings): +## '-no docstring-' +## #return ## +UIA_IsInvokePatternAvailablePropertyId = 30031 # Constant c_int +UIA_Transform2ZoomMaximumPropertyId = 30147 # Constant c_int +class IUIAutomationTextPattern2(IUIAutomationTextPattern): + _case_insensitive_ = True + _iid_ = GUID('{506A921A-FCC9-409F-B23B-37EB74106872}') + _idlflags_ = [] IUIAutomationTextPattern2._methods_ = [ COMMETHOD([], HRESULT, 'RangeFromAnnotation', ( ['in'], POINTER(IUIAutomationElement), 'annotation' ), @@ -4117,639 +4245,650 @@ class IUIAutomationTextRangeArray(comtypes.gen._00020430_0000_0000_C000_00000000 ## #return isActive, range ## -UIA_WindowControlTypeId = 50032 # Constant c_int -AnnotationType_ExternalChange = 60017 # Constant c_int -UIA_HeaderItemControlTypeId = 50035 # Constant c_int -AnnotationType_Footer = 60007 # Constant c_int -AnnotationType_Header = 60006 # Constant c_int -UIA_DataGridControlTypeId = 50028 # Constant c_int -UIA_SplitButtonControlTypeId = 50031 # Constant c_int -UIA_PaneControlTypeId = 50033 # Constant c_int -AnnotationType_Unknown = 60000 # Constant c_int -UIA_HeaderControlTypeId = 50034 # Constant c_int -UIA_TableControlTypeId = 50036 # Constant c_int -UIA_TitleBarControlTypeId = 50037 # Constant c_int -UIA_SeparatorControlTypeId = 50038 # Constant c_int -AnnotationType_Endnote = 60009 # Constant c_int -UIA_SemanticZoomControlTypeId = 50039 # Constant c_int -UIA_AppBarControlTypeId = 50040 # Constant c_int -AnnotationType_SpellingError = 60001 # Constant c_int -AnnotationType_GrammarError = 60002 # Constant c_int -AnnotationType_Comment = 60003 # Constant c_int -AnnotationType_FormulaError = 60004 # Constant c_int -AnnotationType_TrackChanges = 60005 # Constant c_int -AnnotationType_Highlighted = 60008 # Constant c_int -AnnotationType_Footnote = 60010 # Constant c_int -AnnotationType_FormatChange = 60014 # Constant c_int -UIA_DataItemControlTypeId = 50029 # Constant c_int -AnnotationType_InsertionChange = 60011 # Constant c_int -AnnotationType_DeletionChange = 60012 # Constant c_int - -# values for enumeration 'ToggleState' -ToggleState_Off = 0 -ToggleState_On = 1 -ToggleState_Indeterminate = 2 -ToggleState = c_int # enum -AnnotationType_EditingLockedChange = 60016 # Constant c_int -UIA_GroupControlTypeId = 50026 # Constant c_int -AnnotationType_MoveChange = 60013 # Constant c_int -AnnotationType_UnsyncedChange = 60015 # Constant c_int -UIA_CustomControlTypeId = 50025 # Constant c_int -UIA_SpinnerControlTypeId = 50016 # Constant c_int -UIA_ThumbControlTypeId = 50027 # Constant c_int -UIA_DocumentControlTypeId = 50030 # Constant c_int -AnnotationType_ConflictingChange = 60018 # Constant c_int -UIA_TabItemControlTypeId = 50019 # Constant c_int -AnnotationType_CircularReferenceError = 60022 # Constant c_int -AnnotationType_Mathematics = 60023 # Constant c_int -UIA_TreeControlTypeId = 50023 # Constant c_int -UIA_ToolBarControlTypeId = 50021 # Constant c_int -UIA_TextControlTypeId = 50020 # Constant c_int -UIA_MarginLeadingAttributeId = 40019 # Constant c_int -UIA_SliderControlTypeId = 50015 # Constant c_int -UIA_TabControlTypeId = 50018 # Constant c_int -UIA_StatusBarControlTypeId = 50017 # Constant c_int -UIA_TreeItemControlTypeId = 50024 # Constant c_int -UIA_ScrollBarControlTypeId = 50014 # Constant c_int -UIA_MarginTopAttributeId = 40020 # Constant c_int -UIA_RadioButtonControlTypeId = 50013 # Constant c_int -UIA_IsItalicAttributeId = 40014 # Constant c_int -UIA_ToolTipControlTypeId = 50022 # Constant c_int -class IUIAutomationOrCondition(IUIAutomationCondition): +UIA_StylesFillColorPropertyId = 30122 # Constant c_int +UIA_IsRequiredForFormPropertyId = 30025 # Constant c_int +class IUIAutomationAnnotationPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{8753F032-3DB1-47B5-A1FC-6E34A266C712}') + _iid_ = GUID('{9A175B21-339E-41B1-8E8B-623F6B681098}') _idlflags_ = [] -IUIAutomationOrCondition._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'ChildCount', - ( ['retval', 'out'], POINTER(c_int), 'ChildCount' )), - COMMETHOD([], HRESULT, 'GetChildrenAsNativeArray', - ( ['out'], POINTER(POINTER(POINTER(IUIAutomationCondition))), 'childArray' ), - ( ['out'], POINTER(c_int), 'childArrayCount' )), - COMMETHOD([], HRESULT, 'GetChildren', - ( ['retval', 'out'], POINTER(_midlSAFEARRAY(POINTER(IUIAutomationCondition))), 'childArray' )), +IUIAutomationAnnotationPattern._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'CurrentAnnotationTypeId', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentAnnotationTypeName', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentAuthor', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentDateTime', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentTarget', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedAnnotationTypeId', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedAnnotationTypeName', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedAuthor', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedDateTime', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedTarget', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'retVal' )), ] ################################################################ -## code template for IUIAutomationOrCondition implementation -##class IUIAutomationOrCondition_Impl(object): -## def GetChildren(self): +## code template for IUIAutomationAnnotationPattern implementation +##class IUIAutomationAnnotationPattern_Impl(object): +## @property +## def CachedTarget(self): ## '-no docstring-' -## #return childArray +## #return retVal ## -## def GetChildrenAsNativeArray(self): +## @property +## def CachedAuthor(self): ## '-no docstring-' -## #return childArray, childArrayCount +## #return retVal ## ## @property -## def ChildCount(self): +## def CachedAnnotationTypeId(self): ## '-no docstring-' -## #return ChildCount +## #return retVal ## - -UIA_TabsAttributeId = 40027 # Constant c_int -UIA_MarginBottomAttributeId = 40018 # Constant c_int -UIA_IsInvokePatternAvailablePropertyId = 30031 # Constant c_int -UIA_IsSuperscriptAttributeId = 40017 # Constant c_int -UIA_IsSubscriptAttributeId = 40016 # Constant c_int -UIA_IndentationFirstLineAttributeId = 40010 # Constant c_int -UIA_UnderlineColorAttributeId = 40029 # Constant c_int -UIA_IndentationLeadingAttributeId = 40011 # Constant c_int -UIA_FontSizeAttributeId = 40006 # Constant c_int -UIA_FontWeightAttributeId = 40007 # Constant c_int -UIA_AnimationStyleAttributeId = 40000 # Constant c_int -AnnotationType_AdvancedProofingIssue = 60020 # Constant c_int -UIA_AnnotationAnnotationTypeNamePropertyId = 30114 # Constant c_int -UIA_MarginTrailingAttributeId = 40021 # Constant c_int -UIA_DragDropEffectsPropertyId = 30140 # Constant c_int -UIA_OverlineColorAttributeId = 40023 # Constant c_int -UIA_IsHiddenAttributeId = 40013 # Constant c_int -UIA_IndentationTrailingAttributeId = 40012 # Constant c_int -UIA_OverlineStyleAttributeId = 40024 # Constant c_int -UIA_IsReadOnlyAttributeId = 40015 # Constant c_int -UIA_StyleNameAttributeId = 40033 # Constant c_int -UIA_TextFlowDirectionsAttributeId = 40028 # Constant c_int -UIA_ButtonControlTypeId = 50000 # Constant c_int -UIA_UnderlineStyleAttributeId = 40030 # Constant c_int -UIA_OutlineStylesAttributeId = 40022 # Constant c_int -UIA_SelectionActiveEndAttributeId = 40037 # Constant c_int -UIA_CaretPositionAttributeId = 40038 # Constant c_int -UIA_StrikethroughColorAttributeId = 40025 # Constant c_int -UIA_StrikethroughStyleAttributeId = 40026 # Constant c_int -UIA_ListItemControlTypeId = 50007 # Constant c_int -UIA_AnnotationTypesAttributeId = 40031 # Constant c_int -UIA_AnnotationObjectsAttributeId = 40032 # Constant c_int -UIA_IsActiveAttributeId = 40036 # Constant c_int -UIA_SizeOfSetPropertyId = 30153 # Constant c_int -UIA_LineSpacingAttributeId = 40040 # Constant c_int -UIA_StyleIdAttributeId = 40034 # Constant c_int -UIA_LinkAttributeId = 40035 # Constant c_int -UIA_LevelPropertyId = 30154 # Constant c_int -UIA_CaretBidiModeAttributeId = 40039 # Constant c_int -UIA_SayAsInterpretAsAttributeId = 40043 # Constant c_int -UIA_ComboBoxControlTypeId = 50003 # Constant c_int -UIA_FullDescriptionPropertyId = 30159 # Constant c_int -UIA_BeforeParagraphSpacingAttributeId = 40041 # Constant c_int -UIA_AfterParagraphSpacingAttributeId = 40042 # Constant c_int -UIA_CheckBoxControlTypeId = 50002 # Constant c_int -UIA_ProgressBarControlTypeId = 50012 # Constant c_int -UIA_EditControlTypeId = 50004 # Constant c_int -UIA_CalendarControlTypeId = 50001 # Constant c_int -UIA_AnnotationTypesPropertyId = 30155 # Constant c_int -UIA_ImageControlTypeId = 50006 # Constant c_int -UIA_VisualEffectsPropertyId = 30163 # Constant c_int -UIA_ListControlTypeId = 50008 # Constant c_int -class IUIAutomationScrollPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{88F4D42A-E881-459D-A77C-73BBBB7E02DC}') - _idlflags_ = [] -IUIAutomationScrollPattern._methods_ = [ - COMMETHOD([], HRESULT, 'Scroll', - ( ['in'], ScrollAmount, 'horizontalAmount' ), - ( ['in'], ScrollAmount, 'verticalAmount' )), - COMMETHOD([], HRESULT, 'SetScrollPercent', - ( ['in'], c_double, 'horizontalPercent' ), - ( ['in'], c_double, 'verticalPercent' )), - COMMETHOD(['propget'], HRESULT, 'CurrentHorizontalScrollPercent', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentVerticalScrollPercent', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentHorizontalViewSize', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentVerticalViewSize', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentHorizontallyScrollable', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentVerticallyScrollable', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedHorizontalScrollPercent', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedVerticalScrollPercent', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedHorizontalViewSize', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedVerticalViewSize', - ( ['retval', 'out'], POINTER(c_double), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedHorizontallyScrollable', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedVerticallyScrollable', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), -] -################################################################ -## code template for IUIAutomationScrollPattern implementation -##class IUIAutomationScrollPattern_Impl(object): ## @property -## def CachedVerticalScrollPercent(self): +## def CurrentAnnotationTypeName(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CachedHorizontalViewSize(self): +## def CurrentAuthor(self): +## '-no docstring-' +## #return retVal +## +## @property +## def CachedAnnotationTypeName(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CachedVerticalViewSize(self): +## def CachedDateTime(self): +## '-no docstring-' +## #return retVal +## +## @property +## def CurrentTarget(self): +## '-no docstring-' +## #return retVal +## +## @property +## def CurrentAnnotationTypeId(self): +## '-no docstring-' +## #return retVal +## +## @property +## def CurrentDateTime(self): +## '-no docstring-' +## #return retVal +## + +class IUIAutomationElement6(IUIAutomationElement5): + _case_insensitive_ = True + _iid_ = GUID('{4780D450-8BCA-4977-AFA5-A4A517F555E3}') + _idlflags_ = [] +IUIAutomationElement6._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'CurrentFullDescription', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedFullDescription', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), +] +################################################################ +## code template for IUIAutomationElement6 implementation +##class IUIAutomationElement6_Impl(object): +## @property +## def CachedFullDescription(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CurrentHorizontalViewSize(self): +## def CurrentFullDescription(self): ## '-no docstring-' ## #return retVal ## -## @property -## def CachedHorizontalScrollPercent(self): + +UIA_AnimationStyleAttributeId = 40000 # Constant c_int +UIA_FrameworkIdPropertyId = 30024 # Constant c_int +UIA_IsPeripheralPropertyId = 30150 # Constant c_int +UIA_ScrollVerticallyScrollablePropertyId = 30058 # Constant c_int +UIA_ScrollHorizontallyScrollablePropertyId = 30057 # Constant c_int +UIA_ScrollVerticalScrollPercentPropertyId = 30055 # Constant c_int +UIA_ScrollVerticalViewSizePropertyId = 30056 # Constant c_int +UIA_ScrollHorizontalScrollPercentPropertyId = 30053 # Constant c_int +UIA_TextEdit_TextChangedEventId = 20032 # Constant c_int +UIA_DropTarget_DragLeaveEventId = 20030 # Constant c_int +UIA_RangeValueLargeChangePropertyId = 30051 # Constant c_int +UIA_ScrollHorizontalViewSizePropertyId = 30054 # Constant c_int +UIA_RangeValueSmallChangePropertyId = 30052 # Constant c_int +UIA_DropTarget_DroppedEventId = 20031 # Constant c_int +UIA_RangeValueMinimumPropertyId = 30049 # Constant c_int +UIA_RangeValueMaximumPropertyId = 30050 # Constant c_int +UIA_TextEdit_ConversionTargetChangedEventId = 20033 # Constant c_int +UIA_IsTextEditPatternAvailablePropertyId = 30149 # Constant c_int +UIA_RangeValueValuePropertyId = 30047 # Constant c_int +UIA_RangeValueIsReadOnlyPropertyId = 30048 # Constant c_int +UIA_IsValuePatternAvailablePropertyId = 30043 # Constant c_int +UIA_ValueValuePropertyId = 30045 # Constant c_int +UIA_ValueIsReadOnlyPropertyId = 30046 # Constant c_int +UIA_IsItemContainerPatternAvailablePropertyId = 30108 # Constant c_int +UIA_IsWindowPatternAvailablePropertyId = 30044 # Constant c_int +UIA_IsTogglePatternAvailablePropertyId = 30041 # Constant c_int +UIA_IsTransformPatternAvailablePropertyId = 30042 # Constant c_int +UIA_IsTextPatternAvailablePropertyId = 30040 # Constant c_int +UIA_OutlineColorPropertyId = 30161 # Constant c_int +UIA_IsTableItemPatternAvailablePropertyId = 30039 # Constant c_int +UIA_IsSelectionPatternAvailablePropertyId = 30037 # Constant c_int +class IUIAutomationObjectModelPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{71C284B3-C14D-4D14-981E-19751B0D756D}') + _idlflags_ = [] +IUIAutomationObjectModelPattern._methods_ = [ + COMMETHOD([], HRESULT, 'GetUnderlyingObjectModel', + ( ['retval', 'out'], POINTER(POINTER(IUnknown)), 'retVal' )), +] +################################################################ +## code template for IUIAutomationObjectModelPattern implementation +##class IUIAutomationObjectModelPattern_Impl(object): +## def GetUnderlyingObjectModel(self): ## '-no docstring-' ## #return retVal ## -## @property -## def CachedHorizontallyScrollable(self): + +UIA_IsRangeValuePatternAvailablePropertyId = 30033 # Constant c_int +UIA_IsScrollItemPatternAvailablePropertyId = 30035 # Constant c_int +UIA_IsSelectionItemPatternAvailablePropertyId = 30036 # Constant c_int +UIA_IsScrollPatternAvailablePropertyId = 30034 # Constant c_int +UIA_AnnotationTypesPropertyId = 30155 # Constant c_int +UIA_IsMultipleViewPatternAvailablePropertyId = 30032 # Constant c_int +UIA_IsGridItemPatternAvailablePropertyId = 30029 # Constant c_int +UIA_IsGridPatternAvailablePropertyId = 30030 # Constant c_int +UIA_IsDockPatternAvailablePropertyId = 30027 # Constant c_int +UIA_IsExpandCollapsePatternAvailablePropertyId = 30028 # Constant c_int +UIA_AnnotationObjectsPropertyId = 30156 # Constant c_int +UIA_ItemStatusPropertyId = 30026 # Constant c_int +UIA_OrientationPropertyId = 30023 # Constant c_int +UIA_IsControlElementPropertyId = 30016 # Constant c_int +UIA_ItemTypePropertyId = 30021 # Constant c_int +UIA_IsOffscreenPropertyId = 30022 # Constant c_int +UIA_FillTypePropertyId = 30162 # Constant c_int +UIA_IsPasswordPropertyId = 30019 # Constant c_int +UIA_NativeWindowHandlePropertyId = 30020 # Constant c_int +UIA_LabeledByPropertyId = 30018 # Constant c_int +UIA_CulturePropertyId = 30015 # Constant c_int +UIA_FillColorPropertyId = 30160 # Constant c_int +UIA_FullDescriptionPropertyId = 30159 # Constant c_int +UIA_IsContentElementPropertyId = 30017 # Constant c_int +UIA_ClickablePointPropertyId = 30014 # Constant c_int +UIA_AutomationIdPropertyId = 30011 # Constant c_int +UIA_ClassNamePropertyId = 30012 # Constant c_int +UIA_IsKeyboardFocusablePropertyId = 30009 # Constant c_int +UIA_IsEnabledPropertyId = 30010 # Constant c_int +UIA_AccessKeyPropertyId = 30007 # Constant c_int +UIA_HasKeyboardFocusPropertyId = 30008 # Constant c_int +UIA_NamePropertyId = 30005 # Constant c_int +UIA_AcceleratorKeyPropertyId = 30006 # Constant c_int +UIA_ControlTypePropertyId = 30003 # Constant c_int +UIA_LocalizedControlTypePropertyId = 30004 # Constant c_int +UIA_ChangesEventId = 20034 # Constant c_int +UIA_BoundingRectanglePropertyId = 30001 # Constant c_int +UIA_ProcessIdPropertyId = 30002 # Constant c_int +UIA_Drag_DragCancelEventId = 20027 # Constant c_int +UIA_Drag_DragCompleteEventId = 20028 # Constant c_int +UIA_NotificationEventId = 20035 # Constant c_int +UIA_RuntimeIdPropertyId = 30000 # Constant c_int +UIA_LiveRegionChangedEventId = 20024 # Constant c_int +UIA_Drag_DragStartEventId = 20026 # Constant c_int +UIA_DropTarget_DragEnterEventId = 20029 # Constant c_int +UIA_HostedFragmentRootsInvalidatedEventId = 20025 # Constant c_int +UIA_SelectionItem_ElementSelectedEventId = 20012 # Constant c_int +UIA_SelectionPattern2Id = 10034 # Constant c_int +UIA_ObjectModelPatternId = 10022 # Constant c_int +UIA_InputDiscardedEventId = 20022 # Constant c_int +UIA_SystemAlertEventId = 20023 # Constant c_int +UIA_GridRowCountPropertyId = 30062 # Constant c_int +UIA_InputReachedTargetEventId = 20020 # Constant c_int +UIA_InputReachedOtherElementEventId = 20021 # Constant c_int +UIA_MenuModeStartEventId = 20018 # Constant c_int +UIA_MenuModeEndEventId = 20019 # Constant c_int +UIA_Window_WindowOpenedEventId = 20016 # Constant c_int +UIA_Window_WindowClosedEventId = 20017 # Constant c_int +UIA_Text_TextSelectionChangedEventId = 20014 # Constant c_int +UIA_Text_TextChangedEventId = 20015 # Constant c_int +UIA_SpreadsheetItemPatternId = 10027 # Constant c_int +UIA_GridColumnCountPropertyId = 30063 # Constant c_int +UIA_SpreadsheetPatternId = 10026 # Constant c_int +UIA_Selection_InvalidatedEventId = 20013 # Constant c_int +UIA_TextPattern2Id = 10024 # Constant c_int +UIA_ScrollItemPatternId = 10017 # Constant c_int +UIA_DragPatternId = 10030 # Constant c_int +UIA_SelectionIsSelectionRequiredPropertyId = 30061 # Constant c_int +UIA_SelectionItem_ElementAddedToSelectionEventId = 20010 # Constant c_int +UIA_SelectionItem_ElementRemovedFromSelectionEventId = 20011 # Constant c_int +UIA_LayoutInvalidatedEventId = 20008 # Constant c_int +UIA_Invoke_InvokedEventId = 20009 # Constant c_int +UIA_AsyncContentLoadedEventId = 20006 # Constant c_int +UIA_MenuClosedEventId = 20007 # Constant c_int +UIA_AutomationFocusChangedEventId = 20005 # Constant c_int +UIA_StructureChangedEventId = 20002 # Constant c_int +UIA_MenuOpenedEventId = 20003 # Constant c_int +UIA_ToolTipOpenedEventId = 20000 # Constant c_int +UIA_ToolTipClosedEventId = 20001 # Constant c_int +UIA_TextEditPatternId = 10032 # Constant c_int +UIA_TransformPattern2Id = 10028 # Constant c_int +UIA_VirtualizedItemPatternId = 10020 # Constant c_int +UIA_DropTargetPatternId = 10031 # Constant c_int +UIA_TextChildPatternId = 10029 # Constant c_int +UIA_AnnotationPatternId = 10023 # Constant c_int +UIA_ItemContainerPatternId = 10019 # Constant c_int +UIA_LegacyIAccessiblePatternId = 10018 # Constant c_int +UIA_TransformPatternId = 10016 # Constant c_int +UIA_SynchronizedInputPatternId = 10021 # Constant c_int +UIA_StylesPatternId = 10025 # Constant c_int +UIA_GridItemRowPropertyId = 30064 # Constant c_int +UIA_SelectionSelectionPropertyId = 30059 # Constant c_int +UIA_SelectionCanSelectMultiplePropertyId = 30060 # Constant c_int +UIA_LandmarkTypePropertyId = 30157 # Constant c_int +UIA_LocalizedLandmarkTypePropertyId = 30158 # Constant c_int +class IUIAutomationElement7(IUIAutomationElement6): + _case_insensitive_ = True + _iid_ = GUID('{204E8572-CFC3-4C11-B0C8-7DA7420750B7}') + _idlflags_ = [] +IUIAutomationElement7._methods_ = [ + COMMETHOD([], HRESULT, 'FindFirstWithOptions', + ( ['in'], TreeScope, 'scope' ), + ( ['in'], POINTER(IUIAutomationCondition), 'condition' ), + ( ['in'], TreeTraversalOptions, 'traversalOptions' ), + ( ['in'], POINTER(IUIAutomationElement), 'root' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'found' )), + COMMETHOD([], HRESULT, 'FindAllWithOptions', + ( ['in'], TreeScope, 'scope' ), + ( ['in'], POINTER(IUIAutomationCondition), 'condition' ), + ( ['in'], TreeTraversalOptions, 'traversalOptions' ), + ( ['in'], POINTER(IUIAutomationElement), 'root' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'found' )), + COMMETHOD([], HRESULT, 'FindFirstWithOptionsBuildCache', + ( ['in'], TreeScope, 'scope' ), + ( ['in'], POINTER(IUIAutomationCondition), 'condition' ), + ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), + ( ['in'], TreeTraversalOptions, 'traversalOptions' ), + ( ['in'], POINTER(IUIAutomationElement), 'root' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'found' )), + COMMETHOD([], HRESULT, 'FindAllWithOptionsBuildCache', + ( ['in'], TreeScope, 'scope' ), + ( ['in'], POINTER(IUIAutomationCondition), 'condition' ), + ( ['in'], POINTER(IUIAutomationCacheRequest), 'cacheRequest' ), + ( ['in'], TreeTraversalOptions, 'traversalOptions' ), + ( ['in'], POINTER(IUIAutomationElement), 'root' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'found' )), + COMMETHOD([], HRESULT, 'GetCurrentMetadataValue', + ( ['in'], c_int, 'targetId' ), + ( ['in'], c_int, 'metadataId' ), + ( ['retval', 'out'], POINTER(VARIANT), 'returnVal' )), +] +################################################################ +## code template for IUIAutomationElement7 implementation +##class IUIAutomationElement7_Impl(object): +## def FindAllWithOptionsBuildCache(self, scope, condition, cacheRequest, traversalOptions, root): ## '-no docstring-' -## #return retVal +## #return found ## -## @property -## def CurrentHorizontalScrollPercent(self): +## def GetCurrentMetadataValue(self, targetId, metadataId): ## '-no docstring-' -## #return retVal +## #return returnVal ## -## def Scroll(self, horizontalAmount, verticalAmount): +## def FindFirstWithOptions(self, scope, condition, traversalOptions, root): ## '-no docstring-' -## #return +## #return found ## -## @property -## def CurrentHorizontallyScrollable(self): +## def FindAllWithOptions(self, scope, condition, traversalOptions, root): ## '-no docstring-' -## #return retVal +## #return found ## -## @property -## def CurrentVerticalViewSize(self): +## def FindFirstWithOptionsBuildCache(self, scope, condition, cacheRequest, traversalOptions, root): ## '-no docstring-' -## #return retVal +## #return found ## + +StyleId_Heading9 = 70009 # Constant c_int +class IUIAutomationStylesPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{85B5F0A2-BD79-484A-AD2B-388C9838D5FB}') + _idlflags_ = [] +IUIAutomationStylesPattern._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'CurrentStyleId', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentStyleName', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentFillColor', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentFillPatternStyle', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentShape', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentFillPatternColor', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentExtendedProperties', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD([], HRESULT, 'GetCurrentExtendedPropertiesAsArray', + ( ['out'], POINTER(POINTER(ExtendedProperty)), 'propertyArray' ), + ( ['out'], POINTER(c_int), 'propertyCount' )), + COMMETHOD(['propget'], HRESULT, 'CachedStyleId', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedStyleName', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedFillColor', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedFillPatternStyle', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedShape', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedFillPatternColor', + ( ['retval', 'out'], POINTER(c_int), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedExtendedProperties', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD([], HRESULT, 'GetCachedExtendedPropertiesAsArray', + ( ['out'], POINTER(POINTER(ExtendedProperty)), 'propertyArray' ), + ( ['out'], POINTER(c_int), 'propertyCount' )), +] +################################################################ +## code template for IUIAutomationStylesPattern implementation +##class IUIAutomationStylesPattern_Impl(object): ## @property -## def CurrentVerticallyScrollable(self): +## def CurrentFillPatternColor(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CachedVerticallyScrollable(self): +## def CachedStyleName(self): ## '-no docstring-' ## #return retVal ## -## def SetScrollPercent(self, horizontalPercent, verticalPercent): +## @property +## def CachedFillPatternColor(self): ## '-no docstring-' -## #return +## #return retVal ## ## @property -## def CurrentVerticalScrollPercent(self): +## def CurrentFillColor(self): ## '-no docstring-' ## #return retVal ## - -class IUIAutomationGridItemPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{78F8EF57-66C3-4E09-BD7C-E79B2004894D}') - _idlflags_ = [] -IUIAutomationGridItemPattern._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'CurrentContainingGrid', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentRow', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentColumn', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentRowSpan', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CurrentColumnSpan', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedContainingGrid', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedRow', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedColumn', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedRowSpan', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedColumnSpan', - ( ['retval', 'out'], POINTER(c_int), 'retVal' )), -] -################################################################ -## code template for IUIAutomationGridItemPattern implementation -##class IUIAutomationGridItemPattern_Impl(object): ## @property -## def CurrentColumn(self): +## def CurrentFillPatternStyle(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CurrentRow(self): +## def CurrentStyleId(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CachedColumn(self): +## def CurrentShape(self): ## '-no docstring-' ## #return retVal ## +## def GetCachedExtendedPropertiesAsArray(self): +## '-no docstring-' +## #return propertyArray, propertyCount +## ## @property -## def CurrentContainingGrid(self): +## def CachedExtendedProperties(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CachedRowSpan(self): +## def CachedFillPatternStyle(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CachedColumnSpan(self): +## def CachedShape(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CachedContainingGrid(self): +## def CurrentStyleName(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CurrentRowSpan(self): +## def CachedStyleId(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CurrentColumnSpan(self): +## def CachedFillColor(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CachedRow(self): +## def CurrentExtendedProperties(self): ## '-no docstring-' ## #return retVal ## +## def GetCurrentExtendedPropertiesAsArray(self): +## '-no docstring-' +## #return propertyArray, propertyCount +## -UIA_FillTypePropertyId = 30162 # Constant c_int -UIA_MenuItemControlTypeId = 50011 # Constant c_int -UIA_LandmarkTypePropertyId = 30157 # Constant c_int -UIA_OutlineThicknessPropertyId = 30164 # Constant c_int -UIA_MenuControlTypeId = 50009 # Constant c_int -UIA_PositionInSetPropertyId = 30152 # Constant c_int -UIA_CenterPointPropertyId = 30165 # Constant c_int -UIA_RotationPropertyId = 30166 # Constant c_int -UIA_SizePropertyId = 30167 # Constant c_int -AnnotationType_DataValidationError = 60021 # Constant c_int -UIA_AnnotationObjectsPropertyId = 30156 # Constant c_int -UIA_BulletStyleAttributeId = 40002 # Constant c_int -UIA_CapStyleAttributeId = 40003 # Constant c_int -UIA_CultureAttributeId = 40004 # Constant c_int -UIA_SpreadsheetItemAnnotationObjectsPropertyId = 30130 # Constant c_int -UIA_FillColorPropertyId = 30160 # Constant c_int -UIA_OutlineColorPropertyId = 30161 # Constant c_int -UIA_AutomationIdPropertyId = 30011 # Constant c_int -class IUIAutomationTogglePattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{94CF8058-9B8D-4AB9-8BFD-4CD0A33C8C70}') - _idlflags_ = [] -IUIAutomationTogglePattern._methods_ = [ - COMMETHOD([], HRESULT, 'Toggle'), - COMMETHOD(['propget'], HRESULT, 'CurrentToggleState', - ( ['retval', 'out'], POINTER(ToggleState), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedToggleState', - ( ['retval', 'out'], POINTER(ToggleState), 'retVal' )), +UIA_CustomNavigationPatternId = 10033 # Constant c_int +IUIAutomationProxyFactory._methods_ = [ + COMMETHOD([], HRESULT, 'CreateProvider', + ( ['in'], c_void_p, 'hwnd' ), + ( ['in'], c_int, 'idObject' ), + ( ['in'], c_int, 'idChild' ), + ( ['retval', 'out'], POINTER(POINTER(IRawElementProviderSimple)), 'provider' )), + COMMETHOD(['propget'], HRESULT, 'ProxyFactoryId', + ( ['retval', 'out'], POINTER(BSTR), 'factoryId' )), ] ################################################################ -## code template for IUIAutomationTogglePattern implementation -##class IUIAutomationTogglePattern_Impl(object): -## @property -## def CurrentToggleState(self): -## '-no docstring-' -## #return retVal -## -## def Toggle(self): +## code template for IUIAutomationProxyFactory implementation +##class IUIAutomationProxyFactory_Impl(object): +## def CreateProvider(self, hwnd, idObject, idChild): ## '-no docstring-' -## #return +## #return provider ## ## @property -## def CachedToggleState(self): +## def ProxyFactoryId(self): ## '-no docstring-' -## #return retVal +## #return factoryId ## -StyleId_Heading8 = 70008 # Constant c_int -UIA_IsSpreadsheetItemPatternAvailablePropertyId = 30132 # Constant c_int -UIA_HorizontalTextAlignmentAttributeId = 40009 # Constant c_int -class IUIAutomationMultipleViewPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): +class IUIAutomationRangeValuePattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): _case_insensitive_ = True - _iid_ = GUID('{8D253C91-1DC5-4BB5-B18F-ADE16FA495E8}') + _iid_ = GUID('{59213F4F-7346-49E5-B120-80555987A148}') _idlflags_ = [] -IUIAutomationMultipleViewPattern._methods_ = [ - COMMETHOD([], HRESULT, 'GetViewName', - ( ['in'], c_int, 'view' ), - ( ['retval', 'out'], POINTER(BSTR), 'name' )), - COMMETHOD([], HRESULT, 'SetCurrentView', - ( ['in'], c_int, 'view' )), - COMMETHOD(['propget'], HRESULT, 'CurrentCurrentView', +IUIAutomationRangeValuePattern._methods_ = [ + COMMETHOD([], HRESULT, 'SetValue', + ( ['in'], c_double, 'val' )), + COMMETHOD(['propget'], HRESULT, 'CurrentValue', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentIsReadOnly', ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD([], HRESULT, 'GetCurrentSupportedViews', - ( ['retval', 'out'], POINTER(_midlSAFEARRAY(c_int)), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedCurrentView', + COMMETHOD(['propget'], HRESULT, 'CurrentMaximum', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentMinimum', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentLargeChange', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CurrentSmallChange', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedValue', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedIsReadOnly', ( ['retval', 'out'], POINTER(c_int), 'retVal' )), - COMMETHOD([], HRESULT, 'GetCachedSupportedViews', - ( ['retval', 'out'], POINTER(_midlSAFEARRAY(c_int)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedMaximum', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedMinimum', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedLargeChange', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedSmallChange', + ( ['retval', 'out'], POINTER(c_double), 'retVal' )), ] ################################################################ -## code template for IUIAutomationMultipleViewPattern implementation -##class IUIAutomationMultipleViewPattern_Impl(object): -## def SetCurrentView(self, view): -## '-no docstring-' -## #return -## -## def GetCurrentSupportedViews(self): -## '-no docstring-' -## #return retVal -## -## def GetCachedSupportedViews(self): +## code template for IUIAutomationRangeValuePattern implementation +##class IUIAutomationRangeValuePattern_Impl(object): +## @property +## def CachedIsReadOnly(self): ## '-no docstring-' ## #return retVal ## ## @property -## def CurrentCurrentView(self): +## def CurrentValue(self): ## '-no docstring-' ## #return retVal ## -## def GetViewName(self, view): +## def SetValue(self, val): ## '-no docstring-' -## #return name +## #return ## ## @property -## def CachedCurrentView(self): +## def CurrentMaximum(self): ## '-no docstring-' ## #return retVal ## - -UiaChangeInfo._fields_ = [ - ('uiaId', c_int), - ('payload', VARIANT), - ('extraInfo', VARIANT), -] -assert sizeof(UiaChangeInfo) == 40, sizeof(UiaChangeInfo) -assert alignment(UiaChangeInfo) == 8, alignment(UiaChangeInfo) -UIA_WindowCanMinimizePropertyId = 30074 # Constant c_int -class IUIAutomationItemContainerPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{C690FDB2-27A8-423C-812D-429773C9084E}') - _idlflags_ = [] -IUIAutomationItemContainerPattern._methods_ = [ - COMMETHOD([], HRESULT, 'FindItemByProperty', - ( ['in'], POINTER(IUIAutomationElement), 'pStartAfter' ), - ( ['in'], c_int, 'propertyId' ), - ( ['in'], VARIANT, 'value' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'pFound' )), -] -################################################################ -## code template for IUIAutomationItemContainerPattern implementation -##class IUIAutomationItemContainerPattern_Impl(object): -## def FindItemByProperty(self, pStartAfter, propertyId, value): +## @property +## def CurrentSmallChange(self): ## '-no docstring-' -## #return pFound +## #return retVal ## - -class IUIAutomationTextEditPattern(IUIAutomationTextPattern): - _case_insensitive_ = True - _iid_ = GUID('{17E21576-996C-4870-99D9-BFF323380C06}') - _idlflags_ = [] -IUIAutomationTextEditPattern._methods_ = [ - COMMETHOD([], HRESULT, 'GetActiveComposition', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTextRange)), 'range' )), - COMMETHOD([], HRESULT, 'GetConversionTarget', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTextRange)), 'range' )), -] -################################################################ -## code template for IUIAutomationTextEditPattern implementation -##class IUIAutomationTextEditPattern_Impl(object): -## def GetActiveComposition(self): +## @property +## def CachedValue(self): ## '-no docstring-' -## #return range +## #return retVal ## -## def GetConversionTarget(self): +## @property +## def CurrentIsReadOnly(self): ## '-no docstring-' -## #return range +## #return retVal ## - -class IUIAutomationExpandCollapsePattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): - _case_insensitive_ = True - _iid_ = GUID('{619BE086-1F4E-4EE4-BAFA-210128738730}') - _idlflags_ = [] -IUIAutomationExpandCollapsePattern._methods_ = [ - COMMETHOD([], HRESULT, 'Expand'), - COMMETHOD([], HRESULT, 'Collapse'), - COMMETHOD(['propget'], HRESULT, 'CurrentExpandCollapseState', - ( ['retval', 'out'], POINTER(ExpandCollapseState), 'retVal' )), - COMMETHOD(['propget'], HRESULT, 'CachedExpandCollapseState', - ( ['retval', 'out'], POINTER(ExpandCollapseState), 'retVal' )), -] -################################################################ -## code template for IUIAutomationExpandCollapsePattern implementation -##class IUIAutomationExpandCollapsePattern_Impl(object): ## @property -## def CachedExpandCollapseState(self): +## def CurrentLargeChange(self): ## '-no docstring-' ## #return retVal ## -## def Collapse(self): +## @property +## def CachedSmallChange(self): ## '-no docstring-' -## #return +## #return retVal ## -## def Expand(self): +## @property +## def CurrentMinimum(self): ## '-no docstring-' -## #return +## #return retVal ## ## @property -## def CurrentExpandCollapseState(self): +## def CachedMinimum(self): ## '-no docstring-' ## #return retVal ## - -UIA_IsTransformPattern2AvailablePropertyId = 30134 # Constant c_int -StyleId_Heading2 = 70002 # Constant c_int -IUIAutomationTextRangeArray._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'Length', - ( ['retval', 'out'], POINTER(c_int), 'Length' )), - COMMETHOD([], HRESULT, 'GetElement', - ( ['in'], c_int, 'index' ), - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationTextRange)), 'element' )), -] -################################################################ -## code template for IUIAutomationTextRangeArray implementation -##class IUIAutomationTextRangeArray_Impl(object): ## @property -## def Length(self): +## def CachedMaximum(self): ## '-no docstring-' -## #return Length +## #return retVal ## -## def GetElement(self, index): +## @property +## def CachedLargeChange(self): ## '-no docstring-' -## #return element +## #return retVal ## -IUIAutomationProxyFactoryEntry._methods_ = [ - COMMETHOD(['propget'], HRESULT, 'ProxyFactory', - ( ['retval', 'out'], POINTER(POINTER(IUIAutomationProxyFactory)), 'factory' )), - COMMETHOD(['propget'], HRESULT, 'ClassName', - ( ['retval', 'out'], POINTER(BSTR), 'ClassName' )), - COMMETHOD(['propget'], HRESULT, 'ImageName', - ( ['retval', 'out'], POINTER(BSTR), 'ImageName' )), - COMMETHOD(['propget'], HRESULT, 'AllowSubstringMatch', - ( ['retval', 'out'], POINTER(c_int), 'AllowSubstringMatch' )), - COMMETHOD(['propget'], HRESULT, 'CanCheckBaseClass', - ( ['retval', 'out'], POINTER(c_int), 'CanCheckBaseClass' )), - COMMETHOD(['propget'], HRESULT, 'NeedsAdviseEvents', - ( ['retval', 'out'], POINTER(c_int), 'adviseEvents' )), - COMMETHOD(['propput'], HRESULT, 'ClassName', - ( ['in'], WSTRING, 'ClassName' )), - COMMETHOD(['propput'], HRESULT, 'ImageName', - ( ['in'], WSTRING, 'ImageName' )), - COMMETHOD(['propput'], HRESULT, 'AllowSubstringMatch', - ( ['in'], c_int, 'AllowSubstringMatch' )), - COMMETHOD(['propput'], HRESULT, 'CanCheckBaseClass', - ( ['in'], c_int, 'CanCheckBaseClass' )), - COMMETHOD(['propput'], HRESULT, 'NeedsAdviseEvents', - ( ['in'], c_int, 'adviseEvents' )), - COMMETHOD([], HRESULT, 'SetWinEventsForAutomationEvent', - ( ['in'], c_int, 'eventId' ), - ( ['in'], c_int, 'propertyId' ), - ( ['in'], _midlSAFEARRAY(c_uint), 'winEvents' )), - COMMETHOD([], HRESULT, 'GetWinEventsForAutomationEvent', - ( ['in'], c_int, 'eventId' ), - ( ['in'], c_int, 'propertyId' ), - ( ['retval', 'out'], POINTER(_midlSAFEARRAY(c_uint)), 'winEvents' )), +UIA_HelpTextPropertyId = 30013 # Constant c_int +class IUIAutomationSpreadsheetItemPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{7D4FB86C-8D34-40E1-8E83-62C15204E335}') + _idlflags_ = [] +IUIAutomationSpreadsheetItemPattern._methods_ = [ + COMMETHOD(['propget'], HRESULT, 'CurrentFormula', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD([], HRESULT, 'GetCurrentAnnotationObjects', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), + COMMETHOD([], HRESULT, 'GetCurrentAnnotationTypes', + ( ['retval', 'out'], POINTER(_midlSAFEARRAY(c_int)), 'retVal' )), + COMMETHOD(['propget'], HRESULT, 'CachedFormula', + ( ['retval', 'out'], POINTER(BSTR), 'retVal' )), + COMMETHOD([], HRESULT, 'GetCachedAnnotationObjects', + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElementArray)), 'retVal' )), + COMMETHOD([], HRESULT, 'GetCachedAnnotationTypes', + ( ['retval', 'out'], POINTER(_midlSAFEARRAY(c_int)), 'retVal' )), ] ################################################################ -## code template for IUIAutomationProxyFactoryEntry implementation -##class IUIAutomationProxyFactoryEntry_Impl(object): -## def _get(self): -## '-no docstring-' -## #return CanCheckBaseClass -## def _set(self, CanCheckBaseClass): +## code template for IUIAutomationSpreadsheetItemPattern implementation +##class IUIAutomationSpreadsheetItemPattern_Impl(object): +## @property +## def CurrentFormula(self): ## '-no docstring-' -## CanCheckBaseClass = property(_get, _set, doc = _set.__doc__) +## #return retVal ## -## def _get(self): -## '-no docstring-' -## #return ClassName -## def _set(self, ClassName): +## @property +## def CachedFormula(self): ## '-no docstring-' -## ClassName = property(_get, _set, doc = _set.__doc__) +## #return retVal ## -## def _get(self): -## '-no docstring-' -## #return ImageName -## def _set(self, ImageName): +## def GetCachedAnnotationTypes(self): ## '-no docstring-' -## ImageName = property(_get, _set, doc = _set.__doc__) +## #return retVal ## -## @property -## def ProxyFactory(self): +## def GetCurrentAnnotationTypes(self): ## '-no docstring-' -## #return factory +## #return retVal ## -## def SetWinEventsForAutomationEvent(self, eventId, propertyId, winEvents): +## def GetCurrentAnnotationObjects(self): ## '-no docstring-' -## #return +## #return retVal ## -## def _get(self): -## '-no docstring-' -## #return adviseEvents -## def _set(self, adviseEvents): +## def GetCachedAnnotationObjects(self): ## '-no docstring-' -## NeedsAdviseEvents = property(_get, _set, doc = _set.__doc__) +## #return retVal ## -## def _get(self): -## '-no docstring-' -## #return AllowSubstringMatch -## def _set(self, AllowSubstringMatch): + +class IUIAutomationItemContainerPattern(comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{C690FDB2-27A8-423C-812D-429773C9084E}') + _idlflags_ = [] +IUIAutomationItemContainerPattern._methods_ = [ + COMMETHOD([], HRESULT, 'FindItemByProperty', + ( ['in'], POINTER(IUIAutomationElement), 'pStartAfter' ), + ( ['in'], c_int, 'propertyId' ), + ( ['in'], VARIANT, 'value' ), + ( ['retval', 'out'], POINTER(POINTER(IUIAutomationElement)), 'pFound' )), +] +################################################################ +## code template for IUIAutomationItemContainerPattern implementation +##class IUIAutomationItemContainerPattern_Impl(object): +## def FindItemByProperty(self, pStartAfter, propertyId, value): ## '-no docstring-' -## AllowSubstringMatch = property(_get, _set, doc = _set.__doc__) +## #return pFound ## -## def GetWinEventsForAutomationEvent(self, eventId, propertyId): + +UIA_NavigationLandmarkTypeId = 80003 # Constant c_int +IUIAutomationPropertyChangedEventHandler._methods_ = [ + COMMETHOD([], HRESULT, 'HandlePropertyChangedEvent', + ( ['in'], POINTER(IUIAutomationElement), 'sender' ), + ( ['in'], c_int, 'propertyId' ), + ( ['in'], VARIANT, 'newValue' )), +] +################################################################ +## code template for IUIAutomationPropertyChangedEventHandler implementation +##class IUIAutomationPropertyChangedEventHandler_Impl(object): +## def HandlePropertyChangedEvent(self, sender, propertyId, newValue): ## '-no docstring-' -## #return winEvents +## #return ## -UIA_IsRangeValuePatternAvailablePropertyId = 30033 # Constant c_int -UIA_HelpTextPropertyId = 30013 # Constant c_int -class CUIAutomation8(CoClass): - u'The Central Class for UIAutomation8' - _reg_clsid_ = GUID('{E22AD333-B25F-460C-83D0-0581107395C9}') - _idlflags_ = [] - _typelib_path_ = typelib_path - _reg_typelib_ = ('{944DE083-8FB8-45CF-BCB7-C477ACB2F897}', 1, 0) -CUIAutomation8._com_interfaces_ = [IUIAutomation2, IUIAutomation3, IUIAutomation4] - -UIA_SelectionIsSelectionRequiredPropertyId = 30061 # Constant c_int -StyleId_NumberedList = 70016 # Constant c_int -__all__ = ['UIA_IsGridItemPatternAvailablePropertyId', +__all__ = [ 'UIA_IsGridItemPatternAvailablePropertyId', 'IUIAutomationAndCondition', 'UIA_StrikethroughColorAttributeId', 'UIA_LegacyIAccessiblePatternId', - 'UIA_AnimationStyleAttributeId', 'UIA_RotationPropertyId', + 'UIA_AnimationStyleAttributeId', + 'UIA_Drag_DragCancelEventId', + 'UIA_IsSpreadsheetItemPatternAvailablePropertyId', 'IUIAutomationElement', 'UIA_ClickablePointPropertyId', 'UiaChangeInfo', 'UIA_LandmarkTypePropertyId', 'IUIAutomationPropertyChangedEventHandler', @@ -4764,36 +4903,38 @@ class CUIAutomation8(CoClass): 'UIA_ValueIsReadOnlyPropertyId', 'PropertyConditionFlags_None', 'UIA_ToolTipControlTypeId', 'UIA_MultipleViewCurrentViewPropertyId', - 'UIA_IsSpreadsheetItemPatternAvailablePropertyId', 'TextEditChangeType_Composition', 'UIA_MarginLeadingAttributeId', 'UIA_GridColumnCountPropertyId', 'UIA_WindowControlTypeId', 'UIA_CaretBidiModeAttributeId', 'UIA_AnnotationObjectsAttributeId', - 'UIA_LocalizedControlTypePropertyId', + 'UIA_CheckBoxControlTypeId', 'UIA_AnnotationObjectsPropertyId', 'UIA_SelectionItem_ElementAddedToSelectionEventId', - 'AnnotationType_Highlighted', - 'UIA_OutlineStylesAttributeId', 'AnnotationType_Header', + 'AnnotationType_Highlighted', 'UIA_ButtonControlTypeId', + 'AnnotationType_Header', 'UIA_LegacyIAccessibleRolePropertyId', + 'TreeTraversalOptions', 'UIA_InputReachedOtherElementEventId', 'UIA_SelectionItem_ElementRemovedFromSelectionEventId', 'UIA_CaretPositionAttributeId', - 'IUIAutomationExpandCollapsePattern', 'DockPosition_Top', - 'DockPosition_None', 'UIA_MainLandmarkTypeId', + 'IUIAutomationExpandCollapsePattern', + 'UIA_IsTextPatternAvailablePropertyId', + 'UIA_MainLandmarkTypeId', 'SynchronizedInputType_LeftMouseUp', + 'UIA_RotationPropertyId', 'UIA_LegacyIAccessibleDefaultActionPropertyId', - 'TreeTraversalOptions', + 'UIA_CenterPointPropertyId', 'UIA_IsMultipleViewPatternAvailablePropertyId', - 'UIA_ItemContainerPatternId', + 'UIA_RangeValueMinimumPropertyId', 'IUIAutomationTransformPattern2', 'UIA_MenuBarControlTypeId', 'UIA_FontWeightAttributeId', 'UIA_DocumentControlTypeId', 'UIA_CustomControlTypeId', 'UIA_ExpandCollapsePatternId', 'ExtendedProperty', - 'UIA_TableRowHeadersPropertyId', + 'AnnotationType_Comment', 'UIA_GridItemColumnPropertyId', 'AnnotationType_DataValidationError', 'WindowInteractionState_BlockedByModalWindow', - 'IUIAutomationScrollItemPattern', + 'UIA_IsPeripheralPropertyId', 'IUIAutomationTextRangeArray', 'UIA_IsTextPattern2AvailablePropertyId', 'StructureChangeType_ChildrenReordered', @@ -4814,7 +4955,7 @@ class CUIAutomation8(CoClass): 'IUIAutomationAnnotationPattern', 'IUIAutomationNotCondition', 'UIA_OutlineColorPropertyId', 'IUIAutomationTransformPattern', - 'UIA_InputDiscardedEventId', + 'NotificationProcessing_CurrentThenMostRecent', 'ExpandCollapseState_Expanded', 'UIA_IsItalicAttributeId', 'UIA_AnnotationDateTimePropertyId', 'StyleId_BulletedList', 'RowOrColumnMajor_Indeterminate', @@ -4826,48 +4967,52 @@ class CUIAutomation8(CoClass): 'UIA_LegacyIAccessibleStatePropertyId', 'UIA_TextPatternId', 'UIA_RangeValueSmallChangePropertyId', 'UIA_ValueValuePropertyId', + 'IUIAutomationSelectionPattern2', 'UIA_IsSpreadsheetPatternAvailablePropertyId', 'UIA_SpinnerControlTypeId', 'AnnotationType_MoveChange', 'UIA_NativeWindowHandlePropertyId', 'UIA_RuntimeIdPropertyId', 'TextUnit_Document', 'TextUnit_Word', 'IUIAutomationSynchronizedInputPattern', - 'UIA_GridItemColumnPropertyId', 'UIA_SelectionPatternId', + 'UIA_TableRowHeadersPropertyId', 'UIA_SelectionPatternId', 'IUIAutomationOrCondition', - 'UIA_SelectionActiveEndAttributeId', 'WindowInteractionState_Closing', + 'UIA_Selection2CurrentSelectedItemPropertyId', 'UIA_IsScrollPatternAvailablePropertyId', - 'UIA_TogglePatternId', 'UIA_RangeValueMinimumPropertyId', + 'UIA_LevelPropertyId', 'UIA_TogglePatternId', + 'UIA_SelectionActiveEndAttributeId', 'UIA_IsActiveAttributeId', 'ToggleState_On', 'SynchronizedInputType_RightMouseDown', - 'UIA_RangeValueMaximumPropertyId', - 'IUIAutomationValuePattern', + 'UIA_StructureChangedEventId', 'IUIAutomationValuePattern', 'UIA_BoundingRectanglePropertyId', 'IUIAutomationEventHandler', 'UIA_TextFlowDirectionsAttributeId', 'UIA_MultipleViewPatternId', - 'UIA_WindowIsTopmostPropertyId', + 'UIA_GridItemContainingGridPropertyId', + 'UIA_Selection2ItemCountPropertyId', 'NavigateDirection_FirstChild', - 'UIA_Text_TextSelectionChangedEventId', - 'UIA_SearchLandmarkTypeId', + 'UIA_IsTextEditPatternAvailablePropertyId', + 'UIA_ItemContainerPatternId', 'UIA_SearchLandmarkTypeId', 'IUIAutomationSelectionPattern', 'AnnotationType_CircularReferenceError', - 'UIA_TableControlTypeId', + 'UIA_SpreadsheetItemAnnotationObjectsPropertyId', 'IUIAutomationChangesEventHandler', - 'UIA_TableColumnHeadersPropertyId', 'UIA_SizePropertyId', - 'UIA_AnnotationTypesPropertyId', + 'UIA_TableColumnHeadersPropertyId', + 'UIA_Selection2LastSelectedItemPropertyId', + 'UIA_SizePropertyId', 'UIA_AnnotationTypesPropertyId', 'TextPatternRangeEndpoint_Start', 'UIA_TableItemColumnHeaderItemsPropertyId', 'SupportedTextSelection_Single', 'IUIAutomationTextPattern2', 'SynchronizedInputType', 'UIA_ClassNamePropertyId', 'UIA_UnderlineStyleAttributeId', - 'UIA_IsSuperscriptAttributeId', + 'NotificationKind_ItemRemoved', 'UIA_AnnotationPatternId', 'UIA_RangeValueValuePropertyId', 'UIA_HorizontalTextAlignmentAttributeId', 'UIA_SelectionItemSelectionContainerPropertyId', 'UIA_LegacyIAccessibleKeyboardShortcutPropertyId', - 'UIA_IsEnabledPropertyId', + 'TextUnit_Page', 'UIA_SelectionPattern2Id', 'UIA_Transform2ZoomMaximumPropertyId', - 'UIA_PaneControlTypeId', 'UIA_CheckBoxControlTypeId', + 'IUIAutomationMultipleViewPattern', + 'UIA_LocalizedControlTypePropertyId', 'UIA_GridItemPatternId', 'UIA_AnnotationAnnotationTypeIdPropertyId', 'IUIAutomationProxyFactoryMapping', @@ -4876,24 +5021,25 @@ class CUIAutomation8(CoClass): 'IUIAutomationItemContainerPattern', 'UIA_DragDropEffectsPropertyId', 'ExpandCollapseState_Collapsed', - 'UIA_MenuModeStartEventId', 'UIA_MenuClosedEventId', - 'UIA_CustomLandmarkTypeId', - 'UIA_GridItemRowSpanPropertyId', 'UIA_ChangesEventId', + 'ProviderOptions_OverrideProvider', + 'UIA_MenuClosedEventId', 'UIA_CustomLandmarkTypeId', + 'UIA_WindowPatternId', + 'UIA_IsSelectionPatternAvailablePropertyId', 'IUIAutomationDockPattern', 'LiveSetting', 'IUIAutomationFocusChangedEventHandler', 'UIA_CalendarControlTypeId', - 'UIA_OverlineColorAttributeId', 'IUIAutomationDropTargetPattern', - 'UIA_StyleNameAttributeId', 'AnnotationType_Footer', - 'TextUnit_Format', 'UIA_MenuOpenedEventId', + 'UIA_StyleNameAttributeId', + 'UIA_IsControlElementPropertyId', 'AnnotationType_Footer', + 'TextUnit_Format', 'UIA_WindowWindowInteractionStatePropertyId', - 'UIA_ToggleToggleStatePropertyId', - 'UIA_FormLandmarkTypeId', 'UIA_MarginBottomAttributeId', - 'UIA_SpreadsheetItemPatternId', 'AutomationElementMode', - 'UIA_AnnotationTypesAttributeId', 'StyleId_Heading9', - 'StyleId_Heading8', 'StyleId_Heading5', 'StyleId_Heading4', - 'StyleId_Heading7', 'StyleId_Heading6', 'StyleId_Heading1', - 'StyleId_Heading3', 'StyleId_Heading2', + 'UIA_ToggleToggleStatePropertyId', 'StyleId_Quote', + 'UIA_FormLandmarkTypeId', + 'UIA_IsSynchronizedInputPatternAvailablePropertyId', + 'AutomationElementMode', 'UIA_AnnotationTypesAttributeId', + 'StyleId_Heading9', 'StyleId_Heading8', 'StyleId_Heading5', + 'StyleId_Heading4', 'StyleId_Heading7', 'StyleId_Heading6', + 'StyleId_Heading1', 'StyleId_Heading3', 'StyleId_Heading2', 'UIA_ListItemControlTypeId', 'UIA_ObjectModelPatternId', 'UIA_LegacyIAccessibleSelectionPropertyId', 'UIA_TransformPatternId', @@ -4906,9 +5052,11 @@ class CUIAutomation8(CoClass): 'UIA_IsValuePatternAvailablePropertyId', 'IUIAutomationRangeValuePattern', 'ZoomUnit_LargeDecrement', 'UIA_ComboBoxControlTypeId', - 'AnnotationType_Comment', + 'UIA_MarginBottomAttributeId', 'IUIAutomationObjectModelPattern', - 'IUIAutomationTextChildPattern', 'IUIAutomationElement3', + 'UIA_IsWindowPatternAvailablePropertyId', + 'IUIAutomationTextChildPattern', + 'AnnotationType_TrackChanges', 'IUIAutomationElement3', 'IUIAutomationElement2', 'IUIAutomationElement7', 'IUIAutomationElement6', 'IUIAutomationElement5', 'IUIAutomationElement4', 'StyleId_NumberedList', @@ -4917,74 +5065,77 @@ class CUIAutomation8(CoClass): 'UIA_IsGridPatternAvailablePropertyId', 'CUIAutomation8', 'UIA_IsHiddenAttributeId', 'UIA_TableRowOrColumnMajorPropertyId', - 'TreeScope_Children', + 'NotificationKind_ActionCompleted', 'TreeScope_Children', 'UIA_SpreadsheetItemAnnotationTypesPropertyId', 'WindowInteractionState_ReadyForUserInteraction', 'UIA_TableItemRowHeaderItemsPropertyId', 'UIA_SelectionCanSelectMultiplePropertyId', 'WindowInteractionState_NotResponding', - 'UIA_IsTextEditPatternAvailablePropertyId', + 'UIA_Text_TextSelectionChangedEventId', 'ExpandCollapseState_LeafNode', 'UIA_ToolBarControlTypeId', 'IUIAutomation', 'TreeScope_Parent', 'IUIAutomationProxyFactory', 'IUIAutomationTextRange3', - 'IUIAutomationTextRange2', - 'ProviderOptions_ClientSideProvider', + 'NotificationKind', 'ProviderOptions_ClientSideProvider', 'NavigateDirection_NextSibling', 'ScrollAmount_SmallIncrement', 'ProviderOptions_ProviderOwnsSetFocus', - 'AnnotationType_UnsyncedChange', 'UIA_FontNameAttributeId', + 'IUIAutomationTextRange2', 'UIA_FontNameAttributeId', 'TreeScope_Element', 'WindowInteractionState', 'UIA_SummaryChangeId', - 'UIA_IsInvokePatternAvailablePropertyId', - 'ExpandCollapseState', 'TextUnit_Paragraph', + 'UIA_Selection2FirstSelectedItemPropertyId', + 'ExpandCollapseState', + 'IUIAutomationSpreadsheetItemPattern', 'UIA_OptimizeForVisualContentPropertyId', 'SynchronizedInputType_RightMouseUp', - 'UIA_StrikethroughStyleAttributeId', - 'UIA_IsWindowPatternAvailablePropertyId', + 'UIA_StrikethroughStyleAttributeId', 'ScrollAmount', 'UIA_IsDragPatternAvailablePropertyId', 'UIA_DragDropEffectPropertyId', 'UIA_AutomationPropertyChangedEventId', - 'UIA_SpreadsheetItemAnnotationObjectsPropertyId', + 'UIA_TableControlTypeId', 'UIA_ExpandCollapseExpandCollapseStatePropertyId', - 'UIA_TableItemPatternId', 'DockPosition_Right', - 'UIA_ProgressBarControlTypeId', 'Assertive', - 'ProviderOptions_UseClientCoordinates', - 'UIA_ToolTipClosedEventId', - 'UIA_AnnotationAuthorPropertyId', + 'UIA_StylesFillPatternStylePropertyId', + 'DockPosition_Right', 'UIA_ProgressBarControlTypeId', + 'Assertive', 'ProviderOptions_UseClientCoordinates', + 'UIA_MenuOpenedEventId', 'UIA_AnnotationAuthorPropertyId', 'IUIAutomationPropertyCondition', 'UIA_AriaRolePropertyId', 'UIA_TransformCanResizePropertyId', 'AutomationElementMode_Full', 'StructureChangeType_ChildrenBulkRemoved', 'IUIAutomationTextEditPattern', 'Off', - 'AnnotationType_SpellingError', 'UIA_ItemStatusPropertyId', + 'UIA_TextChildPatternId', + 'NotificationProcessing_ImportantMostRecent', 'UIA_MenuControlTypeId', 'UIA_IsDataValidForFormPropertyId', 'UIA_OutlineThicknessPropertyId', 'UIA_ScrollBarControlTypeId', - 'UIA_IsTogglePatternAvailablePropertyId', + 'UIA_SelectionItemIsSelectedPropertyId', 'UIA_LineSpacingAttributeId', 'UIA_CapStyleAttributeId', - 'UIA_CenterPointPropertyId', 'UIA_AppBarControlTypeId', + 'UIA_CultureAttributeId', 'UIA_AppBarControlTypeId', 'UIA_Drag_DragStartEventId', 'StyleId_Custom', - 'UIA_ScrollHorizontalScrollPercentPropertyId', - 'ProviderOptions', 'AnnotationType_EditingLockedChange', + 'IUIAutomationNotificationEventHandler', + 'UIA_DragPatternId', 'AnnotationType_EditingLockedChange', 'WindowVisualState_Maximized', 'WindowVisualState', 'UIA_LiveSettingPropertyId', 'UIA_FlowsToPropertyId', 'AnnotationType_Author', 'UIA_HeaderItemControlTypeId', 'UIA_ListControlTypeId', 'UIA_ProviderDescriptionPropertyId', 'UIA_ScrollVerticalViewSizePropertyId', 'ToggleState', - 'StructureChangeType', 'UIA_SeparatorControlTypeId', + 'StructureChangeType', 'UIA_NotificationEventId', + 'UIA_ItemStatusPropertyId', 'UIA_SeparatorControlTypeId', 'UIA_IsContentElementPropertyId', 'ScrollAmount_LargeDecrement', 'UIA_MarginTrailingAttributeId', 'UIA_InputReachedTargetEventId', 'UIA_DragIsGrabbedPropertyId', 'AnnotationType_Endnote', - 'StyleId_Quote', 'UIA_OrientationPropertyId', + 'DockPosition_Top', 'UIA_OrientationPropertyId', + 'UIA_IsInvokePatternAvailablePropertyId', 'UIA_SayAsInterpretAsMetadataId', 'IUIAutomationCondition', - 'UIA_StructureChangedEventId', 'UIA_MenuItemControlTypeId', - 'UIA_Window_WindowClosedEventId', - 'AnnotationType_TrackChanges', 'DockPosition_Left', - 'PropertyConditionFlags_IgnoreCase', + 'UIA_RangeValueMaximumPropertyId', + 'NotificationProcessing_All', + 'UIA_IsSuperscriptAttributeId', + 'UIA_MenuItemControlTypeId', + 'UIA_Window_WindowClosedEventId', 'UIA_ImageControlTypeId', + 'DockPosition_Left', 'PropertyConditionFlags_IgnoreCase', 'UIA_FlowsFromPropertyId', 'UIA_Transform2CanZoomPropertyId', 'UIA_SelectionSelectionPropertyId', @@ -4994,7 +5145,7 @@ class CUIAutomation8(CoClass): 'UIA_TransformCanRotatePropertyId', 'UIA_NavigationLandmarkTypeId', 'UIA_AutomationIdPropertyId', - 'AnnotationType_ConflictingChange', + 'SynchronizedInputType_LeftMouseDown', 'UIA_StylesStyleIdPropertyId', 'UIA_LegacyIAccessibleChildIdPropertyId', 'IUIAutomationTableItemPattern', @@ -5002,7 +5153,8 @@ class CUIAutomation8(CoClass): 'UIA_IsObjectModelPatternAvailablePropertyId', 'ProviderOptions_ServerSideProvider', 'IUIAutomationTextRange', 'ToggleState_Off', - 'ScrollAmount', 'TextEditChangeType_AutoCorrect', + 'AnnotationType_InsertionChange', + 'TextEditChangeType_AutoCorrect', 'UIA_RangeValueIsReadOnlyPropertyId', 'IUIAutomationTextEditTextChangedEventHandler', 'IAccessible', 'NavigateDirection_Parent', @@ -5010,29 +5162,28 @@ class CUIAutomation8(CoClass): 'ProviderOptions_UseComThreading', 'OrientationType_Vertical', 'AnnotationType_GrammarError', 'UIA_TreeControlTypeId', 'ZoomUnit_SmallIncrement', - 'UIA_WindowCanMinimizePropertyId', 'DockPosition_Bottom', + 'UIA_WindowCanMinimizePropertyId', 'OrientationType', 'UIA_ControllerForPropertyId', 'TreeScope_Subtree', 'UIA_GridRowCountPropertyId', 'UIA_IsOffscreenPropertyId', 'UIA_LegacyIAccessibleDescriptionPropertyId', - 'AnnotationType_DeletionChange', + 'NotificationKind_ItemAdded', 'SupportedTextSelection_None', 'UIA_ValuePatternId', - 'UIA_CulturePropertyId', - 'UIA_IsTableItemPatternAvailablePropertyId', + 'UIA_CulturePropertyId', 'IUIAutomationBoolCondition', 'AnnotationType_Unknown', 'UIA_IsLegacyIAccessiblePatternAvailablePropertyId', - 'TextUnit_Page', 'UIA_NamePropertyId', + 'UIA_SayAsInterpretAsAttributeId', 'UIA_NamePropertyId', 'ZoomUnit_SmallDecrement', 'IUIAutomationDragPattern', 'IUIAutomationScrollPattern', 'ToggleState_Indeterminate', - 'UIA_IsControlElementPropertyId', + 'SupportedTextSelection', 'UIA_ProcessIdPropertyId', 'UIA_AcceleratorKeyPropertyId', 'UIA_HostedFragmentRootsInvalidatedEventId', - 'CUIAutomation', 'UIA_TransformCanMovePropertyId', - 'AnnotationType_Mathematics', - 'IUIAutomationMultipleViewPattern', + 'UIA_IsStylesPatternAvailablePropertyId', + 'UIA_TransformCanMovePropertyId', + 'AnnotationType_Mathematics', 'UIA_PaneControlTypeId', 'TreeTraversalOptions_PostOrder', 'UIA_TextEdit_TextChangedEventId', 'UIA_TextControlTypeId', 'UIA_TextPattern2Id', 'UIA_LinkAttributeId', - 'UIA_StylesPatternId', + 'UIA_SpreadsheetPatternId', 'UIA_StylesPatternId', 'UIA_IsTransformPatternAvailablePropertyId', 'TextEditChangeType_AutoComplete', 'UIA_TextEdit_ConversionTargetChangedEventId', @@ -5042,8 +5193,9 @@ class CUIAutomation8(CoClass): 'UIA_Drag_DragCompleteEventId', 'UIA_AfterParagraphSpacingAttributeId', 'UIA_VirtualizedItemPatternId', + 'AnnotationType_DeletionChange', 'TreeTraversalOptions_LastToFirstOrder', - 'UIA_ButtonControlTypeId', 'UIA_IsPasswordPropertyId', + 'UIA_OutlineStylesAttributeId', 'UIA_IsPasswordPropertyId', 'SynchronizedInputType_KeyDown', 'UIA_SelectionItemPatternId', 'PropertyConditionFlags', 'UIA_UnderlineColorAttributeId', @@ -5052,15 +5204,15 @@ class CUIAutomation8(CoClass): 'UIA_MultipleViewSupportedViewsPropertyId', 'IUIAutomationStructureChangedEventHandler', 'UIA_IndentationTrailingAttributeId', + 'NotificationProcessing_MostRecent', 'UIA_ToolTipOpenedEventId', 'UIA_StylesFillPatternColorPropertyId', 'TreeScope', - 'UIA_DropTargetPatternId', 'UIA_LevelPropertyId', - 'IUIAutomationBoolCondition', + 'UIA_DropTargetPatternId', + 'UIA_IsSelectionPattern2AvailablePropertyId', 'ScrollAmount_LargeIncrement', 'UIA_ThumbControlTypeId', - 'UIA_GridItemContainingGridPropertyId', - 'UIA_AnnotationPatternId', - 'UIA_SpreadsheetItemFormulaPropertyId', - 'UIA_ImageControlTypeId', 'UIA_ScrollPatternId', + 'UIA_WindowIsTopmostPropertyId', + 'UIA_OverlineColorAttributeId', + 'UIA_DescribedByPropertyId', 'UIA_IsTablePatternAvailablePropertyId', 'UIA_GridItemColumnSpanPropertyId', 'UIA_BeforeParagraphSpacingAttributeId', @@ -5068,58 +5220,56 @@ class CUIAutomation8(CoClass): 'UIA_IsKeyboardFocusablePropertyId', 'UIA_EditControlTypeId', 'UIA_SemanticZoomControlTypeId', 'IUIAutomation2', 'IUIAutomation3', 'IUIAutomation4', - 'AnnotationType_InsertionChange', - 'UIA_WindowCanMaximizePropertyId', - 'IUIAutomationSpreadsheetItemPattern', - 'ProviderOptions_OverrideProvider', 'DockPosition', - 'ExpandCollapseState_PartiallyExpanded', + 'IUIAutomation5', 'UIA_WindowCanMaximizePropertyId', + 'TextUnit_Paragraph', 'UIA_MenuModeStartEventId', + 'DockPosition', 'ExpandCollapseState_PartiallyExpanded', 'IRawElementProviderSimple', 'UIA_TablePatternId', 'UIA_AutomationFocusChangedEventId', - 'UIA_TextChildPatternId', + 'AnnotationType_SpellingError', 'UIA_DropTargetDropTargetEffectsPropertyId', - 'UIA_Selection_InvalidatedEventId', 'UIA_DragPatternId', + 'UIA_Selection_InvalidatedEventId', 'ProviderOptions', 'StructureChangeType_ChildRemoved', 'UIA_IsTransformPattern2AvailablePropertyId', - 'UIA_DragGrabbedItemsPropertyId', 'UIA_WindowPatternId', - 'UIA_IsRangeValuePatternAvailablePropertyId', - 'SynchronizedInputType_LeftMouseDown', - 'UIA_MenuModeEndEventId', - 'UIA_IsSelectionPatternAvailablePropertyId', - 'OrientationType', 'UIA_StylesShapePropertyId', - 'UIA_LabeledByPropertyId', 'IUIAutomationElementArray', + 'UIA_DragGrabbedItemsPropertyId', + 'UIA_GridItemRowSpanPropertyId', + 'AnnotationType_ConflictingChange', + 'UIA_MenuModeEndEventId', 'UIA_ChangesEventId', + 'DockPosition_Bottom', 'UIA_StylesShapePropertyId', + 'UIA_Text_TextChangedEventId', 'IUIAutomationElementArray', 'UIA_FontSizeAttributeId', 'UIA_StylesStyleNamePropertyId', 'OrientationType_Horizontal', 'UIA_AnnotationAnnotationTypeNamePropertyId', - 'UIA_Drag_DragCancelEventId', + 'AnnotationType_UnsyncedChange', 'UIA_PositionInSetPropertyId', 'ProviderOptions_NonClientAreaProvider', 'ProviderOptions_RefuseNonClientSupport', 'IUIAutomationSelectionItemPattern', - 'UIA_DescribedByPropertyId', 'IUIAutomationStylesPattern', - 'UIA_IsReadOnlyAttributeId', 'UIA_Text_TextChangedEventId', - 'TextUnit', 'IUIAutomationProxyFactoryEntry', - 'SupportedTextSelection', + 'UIA_SpreadsheetItemFormulaPropertyId', + 'IUIAutomationStylesPattern', 'UIA_IsReadOnlyAttributeId', + 'UIA_LabeledByPropertyId', 'TextUnit', + 'IUIAutomationProxyFactoryEntry', + 'UIA_IsTableItemPatternAvailablePropertyId', 'UIA_RangeValueLargeChangePropertyId', 'UIA_TransformPattern2Id', 'UIA_VisualEffectsPropertyId', 'TreeScope_Ancestors', 'IUIAutomationCustomNavigationPattern', 'ScrollAmount_SmallDecrement', 'TextEditChangeType', - 'UIA_SayAsInterpretAsAttributeId', - 'UIA_TitleBarControlTypeId', 'StyleId_Title', + 'NotificationProcessing', 'UIA_TitleBarControlTypeId', + 'IUIAutomationInvokePattern', 'NavigateDirection_PreviousSibling', 'UIA_RangeValuePatternId', 'ZoomUnit', - 'UIA_ControlTypePropertyId', 'UIA_BulletStyleAttributeId', - 'UIA_MarginTopAttributeId', 'IUIAutomationGridPattern', - 'DockPosition_Fill', - 'UIA_IsStylesPatternAvailablePropertyId', + 'UIA_IsVirtualizedItemPatternAvailablePropertyId', + 'UIA_BulletStyleAttributeId', 'UIA_MarginTopAttributeId', + 'IUIAutomationGridPattern', 'DockPosition_Fill', + 'CUIAutomation', 'NotificationProcessing_ImportantAll', 'UIA_HasKeyboardFocusPropertyId', 'StyleId_Subtitle', - 'UIA_IsTextPatternAvailablePropertyId', + 'UIA_IsEnabledPropertyId', 'DockPosition_None', 'UIA_ScrollVerticalScrollPercentPropertyId', 'ProviderOptions_HasNativeIAccessible', 'UIA_DropTarget_DroppedEventId', 'UIA_ScrollHorizontalViewSizePropertyId', - 'UIA_IsPeripheralPropertyId', 'UIA_IsSubscriptAttributeId', - 'UIA_SystemAlertEventId', + 'IUIAutomationScrollItemPattern', + 'UIA_IsSubscriptAttributeId', 'UIA_SystemAlertEventId', 'TextEditChangeType_CompositionFinalized', 'UIA_FillColorPropertyId', 'UIA_TextEditPatternId', 'UIA_LegacyIAccessibleNamePropertyId', @@ -5128,50 +5278,50 @@ class CUIAutomation8(CoClass): 'UIA_SplitButtonControlTypeId', 'UIA_LegacyIAccessibleValuePropertyId', 'UIA_IsCustomNavigationPatternAvailablePropertyId', - 'UIA_SpreadsheetPatternId', 'TreeScope_None', - 'AnnotationType_Footnote', - 'StructureChangeType_ChildrenBulkAdded', + 'UIA_ScrollPatternId', 'TreeScope_None', + 'AnnotationType_Footnote', 'UIA_InputDiscardedEventId', + 'UIA_IsItemContainerPatternAvailablePropertyId', 'UIA_IsDockPatternAvailablePropertyId', 'IUIAutomationVirtualizedItemPattern', - 'UIA_AsyncContentLoadedEventId', - 'IUIAutomationInvokePattern', + 'UIA_AsyncContentLoadedEventId', 'StyleId_Title', 'UIA_DropTargetDropTargetEffectPropertyId', 'Polite', 'TextUnit_Character', 'UIA_FrameworkIdPropertyId', 'UIA_DropTarget_DragEnterEventId', 'TreeTraversalOptions_Default', - 'UIA_StylesFillPatternStylePropertyId', + 'NotificationKind_ActionAborted', 'UIA_TableItemPatternId', 'TreeScope_Descendants', 'UIA_TabItemControlTypeId', 'IUIAutomationGridItemPattern', 'NavigateDirection_LastChild', - 'UIA_IsSynchronizedInputPatternAvailablePropertyId', - 'UIA_TabsAttributeId', + 'UIA_SpreadsheetItemPatternId', 'UIA_TabsAttributeId', 'StructureChangeType_ChildrenInvalidated', 'IUIAutomationTablePattern', 'NavigateDirection', 'ZoomUnit_NoAmount', - 'UIA_SelectionItemIsSelectedPropertyId', + 'UIA_IsTogglePatternAvailablePropertyId', + 'UIA_ToolTipClosedEventId', 'UIA_IsScrollItemPatternAvailablePropertyId', 'UIA_GridItemRowPropertyId', 'UIA_ScrollVerticallyScrollablePropertyId', 'UIA_AriaPropertiesPropertyId', 'UIA_CustomNavigationPatternId', - 'UIA_WindowIsModalPropertyId', - 'UIA_IsVirtualizedItemPatternAvailablePropertyId', + 'UIA_WindowIsModalPropertyId', 'UIA_ControlTypePropertyId', 'ScrollAmount_NoAmount', 'RowOrColumnMajor', 'UIA_ItemTypePropertyId', 'UIA_IsTextChildPatternAvailablePropertyId', - 'UIA_HelpTextPropertyId', 'UIA_CultureAttributeId', + 'UIA_HelpTextPropertyId', 'NotificationKind_Other', 'UIA_LegacyIAccessibleHelpPropertyId', 'UIA_AccessKeyPropertyId', 'UIA_SelectionIsSelectionRequiredPropertyId', 'StructureChangeType_ChildAdded', 'IUIAutomationLegacyIAccessiblePattern', 'UIA_FillTypePropertyId', - 'UIA_IsItemContainerPatternAvailablePropertyId', + 'StructureChangeType_ChildrenBulkAdded', 'UIA_IndentationFirstLineAttributeId', 'StyleId_Emphasis', - 'UIA_GroupControlTypeId', 'UIA_ProcessIdPropertyId', + 'UIA_GroupControlTypeId', + 'UIA_IsRangeValuePatternAvailablePropertyId', 'UIA_OverlineStyleAttributeId', 'UIA_ScrollHorizontallyScrollablePropertyId', 'UIA_StylesFillColorPropertyId', 'UIA_Transform2ZoomMinimumPropertyId', + 'UIA_ScrollHorizontalScrollPercentPropertyId', 'UIA_TabControlTypeId', 'UIA_GridPatternId'] -from comtypes import _check_version; _check_version('501') +from comtypes import _check_version; _check_version('') diff --git a/source/sourceEnv.py b/source/sourceEnv.py index fe1a4d64019..54d584662ae 100644 --- a/source/sourceEnv.py +++ b/source/sourceEnv.py @@ -15,6 +15,7 @@ # Directories containing Python modules included in git submodules. PYTHON_DIRS = ( os.path.join(TOP_DIR, "include", "pyserial"), + os.path.join(TOP_DIR, "include", "comtypes"), os.path.join(TOP_DIR, "miscDeps", "python"), ) From 8102f71987541477a16721c2440caa795b54f97d Mon Sep 17 00:00:00 2001 From: James Teh Date: Wed, 13 Sep 2017 15:31:39 +1000 Subject: [PATCH 07/25] Update the sapi5 synth driver to support the new speech framework. --- source/synthDrivers/sapi5.py | 37 +++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/source/synthDrivers/sapi5.py b/source/synthDrivers/sapi5.py index 95392667af9..223e8855897 100644 --- a/source/synthDrivers/sapi5.py +++ b/source/synthDrivers/sapi5.py @@ -1,7 +1,7 @@ # -*- coding: UTF-8 -*- #synthDrivers/sapi5.py #A part of NonVisual Desktop Access (NVDA) -#Copyright (C) 2006-2014 NV Access Limited, Peter Vágner, Aleksey Sadovoy +#Copyright (C) 2006-2017 NV Access Limited, Peter Vágner, Aleksey Sadovoy #This file is covered by the GNU General Public License. #See the file COPYING for more details. @@ -18,7 +18,7 @@ import NVDAHelper import globalVars import speech -from synthDriverHandler import SynthDriver,VoiceInfo +from synthDriverHandler import SynthDriver, VoiceInfo, synthIndexReached, synthDoneSpeaking import config import nvwave from logHandler import log @@ -72,9 +72,37 @@ class constants: SVSFlagsAsync = 1 SVSFPurgeBeforeSpeak = 2 SVSFIsXML = 8 + # From the SpeechVoiceEvents enum: https://msdn.microsoft.com/en-us/library/ms720886(v=vs.85).aspx + SVEEndInputStream = 4 + SVEBookmark = 16 + +class SapiSink(object): + """Handles SAPI event notifications. + See https://msdn.microsoft.com/en-us/library/ms723587(v=vs.85).aspx + """ + + def __init__(self, synth): + self.synth = synth + + def Bookmark(self, streamNum, pos, bookmark, bookmarkId): + synthIndexReached.notify(synth=self.synth, index=bookmarkId) + + def EndStream(self, streamNum, pos): + synthDoneSpeaking.notify(synth=self.synth) class SynthDriver(SynthDriver): supportedSettings=(SynthDriver.VoiceSetting(),SynthDriver.RateSetting(),SynthDriver.PitchSetting(),SynthDriver.VolumeSetting()) + supportedCommands = { + speech.IndexCommand, + speech.CharacterModeCommand, + speech.LangChangeCommand, + speech.BreakCommand, + speech.PitchCommand, + speech.RateCommand, + speech.VolumeCommand, + speech.PhonemeCommand, + } + supportedNotifications = {synthIndexReached, synthDoneSpeaking} COM_CLASS = "SAPI.SPVoice" @@ -100,7 +128,8 @@ def __init__(self,_defaultVoiceToken=None): self._initTts(_defaultVoiceToken) def terminate(self): - del self.tts + self._eventsConnection = None + self.tts = None def _getAvailableVoices(self): voices=OrderedDict() @@ -167,6 +196,8 @@ def _initTts(self, voice=None): outputDeviceID=nvwave.outputDeviceNameToID(config.conf["speech"]["outputDevice"], True) if outputDeviceID>=0: self.tts.audioOutput=self.tts.getAudioOutputs()[outputDeviceID] + self._eventsConnection = comtypes.client.GetEvents(self.tts, SapiSink(self)) + self.tts.EventInterests = constants.SVEBookmark | constants.SVEEndInputStream def _set_voice(self,value): tokens = self._getVoiceTokens() From b2c2f74de6c0920b40dcb1541f1d2e0b15f7d86f Mon Sep 17 00:00:00 2001 From: James Teh Date: Thu, 14 Sep 2017 10:30:08 +1000 Subject: [PATCH 08/25] Fix submodule URL for comtypes. Oops! --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 14c1db39ec5..71c23a0bcda 100644 --- a/.gitmodules +++ b/.gitmodules @@ -20,5 +20,5 @@ ignore = untracked [submodule "include/comtypes"] path = include/comtypes - url = https://github.com/enthought/comtypes/issues.git + url = https://github.com/enthought/comtypes.git ignore = untracked From ab63b207a1e7d1dd97664fe9dbda52c66951e4d9 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Fri, 27 Oct 2017 09:44:43 +1000 Subject: [PATCH 09/25] Ensure eSpeak emits index callbacks even if the espeak event chunk containing the index is 0 samples in length. This allows sayAll to function with eSpeak. this may have broken due to a recent change in eSpeak I'm guessing. --- source/synthDrivers/_espeak.py | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/source/synthDrivers/_espeak.py b/source/synthDrivers/_espeak.py index b17ed49df07..6c095a694e3 100755 --- a/source/synthDrivers/_espeak.py +++ b/source/synthDrivers/_espeak.py @@ -127,7 +127,9 @@ def callback(wav,numsamples,event): if not isSpeaking: return 1 indexes = [] + print "events" for e in event: + print repr(e.type) if e.type==espeakEVENT_MARK: indexNum = int(e.id.name) # e.audio_position is ms since the start of this utterance. @@ -141,21 +143,24 @@ def callback(wav,numsamples,event): elif e.type==espeakEVENT_LIST_TERMINATED: break if not wav: + print "not wav" player.idle() onIndexReached(None) isSpeaking = False return 0 - if numsamples > 0: - wav = string_at(wav, numsamples * sizeof(c_short)) - prevByte = 0 - for indexNum, indexByte in indexes: - player.feed(wav[prevByte:indexByte], - onDone=lambda indexNum=indexNum: onIndexReached(indexNum)) - prevByte = indexByte - if not isSpeaking: - return 1 - player.feed(wav[prevByte:]) - _numBytesPushed += len(wav) + print "numSamples %s"%numsamples + wav = string_at(wav, numsamples * sizeof(c_short)) if numsamples>0 else "" + prevByte = 0 + print "speak" + for indexNum, indexByte in indexes: + print repr(indexNum) + player.feed(wav[prevByte:indexByte], + onDone=lambda indexNum=indexNum: onIndexReached(indexNum)) + prevByte = indexByte + if not isSpeaking: + return 1 + player.feed(wav[prevByte:]) + _numBytesPushed += len(wav) return 0 except: log.error("callback", exc_info=True) @@ -198,6 +203,7 @@ def _speak(text): def speak(text): global bgQueue + print "xml: %s"%text _execWhenDone(_speak, text, mustBeAsync=True) def stop(): From 8b87c6b5bdb2884489531a3aa62b45e134814a2c Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Sat, 28 Oct 2017 04:48:53 +1000 Subject: [PATCH 10/25] Remove some debug print statements --- source/synthDrivers/_espeak.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/source/synthDrivers/_espeak.py b/source/synthDrivers/_espeak.py index 6c095a694e3..f312b28fa40 100755 --- a/source/synthDrivers/_espeak.py +++ b/source/synthDrivers/_espeak.py @@ -127,9 +127,7 @@ def callback(wav,numsamples,event): if not isSpeaking: return 1 indexes = [] - print "events" for e in event: - print repr(e.type) if e.type==espeakEVENT_MARK: indexNum = int(e.id.name) # e.audio_position is ms since the start of this utterance. @@ -143,17 +141,13 @@ def callback(wav,numsamples,event): elif e.type==espeakEVENT_LIST_TERMINATED: break if not wav: - print "not wav" player.idle() onIndexReached(None) isSpeaking = False return 0 - print "numSamples %s"%numsamples wav = string_at(wav, numsamples * sizeof(c_short)) if numsamples>0 else "" prevByte = 0 - print "speak" for indexNum, indexByte in indexes: - print repr(indexNum) player.feed(wav[prevByte:indexByte], onDone=lambda indexNum=indexNum: onIndexReached(indexNum)) prevByte = indexByte @@ -203,7 +197,6 @@ def _speak(text): def speak(text): global bgQueue - print "xml: %s"%text _execWhenDone(_speak, text, mustBeAsync=True) def stop(): From c11013fe34230c304b9f61b70e41d2613c5e4f93 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Wed, 6 Dec 2017 03:44:20 +1000 Subject: [PATCH 11/25] Ensure eSpeak sets its speech parameters back to user-configured values if interupted while speaking ssml that changes those parameters. --- source/synthDrivers/_espeak.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/synthDrivers/_espeak.py b/source/synthDrivers/_espeak.py index f312b28fa40..7ba298eebfa 100755 --- a/source/synthDrivers/_espeak.py +++ b/source/synthDrivers/_espeak.py @@ -190,6 +190,11 @@ def _execWhenDone(func, *args, **kwargs): def _speak(text): global isSpeaking, _numBytesPushed uniqueID=c_int() + # if eSpeak was interupted while speaking ssml that changed parameters such as pitch, + # It may not reset those runtime values back to the user-configured values. + # Therefore forcefully cause eSpeak to reset its parameters each time beginning to speak again after not speaking. + if not isSpeaking: + espeakDLL.espeak_ng_Cancel() isSpeaking = True flags = espeakCHARS_WCHAR | espeakSSML | espeakPHONEMES _numBytesPushed = 0 From 63196756911381197d00ac5e0621b72c3d7202a3 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Mon, 4 Jun 2018 16:27:38 +1000 Subject: [PATCH 12/25] Add a 'priority' keyword argument to all speech.speak* functions allowing the caller to provide a speech priority. --- source/speech.py | 74 +++++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 33 deletions(-) diff --git a/source/speech.py b/source/speech.py index 729e063033a..406ac104fd7 100755 --- a/source/speech.py +++ b/source/speech.py @@ -111,12 +111,14 @@ def pauseSpeech(switch): isPaused=switch beenCanceled=False -def speakMessage(text): +def speakMessage(text,priority=None): """Speaks a given message. @param text: the message to speak @type text: string +@param priority: The speech priority. +@type priority: One of the C{SPRI_*} constants. """ - speakText(text,reason=controlTypes.REASON_MESSAGE) + speakText(text,reason=controlTypes.REASON_MESSAGE,priority=priority) def getCurrentLanguage(): synth=getSynth() @@ -132,7 +134,7 @@ def getCurrentLanguage(): language=languageHandler.getLanguage() return language -def spellTextInfo(info,useCharacterDescriptions=False): +def spellTextInfo(info,useCharacterDescriptions=False,priority=None): """Spells the text from the given TextInfo, honouring any LangChangeCommand objects it finds if autoLanguageSwitching is enabled.""" if not config.conf['speech']['autoLanguageSwitching']: speakSpelling(info.text,useCharacterDescriptions=useCharacterDescriptions) @@ -140,7 +142,7 @@ def spellTextInfo(info,useCharacterDescriptions=False): curLanguage=None for field in info.getTextWithFields({}): if isinstance(field,basestring): - speakSpelling(field,curLanguage,useCharacterDescriptions=useCharacterDescriptions) + speakSpelling(field,curLanguage,useCharacterDescriptions=useCharacterDescriptions,priority=priority) elif isinstance(field,textInfos.FieldCommand) and field.command=="formatChange": curLanguage=field.field.get('language') @@ -154,13 +156,13 @@ def shouldUseCompatCodeForIndexing(): % synth.name)) return True -def speakSpelling(text, locale=None, useCharacterDescriptions=False): +def speakSpelling(text, locale=None, useCharacterDescriptions=False,priority=None): if shouldUseCompatCodeForIndexing(): # Import late to avoid circular import. import speechCompat return speechCompat.speakSpelling(text, locale=locale, useCharacterDescriptions=useCharacterDescriptions) seq = list(getSpeechForSpelling(text, locale=locale, useCharacterDescriptions=useCharacterDescriptions)) - speak(seq) + speak(seq,priority=priority) def getSpeechForSpelling(text, locale=None, useCharacterDescriptions=False): defaultLanguage=getCurrentLanguage() @@ -240,7 +242,7 @@ def getCharDescListFromText(text,locale): i = i - 1 return charDescList -def speakObjectProperties(obj, reason=controlTypes.REASON_QUERY, _prefixSpeechCommand=None, **allowedProperties): +def speakObjectProperties(obj, reason=controlTypes.REASON_QUERY, priority=None, _prefixSpeechCommand=None, **allowedProperties): #Fetch the values for all wanted properties newPropertyValues={} positionInfo=None @@ -301,20 +303,20 @@ def speakObjectProperties(obj, reason=controlTypes.REASON_QUERY, _prefixSpeechCo if _prefixSpeechCommand is not None: speechSequence.append(_prefixSpeechCommand) speechSequence.append(text) - speak(speechSequence) + speak(speechSequence,priority=priority) -def _speakPlaceholderIfEmpty(info, obj, reason): +def _speakPlaceholderIfEmpty(info, obj, reason,priority=None): """ attempt to speak placeholder attribute if the textInfo 'info' is empty @return: True if info was considered empty, and we attempted to speak the placeholder value. False if info was not considered empty. """ textEmpty = obj._isTextEmpty if textEmpty: - speakObjectProperties(obj,reason=reason,placeholder=True) + speakObjectProperties(obj,reason=reason,placeholder=True,priority=priority) return True return False -def speakObject(obj, reason=controlTypes.REASON_QUERY, _prefixSpeechCommand=None): +def speakObject(obj, reason=controlTypes.REASON_QUERY, _prefixSpeechCommand=None,priority=None): from NVDAObjects import NVDAObjectTextInfo role=obj.role # Choose when we should report the content of this object's textInfo, rather than just the object's value @@ -365,7 +367,7 @@ def speakObject(obj, reason=controlTypes.REASON_QUERY, _prefixSpeechCommand=None if shouldReportTextContent: allowProperties['value']=False - speakObjectProperties(obj, reason=reason, _prefixSpeechCommand=_prefixSpeechCommand, **allowProperties) + speakObjectProperties(obj, reason=reason, _prefixSpeechCommand=_prefixSpeechCommand, priority=priority, **allowProperties) if reason==controlTypes.REASON_ONLYCACHE: return if shouldReportTextContent: @@ -377,34 +379,36 @@ def speakObject(obj, reason=controlTypes.REASON_QUERY, _prefixSpeechCommand=None speakSelectionMessage(_("selected %s"),info.text) else: info.expand(textInfos.UNIT_LINE) - _speakPlaceholderIfEmpty(info, obj, reason) - speakTextInfo(info,unit=textInfos.UNIT_LINE,reason=controlTypes.REASON_CARET) + _speakPlaceholderIfEmpty(info, obj, reason,priority=priority) + speakTextInfo(info,unit=textInfos.UNIT_LINE,reason=controlTypes.REASON_CARET,priority=priority) except: newInfo=obj.makeTextInfo(textInfos.POSITION_ALL) - if not _speakPlaceholderIfEmpty(newInfo, obj, reason): - speakTextInfo(newInfo,unit=textInfos.UNIT_PARAGRAPH,reason=controlTypes.REASON_CARET) + if not _speakPlaceholderIfEmpty(newInfo, obj, reason,priority=priority): + speakTextInfo(newInfo,unit=textInfos.UNIT_PARAGRAPH,reason=controlTypes.REASON_CARET,priority=priority) elif role==controlTypes.ROLE_MATH: import mathPres mathPres.ensureInit() if mathPres.speechProvider: try: - speak(mathPres.speechProvider.getSpeechForMathMl(obj.mathMl)) + speak(mathPres.speechProvider.getSpeechForMathMl(obj.mathMl),priority=priority) except (NotImplementedError, LookupError): pass -def speakText(text,reason=controlTypes.REASON_MESSAGE,symbolLevel=None): +def speakText(text,reason=controlTypes.REASON_MESSAGE,symbolLevel=None,priority=None): """Speaks some text. @param text: The text to speak. @type text: str @param reason: The reason for this speech; one of the controlTypes.REASON_* constants. @param symbolLevel: The symbol verbosity level; C{None} (default) to use the user's configuration. + @param priority: The speech priority. + @type priority: One of the C{SPRI_*} constants. """ if text is None: return if isBlank(text): # Translators: This is spoken when the line is considered blank. text=_("blank") - speak([text],symbolLevel=symbolLevel) + speak([text],symbolLevel=symbolLevel,priority=priority) RE_INDENTATION_SPLIT = re.compile(r"^([^\S\r\n\f\v]*)(.*)$", re.UNICODE | re.DOTALL) def splitTextIndentation(text): @@ -479,13 +483,15 @@ def getIndentationSpeech(indentation, formatConfig): #: The speech priorities ordered from highest to lowest. SPEECH_PRIORITIES = (SPRI_NOW, SPRI_NEXT, SPRI_NORMAL) -def speak(speechSequence, symbolLevel=None, priority=SPRI_NORMAL): +def speak(speechSequence, symbolLevel=None, priority=None): """Speaks a sequence of text and speech commands @param speechSequence: the sequence of text and L{SpeechCommand} objects to speak @param symbolLevel: The symbol verbosity level; C{None} (default) to use the user's configuration. @param priority: The speech priority. @type priority: One of the C{SPRI_*} constants. """ + if priority is None: + priority=SPRI_NORMAL if not speechSequence: #Pointless - nothing to speak return import speechViewer @@ -549,14 +555,14 @@ def speak(speechSequence, symbolLevel=None, priority=SPRI_NORMAL): return getSynth().speak(speechSequence) _manager.speak(speechSequence, priority) -def speakSelectionMessage(message,text): +def speakSelectionMessage(message,text,priority=None): if len(text) < 512: - speakMessage(message % text) + speakMessage(message % text,priority=priority) else: # Translators: This is spoken when the user has selected a large portion of text. Example output "1000 characters" - speakMessage(message % _("%d characters") % len(text)) + speakMessage(message % _("%d characters") % len(text),priority=priority) -def speakSelectionChange(oldInfo,newInfo,speakSelected=True,speakUnselected=True,generalize=False): +def speakSelectionChange(oldInfo,newInfo,speakSelected=True,speakUnselected=True,generalize=False,priority=None): """Speaks a change in selection, either selected or unselected text. @param oldInfo: a TextInfo instance representing what the selection was before @type oldInfo: L{textInfos.TextInfo} @@ -564,6 +570,8 @@ def speakSelectionChange(oldInfo,newInfo,speakSelected=True,speakUnselected=True @type newInfo: L{textInfos.TextInfo} @param generalize: if True, then this function knows that the text may have changed between the creation of the oldInfo and newInfo objects, meaning that changes need to be spoken more generally, rather than speaking the specific text, as the bounds may be all wrong. @type generalize: boolean + @param priority: The speech priority. + @type priority: One of the C{SPRI_*} constants. """ selectedTextList=[] unselectedTextList=[] @@ -607,30 +615,30 @@ def speakSelectionChange(oldInfo,newInfo,speakSelected=True,speakUnselected=True if len(text)==1: text=characterProcessing.processSpeechSymbol(locale,text) # Translators: This is spoken while the user is in the process of selecting something, For example: "hello selected" - speakSelectionMessage(_("%s selected"),text) + speakSelectionMessage(_("%s selected"),text,priority=priority) elif len(selectedTextList)>0: text=newInfo.text if len(text)==1: text=characterProcessing.processSpeechSymbol(locale,text) # Translators: This is spoken to indicate what has been selected. for example 'selected hello world' - speakSelectionMessage(_("selected %s"),text) + speakSelectionMessage(_("selected %s"),text,priority=priority) if speakUnselected: if not generalize: for text in unselectedTextList: if len(text)==1: text=characterProcessing.processSpeechSymbol(locale,text) # Translators: This is spoken to indicate what has been unselected. for example 'hello unselected' - speakSelectionMessage(_("%s unselected"),text) + speakSelectionMessage(_("%s unselected"),text,priority=priority) elif len(unselectedTextList)>0: if not newInfo.isCollapsed: text=newInfo.text if len(text)==1: text=characterProcessing.processSpeechSymbol(locale,text) # Translators: This is spoken to indicate when the previous selection was removed and a new selection was made. for example 'hello world selected instead' - speakSelectionMessage(_("%s selected instead"),text) + speakSelectionMessage(_("%s selected instead"),text,priority=priority) else: # Translators: Reported when selection is removed. - speakMessage(_("selection removed")) + speakMessage(_("selection removed"),priority=priority) #: The number of typed characters for which to suppress speech. _suppressSpeakTypedCharactersNumber = 0 @@ -729,7 +737,7 @@ def _speakTextInfo_addMath(speechSequence, info, field): except (NotImplementedError, LookupError): return -def speakTextInfo(info, useCache=True, formatConfig=None, unit=None, reason=controlTypes.REASON_QUERY, _prefixSpeechCommand=None, onlyInitialFields=False, suppressBlanks=False): +def speakTextInfo(info, useCache=True, formatConfig=None, unit=None, reason=controlTypes.REASON_QUERY, _prefixSpeechCommand=None, onlyInitialFields=False, suppressBlanks=False,priority=None): onlyCache=reason==controlTypes.REASON_ONLYCACHE if isinstance(useCache,SpeakTextInfoState): speakTextInfoState=useCache @@ -859,9 +867,9 @@ def speakTextInfo(info, useCache=True, formatConfig=None, unit=None, reason=cont if onlyInitialFields or (unit in (textInfos.UNIT_CHARACTER,textInfos.UNIT_WORD) and len(textWithFields)>0 and len(textWithFields[0])==1 and all((isinstance(x,textInfos.FieldCommand) and x.command=="controlEnd") for x in itertools.islice(textWithFields,1,None) )): if not onlyCache: if onlyInitialFields or any(isinstance(x,basestring) for x in speechSequence): - speak(speechSequence) + speak(speechSequence,priority=priority) if not onlyInitialFields: - speakSpelling(textWithFields[0],locale=language if autoLanguageSwitching else None) + speakSpelling(textWithFields[0],locale=language if autoLanguageSwitching else None,priority=priority) if useCache: speakTextInfoState.controlFieldStackCache=newControlFieldStack speakTextInfoState.formatFieldAttributesCache=formatFieldAttributesCache @@ -974,7 +982,7 @@ def speakTextInfo(info, useCache=True, formatConfig=None, unit=None, reason=cont if reason==controlTypes.REASON_SAYALL: return speakWithoutPauses(speechSequence) else: - speak(speechSequence) + speak(speechSequence,priority=priority) return True def getSpeechTextForProperties(reason=controlTypes.REASON_QUERY,**propertyValues): From c6150112d15a26400876379fa60239910501ec9d Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Mon, 4 Jun 2018 17:02:46 +1000 Subject: [PATCH 13/25] Alerts in Chrome and Firefox now are spoken with a higher speech priority, and no longer cancel speech beforehand. This means that the alert text will be spoken straight away, but will not interrupt other speech such as the new focus. --- source/NVDAObjects/IAccessible/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/NVDAObjects/IAccessible/__init__.py b/source/NVDAObjects/IAccessible/__init__.py index 9be9b0ade47..5414562764c 100644 --- a/source/NVDAObjects/IAccessible/__init__.py +++ b/source/NVDAObjects/IAccessible/__init__.py @@ -1347,11 +1347,10 @@ def event_alert(self): api.processPendingEvents() if self in api.getFocusAncestors(): return - speech.cancelSpeech() - speech.speakObject(self, reason=controlTypes.REASON_FOCUS) + speech.speakObject(self, reason=controlTypes.REASON_FOCUS,priority=speech.SPRI_NOW) for child in self.recursiveDescendants: if controlTypes.STATE_FOCUSABLE in child.states: - speech.speakObject(child, reason=controlTypes.REASON_FOCUS) + speech.speakObject(child, reason=controlTypes.REASON_FOCUS,priority=speech.SPRI_NOW) def event_caret(self): focus = api.getFocusObject() From b2bb1891f1d347b698a61bf4e218b907eb127cdf Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Thu, 6 Dec 2018 11:09:53 +1000 Subject: [PATCH 14/25] Unit tests: fake speech functions now must take a 'priority' keyword argument to match the real functions. --- tests/unit/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py index 2598a05983b..20437f8a3c6 100644 --- a/tests/unit/__init__.py +++ b/tests/unit/__init__.py @@ -90,5 +90,5 @@ class AppArgs: # Stub speech functions to make them no-ops. # Eventually, these should keep track of calls so we can make assertions. import speech -speech.speak = lambda speechSequence, symbolLevel=None: None -speech.speakSpelling = lambda text, locale=None, useCharacterDescriptions=False: None +speech.speak = lambda speechSequence, symbolLevel=None, priority=None: None +speech.speakSpelling = lambda text, locale=None, useCharacterDescriptions=False, priority=None: None From 8823902455beda0da746ae573183fb5aa22c1bae Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Mon, 1 Apr 2019 11:48:46 +1000 Subject: [PATCH 15/25] Remove speech compat --- source/sayAllHandler.py | 16 --- source/speech.py | 36 ------ source/speechCompat.py | 270 ---------------------------------------- 3 files changed, 322 deletions(-) delete mode 100644 source/speechCompat.py diff --git a/source/sayAllHandler.py b/source/sayAllHandler.py index 31fb3203256..d9d2eada82b 100644 --- a/source/sayAllHandler.py +++ b/source/sayAllHandler.py @@ -22,10 +22,6 @@ _activeSayAll = lambda: None # Return None when called like a dead weakref. def stop(): - if speech.shouldUseCompatCodeForIndexing(): - # Import late to avoid circular import. - import speechCompat - return speechCompat.sayAll_stop() active = _activeSayAll() if active: active.stop() @@ -35,17 +31,9 @@ def isRunning(): @return: C{True} if say all is currently running, C{False} if not. @rtype: bool """ - if speech.shouldUseCompatCodeForIndexing(): - # Import late to avoid circular import. - import speechCompat - return speechCompat.sayAll_isRunning() return bool(_activeSayAll()) def readObjects(obj): - if speech.shouldUseCompatCodeForIndexing(): - # Import late to avoid circular import. - import speechCompat - return speechCompat.sayAll_readObjects(obj) global _activeSayAll reader = _ObjectsReader(obj) _activeSayAll = weakref.ref(reader) @@ -92,10 +80,6 @@ def readText(cursor): # managed entirely by _TextReader. trigger = SayAllProfileTrigger() trigger.enter() - if speech.shouldUseCompatCodeForIndexing(): - # Import late to avoid circular import. - import speechCompat - return speechCompat.sayAll_readText(cursor, trigger) reader = _TextReader(cursor, trigger) _activeSayAll = weakref.ref(reader) reader.nextLine() diff --git a/source/speech.py b/source/speech.py index a943255d226..9763ce103da 100755 --- a/source/speech.py +++ b/source/speech.py @@ -146,21 +146,7 @@ def spellTextInfo(info,useCharacterDescriptions=False,priority=None): elif isinstance(field,textInfos.FieldCommand) and field.command=="formatChange": curLanguage=field.field.get('language') -def shouldUseCompatCodeForIndexing(): - synth = getSynth() - if synthDriverHandler.synthIndexReached in synth.supportedNotifications: - return False - warnings.warn(DeprecationWarning( - "Synth %s does not support synthIndexReached notifications. " - "Using old speech code (which will be removed in future)." - % synth.name)) - return True - def speakSpelling(text, locale=None, useCharacterDescriptions=False,priority=None): - if shouldUseCompatCodeForIndexing(): - # Import late to avoid circular import. - import speechCompat - return speechCompat.speakSpelling(text, locale=locale, useCharacterDescriptions=useCharacterDescriptions) seq = list(getSpeechForSpelling(text, locale=locale, useCharacterDescriptions=useCharacterDescriptions)) speak(seq,priority=priority) @@ -571,8 +557,6 @@ def speak(speechSequence, symbolLevel=None, priority=None): speechSequence[index]=processText(curLanguage,item,symbolLevel) if not inCharacterMode: speechSequence[index]+=CHUNK_SEPARATOR - if shouldUseCompatCodeForIndexing(): - return getSynth().speak(speechSequence) _manager.speak(speechSequence, priority) def speakSelectionMessage(message,text,priority=None): @@ -1802,18 +1786,10 @@ def speakWithoutPauses(speechSequence,detectBreaks=True): if pendingSpeechSequence: pendingSpeechSequence.reverse() speakWithoutPauses._pendingSpeechSequence.extend(pendingSpeechSequence) - if shouldUseCompatCodeForIndexing(): - # Compat code to support speechCompat.sayAll_readText. - #Scan the final speech sequence backwards - for item in reversed(finalSpeechSequence): - if isinstance(item,IndexCommand): - speakWithoutPauses._lastSentIndex=item.index - break if finalSpeechSequence: speak(finalSpeechSequence) return True return False -speakWithoutPauses._lastSentIndex=None # For speechCompat.sayAll_readText speakWithoutPauses._pendingSpeechSequence=[] class SpeechCommand(object): @@ -2479,9 +2455,6 @@ def _handleDoneSpeaking(self): def _switchProfile(self): command = self._curPriQueue.pendingSequences.pop(0)[0] assert isinstance(command, ConfigProfileTriggerCommand), "First pending command should be a ConfigProfileTriggerCommand" - if not command.enter and command.trigger not in self._curPriQueue.enteredProfileTriggers: - # speechCompat: We already exited this profile due to synth incompatibility. - return if command.enter: try: command.trigger.enter() @@ -2495,15 +2468,6 @@ def _switchProfile(self): log.exception("Error exiting active trigger %r" % command.trigger.spec) self._curPriQueue.enteredProfileTriggers.remove(command.trigger) synthDriverHandler.handleConfigProfileSwitch() - if command.enter and shouldUseCompatCodeForIndexing(): - log.debugWarning("Synth in new profile doesn't support indexing. Exiting trigger.") - try: - command.trigger.exit() - except: - log.exception("Error exiting trigger %r" % command.trigger.spec) - assert self._curPriQueue.enteredProfileTriggers[-1] is command.trigger, "Last profile trigger should be the trigger just entered" - del self._curPriQueue.enteredProfileTriggers[-1] - synthDriverHandler.handleConfigProfileSwitch() def _exitProfileTriggers(self, triggers): for trigger in reversed(triggers): diff --git a/source/speechCompat.py b/source/speechCompat.py deleted file mode 100644 index 42dcf0b7db6..00000000000 --- a/source/speechCompat.py +++ /dev/null @@ -1,270 +0,0 @@ -# -*- coding: UTF-8 -*- -# A part of NonVisual Desktop Access (NVDA) -# Copyright (C) 2006-2017 NV Access Limited, Peter Vágner, Aleksey Sadovoy -# This file may be used under the terms of the GNU General Public License, version 2 or later. -# For more details see: https://www.gnu.org/licenses/gpl-2.0.html - -"""Speech code to support old synthesizers which don't support index and done speaking notifications, etc. -""" - -import itertools -import speech -from synthDriverHandler import getSynth -import tones -import queueHandler -import config -import characterProcessing -from logHandler import log -import textInfos -import api -import controlTypes -import sayAllHandler - -def getLastSpeechIndex(): - return getSynth().lastIndex - -_speakSpellingGenerator=None - -def speakSpelling(text,locale=None,useCharacterDescriptions=False): - global _speakSpellingGenerator - import speechViewer - if speechViewer.isActive: - speechViewer.appendText(text) - if speech.speechMode==speech.speechMode_off: - return - elif speech.speechMode==speech.speechMode_beeps: - tones.beep(config.conf["speech"]["beepSpeechModePitch"],speechMode_beeps_ms) - return - if speech.isPaused: - speech.cancelSpeech() - speech.beenCanceled=False - defaultLanguage=speech.getCurrentLanguage() - if not locale or (not config.conf['speech']['autoDialectSwitching'] and locale.split('_')[0]==defaultLanguage.split('_')[0]): - locale=defaultLanguage - - if not text: - # Translators: This is spoken when NVDA moves to an empty line. - return getSynth().speak((_("blank"),)) - if not text.isspace(): - text=text.rstrip() - if _speakSpellingGenerator and _speakSpellingGenerator.gi_frame: - _speakSpellingGenerator.send((text,locale,useCharacterDescriptions)) - else: - _speakSpellingGenerator=_speakSpellingGen(text,locale,useCharacterDescriptions) - try: - # Speak the first character before this function returns. - next(_speakSpellingGenerator) - except StopIteration: - return - queueHandler.registerGeneratorObject(_speakSpellingGenerator) - -def _speakSpellingGen(text,locale,useCharacterDescriptions): - synth=getSynth() - synthConfig=config.conf["speech"][synth.name] - buf=[(text,locale,useCharacterDescriptions)] - for text,locale,useCharacterDescriptions in buf: - textLength=len(text) - count = 0 - localeHasConjuncts = True if locale.split('_',1)[0] in speech.LANGS_WITH_CONJUNCT_CHARS else False - charDescList = speech.getCharDescListFromText(text,locale) if localeHasConjuncts else text - for item in charDescList: - if localeHasConjuncts: - # item is a tuple containing character and its description - char = item[0] - charDesc = item[1] - else: - # item is just a character. - char = item - if useCharacterDescriptions: - charDesc=characterProcessing.getCharacterDescription(locale,char.lower()) - uppercase=char.isupper() - if useCharacterDescriptions and charDesc: - #Consider changing to multiple synth speech calls - char=charDesc[0] if textLength>1 else u"\u3001".join(charDesc) - else: - char=characterProcessing.processSpeechSymbol(locale,char) - if uppercase and synthConfig["sayCapForCapitals"]: - # Translators: cap will be spoken before the given letter when it is capitalized. - char=_("cap %s")%char - if uppercase and synth.isSupported("pitch") and synthConfig["capPitchChange"]: - oldPitch=synthConfig["pitch"] - synth.pitch=max(0,min(oldPitch+synthConfig["capPitchChange"],100)) - count = len(char) - index=count+1 - log.io("Speaking character %r"%char) - speechSequence=[speech.LangChangeCommand(locale)] if config.conf['speech']['autoLanguageSwitching'] else [] - if len(char) == 1 and synthConfig["useSpellingFunctionality"]: - speechSequence.append(speech.CharacterModeCommand(True)) - if index is not None: - speechSequence.append(speech.IndexCommand(index)) - speechSequence.append(char) - synth.speak(speechSequence) - if uppercase and synth.isSupported("pitch") and synthConfig["capPitchChange"]: - synth.pitch=oldPitch - while textLength>1 and (speech.isPaused or getLastSpeechIndex()!=index): - for x in xrange(2): - args=yield - if args: buf.append(args) - if uppercase and synthConfig["beepForCapitals"]: - tones.beep(2000,50) - args=yield - if args: buf.append(args) - -_sayAll_generatorID = None - -def _sayAll_startGenerator(generator): - global _sayAll_generatorID - sayAll_stop() - _sayAll_generatorID = queueHandler.registerGeneratorObject(generator) - -def sayAll_stop(): - global _sayAll_generatorID - if _sayAll_generatorID is None: - return - queueHandler.cancelGeneratorObject(_sayAll_generatorID) - _sayAll_generatorID = None - -def sayAll_isRunning(): - return _sayAll_generatorID is not None - -def sayAll_readObjects(obj): - _sayAll_startGenerator(sayAll_readObjectsHelper_generator(obj)) - -def sayAll_generateObjectSubtreeSpeech(obj,indexGen): - index=indexGen.next() - indexCommand = speech.IndexCommand(index) - speech.speakObject(obj,reason=controlTypes.REASON_SAYALL,_prefixSpeechCommand=indexCommand) - yield obj,index - child=obj.simpleFirstChild - while child: - childSpeech=sayAll_generateObjectSubtreeSpeech(child,indexGen) - for r in childSpeech: - yield r - child=child.simpleNext - -def sayAll_readObjectsHelper_generator(obj): - lastSentIndex=0 - lastReceivedIndex=0 - speechGen=sayAll_generateObjectSubtreeSpeech(obj,itertools.count()) - objIndexMap={} - keepReading=True - while True: - # lastReceivedIndex might be None if other speech was interspersed with this say all. - # In this case, we want to send more text in case this was the last chunk spoken. - if lastReceivedIndex is None or (lastSentIndex-lastReceivedIndex)<=1: - if keepReading: - try: - o,lastSentIndex=speechGen.next() - except StopIteration: - keepReading=False - continue - objIndexMap[lastSentIndex]=o - receivedIndex=getLastSpeechIndex() - if receivedIndex!=lastReceivedIndex and (lastReceivedIndex!=0 or receivedIndex!=None): - lastReceivedIndex=receivedIndex - lastReceivedObj=objIndexMap.get(lastReceivedIndex) - if lastReceivedObj is not None: - api.setNavigatorObject(lastReceivedObj, isFocus=lastSayAllMode==sayAllHandler.CURSOR_CARET) - #Clear old objects from the map - for i in objIndexMap.keys(): - if i<=lastReceivedIndex: - del objIndexMap[i] - while speech.isPaused: - yield - yield - -def sayAll_readText(cursor, trigger): - _sayAll_startGenerator(sayAll_readTextHelper_generator(cursor, trigger)) - -def sayAll_readTextHelper_generator(cursor, trigger): - if cursor==sayAllHandler.CURSOR_CARET: - try: - reader=api.getCaretObject().makeTextInfo(textInfos.POSITION_CARET) - except (NotImplementedError, RuntimeError): - return - else: - reader=api.getReviewPosition() - - lastSentIndex=0 - lastReceivedIndex=0 - cursorIndexMap={} - keepReading=True - speakTextInfoState=speech.SpeakTextInfoState(reader.obj) - try: - while True: - if not reader.obj: - # The object died, so we should too. - return - # lastReceivedIndex might be None if other speech was interspersed with this say all. - # In this case, we want to send more text in case this was the last chunk spoken. - if lastReceivedIndex is None or (lastSentIndex-lastReceivedIndex)<=10: - if keepReading: - bookmark=reader.bookmark - index=lastSentIndex+1 - delta=reader.move(textInfos.UNIT_READINGCHUNK,1,endPoint="end") - if delta<=0: - speech.speakWithoutPauses(None) - keepReading=False - continue - indexCommand = speech.IndexCommand(index) - speech.speakTextInfo(reader,unit=textInfos.UNIT_READINGCHUNK,reason=controlTypes.REASON_SAYALL,_prefixSpeechCommand=indexCommand,useCache=speakTextInfoState) - lastSentIndex=index - cursorIndexMap[index]=(bookmark,speakTextInfoState.copy()) - try: - reader.collapse(end=True) - except RuntimeError: #MS Word when range covers end of document - # Word specific: without this exception to indicate that further collapsing is not posible, say-all could enter an infinite loop. - speech.speakWithoutPauses(None) - keepReading=False - else: - # We'll wait for speech to catch up a bit before sending more text. - if speech.speakWithoutPauses._lastSentIndex is None or (lastSentIndex-speech.speakWithoutPauses._lastSentIndex)>=10: - # There is a large chunk of pending speech - # Force speakWithoutPauses to send text to the synth so we can move on. - speech.speakWithoutPauses(None) - receivedIndex=getLastSpeechIndex() - if receivedIndex!=lastReceivedIndex and (lastReceivedIndex!=0 or receivedIndex!=None): - lastReceivedIndex=receivedIndex - bookmark,state=cursorIndexMap.get(receivedIndex,(None,None)) - if state: - state.updateObj() - if bookmark is not None: - updater=reader.obj.makeTextInfo(bookmark) - if cursor==sayAllHandler.CURSOR_CARET: - updater.updateCaret() - if cursor!=sayAllHandler.CURSOR_CARET or config.conf["reviewCursor"]["followCaret"]: - api.setReviewPosition(updater, isCaret=cursor==sayAllHandler.CURSOR_CARET) - elif not keepReading and lastReceivedIndex==lastSentIndex: - # All text has been sent to the synth. - # Turn the page and start again if the object supports it. - if isinstance(reader.obj,textInfos.DocumentWithPageTurns): - try: - reader.obj.turnPage() - except RuntimeError: - break - else: - reader=reader.obj.makeTextInfo(textInfos.POSITION_FIRST) - keepReading=True - else: - break - - while speech.isPaused: - yield - yield - - # Wait until the synth has actually finished speaking. - # Otherwise, if there is a triggered profile with a different synth, - # we will switch too early and truncate speech (even up to several lines). - # Send another index and wait for it. - index=lastSentIndex+1 - speech.speak([speech.IndexCommand(index)]) - while getLastSpeechIndex() Date: Mon, 29 Apr 2019 17:52:27 +1000 Subject: [PATCH 16/25] synthDriverHandler.handleConfigProfileSwitch was renamed to handlePostConfigProfileSwitch. Ensure that speech uses this name now. --- source/speech.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/speech.py b/source/speech.py index a943255d226..36a8c4b5b14 100755 --- a/source/speech.py +++ b/source/speech.py @@ -2494,7 +2494,7 @@ def _switchProfile(self): except: log.exception("Error exiting active trigger %r" % command.trigger.spec) self._curPriQueue.enteredProfileTriggers.remove(command.trigger) - synthDriverHandler.handleConfigProfileSwitch() + synthDriverHandler.handlePostConfigProfileSwitch() if command.enter and shouldUseCompatCodeForIndexing(): log.debugWarning("Synth in new profile doesn't support indexing. Exiting trigger.") try: @@ -2503,7 +2503,7 @@ def _switchProfile(self): log.exception("Error exiting trigger %r" % command.trigger.spec) assert self._curPriQueue.enteredProfileTriggers[-1] is command.trigger, "Last profile trigger should be the trigger just entered" del self._curPriQueue.enteredProfileTriggers[-1] - synthDriverHandler.handleConfigProfileSwitch() + synthDriverHandler.handlePostConfigProfileSwitch() def _exitProfileTriggers(self, triggers): for trigger in reversed(triggers): @@ -2511,7 +2511,7 @@ def _exitProfileTriggers(self, triggers): trigger.exit() except: log.exception("Error exiting profile trigger %r" % command.trigger.spec) - synthDriverHandler.handleConfigProfileSwitch() + synthDriverHandler.handlePostConfigProfileSwitch() def _restoreProfileTriggers(self, triggers): for trigger in triggers: @@ -2519,7 +2519,7 @@ def _restoreProfileTriggers(self, triggers): trigger.enter() except: log.exception("Error entering profile trigger %r" % command.trigger.spec) - synthDriverHandler.handleConfigProfileSwitch() + synthDriverHandler.handlePostConfigProfileSwitch() def cancel(self): getSynth().cancel() From 6b2660ab7a52411eec33275f8b0462b8ad03e28e Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Fri, 3 May 2019 10:38:39 +1000 Subject: [PATCH 17/25] synthDriverHandler.handlePostConfigProfileSwitch: reset speech queues if switching synths, so that the new synth has entirely new speech state. This behaviour can however be disabled by providing resetSpeechIfNeeded to false on this function. Speechmanager internally does this when dealing with configProfileSwitch commands in speech sequences. # Please enter the commit message for your changes. Lines starting --- source/speech.py | 8 ++++---- source/synthDriverHandler.py | 12 +++++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/source/speech.py b/source/speech.py index 36a8c4b5b14..b9932d11d10 100755 --- a/source/speech.py +++ b/source/speech.py @@ -2494,7 +2494,7 @@ def _switchProfile(self): except: log.exception("Error exiting active trigger %r" % command.trigger.spec) self._curPriQueue.enteredProfileTriggers.remove(command.trigger) - synthDriverHandler.handlePostConfigProfileSwitch() + synthDriverHandler.handlePostConfigProfileSwitch(resetSpeechIfNeeded=False) if command.enter and shouldUseCompatCodeForIndexing(): log.debugWarning("Synth in new profile doesn't support indexing. Exiting trigger.") try: @@ -2503,7 +2503,7 @@ def _switchProfile(self): log.exception("Error exiting trigger %r" % command.trigger.spec) assert self._curPriQueue.enteredProfileTriggers[-1] is command.trigger, "Last profile trigger should be the trigger just entered" del self._curPriQueue.enteredProfileTriggers[-1] - synthDriverHandler.handlePostConfigProfileSwitch() + synthDriverHandler.handlePostConfigProfileSwitch(resetSpeechIfNeeded=False) def _exitProfileTriggers(self, triggers): for trigger in reversed(triggers): @@ -2511,7 +2511,7 @@ def _exitProfileTriggers(self, triggers): trigger.exit() except: log.exception("Error exiting profile trigger %r" % command.trigger.spec) - synthDriverHandler.handlePostConfigProfileSwitch() + synthDriverHandler.handlePostConfigProfileSwitch(resetSpeechIfNeeded=False) def _restoreProfileTriggers(self, triggers): for trigger in triggers: @@ -2519,7 +2519,7 @@ def _restoreProfileTriggers(self, triggers): trigger.enter() except: log.exception("Error entering profile trigger %r" % command.trigger.spec) - synthDriverHandler.handlePostConfigProfileSwitch() + synthDriverHandler.handlePostConfigProfileSwitch(resetSpeechIfNeeded=False) def cancel(self): getSynth().cancel() diff --git a/source/synthDriverHandler.py b/source/synthDriverHandler.py index 73e22a212e5..08585dc101e 100644 --- a/source/synthDriverHandler.py +++ b/source/synthDriverHandler.py @@ -132,9 +132,19 @@ def setSynth(name,isFallback=False): setSynth(newName,isFallback=True) return False -def handlePostConfigProfileSwitch(): +def handlePostConfigProfileSwitch(resetSpeechIfNeeded=True): + """ + Switches synthesizers and or applies new voice settings to the synth due to a config profile switch. + @var resetSpeechIfNeeded: if true and a new synth will be loaded, speech queues are fully reset first. This is what happens by default. + However, Speech itself may call this with false internally if this is a config profile switch within a currently processing speech sequence. + @type resetSpeechIfNeeded: bool + """ conf = config.conf["speech"] if conf["synth"] != _curSynth.name or conf["outputDevice"] != _audioOutputDevice: + if resetSpeechIfNeeded: + # Reset the speech queues as we are now going to be using a new synthesizer with entirely separate state. + import speech + speech.cancelSpeech() setSynth(conf["synth"]) return _curSynth.loadSettings(onlyChanged=True) From db46a20fd9c8efbdd5d226b02cc7ea87b3640f57 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Fri, 3 May 2019 10:42:42 +1000 Subject: [PATCH 18/25] Remove the audioLogic synthesizer due to its extremely low usage. If someone does require this, it could be updated and provided as an add-on. --- source/synthDrivers/_audiologic.py | 132 ----------------------------- source/synthDrivers/audiologic.py | 87 ------------------- 2 files changed, 219 deletions(-) delete mode 100755 source/synthDrivers/_audiologic.py delete mode 100755 source/synthDrivers/audiologic.py diff --git a/source/synthDrivers/_audiologic.py b/source/synthDrivers/_audiologic.py deleted file mode 100755 index 19f5fbaa94f..00000000000 --- a/source/synthDrivers/_audiologic.py +++ /dev/null @@ -1,132 +0,0 @@ -#synthDrivers/_audiologic.py -#A part of NonVisual Desktop Access (NVDA) -#This file is covered by the GNU General Public License. -#See the file COPYING for more details. -#Copyright (C) 2008-2010 Gianluca Casalino - -from ctypes import * -import os - -NvdaDir=os.getcwdu() -TtsDir="c:\\TTS3\\" -Handle=c_int() -Tts=None -LastIndex=None - -#Tts parameters constants -minRate=50 -maxRate=200 -minPitch=-12 -maxPitch=+9 -minVol=-40 -maxVol=+12 - -#SynthStatus and SynthType Constants -ST_NONE=0 -SYNTH_IDLE=0 -SYNTH_RUNNING=1 -SYNTH_PAUSED=2 - -#callback constants -M_BOOKMARK=8 - -#others constants -ttsRate=0 -ttsPitch=1 -ttsVol=2 -ttsExpression=3 - -class TtsProsody(Structure): - _fields_=[ - ('Speed', c_int), - ('Pitch', c_int), - ('Vol', c_int), - ('Expression', c_int), - ('PhraseSpeed', c_int), - ('PhrasePitch', c_int), - ('PhraseGain', c_int), - ('StressSpeed', c_int), - ('StreesPitch', c_int), - ('StreesGain', c_int), - ('Declination', c_int), - ('PauseFactor', c_int), - ('DoubleFactor', c_int), - ('RandomFactor', c_int)] - -class Tts3Status(Structure): - _fields_=[ - ('SynthType', c_int), - ('SynthStatus', c_int), - ('CurrentTime', c_int), - ('SynthesisTime', c_int), - ('Samples', c_int), - ('CurrentCharIndex', c_int), - ('CurrentWordIndex', c_int), - ('CurrentChar', c_char), - ('CurrentWord', c_char_p)] - - -callbackType = WINFUNCTYPE(None, c_int, c_int, c_int, c_int) - -@callbackType -def TtsCallBackProc(handle, callmode, index, sample): - global LastIndex - LastIndex=index - -class TtsCallBack(Structure): - _fields_=[ - ('CallMode', c_int), - ('BookIndex', c_int), - ('CallbackProc', callbackType)] - - -call=TtsCallBack() - -def TtsOpen(): - global Handle, Tts, call - Tts=windll.LoadLibrary(TtsDir+"Tts3.dll") - Tts.Tts3Open(TtsDir, byref(Handle)) - os.chdir(NvdaDir) - call.CallMode=M_BOOKMARK - call.BookIndex=-1 - call.CallbackProc=TtsCallBackProc - Tts.Tts3SetCallback(Handle, byref(call)) - -def TtsGetStatus(): - global Tts, Handle - Status=Tts3Status() - Tts.Tts3GetStatus(Handle, byref(Status)) - -def TtsSpeak(text): - global Handle, Tts - Tts.Tts3GenSpeech(Handle, c_char_p(text), 0) - -def TtsStop(): - global Handle, Tts - Tts.Tts3Stop(Handle, 1) - -def TtsPause(): - global Handle, Tts - Tts.Tts3Pause(Handle) - -def TtsRestart(): - global Handle,Tts - Tts.Tts3Restart(Handle) - -def TtsSetParam(param, value, relative): - global Tts, Handle - Tts.Tts3SetProsodyValue(Handle, param, value, relative) - -def TtsGetProsody(param): - global Tts, Handle - Parameters=TtsProsody() - Tts.Tts3GetProsody(Handle, byref(Parameters)) - return getattr(Parameters, param) - -def TtsClose(): - global Tts, Handle - TtsStop() - Tts.Tts3Close(Handle) - Status=Tts3Status() - while Status.SynthType!=ST_NONE: TtsGetStatus() - Tts=None diff --git a/source/synthDrivers/audiologic.py b/source/synthDrivers/audiologic.py deleted file mode 100755 index 701a0733c40..00000000000 --- a/source/synthDrivers/audiologic.py +++ /dev/null @@ -1,87 +0,0 @@ -#synthDrivers/audiologic.py -#A part of NonVisual Desktop Access (NVDA) -#This file is covered by the GNU General Public License. -#See the file COPYING for more details. -#Copyright (C) 2008-2010 Gianluca Casalino , James Teh - -from collections import OrderedDict -from . import _audiologic -from synthDriverHandler import SynthDriver, VoiceInfo -try: - import _winreg as winreg # Python 2.7 import -except ImportError: - import winreg # Python 3 import - -class SynthDriver(SynthDriver): - supportedSettings=(SynthDriver.RateSetting(),SynthDriver.PitchSetting(minStep=5),SynthDriver.InflectionSetting(minStep=10),SynthDriver.VolumeSetting(minStep=2)) - - description="Audiologic Tts3" - name="audiologic" - - - @classmethod - def check(cls): - try: - r=winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE,"SOFTWARE\Audiologic\Sintesi Audiologic") - r.Close() - return True - except: - return False - - def __init__(self): - _audiologic.TtsOpen() - - def terminate(self): - _audiologic.TtsClose() - - def speakText(self,text,index=None): - if isinstance(index,int) and index>=0: - text="[:BMK=%d]%s"%(index,text) - _audiologic.TtsSpeak(text) - - def _get_lastIndex(self): - return _audiologic.LastIndex - - def cancel(self): - _audiologic.TtsStop() - - def _getAvailableVoices(self): - return OrderedDict(( - ("", VoiceInfo("", "Tts3", language="it")), - )) - - def _get_voice(self): - return "" - - def _set_voice(self, voice): - pass - - def _get_rate(self): - return self._paramToPercent(_audiologic.TtsGetProsody('Speed') ,_audiologic.minRate, _audiologic.maxRate) - - def _set_rate(self,value): - _audiologic.TtsSetParam(_audiologic.ttsRate, self._percentToParam(value, _audiologic.minRate, _audiologic.maxRate), 0) - - def _get_pitch(self): - return self._paramToPercent(_audiologic.TtsGetProsody('Pitch'),_audiologic.minPitch, _audiologic.maxPitch) - - def _set_pitch(self,value): - _audiologic.TtsSetParam(_audiologic.ttsPitch,self._percentToParam(value, _audiologic.minPitch, _audiologic.maxPitch), 0) - - def _get_volume(self): - return self._paramToPercent(_audiologic.TtsGetProsody('Vol'),_audiologic.minVol, _audiologic.maxVol) - - def _set_volume(self,value): - _audiologic.TtsSetParam(_audiologic.ttsVol,self._percentToParam(value, _audiologic.minVol, _audiologic.maxVol), 0) - - def _get_inflection(self): - return _audiologic.TtsGetProsody('Expression') *10 - - def _set_inflection(self,value): - _audiologic.TtsSetParam(_audiologic.ttsExpression,int(value/10), 0) - - def pause(self,switch): - if switch: - _audiologic.TtsPause() - else: - _audiologic.TtsRestart() From 66a1120d9d387027306647384f30f784f7212e74 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Tue, 7 May 2019 08:23:36 +1000 Subject: [PATCH 19/25] Speech: correct indentation, which allows profile switching in a speech eequence to work again. --- source/speech.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/speech.py b/source/speech.py index 0b47a74d634..cde3abd771c 100755 --- a/source/speech.py +++ b/source/speech.py @@ -2467,7 +2467,7 @@ def _switchProfile(self): except: log.exception("Error exiting active trigger %r" % command.trigger.spec) self._curPriQueue.enteredProfileTriggers.remove(command.trigger) - synthDriverHandler.handlePostConfigProfileSwitch(resetSpeechIfNeeded=False) + synthDriverHandler.handlePostConfigProfileSwitch(resetSpeechIfNeeded=False) def _exitProfileTriggers(self, triggers): for trigger in reversed(triggers): From 1f8d91719ba88941c6005746b348e3c0aa2e0f0f Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Tue, 7 May 2019 08:24:30 +1000 Subject: [PATCH 20/25] Sapi4 synthDriver: very basic conversion to speechRefactor supporting synthIndexReached and synthDoneSpeaking, though for some sapi4 synths, indexing could be slightly early. --- source/synthDrivers/sapi4.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/source/synthDrivers/sapi4.py b/source/synthDrivers/sapi4.py index 160eab5d689..8d029ec6990 100755 --- a/source/synthDrivers/sapi4.py +++ b/source/synthDrivers/sapi4.py @@ -12,7 +12,7 @@ import winreg # Python 3 import from comtypes import COMObject, COMError from ctypes import * -from synthDriverHandler import SynthDriver,VoiceInfo +from synthDriverHandler import SynthDriver,VoiceInfo, synthIndexReached, synthDoneSpeaking from logHandler import log import speech from ._sapi4 import * @@ -28,7 +28,10 @@ def __init__(self,synthDriver): super(SynthDriverBufSink,self).__init__() def ITTSBufNotifySink_BookMark(self, this, qTimeStamp, dwMarkNum): - self._synthDriver.lastIndex=dwMarkNum + synthIndexReached.notify(synth=self._synthDriver,index=dwMarkNum) + if self._synthDriver._finalIndex==dwMarkNum: + self._synthDriver._finalIndex=None + synthDoneSpeaking.notify(synth=self._synthDriver) def IUnknown_Release(self, this, *args, **kwargs): if not self._allowDelete and self._refcnt.value == 1: @@ -41,6 +44,7 @@ class SynthDriver(SynthDriver): name="sapi4" description="Microsoft Speech API version 4" supportedSettings=[SynthDriver.VoiceSetting()] + supportedNotifications={synthIndexReached,synthDoneSpeaking} @classmethod def check(cls): @@ -67,7 +71,7 @@ def _fetchEnginesList(self): return enginesList def __init__(self): - self.lastIndex=None + self._finalIndex=None self._bufSink=SynthDriverBufSink(self) self._bufSinkPtr=self._bufSink.QueryInterface(ITTSBufNotifySink) # HACK: Some buggy engines call Release() too many times on our buf sink. @@ -85,6 +89,7 @@ def terminate(self): def speak(self,speechSequence): textList=[] charMode=False + item=None for item in speechSequence: if isinstance(item,basestring): textList.append(item.replace('\\','\\\\')) @@ -97,6 +102,9 @@ def speak(self,speechSequence): log.debugWarning("Unsupported speech command: %s"%item) else: log.error("Unknown speech: %s"%item) + if isinstance(item,speech.IndexCommand): + # This is the index denoting the end of the speech sequence. + self._finalIndex=item.index if charMode: # Some synths stay in character mode if we don't explicitly disable it. textList.append("\\RmS=0\\") From 9bccb58c0549980bc89e2572b33e0d89577b3039 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Tue, 7 May 2019 09:00:41 +1000 Subject: [PATCH 21/25] Convert system test synthDriver to speechRefactor so that indexing and doneSpeaking notifications are fired. --- tests/system/libraries/speechSpy.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/system/libraries/speechSpy.py b/tests/system/libraries/speechSpy.py index 89b29e482f5..9e6a3edd1fc 100644 --- a/tests/system/libraries/speechSpy.py +++ b/tests/system/libraries/speechSpy.py @@ -5,6 +5,7 @@ import synthDriverHandler import extensionPoints +import speech # inform those who want to know that there is new speech post_speech = extensionPoints.Action() @@ -20,8 +21,13 @@ def check(cls): return True supportedSettings = [] + supportedNotifications={synthDriverHandler.synthIndexReached,synthDriverHandler.synthDoneSpeaking} def speak(self, speechSequence): + for item in speechSequence: + if isinstance(item,speech.IndexCommand): + synthDriverHandler.synthIndexReached.notify(synth=self,index=item.index) + synthDriverHandler.synthDoneSpeaking.notify(synth=self) post_speech.notify(speechSequence=speechSequence) def cancel(self): From 4e4ff4be9c272d3a8a4e8d5b649d1b4b858c36b7 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Tue, 7 May 2019 09:16:07 +1000 Subject: [PATCH 22/25] sayAllhandler: move trigger handling into _readText as recommended. --- source/sayAllHandler.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/source/sayAllHandler.py b/source/sayAllHandler.py index d9d2eada82b..19d9c62b535 100644 --- a/source/sayAllHandler.py +++ b/source/sayAllHandler.py @@ -74,13 +74,7 @@ def stop(self): def readText(cursor): global lastSayAllMode, _activeSayAll lastSayAllMode=cursor - # speechCompat: We have to enter the profile trigger here because it might change synths - # and we need to check whether we have to use compat code for the desired synth. - # Ideally, once the compat code is removed, the trigger would be - # managed entirely by _TextReader. - trigger = SayAllProfileTrigger() - trigger.enter() - reader = _TextReader(cursor, trigger) + reader = _TextReader(cursor) _activeSayAll = weakref.ref(reader) reader.nextLine() @@ -106,9 +100,10 @@ class _TextReader(object): """ MAX_BUFFERED_LINES = 10 - def __init__(self, cursor, trigger): + def __init__(self, cursor): self.cursor = cursor - self.trigger = trigger + self.trigger = SayAllProfileTrigger() + self.trigger.enter() # Start at the cursor. if cursor == CURSOR_CARET: try: From 6c7762afefaca4c3a83e3df4937084d4974508c1 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Wed, 8 May 2019 07:53:26 +1000 Subject: [PATCH 23/25] Remove some more speech compat stuff. --- source/speech.py | 5 ----- source/synthDriverHandler.py | 6 ------ source/synthDrivers/sapi4.py | 2 +- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/source/speech.py b/source/speech.py index cde3abd771c..aedf0f52320 100755 --- a/source/speech.py +++ b/source/speech.py @@ -82,11 +82,6 @@ def processText(locale,text,symbolLevel): text = RE_CONVERT_WHITESPACE.sub(u" ", text) return text.strip() -def getLastSpeechIndex(): - """@deprecated: Use L{CallbackCommand} (or one of the other subclasses of L{BaseCallbackCommand}) instead. - """ - return None - def cancelSpeech(): """Interupts the synthesizer from currently speaking""" global beenCanceled, isPaused diff --git a/source/synthDriverHandler.py b/source/synthDriverHandler.py index 08585dc101e..e7ad982e8f4 100644 --- a/source/synthDriverHandler.py +++ b/source/synthDriverHandler.py @@ -387,12 +387,6 @@ def speakCharacter(self, character, index=None): """ self.speakText(character,index) - def _get_lastIndex(self): - """@deprecated: Callers should use subclasses of L{speech.BaseCallbackCommand} to perform actions at various points in speech. - Drivers should notify about indexes using L{synthIndexReached} instead. - """ - return None - def cancel(self): """Silence speech immediately. """ diff --git a/source/synthDrivers/sapi4.py b/source/synthDrivers/sapi4.py index 8d029ec6990..20c1e395306 100755 --- a/source/synthDrivers/sapi4.py +++ b/source/synthDrivers/sapi4.py @@ -1,6 +1,6 @@ #synthDrivers/sapi4.py #A part of NonVisual Desktop Access (NVDA) -#Copyright (C) 2006-2009 NVDA Contributors +#Copyright (C) 2006-2019 NV Access Limited #This file is covered by the GNU General Public License. #See the file COPYING for more details. From 8f8bd9bb2dfc6c2220ab897fb381fc648fcadf85 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Thu, 9 May 2019 07:32:52 +1000 Subject: [PATCH 24/25] Speech: BaseCallbackCommand's run method is now abstract. Note that CallbackCommand now has been changed slightly so it implements its own run method which executes the callback passed to the command rather than run being overridden directly. BeepCommand also now calls playWaveFile with async set to True, not False so that it does not block. finally, BaseCallbackCommand's run method docstring notes that the main thread is blocked. --- source/speech.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/source/speech.py b/source/speech.py index aedf0f52320..c19d3997839 100755 --- a/source/speech.py +++ b/source/speech.py @@ -8,6 +8,8 @@ """High-level functions to speak information. """ +from abc import ABCMeta, abstractmethod +from six import with_metaclass import itertools import weakref import unicodedata @@ -2004,7 +2006,7 @@ def __repr__(self): out += ", text=%r" % self.text return out + ")" -class BaseCallbackCommand(SpeechCommand): +class BaseCallbackCommand(with_metaclass(ABCMeta, SpeechCommand)): """Base class for commands which cause a function to be called when speech reaches them. This class should not be instantiated directly. It is designed to be subclassed to provide specific functionality; @@ -2013,8 +2015,10 @@ class BaseCallbackCommand(SpeechCommand): This command is never passed to synth drivers. """ + @abstractmethod def run(self): """Code to run when speech reaches this command. + Note that this method is executed in NVDA's main thread, therefore must return as soon as practically possible, otherwise it will block production of further speech and or other functionality in NVDA. """ class CallbackCommand(BaseCallbackCommand): @@ -2022,7 +2026,10 @@ class CallbackCommand(BaseCallbackCommand): """ def __init__(self, callback): - self.run = callback + self._callback = callback + + def run(self,*args, **kwargs): + return self._callback(*args,**kwargs) class BeepCommand(BaseCallbackCommand): """Produce a beep. @@ -2051,7 +2058,7 @@ def __init__(self, fileName): def run(self): import nvwave - nvwave.playWaveFile(self.fileName, async=False) + nvwave.playWaveFile(self.fileName, async=True) def __repr__(self): return "WaveFileCommand(%r)" % self.fileName From 52ab8cbb42b1707c0c92633f263a71c423c3ebe9 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Fri, 10 May 2019 08:48:04 +1000 Subject: [PATCH 25/25] Speech: fix up some docstrings. --- source/speech.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/speech.py b/source/speech.py index c19d3997839..acefa75cd1b 100755 --- a/source/speech.py +++ b/source/speech.py @@ -2018,11 +2018,17 @@ class BaseCallbackCommand(with_metaclass(ABCMeta, SpeechCommand)): @abstractmethod def run(self): """Code to run when speech reaches this command. - Note that this method is executed in NVDA's main thread, therefore must return as soon as practically possible, otherwise it will block production of further speech and or other functionality in NVDA. + This method is executed in NVDA's main thread, + therefore must return as soon as practically possible, + otherwise it will block production of further speech and or other functionality in NVDA. """ class CallbackCommand(BaseCallbackCommand): - """Call a function when speech reaches this point. + """ + Call a function when speech reaches this point. + Note that the provided function is executed in NVDA's main thread, + therefore must return as soon as practically possible, + otherwise it will block production of further speech and or other functionality in NVDA. """ def __init__(self, callback):