blob: 6415871e089b644fe258d61e5962053131cea5e9
1 | // |
2 | // |
3 | // amlogic 2013 |
4 | // |
5 | // @ Project : tv |
6 | // @ File Name : CTvDimension.h |
7 | // @ Date : 2013-11 |
8 | // @ Author : |
9 | // |
10 | // |
11 | |
12 | #if !defined(_CTVDIMENSION_H) |
13 | #define _CTVDIMENSION_H |
14 | #include <utils/Vector.h> |
15 | #include "CTvDatabase.h" |
16 | #include <utils/String8.h> |
17 | #include <stdlib.h> |
18 | |
19 | #include "CTvLog.h" |
20 | |
21 | // TV ATSC rating dimension |
22 | class CTvDimension |
23 | { |
24 | public: |
25 | class VChipRating |
26 | { |
27 | private: |
28 | int region; |
29 | int dimension; |
30 | int value; |
31 | |
32 | public: |
33 | VChipRating(int region, int dimension, int value); |
34 | VChipRating(); |
35 | ~VChipRating(); |
36 | int getRegion(); |
37 | int getDimension(); |
38 | int getValue()const; |
39 | }; |
40 | /* 'All' is a very special case, it links to dimension0 & dimension5 */ |
41 | void createFromCursor(CTvDatabase::Cursor &c); |
42 | static int getUSPGAllLockStatus(String8 abbrev); |
43 | static void setUSPGAllLockStatus(String8 abbrev, int lock); |
44 | static void selectByID(CTvDimension &dm, int id); |
45 | static int selectByIndex(CTvDimension &dm, int ratingRegionID, int index); |
46 | static void selectByName(CTvDimension &dm, int ratingRegionID, String8 dimensionName); |
47 | static void selectByRatingRegion(CTvDimension &dm, int ratingRegionID); |
48 | bool isBlocked(CTvDimension &dm, VChipRating *definedRating); |
49 | int getID(); |
50 | int getRatingRegion(); |
51 | String8 getRatingRegionName(); |
52 | String8 getName(); |
53 | int getGraduatedScale(); |
54 | int getDefinedValue(); |
55 | //int* getLockStatus(); |
56 | int getLockStatus(int valueIndex); |
57 | void getLockStatus(String8 abbrevs[], int lock[], int *array_len); |
58 | int getAbbrev(String8 abb[]); |
59 | String8 getAbbrev(int valueIndex); |
60 | int getText(String8 tx[]); |
61 | String8 getText(int valueIndex); |
62 | void setLockStatus(int valueIndex, int status); |
63 | void setLockStatus(int status[]); |
64 | void setLockStatus(String8 abbrevs[], int locks[], int abb_size); |
65 | /**Rating regions*/ |
66 | public: |
67 | static const int REGION_US = 0x1; |
68 | static const int REGION_CANADA = 0x2; |
69 | static const int REGION_TAIWAN = 0x3; |
70 | static const int REGION_SOUTHKOREA = 0x4; |
71 | |
72 | CTvDimension(CTvDatabase::Cursor &c); |
73 | CTvDimension(); |
74 | ~CTvDimension(); |
75 | |
76 | static void insertNewDimension(const int region, String8 regionName, String8 name, |
77 | int indexj, int *lock, const char **abbrev, const char **text, int size); |
78 | static void builtinAtscDimensions(); |
79 | static int isDimensionTblExist(); |
80 | String8 getCurdimension(); |
81 | String8 getCurAbbr(); |
82 | String8 getCurText(); |
83 | private: |
84 | int id; |
85 | int indexj; |
86 | int ratingRegion; |
87 | int graduatedScale; |
88 | int valuesDefined; |
89 | int *lockValues; |
90 | String8 name; |
91 | String8 ratingRegionName; |
92 | String8 *abbrevValues; |
93 | String8 *textValues; |
94 | bool isPGAll; |
95 | String8 CurvchipDimension; |
96 | String8 CurvchipAbbrev; |
97 | String8 CurvchipText; |
98 | }; |
99 | #endif //_CTVDIMENSION_H |
100 |