home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / lib / python2.4 / site-packages / deskbar / ui / DeskbarUI.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2006-08-31  |  4.2 KB  |  135 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.4)
  3.  
  4. import gtk
  5. import gobject
  6.  
  7. class DeskbarUI(gobject.GObject):
  8.     '''
  9. \tThis class represents an abstraction of a deskbar user interface.
  10. \tThe constructor of any class deriving from it should take a gnomeapplet.Applet
  11. \tas single argument, if it is to be instantiated from a DeskbarApplet instance
  12. \t(which most will).
  13. \t
  14. \tSignals:
  15. \t\t"match-selected" (text, Match):
  16. \t\t\tA match has been selected by the user. Passes the selected match along.
  17. \t\t\t
  18. \t\t"request-history-show" (gtk.Widget, gnomeapplet.ORIENT_*)
  19. \t\t\tThe user has performed and action such that the history should be popped up.
  20. \t\t\tThe widget is the widget to align the popup to, the ORIENT_* is the alignment
  21. \t\t\tthe popup should have relative to the widget.
  22. \t\t\t
  23. \t\t"request-history-hide" ():
  24. \t\t\tRequest that the history window will be hidden.
  25. \t\t
  26. \t\t"start-query" (query_string):
  27. \t\t\tRequest a query on the given string.
  28. \t\t\t
  29. \t\t"stop-query" ():
  30. \t\t\tSignal that we no longer will handle returned queries. Fx. when the user hits
  31. \t\t\tEsc, or the result list have become hidden.
  32. \t\t\t
  33. \t\t"request-keybinding" (Match, key_binding):
  34. \t\t\tThe user has performed an action which should attach a keybinding to the given match.
  35. \t\t
  36. \t\t"keyboard-shortcut" (string, keyval):
  37. \t\t\tTe user has triggered a keyboard shortcut, the query and keyval are passed (from gdk event)
  38. \t\t\t
  39. \t'''
  40.     __gsignals__ = {
  41.         'match-selected': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [
  42.             gobject.TYPE_STRING,
  43.             gobject.TYPE_PYOBJECT]),
  44.         'start-query': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [
  45.             gobject.TYPE_STRING]),
  46.         'stop-query': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, []),
  47.         'request-keybinding': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [
  48.             gobject.TYPE_PYOBJECT,
  49.             gobject.TYPE_PYOBJECT]),
  50.         'keyboard-shortcut': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [
  51.             gobject.TYPE_STRING,
  52.             gobject.TYPE_UINT]) }
  53.     
  54.     def __init__(self, applet, prefs):
  55.         gobject.GObject.__init__(self)
  56.         self.applet = applet
  57.         self.prefs = prefs
  58.  
  59.     
  60.     def on_change_orient(self, applet):
  61.         '''
  62. \t\tConnected to the applets "change-orient" signal.
  63. \t\t'''
  64.         pass
  65.  
  66.     
  67.     def on_change_size(self, applet):
  68.         '''
  69. \t\tConnected to the applets "change-size" signal.
  70. \t\t'''
  71.         pass
  72.  
  73.     
  74.     def receive_focus(self, time):
  75.         '''
  76. \t\tCalled when the applet receives focus. Use fx. to pop up a text entry with focus.
  77. \t\ttime is the event time.
  78. \t\t'''
  79.         pass
  80.  
  81.     
  82.     def middle_click(self):
  83.         '''
  84. \t\tCalled when the applet receives a middle click. Must return True if the middle click event is handled
  85. \t\t'''
  86.         return False
  87.  
  88.     
  89.     def set_sensitive(self, active):
  90.         '''
  91. \t\tCalled when the UI should be in/active because modules are loading
  92. \t\t'''
  93.         pass
  94.  
  95.     
  96.     def append_matches(self, matches):
  97.         '''
  98. \t\tCalled in response to sending a "start-query" signal.
  99. \t\t
  100. \t\tThis method should take both a single (non-list) match and a list
  101. \t\tof matches.
  102. \t\t
  103. \t\tThe list of matches is a list of tuples (text, match), text is the query
  104. \t\tstring and match is a Match instance
  105. \t\t'''
  106.         raise NotImplementedError
  107.  
  108.     
  109.     def get_view(self):
  110.         '''
  111. \t\tReturn the widget to be displayed for this UI.
  112. \t\t'''
  113.         raise NotImplementedError
  114.  
  115.     
  116.     def get_entry(self):
  117.         '''
  118. \t\tReturn the widget to type the text into.
  119.  
  120. \t\tUsually, this is a gtk.Entry
  121. \t\t'''
  122.         raise NotImplementedError
  123.  
  124.     
  125.     def close_view(self):
  126.         '''
  127. \t\tCloses every popup or window owned by the UI, because the ui is going to change
  128. \t\t'''
  129.         pass
  130.  
  131.  
  132. if gtk.pygtk_version < (2, 8, 0):
  133.     gobject.type_register(DeskbarUI)
  134.  
  135.