Copy as Markdown

Other Tools

/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM $SRCDIR/xpcom/system/nsIGIOService.idl
*/
#ifndef __gen_nsIGIOService_h__
#define __gen_nsIGIOService_h__
#include "nsISupports.h"
#include "nsIMIMEInfo.h"
#include "js/GCAnnotations.h"
#include "mozilla/AlreadyAddRefed.h"
#include "mozilla/Assertions.h"
#include "mozilla/DebugOnly.h"
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsIUTF8StringEnumerator; /* forward declaration */
class nsIURI; /* forward declaration */
class nsIFile; /* forward declaration */
class nsIMutableArray; /* forward declaration */
/* starting interface: nsIGIOMimeApp */
#define NS_IGIOMIMEAPP_IID_STR "ca6bad0c-8a48-48ac-82c7-27bb8f510fbe"
#define NS_IGIOMIMEAPP_IID \
{0xca6bad0c, 0x8a48, 0x48ac, \
{ 0x82, 0xc7, 0x27, 0xbb, 0x8f, 0x51, 0x0f, 0xbe }}
class NS_NO_VTABLE nsIGIOMimeApp : public nsIHandlerApp {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IGIOMIMEAPP_IID)
/* Used by ToJSValue to check which scriptable interface is implemented. */
using ScriptableInterfaceType = nsIGIOMimeApp;
enum {
EXPECTS_URIS = 0,
EXPECTS_PATHS = 1,
EXPECTS_URIS_FOR_NON_FILES = 2
};
/* readonly attribute AUTF8String id; */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetId(nsACString& aId) = 0;
/* readonly attribute AUTF8String command; */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetCommand(nsACString& aCommand) = 0;
/* readonly attribute long expectsURIs; */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetExpectsURIs(int32_t *aExpectsURIs) = 0;
/* readonly attribute nsIUTF8StringEnumerator supportedURISchemes; */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetSupportedURISchemes(nsIUTF8StringEnumerator **aSupportedURISchemes) = 0;
/* void setAsDefaultForMimeType (in AUTF8String mimeType); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD SetAsDefaultForMimeType(const nsACString& mimeType) = 0;
/* void setAsDefaultForFileExtensions (in AUTF8String extensions); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD SetAsDefaultForFileExtensions(const nsACString& extensions) = 0;
/* void setAsDefaultForURIScheme (in AUTF8String uriScheme); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD SetAsDefaultForURIScheme(const nsACString& uriScheme) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIGIOMimeApp, NS_IGIOMIMEAPP_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIGIOMIMEAPP \
NS_IMETHOD GetId(nsACString& aId) override; \
NS_IMETHOD GetCommand(nsACString& aCommand) override; \
NS_IMETHOD GetExpectsURIs(int32_t *aExpectsURIs) override; \
NS_IMETHOD GetSupportedURISchemes(nsIUTF8StringEnumerator **aSupportedURISchemes) override; \
NS_IMETHOD SetAsDefaultForMimeType(const nsACString& mimeType) override; \
NS_IMETHOD SetAsDefaultForFileExtensions(const nsACString& extensions) override; \
NS_IMETHOD SetAsDefaultForURIScheme(const nsACString& uriScheme) override;
/* Use this macro when declaring the members of this interface when the
class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIGIOMIMEAPP \
nsresult GetId(nsACString& aId); \
nsresult GetCommand(nsACString& aCommand); \
nsresult GetExpectsURIs(int32_t *aExpectsURIs); \
nsresult GetSupportedURISchemes(nsIUTF8StringEnumerator **aSupportedURISchemes); \
nsresult SetAsDefaultForMimeType(const nsACString& mimeType); \
nsresult SetAsDefaultForFileExtensions(const nsACString& extensions); \
nsresult SetAsDefaultForURIScheme(const nsACString& uriScheme);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIGIOMIMEAPP(_to) \
NS_IMETHOD GetId(nsACString& aId) override { return _to GetId(aId); } \
NS_IMETHOD GetCommand(nsACString& aCommand) override { return _to GetCommand(aCommand); } \
NS_IMETHOD GetExpectsURIs(int32_t *aExpectsURIs) override { return _to GetExpectsURIs(aExpectsURIs); } \
NS_IMETHOD GetSupportedURISchemes(nsIUTF8StringEnumerator **aSupportedURISchemes) override { return _to GetSupportedURISchemes(aSupportedURISchemes); } \
NS_IMETHOD SetAsDefaultForMimeType(const nsACString& mimeType) override { return _to SetAsDefaultForMimeType(mimeType); } \
NS_IMETHOD SetAsDefaultForFileExtensions(const nsACString& extensions) override { return _to SetAsDefaultForFileExtensions(extensions); } \
NS_IMETHOD SetAsDefaultForURIScheme(const nsACString& uriScheme) override { return _to SetAsDefaultForURIScheme(uriScheme); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIGIOMIMEAPP(_to) \
NS_IMETHOD GetId(nsACString& aId) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetId(aId); } \
NS_IMETHOD GetCommand(nsACString& aCommand) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCommand(aCommand); } \
NS_IMETHOD GetExpectsURIs(int32_t *aExpectsURIs) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetExpectsURIs(aExpectsURIs); } \
NS_IMETHOD GetSupportedURISchemes(nsIUTF8StringEnumerator **aSupportedURISchemes) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSupportedURISchemes(aSupportedURISchemes); } \
NS_IMETHOD SetAsDefaultForMimeType(const nsACString& mimeType) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAsDefaultForMimeType(mimeType); } \
NS_IMETHOD SetAsDefaultForFileExtensions(const nsACString& extensions) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAsDefaultForFileExtensions(extensions); } \
NS_IMETHOD SetAsDefaultForURIScheme(const nsACString& uriScheme) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAsDefaultForURIScheme(uriScheme); }
/* starting interface: nsIGIOService */
#define NS_IGIOSERVICE_IID_STR "eda22a30-84e1-4e16-9ca0-cd1553c2b34a"
#define NS_IGIOSERVICE_IID \
{0xeda22a30, 0x84e1, 0x4e16, \
{ 0x9c, 0xa0, 0xcd, 0x15, 0x53, 0xc2, 0xb3, 0x4a }}
class NS_NO_VTABLE nsIGIOService : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IGIOSERVICE_IID)
/* Used by ToJSValue to check which scriptable interface is implemented. */
using ScriptableInterfaceType = nsIGIOService;
/* AUTF8String getMimeTypeFromExtension (in AUTF8String extension); */
NS_IMETHOD GetMimeTypeFromExtension(const nsACString& extension, nsACString& _retval) = 0;
/* nsIHandlerApp getAppForURIScheme (in AUTF8String aURIScheme); */
NS_IMETHOD GetAppForURIScheme(const nsACString& aURIScheme, nsIHandlerApp **_retval) = 0;
/* nsIMutableArray getAppsForURIScheme (in AUTF8String aURIScheme); */
NS_IMETHOD GetAppsForURIScheme(const nsACString& aURIScheme, nsIMutableArray **_retval) = 0;
/* nsIHandlerApp getAppForMimeType (in AUTF8String mimeType); */
NS_IMETHOD GetAppForMimeType(const nsACString& mimeType, nsIHandlerApp **_retval) = 0;
/* nsIGIOMimeApp createAppFromCommand (in AUTF8String cmd, in AUTF8String appName); */
NS_IMETHOD CreateAppFromCommand(const nsACString& cmd, const nsACString& appName, nsIGIOMimeApp **_retval) = 0;
/* nsIGIOMimeApp findAppFromCommand (in AUTF8String cmd); */
NS_IMETHOD FindAppFromCommand(const nsACString& cmd, nsIGIOMimeApp **_retval) = 0;
/* AUTF8String getDescriptionForMimeType (in AUTF8String mimeType); */
NS_IMETHOD GetDescriptionForMimeType(const nsACString& mimeType, nsACString& _retval) = 0;
/* [infallible] readonly attribute boolean isRunningUnderFlatpak; */
NS_IMETHOD GetIsRunningUnderFlatpak(bool *aIsRunningUnderFlatpak) = 0;
inline bool GetIsRunningUnderFlatpak()
{
bool result;
mozilla::DebugOnly<nsresult> rv = GetIsRunningUnderFlatpak(&result);
MOZ_ASSERT(NS_SUCCEEDED(rv));
return result;
}
/* [infallible] readonly attribute boolean isRunningUnderSnap; */
NS_IMETHOD GetIsRunningUnderSnap(bool *aIsRunningUnderSnap) = 0;
inline bool GetIsRunningUnderSnap()
{
bool result;
mozilla::DebugOnly<nsresult> rv = GetIsRunningUnderSnap(&result);
MOZ_ASSERT(NS_SUCCEEDED(rv));
return result;
}
/* [noscript] void showURI (in nsIURI uri); */
NS_IMETHOD ShowURI(nsIURI *uri) = 0;
/* [noscript] void revealFile (in nsIFile file); */
NS_IMETHOD RevealFile(nsIFile *file) = 0;
/* [noscript] void launchFile (in ACString path); */
NS_IMETHOD LaunchFile(const nsACString& path) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIGIOService, NS_IGIOSERVICE_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIGIOSERVICE \
NS_IMETHOD GetMimeTypeFromExtension(const nsACString& extension, nsACString& _retval) override; \
NS_IMETHOD GetAppForURIScheme(const nsACString& aURIScheme, nsIHandlerApp **_retval) override; \
NS_IMETHOD GetAppsForURIScheme(const nsACString& aURIScheme, nsIMutableArray **_retval) override; \
NS_IMETHOD GetAppForMimeType(const nsACString& mimeType, nsIHandlerApp **_retval) override; \
NS_IMETHOD CreateAppFromCommand(const nsACString& cmd, const nsACString& appName, nsIGIOMimeApp **_retval) override; \
NS_IMETHOD FindAppFromCommand(const nsACString& cmd, nsIGIOMimeApp **_retval) override; \
NS_IMETHOD GetDescriptionForMimeType(const nsACString& mimeType, nsACString& _retval) override; \
using nsIGIOService::GetIsRunningUnderFlatpak; \
NS_IMETHOD GetIsRunningUnderFlatpak(bool *aIsRunningUnderFlatpak) override; \
using nsIGIOService::GetIsRunningUnderSnap; \
NS_IMETHOD GetIsRunningUnderSnap(bool *aIsRunningUnderSnap) override; \
NS_IMETHOD ShowURI(nsIURI *uri) override; \
NS_IMETHOD RevealFile(nsIFile *file) override; \
NS_IMETHOD LaunchFile(const nsACString& path) override;
/* Use this macro when declaring the members of this interface when the
class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIGIOSERVICE \
nsresult GetMimeTypeFromExtension(const nsACString& extension, nsACString& _retval); \
nsresult GetAppForURIScheme(const nsACString& aURIScheme, nsIHandlerApp **_retval); \
nsresult GetAppsForURIScheme(const nsACString& aURIScheme, nsIMutableArray **_retval); \
nsresult GetAppForMimeType(const nsACString& mimeType, nsIHandlerApp **_retval); \
nsresult CreateAppFromCommand(const nsACString& cmd, const nsACString& appName, nsIGIOMimeApp **_retval); \
nsresult FindAppFromCommand(const nsACString& cmd, nsIGIOMimeApp **_retval); \
nsresult GetDescriptionForMimeType(const nsACString& mimeType, nsACString& _retval); \
using nsIGIOService::GetIsRunningUnderFlatpak; \
nsresult GetIsRunningUnderFlatpak(bool *aIsRunningUnderFlatpak); \
using nsIGIOService::GetIsRunningUnderSnap; \
nsresult GetIsRunningUnderSnap(bool *aIsRunningUnderSnap); \
nsresult ShowURI(nsIURI *uri); \
nsresult RevealFile(nsIFile *file); \
nsresult LaunchFile(const nsACString& path);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIGIOSERVICE(_to) \
NS_IMETHOD GetMimeTypeFromExtension(const nsACString& extension, nsACString& _retval) override { return _to GetMimeTypeFromExtension(extension, _retval); } \
NS_IMETHOD GetAppForURIScheme(const nsACString& aURIScheme, nsIHandlerApp **_retval) override { return _to GetAppForURIScheme(aURIScheme, _retval); } \
NS_IMETHOD GetAppsForURIScheme(const nsACString& aURIScheme, nsIMutableArray **_retval) override { return _to GetAppsForURIScheme(aURIScheme, _retval); } \
NS_IMETHOD GetAppForMimeType(const nsACString& mimeType, nsIHandlerApp **_retval) override { return _to GetAppForMimeType(mimeType, _retval); } \
NS_IMETHOD CreateAppFromCommand(const nsACString& cmd, const nsACString& appName, nsIGIOMimeApp **_retval) override { return _to CreateAppFromCommand(cmd, appName, _retval); } \
NS_IMETHOD FindAppFromCommand(const nsACString& cmd, nsIGIOMimeApp **_retval) override { return _to FindAppFromCommand(cmd, _retval); } \
NS_IMETHOD GetDescriptionForMimeType(const nsACString& mimeType, nsACString& _retval) override { return _to GetDescriptionForMimeType(mimeType, _retval); } \
using nsIGIOService::GetIsRunningUnderFlatpak; \
NS_IMETHOD GetIsRunningUnderFlatpak(bool *aIsRunningUnderFlatpak) override { return _to GetIsRunningUnderFlatpak(aIsRunningUnderFlatpak); } \
using nsIGIOService::GetIsRunningUnderSnap; \
NS_IMETHOD GetIsRunningUnderSnap(bool *aIsRunningUnderSnap) override { return _to GetIsRunningUnderSnap(aIsRunningUnderSnap); } \
NS_IMETHOD ShowURI(nsIURI *uri) override { return _to ShowURI(uri); } \
NS_IMETHOD RevealFile(nsIFile *file) override { return _to RevealFile(file); } \
NS_IMETHOD LaunchFile(const nsACString& path) override { return _to LaunchFile(path); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIGIOSERVICE(_to) \
NS_IMETHOD GetMimeTypeFromExtension(const nsACString& extension, nsACString& _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMimeTypeFromExtension(extension, _retval); } \
NS_IMETHOD GetAppForURIScheme(const nsACString& aURIScheme, nsIHandlerApp **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAppForURIScheme(aURIScheme, _retval); } \
NS_IMETHOD GetAppsForURIScheme(const nsACString& aURIScheme, nsIMutableArray **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAppsForURIScheme(aURIScheme, _retval); } \
NS_IMETHOD GetAppForMimeType(const nsACString& mimeType, nsIHandlerApp **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAppForMimeType(mimeType, _retval); } \
NS_IMETHOD CreateAppFromCommand(const nsACString& cmd, const nsACString& appName, nsIGIOMimeApp **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateAppFromCommand(cmd, appName, _retval); } \
NS_IMETHOD FindAppFromCommand(const nsACString& cmd, nsIGIOMimeApp **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->FindAppFromCommand(cmd, _retval); } \
NS_IMETHOD GetDescriptionForMimeType(const nsACString& mimeType, nsACString& _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDescriptionForMimeType(mimeType, _retval); } \
NS_IMETHOD GetIsRunningUnderFlatpak(bool *aIsRunningUnderFlatpak) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsRunningUnderFlatpak(aIsRunningUnderFlatpak); } \
NS_IMETHOD GetIsRunningUnderSnap(bool *aIsRunningUnderSnap) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsRunningUnderSnap(aIsRunningUnderSnap); } \
NS_IMETHOD ShowURI(nsIURI *uri) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ShowURI(uri); } \
NS_IMETHOD RevealFile(nsIFile *file) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RevealFile(file); } \
NS_IMETHOD LaunchFile(const nsACString& path) override { return !_to ? NS_ERROR_NULL_POINTER : _to->LaunchFile(path); }
#define NS_GIOSERVICE_CONTRACTID "@mozilla.org/gio-service;1"
#endif /* __gen_nsIGIOService_h__ */