Copy as Markdown

Other Tools

/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM $SRCDIR/widget/nsIDragService.idl
*/
#ifndef __gen_nsIDragService_h__
#define __gen_nsIDragService_h__
#include "nsIArray.h"
#include "nsISupports.h"
#include "nsIDragSession.h"
#include "nsIContentPolicy.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
namespace mozilla {
namespace dom {
class DragEvent; /* webidl DragEvent */
} // namespace dom
} // namespace mozilla
class nsINode; /* webidl Node */
namespace mozilla {
namespace dom {
class Selection; /* webidl Selection */
} // namespace dom
} // namespace mozilla
class nsICookieJarSettings; /* forward declaration */
class nsIMockDragServiceController; /* forward declaration */
#include "mozilla/EventForwards.h"
#include "nsIWidget.h"
class nsIWidget;
namespace mozilla {
namespace dom {
class BrowserParent;
class DataTransfer;
class RemoteDragStartData;
} // namespace dom
} // namespace mozilla
/* starting interface: nsIDragService */
#define NS_IDRAGSERVICE_IID_STR "ebd6b3a2-af16-43af-a698-3091a087dd62"
#define NS_IDRAGSERVICE_IID \
{0xebd6b3a2, 0xaf16, 0x43af, \
{ 0xa6, 0x98, 0x30, 0x91, 0xa0, 0x87, 0xdd, 0x62 }}
class nsIDragService : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDRAGSERVICE_IID)
/* Used by ToJSValue to check which scriptable interface is implemented. */
using ScriptableInterfaceType = nsIDragService;
enum {
DRAGDROP_ACTION_NONE = 0,
DRAGDROP_ACTION_COPY = 1,
DRAGDROP_ACTION_MOVE = 2,
DRAGDROP_ACTION_LINK = 4,
DRAGDROP_ACTION_UNINITIALIZED = 64
};
/* [can_run_script,noscript] void invokeDragSessionWithImage (in Node aDOMNode, in nsIPrincipal aPrincipal, in nsIContentSecurityPolicy aCsp, in nsICookieJarSettings aCookieJarSettings, in nsIArray aTransferableArray, in unsigned long aActionType, in Node aImage, in long aImageX, in long aImageY, in DragEvent aDragEvent, in DataTransferPtr aDataTransfer); */
MOZ_CAN_RUN_SCRIPT NS_IMETHOD InvokeDragSessionWithImage(nsINode *aDOMNode, nsIPrincipal *aPrincipal, nsIContentSecurityPolicy *aCsp, nsICookieJarSettings *aCookieJarSettings, nsIArray *aTransferableArray, uint32_t aActionType, nsINode *aImage, int32_t aImageX, int32_t aImageY, mozilla::dom::DragEvent *aDragEvent, mozilla::dom::DataTransfer * aDataTransfer) = 0;
/* [can_run_script,noscript] void invokeDragSessionWithRemoteImage (in Node aDOMNode, in nsIPrincipal aPrincipal, in nsIContentSecurityPolicy aCsp, in nsICookieJarSettings aCookieJarSettings, in nsIArray aTransferableArray, in unsigned long aActionType, in RemoteDragStartDataPtr aDragStartData, in DragEvent aDragEvent, in DataTransferPtr aDataTransfer); */
MOZ_CAN_RUN_SCRIPT NS_IMETHOD InvokeDragSessionWithRemoteImage(nsINode *aDOMNode, nsIPrincipal *aPrincipal, nsIContentSecurityPolicy *aCsp, nsICookieJarSettings *aCookieJarSettings, nsIArray *aTransferableArray, uint32_t aActionType, mozilla::dom::RemoteDragStartData * aDragStartData, mozilla::dom::DragEvent *aDragEvent, mozilla::dom::DataTransfer * aDataTransfer) = 0;
/* [can_run_script,noscript] void invokeDragSessionWithSelection (in Selection aSelection, in nsIPrincipal aPrincipal, in nsIContentSecurityPolicy aCsp, in nsICookieJarSettings aCookieJarSettings, in nsIArray aTransferableArray, in unsigned long aActionType, in DragEvent aDragEvent, in DataTransferPtr aDataTransfer, in Node aTargetContent); */
MOZ_CAN_RUN_SCRIPT NS_IMETHOD InvokeDragSessionWithSelection(mozilla::dom::Selection *aSelection, nsIPrincipal *aPrincipal, nsIContentSecurityPolicy *aCsp, nsICookieJarSettings *aCookieJarSettings, nsIArray *aTransferableArray, uint32_t aActionType, mozilla::dom::DragEvent *aDragEvent, mozilla::dom::DataTransfer * aDataTransfer, nsINode *aTargetContent) = 0;
/* nsIDragSession getCurrentSession ([optional] in nsISupports aWidgetProvider); */
NS_IMETHOD GetCurrentSession(nsISupports *aWidgetProvider, nsIDragSession **_retval) = 0;
nsIDragSession* GetCurrentSession(nsIWidget* aWidget) {
nsCOMPtr<nsIDragSession> session;
GetCurrentSession(aWidget, getter_AddRefs(session));
return session;
}
/* [nostdcall,notxpcom] nsIDragSession startDragSession (in nsISupports aWidgetProvider); */
virtual nsIDragSession * StartDragSession(nsISupports *aWidgetProvider) = 0;
/* void startDragSessionForTests (in nsISupports aWidgetProvider, in unsigned long aAllowedEffect); */
NS_IMETHOD StartDragSessionForTests(nsISupports *aWidgetProvider, uint32_t aAllowedEffect) = 0;
/* [can_run_script] void suppress (); */
MOZ_CAN_RUN_SCRIPT NS_IMETHOD Suppress(void) = 0;
/* void unsuppress (); */
NS_IMETHOD Unsuppress(void) = 0;
/* [nostdcall,notxpcom] boolean maybeAddBrowser (in BrowserParentPtr aBP); */
virtual bool MaybeAddBrowser(mozilla::dom::BrowserParent * aBP) = 0;
/* [nostdcall,notxpcom] boolean removeAllBrowsers (); */
virtual bool RemoveAllBrowsers(void) = 0;
/* nsIMockDragServiceController getMockDragController (); */
NS_IMETHOD GetMockDragController(nsIMockDragServiceController **_retval) = 0;
/* readonly attribute boolean isMockService; */
NS_IMETHOD GetIsMockService(bool *aIsMockService) = 0;
bool IsMockService() {
bool ret = false;
MOZ_ALWAYS_SUCCEEDS(GetIsMockService(&ret));
return ret;
}
/* [infallible] attribute boolean neverAllowSessionIsSynthesizedForTests; */
NS_IMETHOD GetNeverAllowSessionIsSynthesizedForTests(bool *aNeverAllowSessionIsSynthesizedForTests) = 0;
inline bool GetNeverAllowSessionIsSynthesizedForTests()
{
bool result;
mozilla::DebugOnly<nsresult> rv = GetNeverAllowSessionIsSynthesizedForTests(&result);
MOZ_ASSERT(NS_SUCCEEDED(rv));
return result;
}
NS_IMETHOD SetNeverAllowSessionIsSynthesizedForTests(bool aNeverAllowSessionIsSynthesizedForTests) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDragService, NS_IDRAGSERVICE_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDRAGSERVICE \
MOZ_CAN_RUN_SCRIPT NS_IMETHOD InvokeDragSessionWithImage(nsINode *aDOMNode, nsIPrincipal *aPrincipal, nsIContentSecurityPolicy *aCsp, nsICookieJarSettings *aCookieJarSettings, nsIArray *aTransferableArray, uint32_t aActionType, nsINode *aImage, int32_t aImageX, int32_t aImageY, mozilla::dom::DragEvent *aDragEvent, mozilla::dom::DataTransfer * aDataTransfer) override; \
MOZ_CAN_RUN_SCRIPT NS_IMETHOD InvokeDragSessionWithRemoteImage(nsINode *aDOMNode, nsIPrincipal *aPrincipal, nsIContentSecurityPolicy *aCsp, nsICookieJarSettings *aCookieJarSettings, nsIArray *aTransferableArray, uint32_t aActionType, mozilla::dom::RemoteDragStartData * aDragStartData, mozilla::dom::DragEvent *aDragEvent, mozilla::dom::DataTransfer * aDataTransfer) override; \
MOZ_CAN_RUN_SCRIPT NS_IMETHOD InvokeDragSessionWithSelection(mozilla::dom::Selection *aSelection, nsIPrincipal *aPrincipal, nsIContentSecurityPolicy *aCsp, nsICookieJarSettings *aCookieJarSettings, nsIArray *aTransferableArray, uint32_t aActionType, mozilla::dom::DragEvent *aDragEvent, mozilla::dom::DataTransfer * aDataTransfer, nsINode *aTargetContent) override; \
NS_IMETHOD GetCurrentSession(nsISupports *aWidgetProvider, nsIDragSession **_retval) override; \
virtual nsIDragSession * StartDragSession(nsISupports *aWidgetProvider) override; \
NS_IMETHOD StartDragSessionForTests(nsISupports *aWidgetProvider, uint32_t aAllowedEffect) override; \
MOZ_CAN_RUN_SCRIPT NS_IMETHOD Suppress(void) override; \
NS_IMETHOD Unsuppress(void) override; \
virtual bool MaybeAddBrowser(mozilla::dom::BrowserParent * aBP) override; \
virtual bool RemoveAllBrowsers(void) override; \
NS_IMETHOD GetMockDragController(nsIMockDragServiceController **_retval) override; \
NS_IMETHOD GetIsMockService(bool *aIsMockService) override; \
using nsIDragService::GetNeverAllowSessionIsSynthesizedForTests; \
NS_IMETHOD GetNeverAllowSessionIsSynthesizedForTests(bool *aNeverAllowSessionIsSynthesizedForTests) override; \
NS_IMETHOD SetNeverAllowSessionIsSynthesizedForTests(bool aNeverAllowSessionIsSynthesizedForTests) 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_NSIDRAGSERVICE \
MOZ_CAN_RUN_SCRIPT nsresult InvokeDragSessionWithImage(nsINode *aDOMNode, nsIPrincipal *aPrincipal, nsIContentSecurityPolicy *aCsp, nsICookieJarSettings *aCookieJarSettings, nsIArray *aTransferableArray, uint32_t aActionType, nsINode *aImage, int32_t aImageX, int32_t aImageY, mozilla::dom::DragEvent *aDragEvent, mozilla::dom::DataTransfer * aDataTransfer); \
MOZ_CAN_RUN_SCRIPT nsresult InvokeDragSessionWithRemoteImage(nsINode *aDOMNode, nsIPrincipal *aPrincipal, nsIContentSecurityPolicy *aCsp, nsICookieJarSettings *aCookieJarSettings, nsIArray *aTransferableArray, uint32_t aActionType, mozilla::dom::RemoteDragStartData * aDragStartData, mozilla::dom::DragEvent *aDragEvent, mozilla::dom::DataTransfer * aDataTransfer); \
MOZ_CAN_RUN_SCRIPT nsresult InvokeDragSessionWithSelection(mozilla::dom::Selection *aSelection, nsIPrincipal *aPrincipal, nsIContentSecurityPolicy *aCsp, nsICookieJarSettings *aCookieJarSettings, nsIArray *aTransferableArray, uint32_t aActionType, mozilla::dom::DragEvent *aDragEvent, mozilla::dom::DataTransfer * aDataTransfer, nsINode *aTargetContent); \
nsresult GetCurrentSession(nsISupports *aWidgetProvider, nsIDragSession **_retval); \
nsIDragSession * StartDragSession(nsISupports *aWidgetProvider); \
nsresult StartDragSessionForTests(nsISupports *aWidgetProvider, uint32_t aAllowedEffect); \
MOZ_CAN_RUN_SCRIPT nsresult Suppress(void); \
nsresult Unsuppress(void); \
bool MaybeAddBrowser(mozilla::dom::BrowserParent * aBP); \
bool RemoveAllBrowsers(void); \
nsresult GetMockDragController(nsIMockDragServiceController **_retval); \
nsresult GetIsMockService(bool *aIsMockService); \
using nsIDragService::GetNeverAllowSessionIsSynthesizedForTests; \
nsresult GetNeverAllowSessionIsSynthesizedForTests(bool *aNeverAllowSessionIsSynthesizedForTests); \
nsresult SetNeverAllowSessionIsSynthesizedForTests(bool aNeverAllowSessionIsSynthesizedForTests);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDRAGSERVICE(_to) \
MOZ_CAN_RUN_SCRIPT NS_IMETHOD InvokeDragSessionWithImage(nsINode *aDOMNode, nsIPrincipal *aPrincipal, nsIContentSecurityPolicy *aCsp, nsICookieJarSettings *aCookieJarSettings, nsIArray *aTransferableArray, uint32_t aActionType, nsINode *aImage, int32_t aImageX, int32_t aImageY, mozilla::dom::DragEvent *aDragEvent, mozilla::dom::DataTransfer * aDataTransfer) override { return _to InvokeDragSessionWithImage(aDOMNode, aPrincipal, aCsp, aCookieJarSettings, aTransferableArray, aActionType, aImage, aImageX, aImageY, aDragEvent, aDataTransfer); } \
MOZ_CAN_RUN_SCRIPT NS_IMETHOD InvokeDragSessionWithRemoteImage(nsINode *aDOMNode, nsIPrincipal *aPrincipal, nsIContentSecurityPolicy *aCsp, nsICookieJarSettings *aCookieJarSettings, nsIArray *aTransferableArray, uint32_t aActionType, mozilla::dom::RemoteDragStartData * aDragStartData, mozilla::dom::DragEvent *aDragEvent, mozilla::dom::DataTransfer * aDataTransfer) override { return _to InvokeDragSessionWithRemoteImage(aDOMNode, aPrincipal, aCsp, aCookieJarSettings, aTransferableArray, aActionType, aDragStartData, aDragEvent, aDataTransfer); } \
MOZ_CAN_RUN_SCRIPT NS_IMETHOD InvokeDragSessionWithSelection(mozilla::dom::Selection *aSelection, nsIPrincipal *aPrincipal, nsIContentSecurityPolicy *aCsp, nsICookieJarSettings *aCookieJarSettings, nsIArray *aTransferableArray, uint32_t aActionType, mozilla::dom::DragEvent *aDragEvent, mozilla::dom::DataTransfer * aDataTransfer, nsINode *aTargetContent) override { return _to InvokeDragSessionWithSelection(aSelection, aPrincipal, aCsp, aCookieJarSettings, aTransferableArray, aActionType, aDragEvent, aDataTransfer, aTargetContent); } \
NS_IMETHOD GetCurrentSession(nsISupports *aWidgetProvider, nsIDragSession **_retval) override { return _to GetCurrentSession(aWidgetProvider, _retval); } \
virtual nsIDragSession * StartDragSession(nsISupports *aWidgetProvider) override { return _to StartDragSession(aWidgetProvider); } \
NS_IMETHOD StartDragSessionForTests(nsISupports *aWidgetProvider, uint32_t aAllowedEffect) override { return _to StartDragSessionForTests(aWidgetProvider, aAllowedEffect); } \
MOZ_CAN_RUN_SCRIPT NS_IMETHOD Suppress(void) override { return _to Suppress(); } \
NS_IMETHOD Unsuppress(void) override { return _to Unsuppress(); } \
virtual bool MaybeAddBrowser(mozilla::dom::BrowserParent * aBP) override { return _to MaybeAddBrowser(aBP); } \
virtual bool RemoveAllBrowsers(void) override { return _to RemoveAllBrowsers(); } \
NS_IMETHOD GetMockDragController(nsIMockDragServiceController **_retval) override { return _to GetMockDragController(_retval); } \
NS_IMETHOD GetIsMockService(bool *aIsMockService) override { return _to GetIsMockService(aIsMockService); } \
using nsIDragService::GetNeverAllowSessionIsSynthesizedForTests; \
NS_IMETHOD GetNeverAllowSessionIsSynthesizedForTests(bool *aNeverAllowSessionIsSynthesizedForTests) override { return _to GetNeverAllowSessionIsSynthesizedForTests(aNeverAllowSessionIsSynthesizedForTests); } \
NS_IMETHOD SetNeverAllowSessionIsSynthesizedForTests(bool aNeverAllowSessionIsSynthesizedForTests) override { return _to SetNeverAllowSessionIsSynthesizedForTests(aNeverAllowSessionIsSynthesizedForTests); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDRAGSERVICE(_to) \
MOZ_CAN_RUN_SCRIPT NS_IMETHOD InvokeDragSessionWithImage(nsINode *aDOMNode, nsIPrincipal *aPrincipal, nsIContentSecurityPolicy *aCsp, nsICookieJarSettings *aCookieJarSettings, nsIArray *aTransferableArray, uint32_t aActionType, nsINode *aImage, int32_t aImageX, int32_t aImageY, mozilla::dom::DragEvent *aDragEvent, mozilla::dom::DataTransfer * aDataTransfer) override { return !_to ? NS_ERROR_NULL_POINTER : _to->InvokeDragSessionWithImage(aDOMNode, aPrincipal, aCsp, aCookieJarSettings, aTransferableArray, aActionType, aImage, aImageX, aImageY, aDragEvent, aDataTransfer); } \
MOZ_CAN_RUN_SCRIPT NS_IMETHOD InvokeDragSessionWithRemoteImage(nsINode *aDOMNode, nsIPrincipal *aPrincipal, nsIContentSecurityPolicy *aCsp, nsICookieJarSettings *aCookieJarSettings, nsIArray *aTransferableArray, uint32_t aActionType, mozilla::dom::RemoteDragStartData * aDragStartData, mozilla::dom::DragEvent *aDragEvent, mozilla::dom::DataTransfer * aDataTransfer) override { return !_to ? NS_ERROR_NULL_POINTER : _to->InvokeDragSessionWithRemoteImage(aDOMNode, aPrincipal, aCsp, aCookieJarSettings, aTransferableArray, aActionType, aDragStartData, aDragEvent, aDataTransfer); } \
MOZ_CAN_RUN_SCRIPT NS_IMETHOD InvokeDragSessionWithSelection(mozilla::dom::Selection *aSelection, nsIPrincipal *aPrincipal, nsIContentSecurityPolicy *aCsp, nsICookieJarSettings *aCookieJarSettings, nsIArray *aTransferableArray, uint32_t aActionType, mozilla::dom::DragEvent *aDragEvent, mozilla::dom::DataTransfer * aDataTransfer, nsINode *aTargetContent) override { return !_to ? NS_ERROR_NULL_POINTER : _to->InvokeDragSessionWithSelection(aSelection, aPrincipal, aCsp, aCookieJarSettings, aTransferableArray, aActionType, aDragEvent, aDataTransfer, aTargetContent); } \
NS_IMETHOD GetCurrentSession(nsISupports *aWidgetProvider, nsIDragSession **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCurrentSession(aWidgetProvider, _retval); } \
virtual nsIDragSession * StartDragSession(nsISupports *aWidgetProvider) override; \
NS_IMETHOD StartDragSessionForTests(nsISupports *aWidgetProvider, uint32_t aAllowedEffect) override { return !_to ? NS_ERROR_NULL_POINTER : _to->StartDragSessionForTests(aWidgetProvider, aAllowedEffect); } \
MOZ_CAN_RUN_SCRIPT NS_IMETHOD Suppress(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Suppress(); } \
NS_IMETHOD Unsuppress(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Unsuppress(); } \
virtual bool MaybeAddBrowser(mozilla::dom::BrowserParent * aBP) override; \
virtual bool RemoveAllBrowsers(void) override; \
NS_IMETHOD GetMockDragController(nsIMockDragServiceController **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMockDragController(_retval); } \
NS_IMETHOD GetIsMockService(bool *aIsMockService) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsMockService(aIsMockService); } \
NS_IMETHOD GetNeverAllowSessionIsSynthesizedForTests(bool *aNeverAllowSessionIsSynthesizedForTests) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNeverAllowSessionIsSynthesizedForTests(aNeverAllowSessionIsSynthesizedForTests); } \
NS_IMETHOD SetNeverAllowSessionIsSynthesizedForTests(bool aNeverAllowSessionIsSynthesizedForTests) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetNeverAllowSessionIsSynthesizedForTests(aNeverAllowSessionIsSynthesizedForTests); }
#endif /* __gen_nsIDragService_h__ */