summaryrefslogtreecommitdiffstats
path: root/src/core/hle/applets/applet.h
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2015-05-26 06:30:20 +0200
committerSubv <subv2112@gmail.com>2015-07-12 04:47:22 +0200
commit2a6ebadf66051362cdcf07d722f7e2d3cee14c82 (patch)
treef016b2ee81df95aabccc426762c42073d645803c /src/core/hle/applets/applet.h
parentMerge pull request #914 from yuriks/bitfield-mask (diff)
downloadyuzu-2a6ebadf66051362cdcf07d722f7e2d3cee14c82.tar
yuzu-2a6ebadf66051362cdcf07d722f7e2d3cee14c82.tar.gz
yuzu-2a6ebadf66051362cdcf07d722f7e2d3cee14c82.tar.bz2
yuzu-2a6ebadf66051362cdcf07d722f7e2d3cee14c82.tar.lz
yuzu-2a6ebadf66051362cdcf07d722f7e2d3cee14c82.tar.xz
yuzu-2a6ebadf66051362cdcf07d722f7e2d3cee14c82.tar.zst
yuzu-2a6ebadf66051362cdcf07d722f7e2d3cee14c82.zip
Diffstat (limited to 'src/core/hle/applets/applet.h')
-rw-r--r--src/core/hle/applets/applet.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/core/hle/applets/applet.h b/src/core/hle/applets/applet.h
new file mode 100644
index 000000000..221348d9c
--- /dev/null
+++ b/src/core/hle/applets/applet.h
@@ -0,0 +1,53 @@
+// Copyright 2015 Citra Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include "common/common_types.h"
+#include "core/hle/kernel/kernel.h"
+#include "core/hle/kernel/shared_memory.h"
+#include "core/hle/service/apt/apt.h"
+
+namespace HLE {
+namespace Applets {
+
+class Applet {
+public:
+ virtual ~Applet() {};
+ Applet(Service::APT::AppletId id) : id(id) {};
+
+ /**
+ * Creates an instance of the Applet subclass identified by the parameter
+ * and stores it in a global map.
+ * @param id Id of the applet to create
+ * @returns ResultCode Whether the operation was successful or not
+ */
+ static ResultCode Create(Service::APT::AppletId id);
+
+ /**
+ * Retrieves the Applet instance identified by the specified id
+ * @param id Id of the Applet to retrieve
+ * @returns Requested Applet or nullptr if not found
+ */
+ static std::shared_ptr<Applet> Get(Service::APT::AppletId id);
+
+ /**
+ * Handles a parameter from the application
+ * @param parameter Parameter data to handle
+ * @returns ResultCode Whether the operation was successful or not
+ */
+ virtual ResultCode ReceiveParameter(Service::APT::MessageParameter const& parameter) = 0;
+
+ /**
+ * Handles the Applet start event, triggered from the application
+ * @param parameter Parameter data to handle
+ * @returns ResultCode Whether the operation was successful or not
+ */
+ virtual ResultCode Start(Service::APT::AppletStartupParameter const& parameter) = 0;
+
+ Service::APT::AppletId id; ///< Id of this Applet
+};
+
+}
+} // namespace