Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsClipboard_h_
7 #define nsClipboard_h_
9 #include "nsBaseClipboard.h"
10 #include "nsXPIDLString.h"
12 #import <Cocoa/Cocoa.h>
14 class nsITransferable;
16 class nsClipboard : public nsBaseClipboard
17 {
19 public:
20 nsClipboard();
21 virtual ~nsClipboard();
23 // nsIClipboard
24 NS_IMETHOD HasDataMatchingFlavors(const char** aFlavorList, uint32_t aLength,
25 int32_t aWhichClipboard, bool *_retval);
26 NS_IMETHOD SupportsFindClipboard(bool *_retval);
28 // Helper methods, used also by nsDragService
29 static NSDictionary* PasteboardDictFromTransferable(nsITransferable *aTransferable);
30 static bool IsStringType(const nsCString& aMIMEType, NSString** aPasteboardType);
31 static NSString* WrapHtmlForSystemPasteboard(NSString* aString);
32 static nsresult TransferableFromPasteboard(nsITransferable *aTransferable, NSPasteboard *pboard);
34 protected:
36 // impelement the native clipboard behavior
37 NS_IMETHOD SetNativeClipboardData(int32_t aWhichClipboard);
38 NS_IMETHOD GetNativeClipboardData(nsITransferable * aTransferable, int32_t aWhichClipboard);
40 private:
41 int32_t mCachedClipboard;
42 int32_t mChangeCount; // Set to the native change count after any modification of the clipboard.
43 };
45 #endif // nsClipboard_h_