• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

korganizer

koeventview.cpp

Go to the documentation of this file.
00001 /*
00002   This file is part of KOrganizer.
00003 
00004   Copyright (c) 2000, 2001 Cornelius Schumacher <schumacher@kde.org>
00005   Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00006 
00007   This program is free software; you can redistribute it and/or modify
00008   it under the terms of the GNU General Public License as published by
00009   the Free Software Foundation; either version 2 of the License, or
00010   (at your option) any later version.
00011 
00012   This program is distributed in the hope that it will be useful,
00013   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015   GNU General Public License for more details.
00016 
00017   You should have received a copy of the GNU General Public License along
00018   with this program; if not, write to the Free Software Foundation, Inc.,
00019   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020 
00021   As a special exception, permission is given to link this program
00022   with any edition of Qt, and distribute the resulting executable,
00023   without including the source code for Qt in the source distribution.
00024 */
00025 
00026 #include "koeventview.h"
00027 #include "kocore.h"
00028 #include "koeventpopupmenu.h"
00029 
00030 #include <kcal/calendar.h>
00031 
00032 #include <klocale.h>
00033 #include <kdebug.h>
00034 #include <kiconloader.h>
00035 #include <kmessagebox.h>
00036 #include <kxmlguiclient.h>
00037 #include <kxmlguifactory.h>
00038 
00039 #include <QMenu>
00040 #include <QCursor>
00041 
00042 using namespace KOrg;
00043 
00044 //---------------------------------------------------------------------------
00045 
00046 KOEventView::KOEventView(Calendar *cal,QWidget *parent )
00047   : KOrg::BaseView( cal, parent )
00048 {
00049 }
00050 
00051 //---------------------------------------------------------------------------
00052 
00053 KOEventView::~KOEventView()
00054 {
00055 }
00056 
00057 //---------------------------------------------------------------------------
00058 
00059 KOEventPopupMenu *KOEventView::eventPopup()
00060 {
00061   KOEventPopupMenu *eventPopup = new KOEventPopupMenu;
00062 
00063   connect(eventPopup,SIGNAL(editIncidenceSignal(Incidence *)),
00064                      SIGNAL(editIncidenceSignal(Incidence *)));
00065   connect(eventPopup,SIGNAL(showIncidenceSignal(Incidence *)),
00066                      SIGNAL(showIncidenceSignal(Incidence *)));
00067   connect(eventPopup,SIGNAL(deleteIncidenceSignal(Incidence *)),
00068                      SIGNAL(deleteIncidenceSignal(Incidence *)));
00069   connect(eventPopup,SIGNAL(cutIncidenceSignal(Incidence *)),
00070                      SIGNAL(cutIncidenceSignal(Incidence *)));
00071   connect(eventPopup,SIGNAL(copyIncidenceSignal(Incidence *)),
00072                      SIGNAL(copyIncidenceSignal(Incidence *)));
00073   connect(eventPopup,SIGNAL(pasteIncidenceSignal()),
00074                      SIGNAL(pasteIncidenceSignal()));
00075   connect(eventPopup,SIGNAL(toggleAlarmSignal(Incidence *)),
00076                      SIGNAL(toggleAlarmSignal(Incidence*)));
00077   connect(eventPopup,SIGNAL(dissociateOccurrenceSignal( Incidence *, const QDate & )),
00078                      SIGNAL(dissociateOccurrenceSignal( Incidence *, const QDate & )));
00079   connect(eventPopup,SIGNAL(dissociateFutureOccurrenceSignal( Incidence *, const QDate & )),
00080                      SIGNAL(dissociateFutureOccurrenceSignal( Incidence *, const QDate & )));
00081 
00082   return eventPopup;
00083 }
00084 
00085 QMenu *KOEventView::newEventPopup()
00086 {
00087   KXMLGUIClient *client = KOCore::self()->xmlguiClient( this );
00088   if ( !client ) {
00089     kError() << "no xmlGuiClient.";
00090     return 0;
00091   }
00092   if ( !client->factory() ) {
00093     kError() << "no factory";
00094     return 0; // can happen if called too early
00095   }
00096 
00097   return static_cast<QMenu*>
00098       ( client->factory()->container( "rmb_selection_popup", client ) );
00099 }
00100 //---------------------------------------------------------------------------
00101 
00102 void KOEventView::popupShow()
00103 {
00104   emit showIncidenceSignal(mCurrentIncidence);
00105 }
00106 
00107 //---------------------------------------------------------------------------
00108 
00109 void KOEventView::popupEdit()
00110 {
00111   emit editIncidenceSignal(mCurrentIncidence);
00112 }
00113 
00114 //---------------------------------------------------------------------------
00115 
00116 void KOEventView::popupDelete()
00117 {
00118   emit deleteIncidenceSignal(mCurrentIncidence);
00119 }
00120 
00121 //---------------------------------------------------------------------------
00122 
00123 void KOEventView::popupCut()
00124 {
00125   emit cutIncidenceSignal(mCurrentIncidence);
00126 }
00127 
00128 //---------------------------------------------------------------------------
00129 
00130 void KOEventView::popupCopy()
00131 {
00132   emit copyIncidenceSignal(mCurrentIncidence);
00133 }
00134 
00135 //---------------------------------------------------------------------------
00136 
00137 void KOEventView::showNewEventPopup()
00138 {
00139   QMenu *popup = newEventPopup();
00140   if ( !popup ) {
00141     kError() << "popup creation failed";
00142     return;
00143   }
00144 
00145   popup->popup( QCursor::pos() );
00146 }
00147 
00148 //---------------------------------------------------------------------------
00149 
00150 void KOEventView::defaultAction( Incidence *incidence )
00151 {
00152   kDebug();
00153 
00154   if ( !incidence ) {
00155     return;
00156   }
00157 
00158   kDebug() << "  type:" << incidence->type();
00159 
00160   if ( incidence->isReadOnly() ) {
00161     emit showIncidenceSignal(incidence);
00162   } else {
00163     emit editIncidenceSignal(incidence);
00164   }
00165 }
00166 
00167 //---------------------------------------------------------------------------
00168 
00169 #include "koeventview.moc"
00170 

korganizer

Skip menu "korganizer"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal