widget/cocoa/nsClipboard.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/cocoa/nsClipboard.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,45 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef nsClipboard_h_
    1.10 +#define nsClipboard_h_
    1.11 +
    1.12 +#include "nsBaseClipboard.h"
    1.13 +#include "nsXPIDLString.h"
    1.14 +
    1.15 +#import <Cocoa/Cocoa.h>
    1.16 +
    1.17 +class nsITransferable;
    1.18 +
    1.19 +class nsClipboard : public nsBaseClipboard
    1.20 +{
    1.21 +
    1.22 +public:
    1.23 +  nsClipboard();
    1.24 +  virtual ~nsClipboard();
    1.25 +
    1.26 +  // nsIClipboard  
    1.27 +  NS_IMETHOD HasDataMatchingFlavors(const char** aFlavorList, uint32_t aLength,
    1.28 +                                    int32_t aWhichClipboard, bool *_retval);
    1.29 +  NS_IMETHOD SupportsFindClipboard(bool *_retval);
    1.30 +
    1.31 +  // Helper methods, used also by nsDragService
    1.32 +  static NSDictionary* PasteboardDictFromTransferable(nsITransferable *aTransferable);
    1.33 +  static bool IsStringType(const nsCString& aMIMEType, NSString** aPasteboardType);
    1.34 +  static NSString* WrapHtmlForSystemPasteboard(NSString* aString);
    1.35 +  static nsresult TransferableFromPasteboard(nsITransferable *aTransferable, NSPasteboard *pboard);
    1.36 +
    1.37 +protected:
    1.38 +
    1.39 +  // impelement the native clipboard behavior
    1.40 +  NS_IMETHOD SetNativeClipboardData(int32_t aWhichClipboard);
    1.41 +  NS_IMETHOD GetNativeClipboardData(nsITransferable * aTransferable, int32_t aWhichClipboard);
    1.42 +  
    1.43 +private:
    1.44 +  int32_t mCachedClipboard;
    1.45 +  int32_t mChangeCount; // Set to the native change count after any modification of the clipboard.
    1.46 +};
    1.47 +
    1.48 +#endif // nsClipboard_h_

mercurial