entryextensionwidget.cpp
00001 /*************************************************************************** 00002 * Copyright (C) 2006 by Martin Mueller * 00003 * orvio@orvio.de * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 #include "entryextensionwidget.h" 00021 #include "entryextensionwidget.moc" 00022 00023 #include "editentrywidget.h" 00024 00025 //#include <kdebug.h> 00026 00027 #include <QEvent> 00028 00029 class Blokkal::Ui::EntryExtensionWidget::Private { 00030 public: 00031 Private( Entry * entry, EditEntryWidget * editEntryWidget ) : 00032 entry( entry ), 00033 editEntryWidget( editEntryWidget ) {} 00034 00035 Entry * entry; 00036 EditEntryWidget * editEntryWidget; 00037 }; 00038 00039 Blokkal::Ui::EntryExtensionWidget::EntryExtensionWidget( Entry * entry, EditEntryWidget * parent ): 00040 QWidget( parent ), 00041 d( new Private( entry, parent ) ) 00042 { 00043 } 00044 00045 Blokkal::Ui::EntryExtensionWidget::~EntryExtensionWidget( void ) 00046 { 00047 delete d; 00048 } 00049 00050 Blokkal::Entry * Blokkal::Ui::EntryExtensionWidget::entry( void ) const 00051 { 00052 return d->entry; 00053 } 00054 00055 void Blokkal::Ui::EntryExtensionWidget::emitContentChanged( void ) 00056 { 00057 emit contentChanged( this ); 00058 } 00059 00060 void Blokkal::Ui::EntryExtensionWidget::postInit( void ) 00061 { 00062 } 00063 00064 const Blokkal::Ui::EditEntryWidget * Blokkal::Ui::EntryExtensionWidget::editEntryWidget( void ) const 00065 { 00066 return d->editEntryWidget; 00067 } 00068 00069 bool Blokkal::Ui::EntryExtensionWidget::event( QEvent * event ) 00070 { 00071 /*kDebug() << metaObject()->className() << endl; 00072 kDebug() << event->type() << endl;*/ 00073 switch( event->type() ) { 00074 case QEvent::Show: 00075 case QEvent::Hide: 00076 case QEvent::ShowToParent: 00077 case QEvent::HideToParent: 00078 emit visibilityChanged(); 00079 break; 00080 default: 00081 break; 00082 } 00083 return QWidget::event( event ); 00084 }