michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsClipboard_h_ michael@0: #define nsClipboard_h_ michael@0: michael@0: #include "nsBaseClipboard.h" michael@0: #include "nsXPIDLString.h" michael@0: michael@0: #import michael@0: michael@0: class nsITransferable; michael@0: michael@0: class nsClipboard : public nsBaseClipboard michael@0: { michael@0: michael@0: public: michael@0: nsClipboard(); michael@0: virtual ~nsClipboard(); michael@0: michael@0: // nsIClipboard michael@0: NS_IMETHOD HasDataMatchingFlavors(const char** aFlavorList, uint32_t aLength, michael@0: int32_t aWhichClipboard, bool *_retval); michael@0: NS_IMETHOD SupportsFindClipboard(bool *_retval); michael@0: michael@0: // Helper methods, used also by nsDragService michael@0: static NSDictionary* PasteboardDictFromTransferable(nsITransferable *aTransferable); michael@0: static bool IsStringType(const nsCString& aMIMEType, NSString** aPasteboardType); michael@0: static NSString* WrapHtmlForSystemPasteboard(NSString* aString); michael@0: static nsresult TransferableFromPasteboard(nsITransferable *aTransferable, NSPasteboard *pboard); michael@0: michael@0: protected: michael@0: michael@0: // impelement the native clipboard behavior michael@0: NS_IMETHOD SetNativeClipboardData(int32_t aWhichClipboard); michael@0: NS_IMETHOD GetNativeClipboardData(nsITransferable * aTransferable, int32_t aWhichClipboard); michael@0: michael@0: private: michael@0: int32_t mCachedClipboard; michael@0: int32_t mChangeCount; // Set to the native change count after any modification of the clipboard. michael@0: }; michael@0: michael@0: #endif // nsClipboard_h_