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

Nepomuk

kratingpainter.h

Go to the documentation of this file.
00001 /*
00002    This file is part of the Nepomuk KDE project.
00003    Copyright (C) 2007-2008 Sebastian Trueg <trueg@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 _NEPOMUK_RATING_PAINTER_H_
00022 #define _NEPOMUK_RATING_PAINTER_H_
00023 
00024 #include "nepomuk_export.h"
00025 
00026 #include <QtCore/Qt>
00027 
00028 class QIcon;
00029 class QPixmap;
00030 class QPainter;
00031 class QPoint;
00032 class QRect;
00033 
00034 
00048 class NEPOMUK_EXPORT KRatingPainter
00049 {
00050 public:
00056     KRatingPainter();
00057         
00061     ~KRatingPainter();
00062 
00069     int maxRating() const;
00070 
00078     bool halfStepsEnabled() const;
00079 
00085     Qt::Alignment alignment() const;
00086 
00094     Qt::LayoutDirection layoutDirection() const;
00095 
00102     QIcon icon() const;
00103 
00110     bool isEnabled() const;
00111 
00118     QPixmap customPixmap() const;
00119 
00125     int spacing() const;
00126 
00130     void setMaxRating( int max );
00131 
00136     void setHalfStepsEnabled( bool enabled );
00137         
00142     void setAlignment( Qt::Alignment align );
00143 
00147     void setLayoutDirection( Qt::LayoutDirection direction );
00148 
00152     void setIcon( const QIcon& icon );
00153 
00157     void setEnabled( bool enabled );
00158 
00162     void setCustomPixmap( const QPixmap& pixmap );
00163 
00169     void setSpacing( int spacing );
00170 
00183     void paint( QPainter* painter, const QRect& rect, int rating, int hoverRating = -1 ) const;
00184 
00191     int ratingFromPosition( const QRect& rect, const QPoint& pos ) const;
00192 
00201     static void paintRating( QPainter* p, const QRect& rect, Qt::Alignment align, int rating, int hoverRating = -1 );
00202 
00210     static int getRatingFromPosition( const QRect& rect, Qt::Alignment align, Qt::LayoutDirection direction, const QPoint& pos );
00211 
00212 private:
00213     class Private;
00214     Private* const d;
00215 };
00216 
00217 #endif

Nepomuk

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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