gecko-dev/widget/src/windows/nsClipboard.h

90 lines
2.7 KiB
C
Raw Normal View History

1999-03-23 15:37:34 +00:00
/* -*- 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.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
*
* 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
*
* 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
* 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__
#include "nsBaseClipboard.h"
#include <windows.h>
1999-03-23 15:37:34 +00:00
class nsITransferable;
class nsIClipboardOwner;
class nsIWidget;
1999-04-06 20:25:09 +00:00
struct IDataObject;
1999-03-23 15:37:34 +00:00
/**
* Native Win32 Clipboard wrapper
*/
class nsClipboard : public nsBaseClipboard
1999-03-23 15:37:34 +00:00
{
public:
nsClipboard();
virtual ~nsClipboard();
// nsIClipboard
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
static nsresult CreateNativeDataObject(nsITransferable * aTransferable,
IDataObject ** aDataObj);
1999-05-04 23:14:57 +00:00
static nsresult SetupNativeDataObject(nsITransferable * aTransferable,
IDataObject * aDataObj);
static nsresult GetDataFromDataObject(IDataObject * aDataObject,
UINT anIndex,
nsIWidget * aWindow,
nsITransferable * aTransferable);
static nsresult GetNativeDataOffClipboard(nsIWidget * aWindow, UINT aIndex, UINT aFormat, void ** aData, PRUint32 * aLen);
static nsresult GetNativeDataOffClipboard(IDataObject * aDataObject, UINT aIndex, UINT aFormat, void ** aData, PRUint32 * aLen);
static nsresult GetGlobalData(HGLOBAL aHGBL, void ** aData, PRUint32 * aLen);
static UINT GetFormat(const char* aMimeStr);
1999-04-06 20:25:09 +00:00
1999-03-23 15:37:34 +00:00
protected:
NS_IMETHOD SetNativeClipboardData ( PRInt32 aWhichClipboard );
NS_IMETHOD GetNativeClipboardData ( nsITransferable * aTransferable, PRInt32 aWhichClipboard );
nsIWidget * mWindow;
1999-04-06 20:25:09 +00:00
IDataObject * mDataObj;
1999-03-23 15:37:34 +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__