1999-03-23 15:37:34 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
1999-11-06 03:40:37 +00:00
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
1999-03-23 15:37:34 +00:00
|
|
|
*
|
1999-11-06 03:40:37 +00:00
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
1999-03-23 15:37:34 +00:00
|
|
|
*
|
1999-11-06 03:40:37 +00:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-03-23 15:37:34 +00:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 03:40:37 +00:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-03-23 15:37:34 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsClipboard_h__
|
|
|
|
#define nsClipboard_h__
|
|
|
|
|
1999-03-26 15:43:48 +00:00
|
|
|
#include "nsBaseClipboard.h"
|
1999-04-17 13:49:39 +00:00
|
|
|
#include <windows.h>
|
1999-03-23 15:37:34 +00:00
|
|
|
|
|
|
|
class nsITransferable;
|
|
|
|
class nsIClipboardOwner;
|
1999-03-23 21:26:41 +00:00
|
|
|
class nsIWidget;
|
1999-04-06 20:25:09 +00:00
|
|
|
struct IDataObject;
|
1999-03-23 15:37:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Native Win32 Clipboard wrapper
|
|
|
|
*/
|
|
|
|
|
1999-03-26 15:43:48 +00:00
|
|
|
class nsClipboard : public nsBaseClipboard
|
1999-03-23 15:37:34 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
nsClipboard();
|
|
|
|
virtual ~nsClipboard();
|
|
|
|
|
|
|
|
// nsIClipboard
|
2000-04-14 02:52:58 +00:00
|
|
|
NS_IMETHOD ForceDataToClipboard ( PRInt32 aWhichClipboard );
|
|
|
|
NS_IMETHOD HasDataMatchingFlavors(nsISupportsArray *aFlavorList, PRInt32 aWhichClipboard, PRBool *_retval);
|
1999-03-23 15:37:34 +00:00
|
|
|
|
1999-04-06 20:25:09 +00:00
|
|
|
// Internal Native Routines
|
1999-04-17 13:49:39 +00:00
|
|
|
static nsresult CreateNativeDataObject(nsITransferable * aTransferable,
|
|
|
|
IDataObject ** aDataObj);
|
|
|
|
|
1999-05-04 23:14:57 +00:00
|
|
|
static nsresult SetupNativeDataObject(nsITransferable * aTransferable,
|
|
|
|
IDataObject * aDataObj);
|
|
|
|
|
2000-04-26 01:04:13 +00:00
|
|
|
static nsresult GetDataFromDataObject(IDataObject * aDataObject,
|
|
|
|
UINT anIndex,
|
1999-04-17 13:49:39 +00:00
|
|
|
nsIWidget * aWindow,
|
|
|
|
nsITransferable * aTransferable);
|
|
|
|
|
2000-04-26 01:04:13 +00:00
|
|
|
static nsresult GetNativeDataOffClipboard(nsIWidget * aWindow, UINT aIndex, UINT aFormat, void ** aData, PRUint32 * aLen);
|
1999-04-17 13:49:39 +00:00
|
|
|
|
2000-04-26 01:04:13 +00:00
|
|
|
static nsresult GetNativeDataOffClipboard(IDataObject * aDataObject, UINT aIndex, UINT aFormat, void ** aData, PRUint32 * aLen);
|
1999-04-17 13:49:39 +00:00
|
|
|
|
|
|
|
static nsresult GetGlobalData(HGLOBAL aHGBL, void ** aData, PRUint32 * aLen);
|
|
|
|
|
1999-09-04 20:04:26 +00:00
|
|
|
static UINT GetFormat(const char* aMimeStr);
|
1999-04-06 20:25:09 +00:00
|
|
|
|
1999-03-23 15:37:34 +00:00
|
|
|
|
|
|
|
protected:
|
2000-04-14 02:52:58 +00:00
|
|
|
NS_IMETHOD SetNativeClipboardData ( PRInt32 aWhichClipboard );
|
|
|
|
NS_IMETHOD GetNativeClipboardData ( nsITransferable * aTransferable, PRInt32 aWhichClipboard );
|
1999-03-26 15:43:48 +00:00
|
|
|
|
1999-03-23 21:26:41 +00:00
|
|
|
nsIWidget * mWindow;
|
1999-04-06 20:25:09 +00:00
|
|
|
IDataObject * mDataObj;
|
1999-03-23 15:37:34 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
1999-06-07 19:26:45 +00:00
|
|
|
#define SET_FORMATETC(fe, cf, td, asp, li, med) \
|
|
|
|
{\
|
|
|
|
(fe).cfFormat=cf;\
|
|
|
|
(fe).ptd=td;\
|
|
|
|
(fe).dwAspect=asp;\
|
|
|
|
(fe).lindex=li;\
|
|
|
|
(fe).tymed=med;\
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-03-23 15:37:34 +00:00
|
|
|
#endif // nsClipboard_h__
|