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
12STDAPI RatingEnable(HWND hwndParent,LPCSTR pszUsername,WINBOOL fEnable);
13STDAPI RatingCheckUserAccess(LPCSTR pszUsername,LPCSTR pszURL,LPCSTR pszRatingInfo,LPBYTE pData,DWORD cbData,void **ppRatingDetails);
14STDAPI RatingAccessDeniedDialog(HWND hDlg,LPCSTR pszUsername,LPCSTR pszContentDescription,void *pRatingDetails);
15STDAPI RatingAccessDeniedDialog2(HWND hDlg,LPCSTR pszUsername,void *pRatingDetails);
16STDAPI RatingFreeDetails(void *pRatingDetails);
17STDAPI RatingObtainCancel(HANDLE hRatingObtainQuery);
18STDAPI RatingObtainQuery(LPCSTR pszTargetUrl,DWORD dwUserData,void (*fCallback)(DWORD dwUserData,HRESULT hr,LPCSTR pszRating,void *lpvRatingDetails),HANDLE *phRatingObtainQuery);
19STDAPI RatingSetupUI(HWND hDlg,LPCSTR pszUsername);
20#ifdef _INC_COMMCTRL
21STDAPI RatingAddPropertyPage(PROPSHEETHEADER *ppsh);
22#endif
23
24STDAPI RatingEnabledQuery();
25STDAPI RatingInit();
26STDAPI_(void) RatingTerm();
27
28static 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
40DECLARE_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