Fix keymap.
[vuplus_xbmc] / xbmc / guilib / GUIFadeLabelControl.h
1 /*!
2 \file GUIFadeLabelControl.h
3 \brief
4 */
5
6 #ifndef GUILIB_GUIFADELABELCONTROL_H
7 #define GUILIB_GUIFADELABELCONTROL_H
8
9 #pragma once
10
11 /*
12  *      Copyright (C) 2005-2013 Team XBMC
13  *      http://xbmc.org
14  *
15  *  This Program is free software; you can redistribute it and/or modify
16  *  it under the terms of the GNU General Public License as published by
17  *  the Free Software Foundation; either version 2, or (at your option)
18  *  any later version.
19  *
20  *  This Program is distributed in the hope that it will be useful,
21  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
22  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  *  GNU General Public License for more details.
24  *
25  *  You should have received a copy of the GNU General Public License
26  *  along with XBMC; see the file COPYING.  If not, see
27  *  <http://www.gnu.org/licenses/>.
28  *
29  */
30
31 #include "GUIControl.h"
32 #include "GUILabel.h"
33
34 /*!
35  \ingroup controls
36  \brief
37  */
38 class CGUIFadeLabelControl : public CGUIControl
39 {
40 public:
41   CGUIFadeLabelControl(int parentID, int controlID, float posX, float posY, float width, float height, const CLabelInfo& labelInfo, bool scrollOut, unsigned int timeToDelayAtEnd, bool resetOnLabelChange);
42   CGUIFadeLabelControl(const CGUIFadeLabelControl &from);
43   virtual ~CGUIFadeLabelControl(void);
44   virtual CGUIFadeLabelControl *Clone() const { return new CGUIFadeLabelControl(*this); };
45
46   virtual void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions);
47   virtual void Render();
48   virtual bool CanFocus() const;
49   virtual bool OnMessage(CGUIMessage& message);
50
51   void SetInfo(const std::vector<CGUIInfoLabel> &vecInfo);
52
53 protected:
54   virtual bool UpdateColors();
55   virtual CStdString GetDescription() const;
56   void AddLabel(const std::string &label);
57
58   /*! \brief retrieve the current label for display
59
60    The fadelabel has multiple labels which it cycles through. This routine retrieves the current label.
61    It first checks the current label and if non-empty returns it. Otherwise it will iterate through all labels
62    until it has a non-empty label to return.
63
64    \return the label that should be displayed.  If empty, there is no label available.
65    */
66   CStdString GetLabel();
67
68   std::vector< CGUIInfoLabel > m_infoLabels;
69   unsigned int m_currentLabel;
70   unsigned int m_lastLabel;
71
72   CLabelInfo m_label;
73
74   bool m_scrollOut;   // true if we scroll the text all the way to the left before fading in the next label
75   bool m_shortText;   // true if the text we have is shorter than the width of the control
76
77   CScrollInfo m_scrollInfo;
78   CGUITextLayout m_textLayout;
79   CAnimation m_fadeAnim;
80   TransformMatrix m_fadeMatrix;
81   unsigned int m_scrollSpeed;
82   bool m_resetOnLabelChange;
83 };
84 #endif