widget/cocoa/nsClipboard.h

changeset 2
7e26c7da4463
equal deleted inserted replaced
-1:000000000000 0:eac2f8ce3885
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/. */
5
6 #ifndef nsClipboard_h_
7 #define nsClipboard_h_
8
9 #include "nsBaseClipboard.h"
10 #include "nsXPIDLString.h"
11
12 #import <Cocoa/Cocoa.h>
13
14 class nsITransferable;
15
16 class nsClipboard : public nsBaseClipboard
17 {
18
19 public:
20 nsClipboard();
21 virtual ~nsClipboard();
22
23 // nsIClipboard
24 NS_IMETHOD HasDataMatchingFlavors(const char** aFlavorList, uint32_t aLength,
25 int32_t aWhichClipboard, bool *_retval);
26 NS_IMETHOD SupportsFindClipboard(bool *_retval);
27
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);
33
34 protected:
35
36 // impelement the native clipboard behavior
37 NS_IMETHOD SetNativeClipboardData(int32_t aWhichClipboard);
38 NS_IMETHOD GetNativeClipboardData(nsITransferable * aTransferable, int32_t aWhichClipboard);
39
40 private:
41 int32_t mCachedClipboard;
42 int32_t mChangeCount; // Set to the native change count after any modification of the clipboard.
43 };
44
45 #endif // nsClipboard_h_

mercurial