Debian Codegraph @

Source/Core/UICommon/DiscordPresence.h

raw symbols SCIP
1 // Copyright 2018 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 #pragma once
5
6 #include <cstdint>
7 #include <functional>
8 #include <string>
9
10 namespace Discord
11 {
12 // The number is the client ID for Dolphin, it's used for images and the application name
13 const std::string DEFAULT_CLIENT_ID = "455712169795780630";
14
15 class Handler
16 {
17 public:
18 virtual ~Handler();
19 virtual void DiscordJoin() = 0;
20 virtual void DiscordJoinRequest(const char* id, const std::string& discord_tag,
21 const char* avatar) = 0;
22 };
23
24 enum class SecretType
25 {
26 Empty,
27 IPAddress,
28 RoomID,
29 };
30
31 void Init();
32 void InitNetPlayFunctionality(Handler& handler);
33 void CallPendingCallbacks();
34 void UpdateClientID(const std::string& new_client = {});
35 bool UpdateDiscordPresenceRaw(const std::string& details = {}, const std::string& state = {},
36 const std::string& large_image_key = {},
37 const std::string& large_image_text = {},
38 const std::string& small_image_key = {},
39 const std::string& small_image_text = {},
40 const int64_t start_timestamp = 0, const int64_t end_timestamp = 0,
41 const int party_size = 0, const int party_max = 0);
42 void UpdateDiscordPresence(int party_size = 0, SecretType type = SecretType::Empty,
43 const std::string& secret = {}, const std::string& current_game = {},
44 const bool reset_timer = false);
45 std::string CreateSecretFromIPAddress(const std::string& ip_address, int port);
46 void Shutdown();
47 void SetDiscordPresenceEnabled(bool enabled);
48 } // namespace Discord