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