2
// Copyright 2008 Simon Edwards <simon@simonzone.com>
6
// This file is part of PyKDE4.
8
// PyKDE4 is free software; you can redistribute it and/or modify
9
// it under the terms of the GNU Lesser General Public License as
10
// published by the Free Software Foundation; either version 2.1 of
11
// the License, or (at your option) any later version.
13
// PyKDE4 is distributed in the hope that it will be useful,
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
// GNU General Public License for more details.
18
// You should have received a copy of the GNU General Public License
19
// along with this program. If not, see <http://www.gnu.org/licenses/>.
25
#include <nepomuk/kratingpainter.h>
30
int maxRating () const;
31
bool halfStepsEnabled () const;
32
Qt::Alignment alignment () const;
33
Qt::LayoutDirection layoutDirection () const;
35
bool isEnabled () const;
36
QPixmap customPixmap () const;
38
void setMaxRating (int max);
39
void setHalfStepsEnabled (bool enabled);
40
void setAlignment (Qt::Alignment align);
41
void setLayoutDirection (Qt::LayoutDirection direction);
42
void setIcon (const QIcon& icon);
43
void setEnabled (bool enabled);
44
void setCustomPixmap (const QPixmap& pixmap);
45
void setSpacing (int spacing);
46
void paint (QPainter* painter, const QRect& rect, int rating, int hoverRating = -1) const;
47
int ratingFromPosition (const QRect& rect, const QPoint& pos) const;
48
static void paintRating (QPainter* p, const QRect& rect, Qt::Alignment align, int rating, int hoverRating = -1);
49
static int getRatingFromPosition (const QRect& rect, Qt::Alignment align, Qt::LayoutDirection direction, const QPoint& pos);
54
KRatingPainter (const KRatingPainter& other);