2 \file GUIFadeLabelControl.h
6 #ifndef GUILIB_GUIFADELABELCONTROL_H
7 #define GUILIB_GUIFADELABELCONTROL_H
12 * Copyright (C) 2005-2013 Team XBMC
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)
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.
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/>.
31 #include "GUIControl.h"
38 class CGUIFadeLabelControl : public CGUIControl
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); };
46 virtual void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions);
47 virtual void Render();
48 virtual bool CanFocus() const;
49 virtual bool OnMessage(CGUIMessage& message);
51 void SetInfo(const std::vector<CGUIInfoLabel> &vecInfo);
54 virtual bool UpdateColors();
55 virtual CStdString GetDescription() const;
56 void AddLabel(const std::string &label);
58 /*! \brief retrieve the current label for display
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.
64 \return the label that should be displayed. If empty, there is no label available.
66 CStdString GetLabel();
68 std::vector< CGUIInfoLabel > m_infoLabels;
69 unsigned int m_currentLabel;
70 unsigned int m_lastLabel;
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
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;