/usr/share/pyshared/openoffice/windowsListeners.py is in python-openoffice 1:0.1+20110209-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | #
# Copyright (c) 2008 by Hartmut Goebel <h.goebel@goebel-consult.de>
# Licenced under the GNU General Public License v3 (GPLv3)
# see file LICENSE-gpl-3.0.txt
#
__author__ = "Hartmut Goebel <h.goebel@goebel-consult.de>"
__copyright__ = "Copyright (c) 2008 by Hartmut Goebel <h.goebel@goebel-consult.de>"
__licence__ = "GPLv3 - GNU General Public License v3"
from com.sun.star.awt import XTopWindowListener, XWindowListener, \
XFocusListener, XKeyListener, XMouseListener, XPaintListener, \
XEventListener
class TopWindowListener(XTopWindowListener):
# Note that com.sun.star.lang.EventObject has the following members:
# Source which is a com.sun.star.uno.XInterface
# refers to the object that fired the event.
def __init__(self, *args, **kw):
super(self, TopWindowListener).__init__(*args, **kw)
# Since this class implements the XTopWindowListener interface,
# add ourself as a listener to our own window.
self._window.addTopWindowListener(self)
def windowOpened(self, event):
"""Is invoked when a window has been opened."""
pass
def windowClosing(self, event):
"""Is invoked when a window is in the process of being closed.
The close operation can be overridden at this point."""
self._window.dispose()
def windowClosed(self, event):
"""Is invoked when a window has been closed."""
pass
def windowMinimized(self, event):
"""Is invoked when a window is iconified."""
pass
def windowNormalized(self, event):
"""Is invoked when a window is de-iconified."""
pass
def windowActivated(self, event):
"""is invoked when a window is activated."""
pass
def windowDeactivated(self, event):
"""Is invoked when a window is de-activated."""
pass
class WindowListener(XWindowListener):
# Note that com.sun.star.awt.WindowEvent has the following members:
# long X long Y
# long Width long Height
# long LeftInset long TopInset
# long RightInset long BottomInset
def __init__(self, *args, **kw):
super(self, WindowListener).__init__(*args, **kw)
# Since this class implements the XWindowListener interface,
# add ourself as a listener to our own window.
self._window.addWindowListener(self)
def windowResized(self, event):
"""Is invoked when the window has been resized."""
pass
def windowMoved(self, event):
"""Is invoked when the window has been moved."""
pass
def windowShown(self, event):
"""Is invoked when the window has been shown."""
# please note the type of parameter is described
# above in the comment for XTopWindowListener.
pass
def windowHidden(self, event):
"""Is invoked when the window has been hidden."""
# please note the type of parameter is described
# above in the comment for XTopWindowListener.
pass
class FocusListener(XFocusListener):
# Note that com.sun.star.awt.FocusEvent has the following members:
# short FocusFlags
# com.sun.star.uno.XInterface NextFocus
# boolean Temporary
def __init__(self, *args, **kw):
super(self, FocusListener).__init__(*args, **kw)
# Since this class implements the XFocusListener interface,
# add ourself as a listener to our own window.
self._window.addFocusListener(self)
def focusGained(self, event):
"""Is invoked when a window gains the keyboard focus."""
pass
def focusLost(self, event):
"""Is invoked when a window loses the keyboard focus."""
pass
class KeyListener(XKeyListener):
# Note that com.sun.star.awt.KeyEvent has the following members:
# short KeyCode (constant from com.sun.star.awt.Key)
# char KeyChar
# short KeyFunc (constant from com.sun.star.awt.KeyFunction)
def __init__(self, *args, **kw):
super(self, KeyListener).__init__(*args, **kw)
# Since this class implements the XKeyListener interface,
# add ourself as a listener to our own window.
self._window.addKeyListener(self)
def keyPressed(self, event):
"""Is invoked when a key has been pressed."""
pass
def keyReleased(self, event):
"""Is invoked when a key has been released."""
pass
class MouseListener(XMouseListener):
# Note that com.sun.star.awt.MouseEvent has the following members:
# short Buttons (constant from com.sun.star.awt.MouseButton)
# short X short Y
# long ClickCount
# boolean PupupTrigger
def __init__(self, *args, **kw):
super(self, MouseListener).__init__(*args, **kw)
# Since this class implements the XMouseListener interface,
# add ourself as a listener to our own window.
self._window.addMouseListener(self)
def mousePressed(self, event):
"""Is invoked when a mouse button has been pressed on a window."""
pass
def mouseReleased(self, event):
"""Is invoked when a mouse button has been released on a window."""
pass
def mouseEntered(self, event):
"""Is invoked when the mouse enters a window."""
pass
def mouseExited(self, event):
"""Is invoked when the mouse exits a window."""
pass
class PaintListener(XPaintListener):
# Note that com.sun.star.awt.Painevent has the following members:
# com.sun.star.awt.Rectangle UpdateRect
# short Count
def __init__(self, *args, **kw):
super(self, PaintListener).__init__(*args, **kw)
# Since this class implements the XPaintListener interface,
# add ourself as a listener to our own window.
self._window.addPaintListener(self)
# [oneway] void
# windowPaint([in] Painevent event);
def windowPaint(self, event):
"""
Is invoked when a region of the window became invalid, e.g.
when another window has been moved away.
"""
pass
class EventListener(XEventListener):
# Note that com.sun.star.lang.EventObject has the following members:
# Source which is a com.sun.star.uno.XInterface
# refers to the object that fired the event.
def __init__(self, *args, **kw):
super(self, EventListener).__init__(*args, **kw)
# void
# disposing([in] com.sun.star.lang.EventObject event);
def disposing(self, event):
"""
Gets called when the broadcaster is about to be disposed.
"""
pass
|