Overte C++ Documentation
DiscordRichPresence.h
1 //
2 // DiscordRichPresence.h
3 // interface/src
4 //
5 // Created by Julian Groß on 30th October 2023.
6 // Copyright 2023 Overte e.V.
7 //
8 // Distributed under the Apache License, Version 2.0.
9 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10 // SPDX-License-Identifier: Apache-2.0
11 //
12 
13 #ifndef overte_DiscordPresence_h
14 #define overte_DiscordPresence_h
15 
16 #include "discord_rpc.h"
17 #include <QtCore/QLoggingCategory>
18 #include <QtCore/QObject>
19 
20 Q_DECLARE_LOGGING_CATEGORY(discord_rich_presence)
21 
22 class DiscordPresence : public QObject {
23  Q_OBJECT
24 public:
25  DiscordPresence();
26  void shutdown();
27 
28  void setEnabled(bool enable);
29  bool getEnabled() const { return enabled; }
30 
31 public slots:
32  void domainChanged();
33  void vrChanged(bool isHMDMode);
34 
35 private:
36  void startup();
37 
38  bool enabled { true };
39  bool running { false };
40  QString currentDomainID;
41  DiscordRichPresence discordPresence{};
42 };
43 
44 #endif