2006-10-02 20:28:40 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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/. */
|
2006-10-02 20:28:40 +00:00
|
|
|
|
2007-01-18 06:34:07 +00:00
|
|
|
#ifndef nsClipboard_h_
|
|
|
|
#define nsClipboard_h_
|
2006-10-02 20:28:40 +00:00
|
|
|
|
|
|
|
#include "nsBaseClipboard.h"
|
2008-11-07 01:08:35 +00:00
|
|
|
#include "nsXPIDLString.h"
|
2006-10-02 20:28:40 +00:00
|
|
|
|
2007-06-27 05:26:18 +00:00
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
2006-10-02 20:28:40 +00:00
|
|
|
class nsITransferable;
|
|
|
|
|
|
|
|
class nsClipboard : public nsBaseClipboard
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
nsClipboard();
|
|
|
|
virtual ~nsClipboard();
|
|
|
|
|
|
|
|
// nsIClipboard
|
2012-08-22 15:56:38 +00:00
|
|
|
NS_IMETHOD HasDataMatchingFlavors(const char** aFlavorList, uint32_t aLength,
|
|
|
|
int32_t aWhichClipboard, bool *_retval);
|
2006-10-02 20:28:40 +00:00
|
|
|
|
2007-06-27 05:26:18 +00:00
|
|
|
// Helper methods, used also by nsDragService
|
|
|
|
static NSDictionary* PasteboardDictFromTransferable(nsITransferable *aTransferable);
|
2011-09-29 06:19:26 +00:00
|
|
|
static bool IsStringType(const nsCString& aMIMEType, NSString** aPasteboardType);
|
2009-01-01 14:26:16 +00:00
|
|
|
static NSString* WrapHtmlForSystemPasteboard(NSString* aString);
|
2010-01-11 01:45:45 +00:00
|
|
|
static nsresult TransferableFromPasteboard(nsITransferable *aTransferable, NSPasteboard *pboard);
|
2007-06-27 05:26:18 +00:00
|
|
|
|
2006-10-02 20:28:40 +00:00
|
|
|
protected:
|
|
|
|
|
|
|
|
// impelement the native clipboard behavior
|
2012-08-22 15:56:38 +00:00
|
|
|
NS_IMETHOD SetNativeClipboardData(int32_t aWhichClipboard);
|
|
|
|
NS_IMETHOD GetNativeClipboardData(nsITransferable * aTransferable, int32_t aWhichClipboard);
|
2007-07-03 07:16:19 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
int mChangeCount; // this is always set to the native change count after any clipboard modifications
|
2006-10-02 20:28:40 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2007-01-18 06:34:07 +00:00
|
|
|
#endif // nsClipboard_h_
|