Use enum for speech reason #10703
@leonardder and @codeofdusk I have updated the description, this PR should not cause backwards incompatibility as long as addons are using the constants defined in
This will target 2020.1. Generally we attempt to minimize the risk of incompatibility. This PR maintains the old constant names, which will be removed at "some point" in the future. In case something is overlooked which may affect addons, addon authors should be regularly testing, staying up to date with changes happening in NVDA, and letting us know of any issues being created for them. Communication is key.
This changes the type of all REASON_* constants. One outcome of this is that they no longer have equality with their old string values e.g. REASON_FOCUS == "focus" >> False This would also be the case if the enum used string values instead of int values. All occurrences of the previous string values were inspected, and with a reasonable degree of certainty, there seemed not to be used as REASON_* values.