2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef nsClipboard_h_
|
|
|
|
#define nsClipboard_h_
|
|
|
|
|
|
|
|
#include "nsBaseClipboard.h"
|
2008-11-06 17:08:35 -08:00
|
|
|
#include "nsXPIDLString.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-06-26 22:26:18 -07:00
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
class nsITransferable;
|
|
|
|
|
|
|
|
class nsClipboard : public nsBaseClipboard
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
nsClipboard();
|
|
|
|
virtual ~nsClipboard();
|
|
|
|
|
|
|
|
// nsIClipboard
|
2007-11-20 11:06:30 -08:00
|
|
|
NS_IMETHOD HasDataMatchingFlavors(const char** aFlavorList, PRUint32 aLength,
|
2011-09-28 23:19:26 -07:00
|
|
|
PRInt32 aWhichClipboard, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-06-26 22:26:18 -07:00
|
|
|
// Helper methods, used also by nsDragService
|
|
|
|
static NSDictionary* PasteboardDictFromTransferable(nsITransferable *aTransferable);
|
2011-09-28 23:19:26 -07:00
|
|
|
static bool IsStringType(const nsCString& aMIMEType, NSString** aPasteboardType);
|
2009-01-01 06:26:16 -08:00
|
|
|
static NSString* WrapHtmlForSystemPasteboard(NSString* aString);
|
2010-01-10 17:45:45 -08:00
|
|
|
static nsresult TransferableFromPasteboard(nsITransferable *aTransferable, NSPasteboard *pboard);
|
2007-06-26 22:26:18 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
protected:
|
|
|
|
|
|
|
|
// impelement the native clipboard behavior
|
|
|
|
NS_IMETHOD SetNativeClipboardData(PRInt32 aWhichClipboard);
|
|
|
|
NS_IMETHOD GetNativeClipboardData(nsITransferable * aTransferable, PRInt32 aWhichClipboard);
|
2007-07-03 00:16:19 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
int mChangeCount; // this is always set to the native change count after any clipboard modifications
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsClipboard_h_
|