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
|
2012-08-22 08:56:38 -07:00
|
|
|
NS_IMETHOD HasDataMatchingFlavors(const char** aFlavorList, uint32_t aLength,
|
|
|
|
int32_t aWhichClipboard, bool *_retval);
|
2014-02-28 07:07:30 -08:00
|
|
|
NS_IMETHOD SupportsFindClipboard(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
|
2012-08-22 08:56:38 -07:00
|
|
|
NS_IMETHOD SetNativeClipboardData(int32_t aWhichClipboard);
|
|
|
|
NS_IMETHOD GetNativeClipboardData(nsITransferable * aTransferable, int32_t aWhichClipboard);
|
2007-07-03 00:16:19 -07:00
|
|
|
|
|
|
|
private:
|
2014-02-28 07:07:30 -08:00
|
|
|
// This is always set to the native change count after any modification of the
|
|
|
|
// general clipboard.
|
|
|
|
int mChangeCountGeneral;
|
|
|
|
// This is always set to the native change count after any modification of the
|
|
|
|
// find clipboard.
|
|
|
|
int mChangeCountFind;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsClipboard_h_
|