LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ProgressAnimation.h
Go to the documentation of this file.
1 /* @@@LICENSE
2 *
3 * Copyright (c) 2008-2012 Hewlett-Packard Development Company, L.P.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 * LICENSE@@@ */
18 
19 
20 
21 
22 #ifndef PROGRESSANIMATION_H
23 #define PROGRESSANIMATION_H
24 
25 #include "Common.h"
26 
27 #include <QGraphicsObject>
28 #include <QPixmap>
29 #include <QPropertyAnimation>
30 #include <QParallelAnimationGroup>
31 
33 {
34  Q_OBJECT
35  Q_PROPERTY(qreal brightness READ brightness WRITE setBrightness)
36 
37 public:
38 
39  enum Type {
40  TypeHp = 0,
43  };
44 
46  virtual ~ProgressAnimation();
47 
48  void start();
49  void stop();
50 
51  virtual QRectF boundingRect() const;
52 
53  virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
54 
55 private Q_SLOTS:
56 
57  void slotPulseCompleted();
58 
59 Q_SIGNALS:
60 
62 
63 private:
64 
65  qreal brightness() const { return m_brightness; }
66  void setBrightness(qreal brightness);
67 
68  void constructLogo(const QString& title, const QString& description);
69 
70  QPixmap m_normalPix;
71  QPixmap m_brightPix;
72  QPixmap m_logoPix;
73 
74  qreal m_brightness;
75 
76  bool m_pulsing;
77  QPropertyAnimation m_pulseAnimation;
78  QParallelAnimationGroup m_zoomFadeAnimation;
79 
80  QRectF m_boundingRect;
81 };
82 
83 #endif /* PROGRESSANIMATION_H */