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

libkdegames

kgamepopupitem.h

Go to the documentation of this file.
00001 /*******************************************************************
00002     Copyright 2007 Dmitry Suzdalev <dimsuz@gmail.com>
00003 
00004     This library is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public License
00015     along with this program; if not, write to the Free Software
00016     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00017  ********************************************************************/
00018 #ifndef K_GAME_POPUP_ITEM_H
00019 #define K_GAME_POPUP_ITEM_H
00020 
00021 #include <libkdegames_export.h>
00022 
00023 #include <QtGui/QGraphicsPathItem>
00024 #include <QtCore/QObject>
00025 
00026 class KGamePopupItemPrivate;
00027 
00043 class KDEGAMES_EXPORT KGamePopupItem : public QObject, public QGraphicsItem
00044 {
00045     Q_OBJECT
00046 public:
00051     enum ReplaceMode { LeavePrevious, ReplacePrevious };
00055     enum Sharpness { Square=0, Sharp=2, Soft=5, Softest=10 };
00059     enum Position { TopLeft, TopRight, BottomLeft, BottomRight, Center };
00063     KGamePopupItem(QGraphicsItem * parent = 0);
00067     ~KGamePopupItem();
00083     void showMessage( const QString& text, Position pos, ReplaceMode mode = LeavePrevious);
00095     void setMessageTimeout( int msec );
00099     int messageTimeout() const;
00105     void setMessageOpacity( qreal opacity );
00109     qreal messageOpacity() const;
00113     void setMessageIcon( const QPixmap& pix );
00114 
00118     enum HideType { InstantHide, AnimatedHide };
00122     void forceHide(HideType type=AnimatedHide);
00128     void setBackgroundBrush( const QBrush& brush );
00134     void setTextColor( const QColor& color );
00138     virtual QRectF boundingRect() const;
00142     virtual void paint( QPainter* p, const QStyleOptionGraphicsItem *option, QWidget* widget );
00146     void setSharpness( Sharpness sharpness );
00150     Sharpness sharpness() const;
00151 Q_SIGNALS:
00155     void linkActivated( const QString& link );
00159     void linkHovered( const QString& link );
00164     void hidden();
00165 private Q_SLOTS:
00166     void animationFrame(int);
00167     void hideMe();
00168     void playHideAnimation();
00169     void onLinkHovered(const QString&);
00170 private:
00171     void setupTimeline();
00172     virtual void mousePressEvent( QGraphicsSceneMouseEvent* );
00173     virtual void mouseReleaseEvent( QGraphicsSceneMouseEvent* );
00174     virtual void hoverEnterEvent( QGraphicsSceneHoverEvent* );
00175     virtual void hoverLeaveEvent( QGraphicsSceneHoverEvent* );
00176     KGamePopupItemPrivate * const d;
00177 };
00178 
00179 #endif

libkdegames

Skip menu "libkdegames"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • kblackbox
  • kgoldrunner
  • kmahjongg
  • ksquares
  • libkdegames
  •   highscore
  •   kgame
  •   kggzgames
  •   kggzmod
  •   kggznet
  • libkmahjongg
Generated for API Reference 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