• BlackBerry Dynamics
  • Runtime library for iOS applications
  • 15.3.8766.41
Loading...
Searching...
No Matches
GDSafeUrl.h
Go to the documentation of this file.
1//
2// Copyright (c) 2019 Blackberry Inc. All rights reserved.
3//
4
5#pragma once
6
7#ifdef __cplusplus
8#include <memory>
9
10
11#ifndef GD_C_API
12# if !defined(_WIN32)
13# define GD_C_API __attribute__((visibility("default")))
14# else
15# define GD_C_API
16# endif
17#endif
18
19namespace GD {
20 class SafeUrl
21
45 {
46 public:
47
53 enum class UrlCheckResult {
56 UNKNOWN = 0,
59 SAFE = 1,
62 UNSAFE = 20
63 };
64
65
70 enum class UrlCheckError {
73 NONE = 0,
76 NETWORK = 1,
79 GENERAL = 2
80 };
81
87
89
90 public:
91
93
94 public:
97 long long reference;
98 };
99
105
107
108 public:
109 virtual void completed( const SafeUrlResultItem& resultItem ) = 0;
110 virtual ~SafeUrlCallback() = default;
111 };
112
113
128 GD_C_API void checkUrl(const std::string &url, const std::weak_ptr<SafeUrlCallback> callback,
129 const long long reference = 0, const bool suppressUserPrompt = false) const;
130
131
132
140 GD_C_API bool isSafeBrowsingEnabled();
141 };
142
143};
144#endif
Callback object returned from SafeURL.
Definition GDSafeUrl.h:106
virtual void completed(const SafeUrlResultItem &resultItem)=0
virtual ~SafeUrlCallback()=default
Item within the SafeURL callback.
Definition GDSafeUrl.h:88
UrlCheckResult result
Definition GDSafeUrl.h:95
UrlCheckError error
Definition GDSafeUrl.h:96
long long reference
Definition GDSafeUrl.h:97
SafeUrlResultItem(const UrlCheckResult &result, const UrlCheckError &error, const long long reference)
Check that URLs are safe using BlackBerry Protect (C++).
Definition GDSafeUrl.h:45
void checkUrl(const std::string &url, const std::weak_ptr< SafeUrlCallback > callback, const long long reference=0, const bool suppressUserPrompt=false) const
This function checks whether or not the url is safe to make an http request.
bool isSafeBrowsingEnabled()
Determine if Safe Browsing is enabled.
UrlCheckError
Error codes from testing if a URL is safe.
Definition GDSafeUrl.h:70
UrlCheckResult
Result codes from testing if a URL is safe.
Definition GDSafeUrl.h:53
Definition GDKerberosAuthHandler.h:17