RDK Documentation (Open Sourced RDK Components)
frontPanelTextDisplay.hpp
Go to the documentation of this file.
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 
21 /**
22 * @defgroup devicesettings
23 * @{
24 * @defgroup ds
25 * @{
26 **/
27 
28 
29 #ifndef _DS_FRONTPANELTEXTDISPLAY_HPP_
30 #define _DS_FRONTPANELTEXTDISPLAY_HPP_
31 
32 #include "dsConstant.hpp"
33 #include "list"
34 #include "frontPanelIndicator.hpp"
35 
36 
37 /**
38  * @file frontPanelTextDisplay.hpp
39  * @brief Classes and structures for front panel text display are defined here.
40  * @ingroup frontPanelTextDisplay
41  */
42 using namespace std;
43 
44 namespace device {
45 
46 
47 /**
48  * @class FrontPanelTextDisplay
49  * @brief This class extents FrontPanelIndicator to manage front panel text display mode,
50  * scrolling and its brightness.
51  * @ingroup devicesettingsclass
52  */
54 public:
55 
56 
57 /**
58  * @class FrontPanelTextDisplay::Mode
59  * @brief This class extents DSConstant to mange the front panel text display mode like time display mode or text display mode etc...
60  * @ingroup devicesettingsclass
61  */
62  class Mode : public DSConstant{
63  public:
64  Mode (int id);
65  ~Mode ();
66  };
67 
68 
69 /**
70  * @class FrontPanelTextDisplay::Scroll
71  * @brief To manage front panel text display scrolling.
72  * @ingroup devicesettingsclass
73  */
74  class Scroll {
75  int _vIterations; //!< Indicates vertical iterations of scrolling for text display.
76  int _hIterations; //!< Indicates horizontal iterations of scrolling for text display.
77  int _holdDuragion; //!< Indicates the hold duration for LED while scrolling.
78  public:
79 
80 
81 /**
82  * @fn FrontPanelTextDisplay::Scroll::Scroll (int vIterations = 0, int hIterations = 0, int holdDuration = 0)
83  * @brief This function is a parameterised constructor of Scroll class. It initializes the scroll parameters
84  * with the specified values. If the values are not passed then it sets the scroll parameters of the instance
85  * to 0.
86  *
87  * @param[in] vIterations Indicates the vertical iterations for scrolling.
88  * @param[in] hIterations Indicates the horizontal iterations for scrolling.
89  * @param[in] holdDuration Indicates the hold duration of LED while scrolling.
90  *
91  * @return None
92  */
93  Scroll (int vIterations = 0, int hIterations = 0, int holdDuration = 0) {
94  _vIterations = vIterations;
95  _hIterations = hIterations;
96  _holdDuragion = holdDuration;
97  }
98 
99 
100 /**
101  * @fn FrontPanelTextDisplay::Scroll::getVerticalIteration() const
102  * @brief This API gets the vertical iterations for front panel text display scrolling
103  *
104  * @return _vIterations Indicates the vertical iterations for scrolling
105  */
106  int getVerticalIteration() const {return _vIterations;};
107 
108 
109 /**
110  * @fn FrontPanelTextDisplay::Scroll::getHorizontalIteration() const
111  * @brief This API gets the horizontal iterations for front panel text display scrolling
112  *
113  * @return _hIterations Indicates the horizontal iterations for scrolling
114  */
115  int getHorizontalIteration() const {return _hIterations;};
116 
117 
118 /**
119  * @fn FrontPanelTextDisplay::Scroll::getHoldDuration() const
120  * @brief This API gets the hold duration for front panel text display scrolling
121  *
122  * @return _holdDuragion Indicates the hold duration for scrolling
123  */
124  int getHoldDuration() const {return _holdDuragion;};
125  };
126 
127 private:
128  Scroll _scroll; //!< Indicates scroll properties.
129  int _timeFormat; //!< Indicates time format for the clock display.
130  int _TextBrightness; //!< Indicates text brightness.
131  static const char * kPropertyBrightness;
132 
133 public:
134  static const int kModeClock12Hr; //!< Indicates 12 hour time format.
135  static const int kModeClock24Hr; //!< Indicates 24 hour time format.
136  static const int kModeString; //!< Indicates text string.
137  static FrontPanelTextDisplay & getInstance(int id);
138  static FrontPanelTextDisplay & getInstance(const string &name);
139 
140  int getTextBrightness();
141  void getTextBrightnessLevels(int &levels, int &min, int &max);
142  int getTextColorMode();
143  void setTextBrightness(const int &brightness);
144  void enableDisplay(const int enable);
145 
146 
147 /**
148  * @fn Scroll getScroll() const
149  * @brief This API gets the scroll parameters for front panel display like vertical & horizontal iterations and hold duration
150  *
151  * @return _scroll Returns scroll parameters for front panel display
152  */
153  const Scroll getScroll() const {return _scroll;};
154 
155 
156 /**
157  * @fn getCurrentTimeFormat ()
158  * @brief This API gets the currently set time format for front panel display
159  *
160  * @return _timeFormat Indicates the time format
161  * @retval 0 Indicates 12hr format
162  * @retval 1 Indicates 24hr format
163  */
164  int getCurrentTimeFormat () ;
165 
166  void setScroll(const Scroll & scroll);
167  void setText(const std::string &text);
168  void setTimeFormat(const int iTimeFormat);
169  void setTime(const int uiHours, const int uiMinutes);
170 
171 
172 /**
173  * @fn setMode(int mode)
174  * @brief This API sets the display mode of the LED display to any, text only or clock only.
175  *
176  * @param[in] mode Indicates display mode.
177  * <ul>
178  * <li> 0 indicates both text and clock are supported (default mode).
179  * <li> 1 indicates only text mode is supported (trying to set clock results in no change).
180  * <li> 2 indicates only clock mode is supported (trying to set text results in no change).
181  * </ul>
182  *
183  * @return None
184  */
185  void setMode(int mode);
186 
187 
188  FrontPanelTextDisplay(int id, int maxBrightness, int maxCycleRate, int levels,
189  int maxHorizontalIterations, int maxVerticalIterations,
190  const std::string &supportedCharacters,int colorMode);
191 
192  virtual ~FrontPanelTextDisplay();
193 
194 
195 };
196 
197 }
198 
199 #endif /* _DS_FRONTPANELTEXTDISPLAY_HPP_ */
200 
201 
202 /** @} */
203 /** @} */
device::FrontPanelTextDisplay::getScroll
const Scroll getScroll() const
This API gets the scroll parameters for front panel display like vertical & horizontal iterations and...
Definition: frontPanelTextDisplay.hpp:153
device::FrontPanelTextDisplay::Scroll::Scroll
Scroll(int vIterations=0, int hIterations=0, int holdDuration=0)
This function is a parameterised constructor of Scroll class. It initializes the scroll parameters wi...
Definition: frontPanelTextDisplay.hpp:93
dsConstant.hpp
This file defines DSConstant class which is inherited by most of the device settings classes.
Scroll
To manage front panel text display scrolling.
device::FrontPanelTextDisplay::Scroll::getVerticalIteration
int getVerticalIteration() const
This API gets the vertical iterations for front panel text display scrolling.
Definition: frontPanelTextDisplay.hpp:106
device::FrontPanelTextDisplay::Scroll
Definition: frontPanelTextDisplay.hpp:74
device::FrontPanelTextDisplay::Scroll::getHorizontalIteration
int getHorizontalIteration() const
This API gets the horizontal iterations for front panel text display scrolling.
Definition: frontPanelTextDisplay.hpp:115
device::FrontPanelTextDisplay::Scroll::_vIterations
int _vIterations
Indicates vertical iterations of scrolling for text display.
Definition: frontPanelTextDisplay.hpp:75
device::DSConstant
This class is used to store and manage the names and id's. It is derived by many classes like VideoRe...
Definition: dsConstant.hpp:52
frontPanelIndicator.hpp
Structures and classes for front panel indicator are defined here.
device::FrontPanelTextDisplay::_TextBrightness
int _TextBrightness
Indicates text brightness.
Definition: frontPanelTextDisplay.hpp:130
device::FrontPanelTextDisplay::kModeClock24Hr
static const int kModeClock24Hr
Indicates 24 hour time format.
Definition: frontPanelTextDisplay.hpp:135
device::FrontPanelTextDisplay::Scroll::_hIterations
int _hIterations
Indicates horizontal iterations of scrolling for text display.
Definition: frontPanelTextDisplay.hpp:76
device::FrontPanelTextDisplay::_scroll
Scroll _scroll
Indicates scroll properties.
Definition: frontPanelTextDisplay.hpp:128
device::FrontPanelTextDisplay::Scroll::getHoldDuration
int getHoldDuration() const
This API gets the hold duration for front panel text display scrolling.
Definition: frontPanelTextDisplay.hpp:124
device::FrontPanelTextDisplay::Mode
Definition: frontPanelTextDisplay.hpp:62
device::FrontPanelTextDisplay::kModeString
static const int kModeString
Indicates text string.
Definition: frontPanelTextDisplay.hpp:136
device::FrontPanelTextDisplay::Scroll::_holdDuragion
int _holdDuragion
Indicates the hold duration for LED while scrolling.
Definition: frontPanelTextDisplay.hpp:77
device::FrontPanelTextDisplay::kModeClock12Hr
static const int kModeClock12Hr
Indicates 12 hour time format.
Definition: frontPanelTextDisplay.hpp:134
device::FrontPanelIndicator
This class extents DSConstant to manage front panel indicators color, blink sequence and brightness.
Definition: frontPanelIndicator.hpp:55
device::FrontPanelTextDisplay
This class extents FrontPanelIndicator to manage front panel text display mode, scrolling and its bri...
Definition: frontPanelTextDisplay.hpp:53
device::FrontPanelTextDisplay::_timeFormat
int _timeFormat
Indicates time format for the clock display.
Definition: frontPanelTextDisplay.hpp:129