-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVkApi.Authenticator.pas
55 lines (42 loc) · 1.28 KB
/
VkApi.Authenticator.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
unit VkApi.Authenticator;
interface
uses
REST.Authenticator.OAuth, REST.Utils, VkApi.Types, VkApi.Utils;
type
TVkAuthenticator = class(TOAuth2Authenticator)
private
FDisplay: TVkDisplayType;
FApiVersion: TVkApiVersion;
procedure SetDisplay(const Value: TVkDisplayType);
procedure SetApiVersion(const Value: TVkApiVersion);
public
property Display: TVkDisplayType read FDisplay write SetDisplay;
property ApiVersion: TVkApiVersion read FApiVersion write SetApiVersion;
function AuthorizationRequestURI: string;
end;
implementation
{ TVkAuthenticator }
function TVkAuthenticator.AuthorizationRequestURI: string;
begin
Result := inherited AuthorizationRequestURI;
Result := Result + '&display=' + URIEncode(VkDisplayTypeToString(
FDisplay));
Result := Result + '&v=' + URIEncode(VkApiVersionToString(FApiVersion));
end;
procedure TVkAuthenticator.SetApiVersion(const Value: TVkApiVersion);
begin
if (Value <> FApiVersion) then
begin
FApiVersion := Value;
PropertyValueChanged;
end;
end;
procedure TVkAuthenticator.SetDisplay(const Value: TVkDisplayType);
begin
if (Value <> FDisplay) then
begin
FDisplay := Value;
PropertyValueChanged;
end;
end;
end.