~ubuntu-branches/ubuntu/raring/quassel/raring-proposed

« back to all changes in this revision

Viewing changes to src/qtui/columnhandleitem.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-08-11 12:48:08 UTC
  • mfrom: (1.1.40 upstream)
  • Revision ID: james.westby@ubuntu.com-20100811124808-wl3zpp4gpbzmvn4t
Tags: 0.7~beta1-0ubuntu1
* New upstream beta release
  - Add libqca2-dev to build-depends for blowfish support
* Switch to source format v3 (Quilt) to use .bz2 tarball
  - Drop build-depends on quilt and update debian/rules
  - Add debian/source/format

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
 
*   Copyright (C) 2005-09 by the Quassel Project                          *
3
 
*   devel@quassel-irc.org                                                 *
4
 
*                                                                         *
5
 
*   This program is free software; you can redistribute it and/or modify  *
6
 
*   it under the terms of the GNU General Public License as published by  *
7
 
*   the Free Software Foundation; either version 2 of the License, or     *
8
 
*   (at your option) version 3.                                           *
9
 
*                                                                         *
10
 
*   This program is distributed in the hope that it will be useful,       *
11
 
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12
 
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13
 
*   GNU General Public License for more details.                          *
14
 
*                                                                         *
15
 
*   You should have received a copy of the GNU General Public License     *
16
 
*   along with this program; if not, write to the                         *
17
 
*   Free Software Foundation, Inc.,                                       *
18
 
*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19
 
***************************************************************************/
 
2
 *   Copyright (C) 2005-2010 by the Quassel Project                        *
 
3
 *   devel@quassel-irc.org                                                 *
 
4
 *                                                                         *
 
5
 *   This program is free software; you can redistribute it and/or modify  *
 
6
 *   it under the terms of the GNU General Public License as published by  *
 
7
 *   the Free Software Foundation; either version 2 of the License, or     *
 
8
 *   (at your option) version 3.                                           *
 
9
 *                                                                         *
 
10
 *   This program is distributed in the hope that it will be useful,       *
 
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
13
 *   GNU General Public License for more details.                          *
 
14
 *                                                                         *
 
15
 *   You should have received a copy of the GNU General Public License     *
 
16
 *   along with this program; if not, write to the                         *
 
17
 *   Free Software Foundation, Inc.,                                       *
 
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 
19
 ***************************************************************************/
20
20
 
21
21
#ifndef COLUMNHANDLEITEM_H_
22
22
#define COLUMNHANDLEITEM_H_
23
23
 
24
 
#include <QObject>
25
24
#include <QGraphicsItem>
26
25
#include <QGraphicsScene>
27
 
#include <QTimeLine>
 
26
#include <QPropertyAnimation>
28
27
 
29
28
#include "chatscene.h"
30
29
 
31
 
class ColumnHandleItem : public QObject, public QGraphicsItem {
 
30
class ColumnHandleItem : public QGraphicsObject {
32
31
  Q_OBJECT
33
 
#if QT_VERSION >= 0x040600
34
 
  Q_INTERFACES(QGraphicsItem)
35
 
#endif
 
32
  Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity)
36
33
 
37
34
public:
38
35
  ColumnHandleItem(qreal width, QGraphicsItem *parent = 0);
43
40
  inline qreal sceneLeft() const { return _sceneLeft; }
44
41
  inline qreal sceneRight() const { return _sceneRight; }
45
42
 
 
43
  inline qreal opacity() const { return _opacity; }
 
44
 
46
45
  void setXPos(qreal xpos);
47
46
  void setXLimits(qreal min, qreal max);
48
47
 
50
49
 
51
50
public slots:
52
51
  void sceneRectChanged(const QRectF &);
53
 
  inline void setColor(const QColor &color) { _rulerColor = color; }
 
52
  void setOpacity(qreal opacity);
54
53
 
55
54
protected:
56
55
  void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
62
61
signals:
63
62
  void positionChanged(qreal x);
64
63
 
65
 
private slots:
66
 
  void hoverChanged(qreal value);
67
 
 
68
64
private:
69
65
  qreal _width;
70
66
  qreal _sceneLeft, _sceneRight;
71
67
  QRectF _boundingRect;
72
 
  qreal _hover;
73
68
  bool _moving;
 
69
  qreal _offset;
74
70
  qreal _minXPos, _maxXPos;
75
 
  QTimeLine _timeLine;
76
 
  QColor _rulerColor;
 
71
  qreal _opacity;
 
72
  QPropertyAnimation *_animation;
77
73
};
78
74
 
79
75
#endif