[1166] | 1 | /**
|
---|
| 2 | * This file is part of the mingw-w64 runtime package.
|
---|
| 3 | * No warranty is given; refer to the file DISCLAIMER within this package.
|
---|
| 4 | */
|
---|
| 5 | #ifndef _RATINGS_H_
|
---|
| 6 | #define _RATINGS_H_
|
---|
| 7 |
|
---|
| 8 | #include <winapifamily.h>
|
---|
| 9 |
|
---|
| 10 | #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
|
---|
| 11 |
|
---|
| 12 | #include <winerror.h>
|
---|
| 13 | #include <shlwapi.h>
|
---|
| 14 |
|
---|
| 15 | STDAPI RatingEnable(HWND hwndParent,LPCSTR pszUsername,WINBOOL fEnable);
|
---|
| 16 | STDAPI RatingEnableW(HWND hwndParent, LPCWSTR pszUsername, WINBOOL fEnable);
|
---|
| 17 | STDAPI RatingCheckUserAccess(LPCSTR pszUsername,LPCSTR pszURL,LPCSTR pszRatingInfo,LPBYTE pData,DWORD cbData,void **ppRatingDetails);
|
---|
| 18 | STDAPI RatingCheckUserAccessW(LPCWSTR pszUsername, LPCWSTR pszURL, LPCWSTR pszRatingInfo, LPBYTE pData, DWORD cbData, void **ppRatingDetails);
|
---|
| 19 | STDAPI RatingAccessDeniedDialog(HWND hDlg,LPCSTR pszUsername,LPCSTR pszContentDescription,void *pRatingDetails);
|
---|
| 20 | STDAPI RatingAccessDeniedDialog2(HWND hDlg,LPCSTR pszUsername,void *pRatingDetails);
|
---|
| 21 | STDAPI RatingAccessDeniedDialogW(HWND hDlg, LPCWSTR pszUsername, LPCWSTR pszContentDescription, void *pRatingDetails);
|
---|
| 22 | STDAPI RatingFreeDetails(void *pRatingDetails);
|
---|
| 23 | STDAPI RatingObtainCancel(HANDLE hRatingObtainQuery);
|
---|
| 24 | STDAPI RatingObtainQuery(LPCSTR pszTargetUrl,DWORD dwUserData,void (*fCallback)(DWORD dwUserData,HRESULT hr,LPCSTR pszRating,void *lpvRatingDetails),HANDLE *phRatingObtainQuery);
|
---|
| 25 | STDAPI RatingObtainQueryW(LPCWSTR pszTargetUrl, DWORD dwUserData, void (*fCallback) (DWORD dwUserData, HRESULT hr, LPCWSTR pszRating, void *lpvRatingDetails),HANDLE *phRatingObtainQuery);
|
---|
| 26 | STDAPI RatingSetupUI(HWND hDlg,LPCSTR pszUsername);
|
---|
| 27 | STDAPI RatingSetupUIW (HWND hDlg, LPCWSTR pszUsername);
|
---|
| 28 | #ifdef _INC_COMMCTRL
|
---|
| 29 | STDAPI RatingAddPropertyPage(PROPSHEETHEADER *ppsh);
|
---|
| 30 | #endif
|
---|
| 31 |
|
---|
| 32 | STDAPI RatingAddToApprovedSites (HWND hDlg, DWORD cbPasswordBlob, BYTE *pbPasswordBlob, LPCWSTR lpszUrl, WINBOOL fAlwaysNever, WINBOOL fSitePage, WINBOOL fApprovedSitesEnforced);
|
---|
| 33 | STDAPI RatingClickedOnPRFInternal (HWND hWndOwner, HINSTANCE, LPSTR lpszFileName, int nShow);
|
---|
| 34 | STDAPI RatingClickedOnRATInternal (HWND hWndOwner, HINSTANCE, LPSTR lpszFileName, int nShow);
|
---|
| 35 |
|
---|
| 36 | STDAPI RatingEnabledQuery(void);
|
---|
| 37 | STDAPI RatingInit(void);
|
---|
| 38 | STDAPI_(void) RatingTerm(void);
|
---|
| 39 |
|
---|
| 40 | static inline WINBOOL IS_RATINGS_ENABLED() {
|
---|
| 41 | TCHAR sz[200];
|
---|
| 42 | DWORD typ, sz = sizeof (sz);
|
---|
| 43 | return (SHGetValue(HKEY_LOCAL_MACHINE,TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Ratings"),TEXT("Key"), &typ,&sz, &sz) == ERROR_SUCCESS);
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 | #define S_RATING_ALLOW S_OK
|
---|
| 47 | #define S_RATING_DENY S_FALSE
|
---|
| 48 | #define S_RATING_FOUND 0x00000002
|
---|
| 49 | #define E_RATING_NOT_FOUND 0x80000001
|
---|
| 50 |
|
---|
| 51 | #undef INTERFACE
|
---|
| 52 | #define INTERFACE IObtainRating
|
---|
| 53 | DECLARE_INTERFACE_(IObtainRating,IUnknown) {
|
---|
| 54 | #ifndef __cplusplus
|
---|
| 55 | STDMETHOD(QueryInterface) (THIS_ REFIID riid,void **ppvObj) PURE;
|
---|
| 56 | STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
---|
| 57 | STDMETHOD_(ULONG,Release) (THIS) PURE;
|
---|
| 58 | #endif
|
---|
| 59 | STDMETHOD(ObtainRating) (THIS_ LPCSTR pszTargetUrl,HANDLE hAbortEvent,IMalloc *pAllocator,LPSTR *ppRatingOut) PURE;
|
---|
| 60 | STDMETHOD_(ULONG,GetSortOrder) (THIS) PURE;
|
---|
| 61 | };
|
---|
| 62 | #undef INTERFACE
|
---|
| 63 |
|
---|
| 64 | #define RATING_ORDER_REMOTESITE 0x80000000
|
---|
| 65 | #define RATING_ORDER_LOCALLIST 0xC0000000
|
---|
| 66 |
|
---|
| 67 | #endif
|
---|
| 68 | #endif
|
---|