Bug 1943650 - Command-line --help output misformatted after --dbus-service. r=emilio
[gecko.git] / toolkit / components / remote / nsDBusRemoteServer.h
blob91c30ee76e67cb5bfd2abf925f4672566f86cb3a
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:expandtab:shiftwidth=2:tabstop=2:
3 */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #ifndef __nsDBusRemoteServer_h__
9 #define __nsDBusRemoteServer_h__
11 #include "nsRemoteServer.h"
12 #include "nsUnixRemoteServer.h"
13 #include "mozilla/DBusHelpers.h"
14 #include "mozilla/Span.h"
16 #include <gio/gio.h>
17 #include "mozilla/RefPtr.h"
18 #include "mozilla/GRefPtr.h"
20 class nsDBusRemoteServer final : public nsRemoteServer,
21 public nsUnixRemoteServer {
22 public:
23 ~nsDBusRemoteServer() override { Shutdown(); }
25 nsresult Startup(const char* aAppName, const char* aProfileName) override;
26 void Shutdown() override;
28 void OnBusAcquired(GDBusConnection* aConnection);
29 void OnNameAcquired(GDBusConnection* aConnection);
30 void OnNameLost(GDBusConnection* aConnection);
32 bool HandleOpenURL(const gchar* aInterfaceName, const gchar* aMethodName,
33 mozilla::Span<const gchar> aParam);
35 private:
36 uint mDBusID = 0;
37 uint mRegistrationId = 0;
38 GDBusConnection* mConnection = nullptr;
39 RefPtr<GDBusNodeInfo> mIntrospectionData;
41 nsCString mAppName;
42 nsCString mPathName;
45 #endif // __nsDBusRemoteServer_h__