1 2import "oaidl.idl"; 3import "ocidl.idl"; 4 5typedef enum 6{ 7 MPAA = 0, 8 US_TV = 1, 9 Canadian_English = 2, 10 Canadian_French = 3, 11 Reserved4 = 4, 12 System5 = 5, 13 System6 = 6, 14 Reserved7 = 7, 15 TvRat_kSystems = 8, 16 TvRat_SystemDontKnow = 255 17} EnTvRat_System; 18 19 20typedef enum 21{ 22 TvRat_0 = 0, 23 TvRat_1 = 1, 24 TvRat_2 = 2, 25 TvRat_3 = 3, 26 TvRat_4 = 4, 27 TvRat_5 = 5, 28 TvRat_6 = 6, 29 TvRat_7 = 7, 30 TvRat_kLevels = 8, 31 TvRat_LevelDontKnow = 255 32} EnTvRat_GenericLevel; 33 34 35typedef enum 36{ 37 MPAA_NotApplicable = TvRat_0, 38 MPAA_G = TvRat_1, 39 MPAA_PG = TvRat_2, 40 MPAA_PG13 = TvRat_3, 41 MPAA_R = TvRat_4, 42 MPAA_NC17 = TvRat_5, 43 MPAA_X = TvRat_6, 44 MPAA_NotRated = TvRat_7 45} EnTvRat_MPAA; 46 47typedef enum 48{ 49 US_TV_None = TvRat_0, 50 US_TV_Y = TvRat_1, 51 US_TV_Y7 = TvRat_2, 52 US_TV_G = TvRat_3, 53 US_TV_PG = TvRat_4, 54 US_TV_14 = TvRat_5, 55 US_TV_MA = TvRat_6, 56 US_TV_None7 = TvRat_7 57} EnTvRat_US_TV; 58 59typedef enum 60{ 61 CAE_TV_Exempt = TvRat_0, 62 CAE_TV_C = TvRat_1, 63 CAE_TV_C8 = TvRat_2, 64 CAE_TV_G = TvRat_3, 65 CAE_TV_PG = TvRat_4, 66 CAE_TV_14 = TvRat_5, 67 CAE_TV_18 = TvRat_6, 68 CAE_TV_Reserved = TvRat_7 69} EnTvRat_CAE_TV; 70 71typedef enum 72{ 73 CAF_TV_Exempt = TvRat_0, 74 CAF_TV_G = TvRat_1, 75 CAF_TV_8 = TvRat_2, 76 CAF_TV_13 = TvRat_3, 77 CAF_TV_16 = TvRat_4, 78 CAF_TV_18 = TvRat_5, 79 CAF_TV_Reserved6 = TvRat_6, 80 CAF_TV_Reserved = TvRat_7 81} EnTvRat_CAF_TV; 82 83typedef enum 84{ 85 BfAttrNone = 0, 86 BfIsBlocked = 1, 87 BfIsAttr_1 = 2, 88 BfIsAttr_2 = 4, 89 BfIsAttr_3 = 8, 90 BfIsAttr_4 = 16, 91 BfIsAttr_5 = 32, 92 BfIsAttr_6 = 64, 93 BfIsAttr_7 = 128, 94 BfValidAttrSubmask = 255 95} BfEnTvRat_GenericAttributes; 96 97typedef enum 98{ 99 US_TV_IsBlocked = BfIsBlocked, 100 US_TV_IsViolent = BfIsAttr_1, 101 US_TV_IsSexualSituation = BfIsAttr_2, 102 US_TV_IsAdultLanguage = BfIsAttr_3, 103 US_TV_IsSexuallySuggestiveDialog = BfIsAttr_4, 104 US_TV_ValidAttrSubmask = 31 105} BfEnTvRat_Attributes_US_TV; 106 107typedef enum 108{ 109 MPAA_IsBlocked = BfIsBlocked, 110 MPAA_ValidAttrSubmask = 1 111} BfEnTvRat_Attributes_MPAA; 112 113typedef enum 114{ 115 CAE_IsBlocked = BfIsBlocked, 116 CAE_ValidAttrSubmask = 1 117} BfEnTvRat_Attributes_CAE_TV; 118 119typedef enum 120{ 121 CAF_IsBlocked = BfIsBlocked, 122 CAF_ValidAttrSubmask = 1 123} BfEnTvRat_Attributes_CAF_TV; 124 125 126[ 127 object, 128 uuid(C5C5C5B0-3ABC-11D6-B25B-00C04FA0C026), 129 dual, 130 pointer_default(unique) 131] 132interface IXDSToRat : IDispatch 133{ 134 [id(1)] 135 HRESULT Init(); 136 [id(2)] 137 HRESULT ParseXDSBytePair([in] BYTE byte1, [in] BYTE byte2, [out] EnTvRat_System *pEnSystem, [out] EnTvRat_GenericLevel *pEnLevel, [out] LONG *plBfEnAttributes); 138}; 139 140 141[ 142 object, 143 uuid(C5C5C5B1-3ABC-11D6-B25B-00C04FA0C026), 144 dual, 145 pointer_default(unique) 146] 147interface IEvalRat : IDispatch 148{ 149 [propget, id(1)] 150 HRESULT BlockedRatingAttributes([in] EnTvRat_System enSystem, [in] EnTvRat_GenericLevel enLevel, [out, retval] LONG *plbfAttrs); 151 [propput, id(1)] 152 HRESULT BlockedRatingAttributes([in] EnTvRat_System enSystem, [in] EnTvRat_GenericLevel enLevel, [in] LONG lbfAttrs); 153 [propget, id(2)] 154 HRESULT BlockUnRated([out, retval] BOOL *pfBlockUnRatedShows); 155 [propput, id(2)] 156 HRESULT BlockUnRated([in] BOOL fBlockUnRatedShows); 157 [id(3)] 158 HRESULT MostRestrictiveRating([in] EnTvRat_System enSystem1, [in] EnTvRat_GenericLevel enEnLevel1, [in] LONG lbfEnAttr1, [in] EnTvRat_System enSystem2, [in] EnTvRat_GenericLevel enEnLevel2, [in] LONG lbfEnAttr2, [out] EnTvRat_System *penSystem, [out] EnTvRat_GenericLevel *penEnLevel, [out] LONG *plbfEnAttr); 159 [id(4)] 160 HRESULT TestRating([in] EnTvRat_System enShowSystem, [in] EnTvRat_GenericLevel enShowLevel, [in] LONG lbfEnShowAttributes); 161 162}; 163 164[uuid(C5C5C500-3ABC-11D6-B25B-00C04FA0C026)] 165library TVRATINGSLib 166{ 167 importlib("stdole32.tlb"); 168 importlib("stdole2.tlb"); 169 170 [uuid(C5C5C5F0-3ABC-11D6-B25B-00C04FA0C026)] 171 coclass XDSToRat 172 { 173 [default] interface IXDSToRat; 174 }; 175 [uuid(C5C5C5F1-3ABC-11D6-B25B-00C04FA0C026)] 176 coclass EvalRat 177 { 178 [default] interface IEvalRat; 179 }; 180}; 181 182