Path: blob/master/src/java.desktop/macosx/native/libawt_lwawt/awt/CDragSource.h
41152 views
/*1* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425#ifndef CDragSource_h26#define CDragSource_h2728#import <Cocoa/Cocoa.h>29#include <jni.h>3031@class CDragSource;3233@protocol CDragSourceHolder34- (void) setDragSource:(CDragSource *)source;35@end3637@interface CDragSource : NSObject {38@private39NSView<CDragSourceHolder>* fView;40jobject fComponent;41jobject fDragSourceContextPeer;4243jobject fTransferable;44jobject fTriggerEvent;45jlong fTriggerEventTimeStamp;46NSPoint fDragPos;47jint fClickCount;48jint fModifiers;4950NSImage* fDragImage;51NSPoint fDragImageOffset;5253jint fSourceActions;54jlongArray fFormats;55jobject fFormatMap;5657jint fDragKeyModifiers;58jint fDragMouseModifiers;59}6061// Common methods:62- (id) init:(jobject)jDragSourceContextPeer63component:(jobject)jComponent64control:(id)control65transferable:(jobject)jTransferable66triggerEvent:(jobject)jTrigger67dragPosX:(jint)dragPosX68dragPosY:(jint)dragPosY69modifiers:(jint)extModifiers70clickCount:(jint)clickCount71timeStamp:(jlong)timeStamp72dragImage:(jlong)nsDragImagePtr73dragImageOffsetX:(jint)jDragImageOffsetX74dragImageOffsetY:(jint)jDragImageOffsetY75sourceActions:(jint)jSourceActions76formats:(jlongArray)jFormats77formatMap:(jobject)jFormatMap;7879- (void)removeFromView:(JNIEnv *)env;8081- (void)drag;8283// dnd APIs (see AppKit/NSDragging.h, NSDraggingSource):84- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)flag;85- (void)draggedImage:(NSImage *)image beganAt:(NSPoint)screenPoint;86- (void)draggedImage:(NSImage *)image endedAt:(NSPoint)screenPoint operation:(NSDragOperation)operation;87- (void)draggedImage:(NSImage *)image movedTo:(NSPoint)screenPoint;88- (BOOL)ignoreModifierKeysWhileDragging;8990@end9192#endif // CDragSource_h939495