source/ui/baselistener.cxx

Go to the documentation of this file.
00001 /*************************************************************************
00002  *
00003  *  The Contents of this file are made available subject to
00004  *  the terms of GNU Lesser General Public License Version 2.1.
00005  *
00006  *
00007  *    GNU Lesser General Public License Version 2.1
00008  *    =============================================
00009  *    Copyright 2005 by Kohei Yoshida.
00010  *    1039 Kingsway Dr., Apex, NC 27502, USA
00011  *
00012  *    This library is free software; you can redistribute it and/or
00013  *    modify it under the terms of the GNU Lesser General Public
00014  *    License version 2.1, as published by the Free Software Foundation.
00015  *
00016  *    This library is distributed in the hope that it will be useful,
00017  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  *    Lesser General Public License for more details.
00020  *
00021  *    You should have received a copy of the GNU Lesser General Public
00022  *    License along with this library; if not, write to the Free Software
00023  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00024  *    MA  02111-1307  USA
00025  *
00026  ************************************************************************/
00027 
00028 #include "baselistener.hxx"
00029 #include "basedlg.hxx"
00030 #include <stdio.h>
00031 
00032 namespace scsolver {
00033 
00034 Listener::~Listener() throw()
00035 {
00036 }
00037 
00038 //-----------------------------------------------------------------
00039 
00040 SimpleActionObject::SimpleActionObject()
00041 {
00042 }
00043 
00044 SimpleActionObject::~SimpleActionObject() throw()
00045 {
00046 }
00047 
00048 ActionObject::ActionObject()
00049 {
00050 }
00051 
00052 ActionObject::~ActionObject() throw()
00053 {
00054 }
00055 
00056 ActionListener::ActionListener( BaseDialog* pDlg ) 
00057         : Listener(pDlg), m_pAction(NULL)
00058 {
00059 }
00060 
00061 
00062 ActionListener::ActionListener( BaseDialog* pDlg, ActionObject* pAction ) 
00063         : Listener(pDlg), m_pAction(pAction)
00064 {
00065 }
00066 
00067 ActionListener::~ActionListener() throw()
00068 {
00069 }
00070 
00071 void SAL_CALL ActionListener::disposing( const lang::EventObject& )
00072         throw ( RuntimeException )
00073 {
00074 }
00075 
00076 void SAL_CALL ActionListener::actionPerformed( const awt::ActionEvent& e )
00077         throw ( RuntimeException )
00078 {
00079         if( m_pAction )
00080                 m_pAction->execute( getDialog(), e );
00081 }
00082 
00083 ItemListener::~ItemListener() throw()
00084 {
00085 }
00086 
00087 FocusListener::~FocusListener() throw()
00088 {
00089 }
00090 
00091 MouseListener::~MouseListener() throw()
00092 {
00093 }
00094 
00095 //-----------------------------------------------------------------
00096 
00097 class TopWindowListenerImpl
00098 {
00099 public:
00100         TopWindowListenerImpl() :
00101                 pCloseAction(NULL)
00102         {
00103         }
00104 
00105         ~TopWindowListenerImpl() throw()
00106         {
00107         }
00108 
00109         SimpleActionObject* pCloseAction;
00110 };
00111 
00112 TopWindowListener::TopWindowListener( BaseDialog* pDlg ) :
00113         Listener(pDlg),
00114         m_pImpl( new TopWindowListenerImpl )
00115 {
00116 }
00117 
00118 TopWindowListener::~TopWindowListener() throw()
00119 {
00120 }
00121 
00122 void SAL_CALL TopWindowListener::windowOpened( const lang::EventObject& )
00123                 throw(RuntimeException)
00124 {
00125 }
00126 
00127 void SAL_CALL TopWindowListener::windowClosing( const lang::EventObject& )
00128                 throw(RuntimeException)
00129 {
00130         BaseDialog* p = getDialog();
00131         if (m_pImpl->pCloseAction == NULL)
00132         {
00133                 p->setVisible(false);
00134                 return;
00135         }
00136         m_pImpl->pCloseAction->execute( getDialog() );
00137 }
00138 
00139 void SAL_CALL TopWindowListener::windowClosed( const lang::EventObject& )
00140                 throw (RuntimeException)
00141 {
00142 }
00143 
00144 void SAL_CALL TopWindowListener::windowMinimized( const lang::EventObject& )
00145                 throw (RuntimeException)
00146 {
00147 }
00148 
00149 void SAL_CALL TopWindowListener::windowNormalized( const lang::EventObject& )
00150                 throw (RuntimeException)
00151 {
00152 }
00153 
00154 void SAL_CALL TopWindowListener::windowActivated( const lang::EventObject& )
00155                 throw (RuntimeException)
00156 {
00157 }
00158 
00159 void SAL_CALL TopWindowListener::windowDeactivated( const lang::EventObject& )
00160                 throw (RuntimeException)
00161 {
00162 }
00163 
00164 void SAL_CALL TopWindowListener::disposing( const lang::EventObject& )
00165                 throw (RuntimeException)
00166 {
00167 }
00168 
00169 void TopWindowListener::setActionClosing( SimpleActionObject* p )
00170 {
00171         m_pImpl->pCloseAction = p;
00172 }
00173 
00174 }
00175 

Generated on Mon Jul 28 09:13:20 2008 for scsolver by  doxygen 1.5.3