| 1 |
/* AbiSource Application Framework |
| 2 |
* Copyright (C) 1998 AbiSource, Inc. |
| 3 |
* Copyright (C) 2005 Net Integration Technologies Inc. (written by Hubert Figuiere) |
| 4 |
* Copyright (C) 2001, 2003, 2009 Hubert Figuiere |
| 5 |
* |
| 6 |
* This program is free software; you can redistribute it and/or |
| 7 |
* modify it under the terms of the GNU General Public License |
| 8 |
* as published by the Free Software Foundation; either version 2 |
| 9 |
* of the License, or (at your option) any later version. |
| 10 |
* |
| 11 |
* This program is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
* GNU General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU General Public License |
| 17 |
* along with this program; if not, write to the Free Software |
| 18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 19 |
* 02110-1301 USA. |
| 20 |
*/ |
| 21 |
|
| 22 |
#ifndef XAP_COCOACLIPBOARD_H |
| 23 |
#define XAP_COCOACLIPBOARD_H |
| 24 |
|
| 25 |
#import <AppKit/AppKit.h> |
| 26 |
|
| 27 |
#include "ut_types.h" |
| 28 |
#include "xap_CocoaApp.h" |
| 29 |
#include "xap_FakeClipboard.h" |
| 30 |
|
| 31 |
////////////////////////////////////////////////////////////////// |
| 32 |
|
| 33 |
class XAP_CocoaClipboard |
| 34 |
: public XAP_FakeClipboard |
| 35 |
{ |
| 36 |
public: |
| 37 |
|
| 38 |
XAP_CocoaClipboard(); |
| 39 |
virtual ~XAP_CocoaClipboard(); |
| 40 |
|
| 41 |
virtual bool clearClipboard(void); |
| 42 |
|
| 43 |
virtual bool addData(const char* format, void* pData, UT_sint32 iNumBytes); |
| 44 |
virtual bool getClipboardData(const char** formatAccepted, void ** ppData, UT_uint32 * pLen, const char ** szFormatFound); |
| 45 |
virtual bool hasFormat(const char* format); |
| 46 |
/*! return if clipboard has one of the formats listed |
| 47 |
*/ |
| 48 |
bool hasFormats(const char** format); |
| 49 |
void prepareForText(); |
| 50 |
NSPasteboard *_getPasteboard () { return [NSPasteboard generalPasteboard]; }; |
| 51 |
static const char * XAP_CLIPBOARD_TEXTPLAIN_8BIT; |
| 52 |
static const char * XAP_CLIPBOARD_STRING; |
| 53 |
static const char * XAP_CLIPBOARD_COMPOUND_TEXT; |
| 54 |
static const char * XAP_CLIPBOARD_RTF; |
| 55 |
static const char * XAP_CLIPBOARD_IMAGE; |
| 56 |
|
| 57 |
private: |
| 58 |
static NSString *_abi2ns_cbType(const char *); |
| 59 |
}; |
| 60 |
|
| 61 |
#endif /* XAP_COCOACLIPBOARD_H */ |