Module AEInterfaces
[hide private]
[frames] | no frames]

Source Code for Module AEInterfaces

   1  ''' 
   2  Defines standard interfaces for inspecting, manipulating, and navigating  
   3  accessibles and handling their events. 
   4   
   5  @author: Peter Parente 
   6  @author: Pete Brunet 
   7  @author: Larry Weiss 
   8  @author: Brett Clippingdale 
   9  @author: Eirikur Hallgrimsson 
  10  @author: Scott Haeger 
  11  @organization: IBM Corporation 
  12  @copyright: Copyright (c) 2005, 2007 IBM Corporation 
  13  @license: The BSD License 
  14   
  15  All rights reserved. This program and the accompanying materials are made 
  16  available under the terms of the BSD license which accompanies 
  17  this distribution, and is available at 
  18  U{http://www.opensource.org/licenses/bsd-license.php} 
  19  ''' 
  20   
  21  from AccAdapt import Interface 
  22   
23 -def implements(thing, interface):
24 ''' 25 Checks if the given thing implements the given interface. The thing may be 26 an instance or class. The thing is checked using issubclass first, followed 27 by isinstance next, and then by brute force method comparison last. 28 29 @param thing: Class or object to be tested for an interface 30 @type thing: class or object 31 @param interface: Class representing an interface to be implemented 32 @type interface: class 33 @return: Does the thing implement the given interface? 34 @rtype: boolean 35 ''' 36 try: 37 if issubclass(thing, interface): return True 38 except: 39 pass 40 try: 41 if isinstance(thing, interface): return True 42 except: 43 pass 44 return False
45
46 -class IAccessibleNav(Interface):
47 ''' 48 Provides methods for navigating across accessible objects. 49 '''
50 - def getNextAcc():
51 ''' 52 Gets the next accessible relative to the one providing this interface. 53 54 @return: Point of regard to the next accessible 55 @rtype: L{POR} 56 @raise IndexError: When there is no next accessible 57 @raise LookupError: When lookup for the next accessible fails even though 58 it may exist 59 ''' 60 pass
61
62 - def getPrevAcc():
63 ''' 64 Gets the previous accessible relative to the one providing this interface. 65 66 @return: Point of regard to the previous accessible 67 @rtype: L{POR} 68 @raise IndexError: When there is no previous accessible 69 @raise LookupError: When lookup for the previous accessible fails even 70 though it may exist 71 ''' 72 pass
73
74 - def getParentAcc():
75 ''' 76 Gets the parent accessible relative to the one providing this interface. 77 78 @return: Point of regard to the parent accessible 79 @rtype: L{POR} 80 @raise LookupError: When lookup for the parent accessible fails because it 81 does not exist 82 ''' 83 pass
84
85 - def getFirstAccChild():
86 ''' 87 Gets the first accessible child relative to the subject accessible. 88 89 @return: Point of regard to the first child accessible 90 @rtype: L{POR} 91 @raise LookupError: When lookup for child fails because it does not exist 92 ''' 93 pass
94
95 - def getLastAccChild():
96 ''' 97 Gets the last accessible child relative to the subject accessible. 98 99 @return: Point of regard to the last child accessible 100 @rtype: L{POR} 101 @raise LookupError: When lookup for child fails because it does not exist 102 ''' 103 pass
104
105 - def getChildAcc(index):
106 ''' 107 Gets the child accessible at the given index relative to the one providing 108 this interface. 109 110 @param index: Index of the child to retrieve 111 @type index: integer 112 @return: Point of regard to the child accessible 113 @rtype: L{POR} 114 @raise IndexError: When there is no child at the given index 115 @raise LookupError: When the lookup for the child fails even though it may 116 exist 117 ''' 118 pass
119
120 - def findAncestorAcc(predicate):
121 ''' 122 Searches all ancestors for one matching the given predicate. 123 124 @param predicate: Search predicate 125 @type predicate: callable 126 @return: Point of regard to the target or None if not found 127 @rtype: L{POR} 128 @raise LookupError: When the lookup fails during the search 129 ''' 130 pass
131
132 - def findDescendantAcc(predicate, depth_first):
133 ''' 134 Searches all descendants for one matching the given predicate. 135 136 @param predicate: Search predicate 137 @type predicate: callable 138 @param depth_first: Perform the search in depth-first (True) or breadth 139 first (False) order? 140 @type depth_first: boolean 141 @return: Point of regard to the target or None if not found 142 @rtype: L{POR} 143 @raise LookupError: When the lookup fails during the search 144 ''' 145 pass
146
147 -class IItemNav(Interface):
148 ''' 149 Provides methods for navigating items within accessible objects. The 150 definition of an item is left up to the object implementing this interface. 151 '''
152 - def getNextItem(only_visible=True):
153 ''' 154 Gets the next Item relative to the one indicated by the L{POR} 155 providing this interface. 156 157 @param only_visible: True when Item in the returned L{POR} must be visible 158 @type only_visible: boolean 159 @return: Point of regard to the next visible item in the same accessible 160 @rtype: L{POR} 161 @raise IndexError: When there is no next visible item 162 @raise LookupError: When lookup for the next item fails even though it may 163 exist 164 ''' 165 pass
166
167 - def getPrevItem(only_visible=True):
168 ''' 169 Gets the previous Item relative to the one indicated by the L{POR} providing 170 this interface. 171 172 @param only_visible: True when Item in the returned L{POR} must be visible 173 @type only_visible: boolean 174 @return: Point of regard to the previous visible item in the same accessible 175 @rtype: L{POR} 176 @raise IndexError: When there is no previous visible item 177 @raise LookupError: When lookup for the previous item fails even though it 178 may exist 179 ''' 180 pass
181
182 - def getFirstItem(only_visible=True):
183 ''' 184 Gets the first Item relative to the one indicated by the L{POR} 185 providing this interface. 186 187 @param only_visible: True when Item in the returned L{POR} must be visible 188 @type only_visible: boolean 189 @return: Point of regard to the first visible item in the same accessible 190 @rtype: L{POR} 191 @raise IndexError: When there is no last visible item 192 @raise LookupError: When lookup for the last item fails even though it may 193 exist 194 ''' 195 pass
196
197 - def getLastItem(only_visible=True):
198 ''' 199 Gets the last Item relative to the one indicated by the L{POR} 200 providing this interface. 201 202 @param only_visible: True when Item in the returned L{POR} must be visible 203 @type only_visible: boolean 204 @return: Point of regard to the last visible item in the same accessible 205 @rtype: L{POR} 206 @raise LookupError: When lookup for the last item fails because it does not 207 exist 208 ''' 209 pass
210
211 - def getAccAsItem(por):
212 ''' 213 Gets a L{POR} to the child as an item of the subject rather than as a child 214 of the subject. 215 216 @param por: Point of regard to a child of the subject 217 @type por: L{POR} 218 @return: Point of regard to an item of the subject 219 @rtype: L{POR} 220 @raise LookupError: When lookup for the offset fails 221 ''' 222 pass
223
224 -class IAccessibleInfo(Interface):
225 ''' 226 Provides methods for accessing basic information about accessible objects. 227 '''
228 - def getAccSelection():
229 ''' 230 Gets a list of L{POR}s referring to the selected objects in the subject 231 accessible. 232 233 @return: Points of regard to selected accessibles 234 @rtype: list of L{POR}s 235 @raise LookupError: When the subject accessible is dead 236 ''' 237 pass
238
239 - def getAccChildCount():
240 ''' 241 Gets the number of child accessibles for the object implementing this 242 interface. 243 244 @return: Number of accessible children 245 @rtype: integer 246 @raise LookupError: When the accessible object is dead 247 ''' 248 pass
249
250 - def getAccAppName():
251 ''' 252 Gets the name of the application application to which the subject accessible 253 belongs. 254 255 @return: Name of the subject's application 256 @rtype: string 257 @raise LookupError: When the accessible or any parent accessible up to the 258 application is dead 259 ''' 260 pass
261
262 - def getAccAppID():
263 ''' 264 Gets a unique ID identifying the application to which the subject accessible 265 belongs. 266 267 @return: Unique identifier for the subject's application 268 @rtype: hashable 269 @raise LookupError: When the accessible or any parent accessible up to the 270 application is dead 271 ''' 272 pass
273
274 - def getAccRoleName():
275 ''' 276 Gets the localized unicode accessible role name for the object implementing 277 this interface. 278 279 @return: Unicode role name 280 @rtype: string 281 @raise LookupError: When the accessible object is dead 282 ''' 283 pass
284
285 - def getAccName():
286 ''' 287 Gets the accessible name for the object implementing this interface. 288 289 @return: Name of the accessible 290 @rtype: string 291 @raise LookupError: When the accessible object is dead 292 @raise IndexError: When the item offset is outside the bounds of the 293 number of children of the subject accessible 294 ''' 295 pass
296
297 - def getAccDescription():
298 ''' 299 Gets the accessible description for the object implementing this interface. 300 301 @return: Accessible description of requested object 302 @rtype: string 303 @raise LookupError: When the subject accessible is dead 304 @raise IndexError: When the item offset is outside the bounds of the 305 number of children of the subject accessible 306 ''' 307 pass
308
309 - def getAccStates():
310 ''' 311 Gets a list of states for the object implementing this interface. 312 313 @return: Names of all states 314 @rtype: list of string 315 @raise LookupError: When the subject accessible is dead 316 @raise IndexError: When the item offset is outside the bounds of the 317 number of children of the subject accessible 318 ''' 319 pass
320
321 - def getAccItemText():
322 ''' 323 Gets the accessible text for the object implementing this interface. 324 The item text will be the accessible text if that is available, otherwise 325 it will be the accessible name. 326 327 @return: The accessible text or name 328 @rtype: string 329 @raise LookupError: When the subject accessible is dead 330 @raise IndexError: When the item offset is invalid 331 ''' 332 pass
333
334 - def getAccRelations(kind):
335 ''' 336 Gets a list of accessibles related to the subject accessible in the manner 337 given by kind. 338 339 @param kind: Name specifying the kind of relations to retrieve 340 @type kind: string 341 @return: List of L{POR}s related to subject accessible in the manner 342 given by kind 343 @rtype: list of L{POR} 344 @raise LookupError: When the accessible object is dead 345 ''' 346 pass
347
348 - def getAccTextAttr(name):
349 ''' 350 Gets the value of a given attribute name. 351 352 @param name: Name of the attribute 353 @type name: string 354 @return: Value of the accessible attribute 355 @rtype: string 356 @raise LookupError: When the accessible object is dead 357 ''' 358 pass
359
360 - def getAccAllTextAttrs():
361 ''' 362 Gets all of the name:value attribute pairs of an accessible. 363 364 @return: Name:value pairs in the accessible attributes 365 @rtype: dictionary 366 @raise LookupError: When the accessible object is dead 367 ''' 368 pass
369
370 - def getAccLevel():
371 ''' 372 Gets the logical depth of an accessible within a tree or hierarchy. 373 374 @return: Level of an accessible with zero being the root 375 @rtype: integer 376 @raise LookupError: When the accessible object is dead 377 ''' 378 pass
379
380 - def getAccIndex():
381 ''' 382 Gets the index an accessible within some 1D ordered collection. 383 384 @return: Index of an accessible with zero being the first 385 @rtype: integer 386 @raise LookupError: When the accessible object is dead 387 ''' 388 pass
389
390 - def getAccRow():
391 ''' 392 Gets the row index of an accessible within some 2D ordered collection. 393 394 @return: Row of an accessible with zero being the first 395 @rtype: integer 396 @raise LookupError: When the accessible object is dead 397 ''' 398 pass
399
400 - def getAccColumn():
401 ''' 402 Gets the column index of an accessible within some 2D ordered collection. 403 404 @return: Column of an accessible with zero being the first 405 @rtype: integer 406 @raise LookupError: When the accessible object is dead 407 ''' 408 pass
409
410 - def getAccRowColIndex(row, col):
411 ''' 412 Gets the 1D index of the cell at the given 2D row and column. 413 414 @param row: Row index 415 @type row: integer 416 @param col: Column index 417 @type col: integer 418 @return: 1D index into the table 419 @rtype: integer 420 @raise IndexError: When the row/column offsets are invalid 421 @raise LookupError: When the accessible object is dead 422 ''' 423 pass
424
425 - def getAccColumnHeader():
426 ''' 427 Gets the description of the column in which the accessible at the L{POR} 428 falls, typically the column header. 429 430 @return: Description of the column 431 @rtype: string 432 @raise LookupError: When the accessible object is dead 433 ''' 434 pass
435
436 - def getAccRowHeader():
437 ''' 438 Gets the description of the row in which the accessible at the L{POR} 439 falls, typically the row header. 440 441 @return: Description of the row 442 @rtype: string 443 @raise LookupError: When the accessible object is dead 444 ''' 445 pass
446
447 - def getAccAttrs():
448 ''' 449 Gets a list of name:value attribute pairs for the subject. 450 451 @return: Name:value pairs of the accessible object attributes 452 @rtype: dictionary 453 @raise LookupError: When the accessible object is dead 454 ''' 455 pass
456
458 ''' 459 Gets the minimum, maximum, and step for the floating point value exposed 460 by the subject. 461 462 @return: Minimum, maximum, and step values 463 @rtype: 3-tuple of float 464 @raise LookupError: When the accessible object is dead 465 ''' 466 pass
467
468 - def getAccVisualExtents():
469 ''' 470 Gets the visual width and height of the subject. 471 472 @return: Width and height extents 473 @rtype: 2-tuple of integer 474 @raise LookupError: When the accessible object is dead 475 ''' 476 pass
477
478 - def getAccVisualPoint():
479 ''' 480 Gets the focal point within the subject, where the focal point is defined 481 as the center of the most interesting point of regard. For a simple 482 control, the focal point is the center of the control. For a control with 483 items, the focal point is the center of an item. 484 485 @return: x,y coordinates 486 @rtype: 2-tuple of integer 487 @raise LookupError: When the accessible object is dead 488 ''' 489 pass
490
491 - def getAccPosition(self):
492 ''' 493 Gets the position of the accessible object, usually upper-left corner. 494 495 @return: x,y coordinate 496 @rtype: 2-tuple integer 497 @raise NotImplementedError: When this accessible does not support the 498 Component interface 499 ''' 500 pass
501
502 - def getAccFloatValue():
503 ''' 504 Gets the current floating point value of the subject 505 506 @return: Current value 507 @rtype: float 508 @raise LookupError: When the accessible object is dead 509 ''' 510 pass
511
512 - def getAccDefTextAttrs():
513 ''' 514 Gets all of the default text attributes assigned to the subject. 515 516 @return: Name:value pairs of the default text attributes 517 @rtype: dictionary 518 @raise LookupError: When the accessible object is dead 519 ''' 520 pass
521
522 - def getAccTextSelection(n=None):
523 ''' 524 Gets a list of all text selections in the subject if n is None, or the nth 525 selection if it is specified. 526 527 @param n: Index of selection to be returned, or None to indicate all 528 @type n: integer 529 @return: List of selected text runs 530 @rtype: list of string 531 @raise LookupError: When the accessible object is dead 532 ''' 533 pass
534
535 - def getAccText(self, por):
536 ''' 537 Gets the text starting at the subject and ending at the given L{POR}. 538 539 @param por: Point of regard to the end terminus of the get operation 540 @type por: L{POR} 541 @raise LookupError: When the accessible object is dead 542 ''' 543 pass
544
545 - def getAccTableExtents():
546 ''' 547 Returns the number of rows and columns in a table. 548 549 @return: Row and column count 550 @rtype: 2-tuple of integer 551 ''' 552 pass
553
554 - def getAccAppLocale():
555 ''' 556 Gets the POSIX locale of an application as a string. 557 558 @return: POSIX locale of the application 559 @rtype: string 560 ''' 561 pass
562
563 - def isAccEmbedded():
564 ''' 565 Gets whether or not the accessible considers itself embedded in an 566 ancestor's content. 567 568 @return: Does the accessible consider itself embedded? 569 @rtype: boolean 570 @raise LookupError: When the accessible object is dead 571 ''' 572 pass
573
574 - def getAccURI():
575 ''' 576 Obtain a resource locator ('URI') string which can be used to access the 577 content to which this link "points" or is connected. 578 579 @return: URI string 580 @rtype: string 581 @raise LookupError: When the accessible object is dead 582 ''' 583 pass
584
585 - def getAccAnchorCount():
586 ''' 587 Obtain he number of separate anchors associated with this accessible. 588 589 @return: Number of anchors 590 @rtype: integer 591 @raise PORError: When the L{POR} is invalid 592 ''' 593 pass
594
595 - def isAccTrivial():
596 ''' 597 Gets whether or not the accessible considers itself to be trivial. 598 599 @return: Does the accessible consider itself trivial? 600 @rtype: boolean 601 @raise LookupError: When the accessible object is dead 602 ''' 603 pass
604
605 - def isAccVisible():
606 ''' 607 Gets whether or not the accessible considers itself visible. 608 609 @return: Does the accessible consider itself visible? 610 @rtype: boolean 611 @raise LookupError: When the accessible object is dead 612 ''' 613 pass
614
615 - def getAccRole():
616 ''' 617 Gets the unlocalized string role identifier for the object implementing 618 this interface. 619 620 @return: Role name 621 @rtype: string 622 @raise LookupError: When the accessible object is dead 623 ''' 624 pass
625
626 - def hasAccRole(role):
627 ''' 628 Gets if the subject has the given role. 629 630 @param role: Name of the role 631 @type role: string 632 @return: Does the accessible have the given role? 633 @rtype: boolean 634 @raise LookupError: When the accessible object is dead 635 ''' 636 pass
637
638 - def hasOneAccRole(*roles):
639 ''' 640 Gets if the subject has any one of the given roles. 641 642 @param roles: Names of the roles 643 @type roles: list of string 644 @return: Does the accessible have any one of the given roles? 645 @rtype: boolean 646 ''' 647 pass
648
649 - def hasAccState(state):
650 ''' 651 Gets if the subject has the given state. 652 653 @param state: Name of the state 654 @type state: string 655 @return: Does the accessible have the given state? 656 @rtype: boolean 657 @raise LookupError: When the accessible object is dead 658 ''' 659 pass
660
661 - def hasAccOneState(*states):
662 ''' 663 Gets if the subject has at least one of the given states. 664 665 @param states: State names 666 @type states: string 667 @return: Does the accessible have at least one of the given states? 668 @rtype: boolean 669 @raise LookupError: When the accessible object is dead 670 ''' 671 pass
672
673 - def hasAccAllStates(*states):
674 ''' 675 Gets if the subject has all of the given states. 676 677 @param states: State names 678 @type states: string 679 @return: Does the accessible have all of the given states? 680 @rtype: boolean 681 @raise LookupError: When the accessible object is dead 682 ''' 683 pass
684
685 - def allowsAccEmbeds():
686 ''' 687 Gets whether or not the subject accessible allows embedded objects in its 688 text. 689 690 @return: Does the subject allow embedded objects? 691 @rtype: boolean 692 @raise LookupError: When the accessible object is dead 693 ''' 694 pass
695
696 - def isAccTopLevelWindow():
697 ''' 698 Gets whether or not the subject accessible is a top-level container in the 699 accessible hierarchy. 700 701 @return: Is the subject a top-level container or not? 702 @rtype: boolean 703 @raise LookupError: When the accessible object is dead 704 ''' 705 pass
706
707 - def getAccActionNames():
708 ''' 709 Gets the list of all action names defined by the subject. 710 711 @return: List of all action names 712 @rtype: list of string 713 @raise LookupError: When the accessible object is dead 714 ''' 715 pass
716
717 - def getAccActionDescs():
718 ''' 719 Gets the list of all action descriptions defined by the subject. 720 721 @return: List of all action descriptions 722 @rtype: list of string 723 @raise LookupError: When the accessible object is dead 724 ''' 725 pass
726
727 - def getAccActionCount():
728 ''' 729 Gets the number of available actions on the subject. 730 731 @return: Number of actions available 732 @rtype: integer 733 @raise LookupError: When the accessible object is dead 734 ''' 735 pass
736
737 - def getAccActionKeys():
738 ''' 739 Gets the key bindings associated with all available actions. 740 741 @return: List of tuples, each containing one or more string keysym names 742 indicating the keys to press in sequence to perform the action 743 @rtype: list of tuple of string 744 @raise LookupError: When the accessible object is dead 745 ''' 746 pass
747
748 - def getAccTextSelectionCount(self):
749 ''' 750 Gets the number of discontiguous selected text ranges. 751 752 @return: Number of selections 753 @rtype: integer 754 @raise LookupError: When the accessible object is dead 755 ''' 756 pass
757
758 - def getAccCaret(self):
759 ''' 760 Gets the current offset of the caret in this text object as a L{POR}. 761 762 @return: Point of regard of the text caret in this object 763 @rtype: L{POR} 764 @raise LookupError: When the accessible object is dead 765 ''' 766 pass
767
768 - def getAccTextCharCount(self):
769 ''' 770 Gets the number of characters in a text body. 771 772 @return: Total number of characters 773 @rtype: integer 774 @raise LookupError: When the accessible object is dead 775 ''' 776 pass
777
778 -class IAccessibleAction(Interface):
779 ''' 780 Provides methods for manipulating accessible objects. 781 '''
782 - def setAccFocus():
783 ''' 784 Gives the subject accessible the input focus. 785 786 @return: Did accessible accept (True) or refuse (False) the focus change? 787 @rtype: boolean 788 @raise LookupError: When the accessible object is dead or does not support 789 setting the focus 790 ''' 791 pass
792
793 - def selectAcc(all=False):
794 ''' 795 Selects the subject accessible or one of its children or items if all is 796 False. Selects all children or items if all is True. 797 798 @param all: Select all items? 799 @type all: boolean 800 @return: Did accessible accept (True) or refuse (False) the selection? 801 @rtype: boolean 802 @raise LookupError: When the accessible object is dead 803 ''' 804 pass
805
806 - def deselectAcc(all=False):
807 ''' 808 Deselects the subject accessible if all is False. Deselects all children if 809 all is True. 810 811 @param all: Deselect all children? 812 @type all: boolean 813 @return: Did accessible accept (True) or refuse (False) the deselection? 814 @rtype: boolean 815 @raise LookupError: When the accessible object is dead 816 ''' 817 pass
818
819 - def doAccAction(index):
820 ''' 821 Executes the action given by the index in the list of all actions. 822 823 @param index: Index of the action to execute 824 @type index: integer 825 @return: Did the action execute (True) or not (False)? 826 @rtype: boolean 827 @raise LookupError: When the accessible object is dead 828 ''' 829 pass
830
831 - def setAccCaret():
832 ''' 833 Moves the caret to the location given by the subject. 834 835 @return: Indicator of whether the caret was moved successfully 836 @rtype: boolean 837 @raise LookupError: When the accessible object is dead 838 ''' 839 pass
840
841 - def setAccText(text):
842 ''' 843 Replace contents of text area with the given text. 844 845 @param text: Text to set as the content of the text area 846 @type text: string 847 @return: Indicator of whether the text was set successfully or not 848 @rtype: boolean 849 @raise LookupError: When the accessible object is dead 850 ''' 851 pass
852
853 - def insertAccText(text, attrs):
854 ''' 855 Inserts text at the location given by the subject. 856 857 @param text: Text to insert at the given position 858 @type text: string 859 @param attrs: Dictionary of string name/value pairs of text attributes to 860 set on the inserted text 861 @type attrs: dictionary 862 @return: Indicator of whether the text was inserted successfully or not 863 @rtype: boolean 864 @raise LookupError: When the accessible object is dead 865 ''' 866 pass
867
868 - def setAccTextAttrs(por, attrs):
869 ''' 870 Sets the accessible text attributes from the subject to the given L{POR}. 871 872 @param por: Point of regard to the end of the text run 873 @type por: L{POR} 874 @param attrs: Dictionary of string name/value pairs of text attributes to 875 set on the text range 876 @type attrs: dictionary 877 @return: Indicator of whether the text attributes were set successfully or 878 not 879 @rtype: boolean 880 @raise LookupError: When the accessible object is dead 881 ''' 882 pass
883
884 - def copyAccText(por):
885 ''' 886 Copy the text starting at the subject and ending at the given L{POR}. 887 888 @param por: Point of regard to the end terminus of the copy operation 889 @type por: L{POR} 890 @return: Indicator of whether the text was copied successfully or not 891 @rtype: boolean 892 @raise LookupError: When the accessible object is dead 893 ''' 894 pass
895
896 - def cutAccText(por):
897 ''' 898 Cut the text starting at the subject and ending at the given L{POR}. 899 900 @param por: Point of regard to the end terminus of the copy operation 901 @type por: L{POR} 902 @return: Indicator of whether the text was copied successfully or not 903 @rtype: boolean 904 @raise LookupError: When the accessible object is dead 905 ''' 906 pass
907
908 - def deleteAccText(por):
909 '''' 910 Delete the text starting at the subject and ending at the given L{POR}. 911 912 @param por: Point of regard to the end terminus of the copy operation 913 @type por: L{POR} 914 @return: Indicator of whether the text was copied successfully or not 915 @rtype: boolean 916 @raise LookupError: When the accessible object is dead 917 ''' 918 pass
919
920 - def pasteAccText():
921 ''' 922 Paste the text starting at the subject. 923 924 @return: Indicator of whether the text was copied successfully or not 925 @rtype: boolean 926 @raise LookupError: When the accessible object is dead 927 ''' 928 pass
929
930 - def selectAccText(por, n=None):
931 ''' 932 Adds a new selection if n is None or sets the nth selection otherwise 933 starting at the subject and ending at the given L{POR}. 934 935 @param por: Point of regard to the end terminus of the select operation 936 @type por: L{POR} 937 @return: Indicator of whether the text was selected successfully or not 938 @rtype: boolean 939 @raise LookupError: When the accessible object is dead 940 ''' 941 pass
942
943 - def deselectAccText(por, n=None):
944 ''' 945 Removes a all text selections if n is None or removes the nth text 946 selection otherwise. When n is None, returns True if at least one selection 947 was removed. 948 949 @param por: Point of regard to the end terminus of the select operation 950 @type por: L{POR} 951 @return: Indicator of whether the text was deselected successfully or not 952 @rtype: boolean 953 @raise LookupError: When the accessible object is dead 954 ''' 955 pass
956
957 - def doMouseAction(event):
958 ''' 959 Performs a mouse event on the center of a given point of regard. 960 961 @param event: Mouse event to perform 962 @type event: integer of type EVENT_SYNTHMOUSE* 963 @return: Indicator of whether the event was performed (True) or not (False) 964 @raise LookupError: When the accessible object is dead 965 ''' 966 pass
967
968 -class IEventHandler(Interface):
969 ''' 970 Provides methods for handling accessible events. 971 '''
972 - def getRawEvents(self, kind):
973 ''' 974 Gets a list of raw event names that map to the given kind of L{AEEvent}. 975 976 @param kind: Indicates the type of L{AEEvent} 977 @type kind: L{AEEvent} class 978 @return: List of raw event names 979 @rtype: list of string 980 @raise KeyError: When no mapping exists for the given event 981 ''' 982 pass
983
984 - def getAEViewEvents(self, event, collector, vm):
985 ''' 986 Determines if the active view has changed and what events need to be 987 fired in response. 988 989 @param event: Raw event 990 @type event: L{pyLinAcc.Event.Event} 991 @param collector: Callable object that collects L{AEEvent}s to process. 992 Accepts N parameters of type L{AEEvent}. 993 @type collector: callable 994 @param vm: Reference to the view manager that has information about the 995 current view and needs to store a reference to a new view 996 @type vm: L{ViewManager} 997 ''' 998 pass
999
1000 - def getAEEvents(event, collector):
1001 ''' 1002 Collects the L{AEEvent}s that need to be posted for this event. 1003 1004 @param event: Raw event 1005 @type event: object 1006 @param collector: Callable object that collects L{AEEvent}s to process. 1007 Accepts N parameters of type L{AEEvent}. 1008 @type collector: callable 1009 ''' 1010 pass
1011
1012 -class IPORFactory(Interface):
1013 ''' 1014 Provides methods for building L{POR}s. 1015 '''
1016 - def create():
1017 ''' 1018 Returns a complete L{POR} built based on the properties of the subject. 1019 1020 @return: Point of regard 1021 @rtype: L{POR} 1022 ''' 1023 pass
1024