kpresenter

KPrEffectHandler.h

00001 // -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
00002 /* This file is part of the KDE project
00003    Copyright (C) 2004 Thorsten Zachmann <zachmann@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library 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 GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef EFFECTHANDLER_H
00022 #define EFFECTHANDLER_H
00023 
00024 #include <qpixmap.h>
00025 #include <qptrlist.h>
00026 #include <qstring.h>
00027 
00028 #include "global.h"
00029 #include "presstep.h"
00030 
00031 class QPaintDevice;
00032 class KPrObject;
00033 class KPrView;
00034 
00035 class KPrEffectHandler
00036 {
00037 public:
00048   KPrEffectHandler( PresStep step, bool back, QPaintDevice *dst, QPixmap *src, const QPtrList<KPrObject> &objects, KPrView *view, int _presSpeed );
00049 
00053   ~KPrEffectHandler();
00054 
00063   bool doEffect();
00064 
00071   void finish();
00072 protected:
00077   bool doAppearEffectStep( KPrObject *object );
00078 
00083   bool doDisappearEffectStep( KPrObject *object );
00084 
00090   bool appearNone( KPrObject *object );
00091 
00097   bool appearComeLeft( KPrObject *object );
00098 
00104   bool appearComeTop( KPrObject *object );
00105 
00111   bool appearComeRight( KPrObject *object );
00112 
00118   bool appearComeBottom( KPrObject *object );
00119 
00125   bool appearComeLeftTop( KPrObject *object );
00126 
00132   bool appearComeLeftBottom( KPrObject *object );
00133 
00139   bool appearComeRightTop( KPrObject *object );
00140 
00146   bool appearComeRightBottom( KPrObject *object );
00147 
00152   bool appearWipeLeft( KPrObject *object );
00153 
00158   bool appearWipeRight( KPrObject *object );
00159 
00164   bool appearWipeTop( KPrObject *object );
00165 
00170   bool appearWipeBottom( KPrObject *object );
00171 
00177   bool disappearGoLeft( KPrObject *object );
00178 
00184   bool disappearGoRight( KPrObject *object );
00185 
00191   bool disappearGoTop( KPrObject *object );
00192 
00198   bool disappearGoBottom( KPrObject *object );
00199 
00205   bool disappearGoLeftTop( KPrObject *object );
00206 
00212   bool disappearGoLeftBottom( KPrObject *object );
00213 
00219   bool disappearGoRightTop( KPrObject *object );
00220 
00226   bool disappearGoRightBottom( KPrObject *object );
00227 
00232   bool disappearWipeLeft( KPrObject *object );
00233 
00238   bool disappearWipeRight( KPrObject *object );
00239 
00244   bool disappearWipeTop( KPrObject *object );
00245 
00250   bool disappearWipeBottom( KPrObject *object );
00251 
00256   void drawObject( KPrObject *object, int x, int y, QPixmap *screen, QRect *clipRect = 0 );
00257 
00262   int m_effectStep;
00263 
00267   PresStep m_step;
00268 
00272   bool m_back;
00273 
00277   QPaintDevice *m_dst;
00278 
00284   QPixmap *m_src;
00285 
00289   QPixmap m_paint;
00290 
00294   QPtrList<KPrObject> m_objects;
00295 
00301   QPtrList<KPrObject> m_appearEffectObjects;
00302 
00307   QPtrList<KPrObject> m_disappearEffectObjects;
00308 
00310   KPrView *m_view;
00311 
00315   int m_stepWidth;
00316 
00320   int m_stepHeight;
00321 
00325   QPtrList<QRect> m_repaintRects;
00326 
00331   QPtrList<QRect> m_lastRepaintRects;
00332 
00336   QString m_soundEffect;
00337 
00341   int m_objectTimer;
00342 };
00343 
00344 
00345 #endif /* EFFECTHANDLER_H */
KDE Home | KDE Accessibility Home | Description of Access Keys