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