JSAPI2_Security.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include "JSAPI2_api_security.h"
  3. #include <bfc/platform/types.h>
  4. #include <map>
  5. #include <vector>
  6. #include "JSAPI_Info.h"
  7. namespace JSAPI2
  8. {
  9. class Security : public JSAPI2::api_security
  10. {
  11. public:
  12. ~Security();
  13. static const char *getServiceName() { return "JSAPI2 Security API"; }
  14. static const GUID getServiceGuid() { return api_securityGUID; }
  15. int GetActionAuthorization(const wchar_t *group, const wchar_t *action, const wchar_t *authorization_key, JSAPI::ifc_info *info, int default_authorization = ACTION_UNDEFINED, AuthorizationData *data = 0);
  16. int SetActionAuthorization(const wchar_t *group, const wchar_t *action, const wchar_t *authorization_key, int authorization);
  17. void Associate(const wchar_t *authorization_key, HWND hwnd);
  18. HWND GetAssociation(const wchar_t *authorization_key);
  19. int SecurityPrompt(HWND hwnd, const wchar_t *title_string, const wchar_t *display_string, int flags);
  20. void AssociateName(const wchar_t *authorization_key, const wchar_t *name);
  21. const wchar_t *GetAssociatedName(const wchar_t *authorization_key);
  22. void ResetAuthorization(const wchar_t *authorization_key);
  23. void SetBypass(const wchar_t *authorization_key, bool enable_bypass);
  24. protected:
  25. bool IsAuthorizationBypassed(const wchar_t *authorization_key);
  26. protected:
  27. RECVS_DISPATCH;
  28. private:
  29. typedef std::map<uint32_t, wchar_t*> NameMap;
  30. typedef std::map<uint32_t, void*> AssociationMap;
  31. typedef std::vector<uint32_t> BypassList;
  32. AssociationMap associations;
  33. NameMap names;
  34. BypassList bypassList;
  35. };
  36. extern Security security;
  37. }