Danny.OOo.Listeners.TopWindowListener.py
From Apache OpenOffice Wiki
This is similar in purpose to the Danny.OOo.Listeners.ListenerProcAdapters.py module.
This one is NOT an adapter however. It is a class that you subclass. Your subclass does not need to implement every possible listener method, because you inherit the empty implementations from this class. So when you need to add a window listener to a TopWindow, this class comes in very handy.
#********************************************************************** # # Danny.OOo.Listeners.TopWindowListener.py # # A module to easily work with OpenOffice.org. # #********************************************************************** # Copyright (c) 2003-2004 Danny Brewer # d29583@groovegarden.com # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # See: http://www.gnu.org/licenses/lgpl.html # #********************************************************************** # If you make changes, please append to the change log below. # # Change Log # Danny Brewer Revised 2004-06-05-01 # #********************************************************************** # OOo's libraries import uno import unohelper from com.sun.star.awt import XTopWindowListener class TopWindowListener( XTopWindowListener ): """An empty implementation of com.sun.star.awt.XTopWindowListener. It is useful for you to be able to subclass from this. """ # NOTE: # If you subclass from this, you must either: # 1. also subclass from unohelper.Base. # 2. or otherwise implement com.sun.star.lang.XTypeProvider. #---------------------------------------- # Interface: XTopWindowListener # # This interface is implemented so that your subclass # can conveniently override these methods! # # 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. #---------------------------------------- # [oneway] void # windowOpened( [in] com.sun.star.lang.EventObject tEvent ); def windowOpened( self, tEvent ): """is invoked when a window has been opened.""" pass # [oneway] void # windowClosing( [in] com.sun.star.lang.EventObject tEvent ); def windowClosing( self, tEvent ): """is invoked when a window is in the process of being closed. The close operation can be overridden at this point.""" pass # [oneway] void # windowClosed( [in] com.sun.star.lang.EventObject tEvent ); def windowClosed( self, tEvent ): """is invoked when a window has been closed.""" pass # [oneway] void # windowMinimized( [in] com.sun.star.lang.EventObject tEvent ); def windowMinimized( self, tEvent ): """is invoked when a window is iconified.""" pass # [oneway] void # windowNormalized( [in] com.sun.star.lang.EventObject tEvent ); def windowNormalized( self, tEvent ): """is invoked when a window is de-iconified.""" pass # [oneway] void # windowActivated( [in] com.sun.star.lang.EventObject tEvent ); def windowActivated( self, tEvent ): """is invoked when a window is activated.""" pass # [oneway] void # windowDeactivated( [in] com.sun.star.lang.EventObject tEvent ); def windowDeactivated( self, tEvent ): """is invoked when a window is de-activated.""" pass