Ginga  0.13.6
 All Classes Namespaces Functions Variables
CodeMap.h
1 /******************************************************************************
2 Este arquivo eh parte da implementacao do ambiente declarativo do middleware
3 Ginga (Ginga-NCL).
4 
5 Direitos Autorais Reservados (c) 1989-2007 PUC-Rio/Laboratorio TeleMidia
6 
7 Este programa eh software livre; voce pode redistribui-lo e/ou modificah-lo sob
8 os termos da Licenca Publica Geral GNU versao 2 conforme publicada pela Free
9 Software Foundation.
10 
11 Este programa eh distribuido na expectativa de que seja util, porem, SEM
12 NENHUMA GARANTIA; nem mesmo a garantia implicita de COMERCIABILIDADE OU
13 ADEQUACAO A UMA FINALIDADE ESPECIFICA. Consulte a Licenca Publica Geral do
14 GNU versao 2 para mais detalhes.
15 
16 Voce deve ter recebido uma copia da Licenca Publica Geral do GNU versao 2 junto
17 com este programa; se nao, escreva para a Free Software Foundation, Inc., no
18 endereco 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
19 
20 Para maiores informacoes:
21 ncl @ telemidia.puc-rio.br
22 http://www.ncl.org.br
23 http://www.ginga.org.br
24 http://www.telemidia.puc-rio.br
25 ******************************************************************************
26 This file is part of the declarative environment of middleware Ginga (Ginga-NCL)
27 
28 Copyright: 1989-2007 PUC-RIO/LABORATORIO TELEMIDIA, All Rights Reserved.
29 
30 This program is free software; you can redistribute it and/or modify it under
31 the terms of the GNU General Public License version 2 as published by
32 the Free Software Foundation.
33 
34 This program is distributed in the hope that it will be useful, but WITHOUT ANY
35 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
36 PARTICULAR PURPOSE. See the GNU General Public License version 2 for more
37 details.
38 
39 You should have received a copy of the GNU General Public License version 2
40 along with this program; if not, write to the Free Software
41 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
42 
43 For further information contact:
44 ncl @ telemidia.puc-rio.br
45 http://www.ncl.org.br
46 http://www.ginga.org.br
47 http://www.telemidia.puc-rio.br
48 *******************************************************************************/
49 
50 #ifndef CODEMAP_H_
51 #define CODEMAP_H_
52 
53 #include <string>
54 #include <map>
55 using namespace std;
56 
57 namespace br {
58 namespace pucrio {
59 namespace telemidia {
60 namespace ginga {
61 namespace core {
62 namespace mb {
63  class CodeMap {
64  public:
65  static const int KEY_QUIT;
66  static const int KEY_NULL;
67  static const int KEY_0;
68  static const int KEY_1;
69  static const int KEY_2;
70  static const int KEY_3;
71  static const int KEY_4;
72  static const int KEY_5;
73  static const int KEY_6;
74  static const int KEY_7;
75  static const int KEY_8;
76  static const int KEY_9;
77 
78  static const int KEY_SMALL_A;
79  static const int KEY_SMALL_B;
80  static const int KEY_SMALL_C;
81  static const int KEY_SMALL_D;
82  static const int KEY_SMALL_E;
83  static const int KEY_SMALL_F;
84  static const int KEY_SMALL_G;
85  static const int KEY_SMALL_H;
86  static const int KEY_SMALL_I;
87  static const int KEY_SMALL_J;
88  static const int KEY_SMALL_K;
89  static const int KEY_SMALL_L;
90  static const int KEY_SMALL_M;
91  static const int KEY_SMALL_N;
92  static const int KEY_SMALL_O;
93  static const int KEY_SMALL_P;
94  static const int KEY_SMALL_Q;
95  static const int KEY_SMALL_R;
96  static const int KEY_SMALL_S;
97  static const int KEY_SMALL_T;
98  static const int KEY_SMALL_U;
99  static const int KEY_SMALL_V;
100  static const int KEY_SMALL_W;
101  static const int KEY_SMALL_X;
102  static const int KEY_SMALL_Y;
103  static const int KEY_SMALL_Z;
104 
105  static const int KEY_CAPITAL_A;
106  static const int KEY_CAPITAL_B;
107  static const int KEY_CAPITAL_C;
108  static const int KEY_CAPITAL_D;
109  static const int KEY_CAPITAL_E;
110  static const int KEY_CAPITAL_F;
111  static const int KEY_CAPITAL_G;
112  static const int KEY_CAPITAL_H;
113  static const int KEY_CAPITAL_I;
114  static const int KEY_CAPITAL_J;
115  static const int KEY_CAPITAL_K;
116  static const int KEY_CAPITAL_L;
117  static const int KEY_CAPITAL_M;
118  static const int KEY_CAPITAL_N;
119  static const int KEY_CAPITAL_O;
120  static const int KEY_CAPITAL_P;
121  static const int KEY_CAPITAL_Q;
122  static const int KEY_CAPITAL_R;
123  static const int KEY_CAPITAL_S;
124  static const int KEY_CAPITAL_T;
125  static const int KEY_CAPITAL_U;
126  static const int KEY_CAPITAL_V;
127  static const int KEY_CAPITAL_W;
128  static const int KEY_CAPITAL_X;
129  static const int KEY_CAPITAL_Y;
130  static const int KEY_CAPITAL_Z;
131 
132  static const int KEY_PAGE_DOWN;
133  static const int KEY_PAGE_UP;
134 
135  static const int KEY_F1;
136  static const int KEY_F2;
137  static const int KEY_F3;
138  static const int KEY_F4;
139  static const int KEY_F5;
140  static const int KEY_F6;
141  static const int KEY_F7;
142  static const int KEY_F8;
143  static const int KEY_F9;
144  static const int KEY_F10;
145  static const int KEY_F11;
146  static const int KEY_F12;
147 
148  static const int KEY_PLUS_SIGN;
149  static const int KEY_MINUS_SIGN;
150 
151  static const int KEY_ASTERISK;
152  static const int KEY_NUMBER_SIGN;
153 
154  static const int KEY_PERIOD;
155 
156  static const int KEY_SUPER;
157  static const int KEY_PRINTSCREEN;
158  static const int KEY_MENU;
159  static const int KEY_INFO;
160  static const int KEY_EPG;
161 
162  static const int KEY_CURSOR_DOWN;
163  static const int KEY_CURSOR_LEFT;
164  static const int KEY_CURSOR_RIGHT;
165  static const int KEY_CURSOR_UP;
166 
167  static const int KEY_CHANNEL_DOWN;
168  static const int KEY_CHANNEL_UP;
169 
170  static const int KEY_VOLUME_DOWN;
171  static const int KEY_VOLUME_UP;
172 
173  static const int KEY_ENTER;
174 
175  static const int KEY_RED;
176  static const int KEY_GREEN;
177  static const int KEY_YELLOW;
178  static const int KEY_BLUE;
179 
180  static const int KEY_SPACE;
181  static const int KEY_BACKSPACE;
182  static const int KEY_BACK;
183  static const int KEY_ESCAPE;
184  static const int KEY_EXIT;
185 
186  static const int KEY_POWER;
187  static const int KEY_REWIND;
188  static const int KEY_STOP;
189  static const int KEY_EJECT;
190  static const int KEY_PLAY;
191  static const int KEY_RECORD;
192  static const int KEY_PAUSE;
193 
194  static const int KEY_GREATER_THAN_SIGN;
195  static const int KEY_LESS_THAN_SIGN;
196 
197  static const int KEY_TAB;
198  static const int KEY_TAP;
199 
200  private:
201  map<string, int> keyMap;
202  map<int, string> valueMap;
203 
204  static CodeMap* _instance;
205  CodeMap();
206 
207  public:
208  static CodeMap* getInstance();
209 
210  int getCode(string codeStr);
211  string getValue(int value);
212  map<string, int>* cloneKeyMap();
213  };
214 }
215 }
216 }
217 }
218 }
219 }
220 
221 #endif /*CODEMAP_H_*/