124f6443dSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 324f6443dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 424f6443dSAndrew Rist * or more contributor license agreements. See the NOTICE file 524f6443dSAndrew Rist * distributed with this work for additional information 624f6443dSAndrew Rist * regarding copyright ownership. The ASF licenses this file 724f6443dSAndrew Rist * to you under the Apache License, Version 2.0 (the 824f6443dSAndrew Rist * "License"); you may not use this file except in compliance 924f6443dSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 1124f6443dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 1324f6443dSAndrew Rist * Unless required by applicable law or agreed to in writing, 1424f6443dSAndrew Rist * software distributed under the License is distributed on an 1524f6443dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 1624f6443dSAndrew Rist * KIND, either express or implied. See the License for the 1724f6443dSAndrew Rist * specific language governing permissions and limitations 1824f6443dSAndrew Rist * under the License. 19cdf0e10cSrcweir * 2024f6443dSAndrew Rist *************************************************************/ 2124f6443dSAndrew Rist 2224f6443dSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _VCL_SALFRAMEVIEW_H 25cdf0e10cSrcweir #define _VCL_SALFRAMEVIEW_H 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "aqua/aqua11ywrapper.h" 28cdf0e10cSrcweir 292dae3561SHerbert Dürr @interface SalFrameWindow : NSWindow<NSWindowDelegate> 30cdf0e10cSrcweir { 31cdf0e10cSrcweir AquaSalFrame* mpFrame; 32cdf0e10cSrcweir id mDraggingDestinationHandler; 33cdf0e10cSrcweir } 34cdf0e10cSrcweir -(id)initWithSalFrame: (AquaSalFrame*)pFrame; 35cdf0e10cSrcweir -(BOOL)canBecomeKeyWindow; 36cdf0e10cSrcweir -(void)displayIfNeeded; 37cdf0e10cSrcweir -(void)windowDidBecomeKey: (NSNotification*)pNotification; 38cdf0e10cSrcweir -(void)windowDidResignKey: (NSNotification*)pNotification; 39cdf0e10cSrcweir -(void)windowDidChangeScreen: (NSNotification*)pNotification; 40cdf0e10cSrcweir -(void)windowDidMove: (NSNotification*)pNotification; 41cdf0e10cSrcweir -(void)windowDidResize: (NSNotification*)pNotification; 42cdf0e10cSrcweir -(void)windowDidMiniaturize: (NSNotification*)pNotification; 43cdf0e10cSrcweir -(void)windowDidDeminiaturize: (NSNotification*)pNotification; 44cdf0e10cSrcweir -(BOOL)windowShouldClose: (NSNotification*)pNotification; 452dae3561SHerbert Dürr //-(void)willEncodeRestorableState:(NSCoder*)pCoderState; 462dae3561SHerbert Dürr //-(void)didDecodeRestorableState:(NSCoder*)pCoderState; 472dae3561SHerbert Dürr //-(void)windowWillEnterVersionBrowser:(NSNotification*)pNotification; 48cdf0e10cSrcweir -(void)dockMenuItemTriggered: (id)sender; 49cdf0e10cSrcweir -(AquaSalFrame*)getSalFrame; 50cdf0e10cSrcweir -(BOOL)containsMouse; 51cdf0e10cSrcweir -(::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >)accessibleContext; 52cdf0e10cSrcweir 53cdf0e10cSrcweir /* NSDraggingDestination protocol methods 54cdf0e10cSrcweir */ 55cdf0e10cSrcweir -(NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender; 56cdf0e10cSrcweir -(NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender; 57cdf0e10cSrcweir -(void)draggingExited:(id <NSDraggingInfo>)sender; 58cdf0e10cSrcweir -(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender; 59cdf0e10cSrcweir -(BOOL)performDragOperation:(id <NSDraggingInfo>)sender; 60cdf0e10cSrcweir -(void)concludeDragOperation:(id <NSDraggingInfo>)sender; 61cdf0e10cSrcweir 62cdf0e10cSrcweir -(void)registerDraggingDestinationHandler:(id)theHandler; 63cdf0e10cSrcweir -(void)unregisterDraggingDestinationHandler:(id)theHandler; 64cdf0e10cSrcweir @end 65cdf0e10cSrcweir 66cdf0e10cSrcweir @interface SalFrameView : AquaA11yWrapper <NSTextInput> 67cdf0e10cSrcweir { 68cdf0e10cSrcweir AquaSalFrame* mpFrame; 69cdf0e10cSrcweir 70cdf0e10cSrcweir // for NSTextInput 71cdf0e10cSrcweir NSEvent* mpLastEvent; 72cdf0e10cSrcweir BOOL mbNeedSpecialKeyHandle; 73cdf0e10cSrcweir BOOL mbInKeyInput; 74cdf0e10cSrcweir BOOL mbKeyHandled; 75cdf0e10cSrcweir NSRange mMarkedRange; 76cdf0e10cSrcweir NSRange mSelectedRange; 77cdf0e10cSrcweir id mpMouseEventListener; 78cdf0e10cSrcweir id mDraggingDestinationHandler; 79cdf0e10cSrcweir NSEvent* mpLastSuperEvent; 80cdf0e10cSrcweir 81cdf0e10cSrcweir // #i102807# used by magnify event handler 82cdf0e10cSrcweir NSTimeInterval mfLastMagnifyTime; 83cdf0e10cSrcweir float mfMagnifyDeltaSum; 84cdf0e10cSrcweir } 85cdf0e10cSrcweir +(void)unsetMouseFrame: (AquaSalFrame*)pFrame; 86cdf0e10cSrcweir -(id)initWithSalFrame: (AquaSalFrame*)pFrame; 87cdf0e10cSrcweir -(AquaSalFrame*)getSalFrame; 88cdf0e10cSrcweir -(BOOL)acceptsFirstResponder; 89cdf0e10cSrcweir -(BOOL)acceptsFirstMouse: (NSEvent *)pEvent; 90cdf0e10cSrcweir -(BOOL)isOpaque; 91cdf0e10cSrcweir -(void)drawRect: (NSRect)aRect; 92cdf0e10cSrcweir -(void)mouseDown: (NSEvent*)pEvent; 93cdf0e10cSrcweir -(void)mouseDragged: (NSEvent*)pEvent; 94cdf0e10cSrcweir -(void)mouseUp: (NSEvent*)pEvent; 95cdf0e10cSrcweir -(void)mouseMoved: (NSEvent*)pEvent; 96cdf0e10cSrcweir -(void)mouseEntered: (NSEvent*)pEvent; 97cdf0e10cSrcweir -(void)mouseExited: (NSEvent*)pEvent; 98cdf0e10cSrcweir -(void)rightMouseDown: (NSEvent*)pEvent; 99cdf0e10cSrcweir -(void)rightMouseDragged: (NSEvent*)pEvent; 100cdf0e10cSrcweir -(void)rightMouseUp: (NSEvent*)pEvent; 101cdf0e10cSrcweir -(void)otherMouseDown: (NSEvent*)pEvent; 102cdf0e10cSrcweir -(void)otherMouseDragged: (NSEvent*)pEvent; 103cdf0e10cSrcweir -(void)otherMouseUp: (NSEvent*)pEvent; 104cdf0e10cSrcweir -(void)scrollWheel: (NSEvent*)pEvent; 105cdf0e10cSrcweir -(void)magnifyWithEvent: (NSEvent*)pEvent; 106cdf0e10cSrcweir -(void)rotateWithEvent: (NSEvent*)pEvent; 107cdf0e10cSrcweir -(void)swipeWithEvent: (NSEvent*)pEvent; 108cdf0e10cSrcweir -(void)keyDown: (NSEvent*)pEvent; 109cdf0e10cSrcweir -(void)flagsChanged: (NSEvent*)pEvent; 110cdf0e10cSrcweir -(void)sendMouseEventToFrame:(NSEvent*)pEvent button:(sal_uInt16)nButton eventtype:(sal_uInt16)nEvent; 111cdf0e10cSrcweir -(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar; 112cdf0e10cSrcweir -(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod; 113cdf0e10cSrcweir -(BOOL)sendKeyToFrameDirect: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod; 114cdf0e10cSrcweir -(BOOL)sendSingleCharacter:(NSEvent*)pEvent; 115cdf0e10cSrcweir -(BOOL)handleKeyDownException:(NSEvent*)pEvent; 116cdf0e10cSrcweir -(void)clearLastEvent; 117cdf0e10cSrcweir /* 118cdf0e10cSrcweir text action methods 119cdf0e10cSrcweir */ 120cdf0e10cSrcweir -(void)insertText:(id)aString; 121cdf0e10cSrcweir -(void)insertTab: (id)aSender; 122cdf0e10cSrcweir -(void)insertBacktab: (id)aSender; 123cdf0e10cSrcweir -(void)moveLeft: (id)aSender; 124cdf0e10cSrcweir -(void)moveLeftAndModifySelection: (id)aSender; 125cdf0e10cSrcweir -(void)moveBackwardAndModifySelection: (id)aSender; 126cdf0e10cSrcweir -(void)moveRight: (id)aSender; 127cdf0e10cSrcweir -(void)moveRightAndModifySelection: (id)aSender; 128cdf0e10cSrcweir -(void)moveForwardAndModifySelection: (id)aSender; 129cdf0e10cSrcweir -(void)moveUp: (id)aSender; 130cdf0e10cSrcweir -(void)moveDown: (id)aSender; 131cdf0e10cSrcweir -(void)moveWordBackward: (id)aSender; 132cdf0e10cSrcweir -(void)moveWordBackwardAndModifySelection: (id)aSender; 133cdf0e10cSrcweir -(void)moveWordLeftAndModifySelection: (id)aSender; 134cdf0e10cSrcweir -(void)moveWordForward: (id)aSender; 135cdf0e10cSrcweir -(void)moveWordForwardAndModifySelection: (id)aSender; 136cdf0e10cSrcweir -(void)moveWordRightAndModifySelection: (id)aSender; 137cdf0e10cSrcweir -(void)moveToEndOfLine: (id)aSender; 138cdf0e10cSrcweir -(void)moveToRightEndOfLine: (id)aSender; 139cdf0e10cSrcweir -(void)moveToLeftEndOfLine: (id)aSender; 140cdf0e10cSrcweir -(void)moveToEndOfLineAndModifySelection: (id)aSender; 141cdf0e10cSrcweir -(void)moveToRightEndOfLineAndModifySelection: (id)aSender; 142cdf0e10cSrcweir -(void)moveToLeftEndOfLineAndModifySelection: (id)aSender; 143cdf0e10cSrcweir -(void)moveToBeginningOfLine: (id)aSender; 144cdf0e10cSrcweir -(void)moveToBeginningOfLineAndModifySelection: (id)aSender; 145cdf0e10cSrcweir -(void)moveToEndOfParagraph: (id)aSender; 146cdf0e10cSrcweir -(void)moveToEndOfParagraphAndModifySelection: (id)aSender; 147cdf0e10cSrcweir -(void)moveToBeginningOfParagraph: (id)aSender; 148cdf0e10cSrcweir -(void)moveToBeginningOfParagraphAndModifySelection: (id)aSender; 149cdf0e10cSrcweir -(void)moveParagraphForward: (id)aSender; 150cdf0e10cSrcweir -(void)moveParagraphForwardAndModifySelection: (id)aSender; 151cdf0e10cSrcweir -(void)moveParagraphBackward: (id)aSender; 152cdf0e10cSrcweir -(void)moveParagraphBackwardAndModifySelection: (id)aSender; 153cdf0e10cSrcweir -(void)moveToEndOfDocument: (id)aSender; 154cdf0e10cSrcweir -(void)scrollToEndOfDocument: (id)aSender; 155cdf0e10cSrcweir -(void)moveToEndOfDocumentAndModifySelection: (id)aSender; 156cdf0e10cSrcweir -(void)moveToBeginningOfDocument: (id)aSender; 157cdf0e10cSrcweir -(void)scrollToBeginningOfDocument: (id)aSender; 158cdf0e10cSrcweir -(void)moveToBeginningOfDocumentAndModifySelection: (id)aSender; 159cdf0e10cSrcweir -(void)insertNewline: (id)aSender; 160cdf0e10cSrcweir -(void)deleteBackward: (id)aSender; 161cdf0e10cSrcweir -(void)deleteForward: (id)aSender; 162cdf0e10cSrcweir -(void)cancelOperation: (id)aSender; 163cdf0e10cSrcweir -(void)deleteBackwardByDecomposingPreviousCharacter: (id)aSender; 164cdf0e10cSrcweir -(void)deleteWordBackward: (id)aSender; 165cdf0e10cSrcweir -(void)deleteWordForward: (id)aSender; 166cdf0e10cSrcweir -(void)deleteToBeginningOfLine: (id)aSender; 167cdf0e10cSrcweir -(void)deleteToEndOfLine: (id)aSender; 168cdf0e10cSrcweir -(void)deleteToBeginningOfParagraph: (id)aSender; 169cdf0e10cSrcweir -(void)deleteToEndOfParagraph: (id)aSender; 170cdf0e10cSrcweir -(void)insertLineBreak: (id)aSender; 171cdf0e10cSrcweir -(void)insertParagraphSeparator: (id)aSender; 172cdf0e10cSrcweir -(void)selectWord: (id)aSender; 173cdf0e10cSrcweir -(void)selectLine: (id)aSender; 174cdf0e10cSrcweir -(void)selectParagraph: (id)aSender; 175cdf0e10cSrcweir -(void)selectAll: (id)aSender; 176cdf0e10cSrcweir -(void)noop: (id)aSender; 177cdf0e10cSrcweir /* set the correct pointer for our view */ 178cdf0e10cSrcweir -(void)resetCursorRects; 179cdf0e10cSrcweir -(::com::sun::star::accessibility::XAccessibleContext *)accessibleContext; 180cdf0e10cSrcweir -(id)parentAttribute; 181*2fb76c82SHerbert Dürr -(NSWindow*)windowForParent; 182cdf0e10cSrcweir /* 183cdf0e10cSrcweir Event hook for D&D service. 184cdf0e10cSrcweir 185cdf0e10cSrcweir A drag operation will be invoked on a NSView using 186cdf0e10cSrcweir the method 'dragImage'. This method requires the 187cdf0e10cSrcweir actual mouse event initiating this drag operation. 188cdf0e10cSrcweir Mouse events can only be received by subclassing 189cdf0e10cSrcweir NSView and overriding methods like 'mouseDown' etc. 190cdf0e10cSrcweir hence we implement a event hook here so that the 191cdf0e10cSrcweir D&D service can register as listener for mouse 192cdf0e10cSrcweir messages and use the last 'mouseDown' or 193cdf0e10cSrcweir 'mouseDragged' message to initiate the drag 194cdf0e10cSrcweir operation. 195cdf0e10cSrcweir */ 196cdf0e10cSrcweir -(void)registerMouseEventListener: (id)theListener; 197cdf0e10cSrcweir -(void)unregisterMouseEventListener: (id)theListener; 198cdf0e10cSrcweir 199cdf0e10cSrcweir /* NSDraggingDestination protocol methods 200cdf0e10cSrcweir */ 201cdf0e10cSrcweir -(NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender; 202cdf0e10cSrcweir -(NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender; 203cdf0e10cSrcweir -(void)draggingExited:(id <NSDraggingInfo>)sender; 204cdf0e10cSrcweir -(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender; 205cdf0e10cSrcweir -(BOOL)performDragOperation:(id <NSDraggingInfo>)sender; 206cdf0e10cSrcweir -(void)concludeDragOperation:(id <NSDraggingInfo>)sender; 207cdf0e10cSrcweir 208cdf0e10cSrcweir -(void)registerDraggingDestinationHandler:(id)theHandler; 209cdf0e10cSrcweir -(void)unregisterDraggingDestinationHandler:(id)theHandler; 210cdf0e10cSrcweir 211cdf0e10cSrcweir @end 212cdf0e10cSrcweir 213cdf0e10cSrcweir #endif 214