~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to kde/src/klib/tipmanager.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (1.1.11)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20140128182336-3xenud1kbnwmf3mz
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/****************************************************************************
2
 
 *   Copyright (C) 2012-2013 by Savoir-Faire Linux                          *
 
2
 *   Copyright (C) 2012-2014 by Savoir-Faire Linux                          *
3
3
 *   Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
4
4
 *                                                                          *
5
5
 *   This library is free software; you can redistribute it and/or          *
20
20
 
21
21
//Qt
22
22
#include <QtCore/QObject>
23
 
#include <QtCore/QStringList>
24
 
#include <QtGui/QPalette>
25
 
#include <QtGui/QTreeView>
 
23
#include <QtGui/QAbstractItemView>
26
24
#include <QtGui/QImage>
27
 
class QTimer;
 
25
#include <QtCore/QAbstractAnimation>
28
26
 
29
27
//SFLPhone
30
28
#include "../lib/typedefs.h"
32
30
#include "tipanimationwrapper.h"
33
31
class TipManager;
34
32
 
35
 
//Classes
36
 
class ResizeEventFilter : public QObject
37
 
{
38
 
   Q_OBJECT
39
 
public:
40
 
   explicit ResizeEventFilter(TipManager* parent) : QObject(0) {
41
 
      m_pLoader =  parent;
42
 
   }
43
 
protected:
44
 
   bool eventFilter(QObject *obj, QEvent *event);
45
 
private:
46
 
   TipManager* m_pLoader;
47
 
};
48
 
 
49
33
///This class create a background brush for a QWidget with a tip window
50
34
class LIB_EXPORT TipManager : public QObject
51
35
{
 
36
   #pragma GCC diagnostic push
 
37
   #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
52
38
   Q_OBJECT
 
39
   #pragma GCC diagnostic pop
53
40
   friend class ResizeEventFilter;
54
41
public:
55
42
   //Constructor
56
 
   explicit TipManager(QTreeView* parent);
 
43
   explicit TipManager(QAbstractItemView* parent);
 
44
   virtual ~TipManager();
57
45
 
58
46
   //Mutator
59
 
   void hideTip(Tip* tip);
 
47
   bool hideCurrentTip(bool skipAnimation = false);
60
48
 
61
49
   //Getter
62
50
   QImage getImage();
67
55
   void setBottomMargin(int margin);
68
56
   void setCurrentTip(Tip* tip);
69
57
 
 
58
protected:
 
59
   bool eventFilter(QObject *obj, QEvent *event);
 
60
 
70
61
private:
71
62
   //Methods
72
63
   void reload();
73
 
   void setCurrentTip_private(Tip* tip);
74
64
 
75
65
   //Attributes
76
 
   QPalette                m_OriginalPalette ;
77
 
   QTreeView*              m_pParent         ;
 
66
   QAbstractItemView*      m_pParent         ;
78
67
   int                     m_TopMargin       ;
79
68
   int                     m_BottomMargin    ;
80
69
   QImage                  m_CurrentImage    ;
81
70
   Tip*                    m_pCurrentTip     ;
82
71
   TipAnimationWrapper     m_pAnim           ;
83
72
   FrameDescription        m_CurrentFrame    ;
84
 
   QList<Tip*>             m_lTipQueue       ;
85
 
   QList<Tip*>             m_lHidingTipQueue ;
86
 
   QTimer*                 m_pTimer          ;
87
73
 
88
74
private Q_SLOTS:
89
75
   void animationStep(FrameDescription desc);
 
76
   void slotTransitionStarted(QAbstractAnimation::Direction direction, QAbstractAnimation::State state);
 
77
 
 
78
public Q_SLOTS:
90
79
   void changeSize(bool ignoreAnim = false);
91
 
   void animationEnded();
92
 
   void timeout();
93
80
 
94
81
Q_SIGNALS:
95
 
   void sizeChanged(QRect newRect,bool ignoreAnim);
 
82
   void sizeChanged(const QRect &newRect,bool ignoreAnim);
96
83
   void currentTipChanged(Tip*);
 
84
   void transitionStarted(QAbstractAnimation::Direction direction, QAbstractAnimation::State state);
97
85
 
98
86
};
 
87
Q_DECLARE_METATYPE(TipManager*)
99
88
 
100
89
#endif