korganizer Library API Documentation

koeventview.cpp

00001 /*
00002     This file is part of KOrganizer.
00003     Copyright (c) 2000, 2001 Cornelius Schumacher <schumacher@kde.org>
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 Free Software
00017     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 
00019     As a special exception, permission is given to link this program
00020     with any edition of Qt, and distribute the resulting executable,
00021     without including the source code for Qt in the source distribution.
00022 */
00023 
00024 #include <qpopupmenu.h>
00025 #include <qcursor.h>
00026 
00027 #include <klocale.h>
00028 #include <kdebug.h>
00029 #include <kiconloader.h>
00030 #include <kmessagebox.h>
00031 
00032 #include <libkcal/calendar.h>
00033 
00034 #include "calprinter.h"
00035 
00036 #include "koeventview.h"
00037 using namespace KOrg;
00038 #include "koeventview.moc"
00039 
00040 KOEventView::KOEventView(Calendar *cal,QWidget *parent,const char *name)
00041   : KOrg::BaseView(cal,parent,name)
00042 {
00043 }
00044 
00045 KOEventView::~KOEventView()
00046 {
00047 }
00048 
00049 KOEventPopupMenu *KOEventView::eventPopup()
00050 {
00051   KOEventPopupMenu *eventPopup = new KOEventPopupMenu;
00052   
00053   connect (eventPopup,SIGNAL(editEventSignal(Event *)),
00054            SIGNAL(editEventSignal(Event *)));
00055   connect (eventPopup,SIGNAL(showEventSignal(Event *)),
00056            SIGNAL(showEventSignal(Event *)));
00057   connect (eventPopup,SIGNAL(deleteEventSignal(Event *)),
00058            SIGNAL(deleteEventSignal(Event *)));
00059 
00060   return eventPopup;
00061 }
00062 
00063 void KOEventView::showEventPopup(QPopupMenu *popup,Event *event)
00064 {
00065   mCurrentEvent = event;
00066   if (event) popup->popup(QCursor::pos());
00067   else kdDebug() << "KOEventView::showEventPopup(): No event selected" << endl;
00068 }
00069 
00070 void KOEventView::popupShow()
00071 {
00072   emit showEventSignal(mCurrentEvent);
00073 }
00074 
00075 void KOEventView::popupEdit()
00076 {
00077   emit editEventSignal(mCurrentEvent);
00078 }
00079 
00080 void KOEventView::popupDelete()
00081 {
00082   emit deleteEventSignal(mCurrentEvent);
00083 }
00084 
00085 void KOEventView::defaultAction( Incidence *incidence )
00086 {
00087   kdDebug() << "KOEventView::defaultAction()" << endl;
00088 
00089   if ( !incidence ) return;
00090 
00091   kdDebug() << "  type: " << incidence->type() << endl;
00092 
00093   if ( incidence->type() == "Event" ) {
00094     Event *event = static_cast<Event *>( incidence );
00095     if (event->isReadOnly()) emit showEventSignal(event);
00096     else emit editEventSignal(event);
00097   }
00098 }
00099 
00100 #include "baseview.moc"
00101 
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Oct 18 02:47:31 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001