korganizer Library API Documentation

koincidencetooltip.h

00001 /*
00002     This file is part of KOrganizer.
00003     Copyright (c) 2003
00004     Reinhold Kainhofer <reinhhold@kainhofer.com>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of Qt, and distribute the resulting executable,
00022     without including the source code for Qt in the source distribution.
00023 */
00024 #ifndef KOINCIDENCETOOLTIP_H
00025 #define KOINCIDENCETOOLTIP_H
00026 
00027 #include <qtooltip.h>
00028 
00029 namespace KCal
00030 {
00031 class Incidence;
00032 class Event;
00033 class Todo;
00034 class Journal;
00035 }
00036 using namespace KCal;
00037 
00041 class KOIncidenceToolTip : public QToolTip
00042 {
00043   public:
00044     KOIncidenceToolTip(QWidget * widget, QToolTipGroup * group = 0 ):QToolTip (widget, group) {}
00045 /*    ~KOIncidenceToolTip();*/
00046 
00047   public:
00048     static void add ( QWidget * widget, Incidence *incidence,
00049         QToolTipGroup * group = 0, const QString & longText = "" );
00050 };
00051 
00052 class ToolTipVisitor : public Incidence::Visitor
00053 {
00054   public:
00055     ToolTipVisitor() : mRichText( true ),mTipText(0) {}
00056 
00057     bool act( Incidence *incidence, QString* tipText, bool richText=true)
00058     {
00059       mTipText = tipText;
00060       mRichText = richText;
00061       return incidence ? incidence->accept( *this ) : false;
00062     }
00063 
00064   protected:
00065     bool visit( Event *event );
00066     bool visit( Todo *todo );
00067     bool visit( Journal *journal );
00068 
00069     QString dateRangeText( Event*event );
00070     QString dateRangeText( Todo *todo );
00071     QString dateRangeText( Journal *journal );
00072 
00073     bool generateToolTip( Incidence* incidence, QString dtRangeText );
00074 
00075   protected:
00076     bool mRichText;
00077     QString *mTipText;
00078 };
00079 
00080 
00081 #endif
KDE Logo
This file is part of the documentation for korganizer Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:38:29 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003