Home | History | Annotate | Download | only in include
      1 /**
      2  * This file has no copyright assigned and is placed in the Public Domain.
      3  * This file is part of the mingw-w64 runtime package.
      4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
      5  */
      6 #ifndef _RATINGS_H_
      7 #define _RATINGS_H_
      8 
      9 #include <winerror.h>
     10 #include <shlwapi.h>
     11 
     12 STDAPI RatingEnable(HWND hwndParent,LPCSTR pszUsername,WINBOOL fEnable);
     13 STDAPI RatingCheckUserAccess(LPCSTR pszUsername,LPCSTR pszURL,LPCSTR pszRatingInfo,LPBYTE pData,DWORD cbData,void **ppRatingDetails);
     14 STDAPI RatingAccessDeniedDialog(HWND hDlg,LPCSTR pszUsername,LPCSTR pszContentDescription,void *pRatingDetails);
     15 STDAPI RatingAccessDeniedDialog2(HWND hDlg,LPCSTR pszUsername,void *pRatingDetails);
     16 STDAPI RatingFreeDetails(void *pRatingDetails);
     17 STDAPI RatingObtainCancel(HANDLE hRatingObtainQuery);
     18 STDAPI RatingObtainQuery(LPCSTR pszTargetUrl,DWORD dwUserData,void (*fCallback)(DWORD dwUserData,HRESULT hr,LPCSTR pszRating,void *lpvRatingDetails),HANDLE *phRatingObtainQuery);
     19 STDAPI RatingSetupUI(HWND hDlg,LPCSTR pszUsername);
     20 #ifdef _INC_COMMCTRL
     21 STDAPI RatingAddPropertyPage(PROPSHEETHEADER *ppsh);
     22 #endif
     23 
     24 STDAPI RatingEnabledQuery();
     25 STDAPI RatingInit();
     26 STDAPI_(void) RatingTerm();
     27 
     28 static inline WINBOOL IS_RATINGS_ENABLED() {
     29   TCHAR szSup[200];
     30   DWORD dwType;
     31   DWORD cbSize = sizeof(szSup);
     32   return (SHGetValue(HKEY_LOCAL_MACHINE,TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Ratings"),TEXT("Key"),&dwType,&szSup,&cbSize)==ERROR_SUCCESS);
     33 }
     34 
     35 #define S_RATING_ALLOW S_OK
     36 #define S_RATING_DENY S_FALSE
     37 #define S_RATING_FOUND 0x00000002
     38 #define E_RATING_NOT_FOUND 0x80000001
     39 
     40 DECLARE_INTERFACE_(IObtainRating,IUnknown) {
     41   STDMETHOD(QueryInterface) (THIS_ REFIID riid,void **ppvObj) PURE;
     42   STDMETHOD_(ULONG,AddRef) (THIS) PURE;
     43   STDMETHOD_(ULONG,Release) (THIS) PURE;
     44   STDMETHOD(ObtainRating) (THIS_ LPCSTR pszTargetUrl,HANDLE hAbortEvent,IMalloc *pAllocator,LPSTR *ppRatingOut) PURE;
     45   STDMETHOD_(ULONG,GetSortOrder) (THIS) PURE;
     46 };
     47 
     48 #define RATING_ORDER_REMOTESITE 0x80000000
     49 #define RATING_ORDER_LOCALLIST 0xC0000000
     50 #endif
     51