Added webConfigSetAlbumEntry and webConfigSetApplicationAlbumEntry.

This commit is contained in:
yellows8 2019-03-01 22:17:11 -05:00
parent bbd0dcbd2b
commit dc3cf7084e
2 changed files with 29 additions and 0 deletions

View File

@ -7,6 +7,7 @@
#pragma once
#include "../types.h"
#include "../services/applet.h"
#include "../services/caps.h"
/// This indicates the type of web-applet.
typedef enum {
@ -226,6 +227,14 @@ Result webConfigSetWhitelist(WebCommonConfig* config, const char* whitelist);
*/
Result webConfigSetUserID(WebCommonConfig* config, u128 userID);
/**
* @brief Sets the CapsAlbumEntry.
* @note Only available with config created by \ref webShareCreate.
* @param config WebCommonConfig object.
* @param entry \ref CapsAlbumEntry
*/
Result webConfigSetAlbumEntry(WebCommonConfig* config, CapsAlbumEntry *entry);
/**
* @brief Sets the ScreenShot flag, which controls whether screen-shot capture is allowed.
* @note Only available with config created by \ref webPageCreate.
@ -340,6 +349,14 @@ Result webConfigSetMediaPlayerUserGestureRestriction(WebCommonConfig* config, bo
*/
Result webConfigSetLobbyParameter(WebCommonConfig* config, const char* str);
/**
* @brief Sets the CapsApplicationAlbumEntry.
* @note Only available with config created by \ref webShareCreate on [3.0.0+].
* @param config WebCommonConfig object.
* @param entry \ref CapsApplicationAlbumEntry
*/
Result webConfigSetApplicationAlbumEntry(WebCommonConfig* config, CapsApplicationAlbumEntry *entry);
/**
* @brief Sets whether JsExtension is enabled.
* @note Only available with config created by \ref webPageCreate or with Offline-applet, on [3.0.0+].

View File

@ -2,6 +2,7 @@
#include <malloc.h>
#include "types.h"
#include "result.h"
#include "services/caps.h"
#include "services/applet.h"
#include "applets/libapplet.h"
#include "applets/web.h"
@ -322,6 +323,11 @@ Result webConfigSetUserID(WebCommonConfig* config, u128 userID) {
return _webTLVSet(config, WebArgType_UserID, &userID, sizeof(userID));
}
Result webConfigSetAlbumEntry(WebCommonConfig* config, CapsAlbumEntry *entry) {
if (_webGetShimKind(config) != WebShimKind_Share) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
return _webTLVSet(config, WebArgType_AlbumEntry, entry, sizeof(*entry));
}
Result webConfigSetScreenShot(WebCommonConfig* config, bool flag) {
if (_webGetShimKind(config) != WebShimKind_Web) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
return _webConfigSetFlag(config, WebArgType_ScreenShot, flag);
@ -411,6 +417,12 @@ Result webConfigSetLobbyParameter(WebCommonConfig* config, const char* str) {
return _webConfigSetString(config, WebArgType_LobbyParameter, str, 0x100);
}
Result webConfigSetApplicationAlbumEntry(WebCommonConfig* config, CapsApplicationAlbumEntry *entry) {
if (_webGetShimKind(config) != WebShimKind_Share) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
if (hosversionBefore(3,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _webTLVSet(config, WebArgType_ApplicationAlbumEntry, entry, sizeof(*entry));
}
Result webConfigSetJsExtension(WebCommonConfig* config, bool flag) {
WebShimKind shim = _webGetShimKind(config);
if (shim != WebShimKind_Offline && shim != WebShimKind_Web) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);