mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 22:04:36 +00:00
initial checkin
This commit is contained in:
parent
6496ce1075
commit
d22757c3d0
@ -2,6 +2,7 @@
|
||||
# This is a list of local files which get copied to the mozilla:dist:widget directory
|
||||
#
|
||||
|
||||
nsIClipboardOwner.h
|
||||
nsIClipboard.h
|
||||
nsIDragTarget.h
|
||||
nsIDragSource.h
|
||||
|
@ -25,6 +25,7 @@ include $(DEPTH)/config/autoconf.mk
|
||||
DEFINES += -D_IMPL_NS_UI
|
||||
|
||||
EXPORTS = \
|
||||
nsIClipboardOwner.h \
|
||||
nsIClipboard.h \
|
||||
nsIDragTarget.h \
|
||||
nsIDragSource.h \
|
||||
|
@ -22,6 +22,7 @@ DEFINES=-D_IMPL_NS_UI
|
||||
MODULE=raptor
|
||||
|
||||
EXPORTS=nsui.h \
|
||||
nsIClipboardOwner.h \
|
||||
nsIClipboard.h \
|
||||
nsIDragTarget.h \
|
||||
nsIDragSource.h \
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include "nsISupports.h"
|
||||
|
||||
class nsITransferable;
|
||||
class nsIClipboardOwner;
|
||||
class nsIDataFlavor;
|
||||
|
||||
// {8B5314BA-DB01-11d2-96CE-0060B0FB9956}
|
||||
#define NS_ICLIPBOARD_IID \
|
||||
@ -32,22 +34,41 @@ class nsIClipboard : public nsISupports {
|
||||
public:
|
||||
|
||||
/**
|
||||
* Gets the transferable object
|
||||
* Set the transferable object onto the clipboard,
|
||||
* it is used to get and set the data from the native clipboard
|
||||
*
|
||||
* @param aTransferable The transferable
|
||||
* @param anOwner The owner of the transferable
|
||||
* @result NS_Ok if no errors
|
||||
*/
|
||||
|
||||
NS_IMETHOD GetTransferable(nsITransferable ** aTransferable) = 0;
|
||||
NS_IMETHOD SetTransferable(nsITransferable * aTransferable, nsIClipboardOwner * anOwner) = 0;
|
||||
|
||||
/**
|
||||
* Sets the transferable object
|
||||
* Gets the data from the clipboard and put it into the transferable object
|
||||
*
|
||||
* @param aTransferable The transferable
|
||||
* @result NS_Ok if no errors
|
||||
*/
|
||||
|
||||
NS_IMETHOD SetTransferable(nsITransferable * aTransferable) = 0;
|
||||
NS_IMETHOD GetClipboard() = 0;
|
||||
|
||||
/**
|
||||
* Sets the clipboard from the transferable object
|
||||
*
|
||||
* @param aTransferable The transferable
|
||||
* @result NS_Ok if no errors
|
||||
*/
|
||||
|
||||
NS_IMETHOD SetClipboard() = 0;
|
||||
|
||||
/**
|
||||
* Check to set if ant of the native data on the clipboard matches this data flavor
|
||||
*
|
||||
* @result NS_Ok if if the data flavor is supported and, NS_ERROR_FAILURE is it is not
|
||||
*/
|
||||
|
||||
NS_IMETHOD IsDataFlavorSupported(nsIDataFlavor * aDataFlavor) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
46
widget/public/nsIClipboardOwner.h
Normal file
46
widget/public/nsIClipboardOwner.h
Normal file
@ -0,0 +1,46 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef nsIClipboardOwner_h__
|
||||
#define nsIClipboardOwner_h__
|
||||
|
||||
#include "nsISupports.h"
|
||||
|
||||
class nsITransferable;
|
||||
|
||||
// {5A31C7A1-E122-11d2-9A57-000064657374}
|
||||
#define NS_ICLIPBOARDOWNER_IID \
|
||||
{ 0x5a31c7a1, 0xe122, 0x11d2, { 0x9a, 0x57, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } };
|
||||
|
||||
class nsIClipboardOwner : public nsISupports {
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Notifies the owner of the clipboard transferable that the
|
||||
* transferable is being removed from the clipboard
|
||||
*
|
||||
* @param aTransferable The transferable
|
||||
* @result NS_Ok if no errors
|
||||
*/
|
||||
|
||||
NS_IMETHOD LosingOwnership(nsITransferable * aTransferable) = 0;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -27,8 +27,17 @@
|
||||
#define NS_IDATAFLAVOR_IID \
|
||||
{ 0x8b5314bd, 0xdb01, 0x11d2, { 0x96, 0xce, 0x0, 0x60, 0xb0, 0xfb, 0x99, 0x56 } }
|
||||
|
||||
// public static Flavor PLAIN_TEXT - A basic flavor representing plain text in UNICODE.
|
||||
// public static Flavor HTML - A flavor representing HTML source in UNICODE.
|
||||
//const char * kTextMime = "text/text";
|
||||
//const char * kUnicodeMime = "text/unicode";
|
||||
//const char * kHTMLMime = "text/html";
|
||||
//const char * kAOLMailMime = "AOLMAIL";
|
||||
//const char * kImageMime = "text/image";
|
||||
|
||||
#define kTextMime "text/text"
|
||||
#define kUnicodeMime "text/unicode"
|
||||
#define kHTMLMime "text/html"
|
||||
#define kAOLMailMime "AOLMAIL"
|
||||
#define kImageMime "text/image"
|
||||
|
||||
class nsIDataFlavor : public nsISupports {
|
||||
|
||||
|
@ -26,7 +26,7 @@ class nsIDragSource;
|
||||
class nsIImage;
|
||||
|
||||
// {8B5314BB-DB01-11d2-96CE-0060B0FB9956}
|
||||
#define NS_IDRAGSESSION_IID \
|
||||
#define NS_IDRAGSERVICE_IID \
|
||||
{ 0x8b5314bb, 0xdb01, 0x11d2, { 0x96, 0xce, 0x0, 0x60, 0xb0, 0xfb, 0x99, 0x56 } }
|
||||
|
||||
|
||||
|
@ -42,6 +42,15 @@ class nsIDragSource : public nsISupports {
|
||||
|
||||
NS_IMETHOD GetTransferable(nsITransferable ** aTransferable) = 0;
|
||||
|
||||
/**
|
||||
* Sets the transferable object
|
||||
*
|
||||
* @param aTransferable The transferable
|
||||
* @result NS_Ok if no errors
|
||||
*/
|
||||
|
||||
NS_IMETHOD SetTransferable(nsITransferable * aTransferable) = 0;
|
||||
|
||||
/**
|
||||
* Called when a drag session has finished with the action that occured.
|
||||
*
|
||||
|
@ -38,7 +38,7 @@ class nsITransferable : public nsISupports {
|
||||
*
|
||||
* @param aDataFlavorList fills list with supported flavors
|
||||
*/
|
||||
NS_IMETHOD GetTransferDataFlavors(nsISupportsArray * aDataFlavorList) = 0;
|
||||
NS_IMETHOD GetTransferDataFlavors(nsISupportsArray ** aDataFlavorList) = 0;
|
||||
|
||||
/**
|
||||
* See if the given flavor is supported
|
||||
@ -53,16 +53,34 @@ class nsITransferable : public nsISupports {
|
||||
*
|
||||
* @param aFlavor the flavor of data to retrieve
|
||||
* @param aData the data
|
||||
* @param aDataLen the length of the data
|
||||
*/
|
||||
NS_IMETHOD GetTransferData(nsIDataFlavor * aFlavor, nsISupports ** aData) = 0;
|
||||
NS_IMETHOD GetTransferData(nsIDataFlavor * aFlavor, void ** aData, PRUint32 * aDataLen) = 0;
|
||||
|
||||
/**
|
||||
* Sets data
|
||||
* Set Data into the transferable as a specified DataFlavor
|
||||
*
|
||||
* @param aFlavor the flavor of data that is being set
|
||||
* @param aData the data
|
||||
* @param aDataLen the length of the data (it may or may not be meaningful)
|
||||
*/
|
||||
NS_IMETHOD SetTransferData(nsIDataFlavor * aFlavor, void * aData, PRUint32 aDataLen) = 0;
|
||||
|
||||
/**
|
||||
* Convience method for setting string data into the transferable
|
||||
*
|
||||
* @param aFlavor the flavor of data to retrieve
|
||||
* @param aData the data
|
||||
*/
|
||||
NS_IMETHOD SetTransferData(const nsString & aStr) = 0;
|
||||
NS_IMETHOD SetTransferString(const nsString & aStr) = 0;
|
||||
|
||||
/**
|
||||
* Convience method for getting string data from the transferable
|
||||
*
|
||||
* @param aFlavor the flavor of data to retrieve
|
||||
* @param aData the data
|
||||
*/
|
||||
NS_IMETHOD GetTransferString(nsString & aStr) = 0;
|
||||
|
||||
/**
|
||||
* Initializes the data flavor
|
||||
@ -72,25 +90,6 @@ class nsITransferable : public nsISupports {
|
||||
*/
|
||||
NS_IMETHOD AddDataFlavor(const nsString & aMimeType, const nsString & aHumanPresentableName) = 0;
|
||||
|
||||
/**
|
||||
* Returns the Platform specific data object
|
||||
*
|
||||
* @param aData the native data to be put on the clipboard
|
||||
*/
|
||||
NS_IMETHOD GetNativeData(void ** aData) = 0;
|
||||
|
||||
/**
|
||||
* Tells the transferrable, that now is the time to set the data on the native clipboard
|
||||
*
|
||||
*/
|
||||
NS_IMETHOD SetNativeClipboard() = 0;
|
||||
|
||||
/**
|
||||
* Sets Native data
|
||||
*
|
||||
* @param aData the native data
|
||||
*/
|
||||
NS_IMETHOD SetNativeData(void * aData) = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -180,7 +180,7 @@
|
||||
{ 0x8b5314b9, 0xdb01, 0x11d2, { 0x96, 0xce, 0x0, 0x60, 0xb0, 0xfb, 0x99, 0x56 } }
|
||||
|
||||
// {8B5314BB-DB01-11d2-96CE-0060B0FB9956}
|
||||
#define NS_DRAGSESSION_CID \
|
||||
#define NS_DRAGSERVICE_CID \
|
||||
{ 0x8b5314bb, 0xdb01, 0x11d2, { 0x96, 0xce, 0x0, 0x60, 0xb0, 0xfb, 0x99, 0x56 } }
|
||||
|
||||
// {8B5314BC-DB01-11d2-96CE-0060B0FB9956}
|
||||
|
Loading…
x
Reference in New Issue
Block a user