1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: salframeview.h,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _VCL_SALFRAMEVIEW_H
32 #define _VCL_SALFRAMEVIEW_H
34 #include "aqua11ywrapper.h"
36 @interface SalFrameWindow
: NSWindow
38 AquaSalFrame
* mpFrame
;
39 id mDraggingDestinationHandler
;
41 -(id
)initWithSalFrame
: (AquaSalFrame
*)pFrame
;
42 -(MacOSBOOL
)canBecomeKeyWindow
;
43 -(void)windowDidBecomeKey
: (NSNotification
*)pNotification
;
44 -(void)windowDidResignKey
: (NSNotification
*)pNotification
;
45 -(void)windowDidChangeScreen
: (NSNotification
*)pNotification
;
46 -(void)windowDidMove
: (NSNotification
*)pNotification
;
47 -(void)windowDidResize
: (NSNotification
*)pNotification
;
48 -(void)windowDidMiniaturize
: (NSNotification
*)pNotification
;
49 -(void)windowDidDeminiaturize
: (NSNotification
*)pNotification
;
50 -(MacOSBOOL
)windowShouldClose
: (NSNotification
*)pNotification
;
51 -(void)dockMenuItemTriggered
: (id
)sender
;
52 -(AquaSalFrame
*)getSalFrame
;
53 -(MacOSBOOL
)containsMouse
;
54 -(::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessibleContext
>)accessibleContext
;
56 /* NSDraggingDestination protocol methods
58 -(NSDragOperation
)draggingEntered
:(id
<NSDraggingInfo
>)sender
;
59 -(NSDragOperation
)draggingUpdated
:(id
<NSDraggingInfo
>)sender
;
60 -(void)draggingExited
:(id
<NSDraggingInfo
>)sender
;
61 -(MacOSBOOL
)prepareForDragOperation
:(id
<NSDraggingInfo
>)sender
;
62 -(MacOSBOOL
)performDragOperation
:(id
<NSDraggingInfo
>)sender
;
63 -(void)concludeDragOperation
:(id
<NSDraggingInfo
>)sender
;
65 -(void)registerDraggingDestinationHandler
:(id
)theHandler
;
66 -(void)unregisterDraggingDestinationHandler
:(id
)theHandler
;
69 @interface SalFrameView
: AquaA11yWrapper
<NSTextInput
>
71 AquaSalFrame
* mpFrame
;
75 BOOL mbNeedSpecialKeyHandle
;
79 NSRange mSelectedRange
;
80 id mpMouseEventListener
;
81 id mDraggingDestinationHandler
;
82 NSEvent
* mpLastSuperEvent
;
84 +(void)unsetMouseFrame
: (AquaSalFrame
*)pFrame
;
85 -(id
)initWithSalFrame
: (AquaSalFrame
*)pFrame
;
86 -(MacOSBOOL
)acceptsFirstResponder
;
87 -(MacOSBOOL
)acceptsFirstMouse
: (NSEvent
*)pEvent
;
89 -(void)drawRect
: (NSRect
)aRect
;
90 -(void)mouseDown
: (NSEvent
*)pEvent
;
91 -(void)mouseDragged
: (NSEvent
*)pEvent
;
92 -(void)mouseUp
: (NSEvent
*)pEvent
;
93 -(void)mouseMoved
: (NSEvent
*)pEvent
;
94 -(void)mouseEntered
: (NSEvent
*)pEvent
;
95 -(void)mouseExited
: (NSEvent
*)pEvent
;
96 -(void)rightMouseDown
: (NSEvent
*)pEvent
;
97 -(void)rightMouseDragged
: (NSEvent
*)pEvent
;
98 -(void)rightMouseUp
: (NSEvent
*)pEvent
;
99 -(void)otherMouseDown
: (NSEvent
*)pEvent
;
100 -(void)otherMouseDragged
: (NSEvent
*)pEvent
;
101 -(void)otherMouseUp
: (NSEvent
*)pEvent
;
102 -(void)scrollWheel
: (NSEvent
*)pEvent
;
103 -(void)magnifyWithEvent
: (NSEvent
*)pEvent
;
104 -(void)rotateWithEvent
: (NSEvent
*)pEvent
;
105 -(void)swipeWithEvent
: (NSEvent
*)pEvent
;
106 -(void)keyDown
: (NSEvent
*)pEvent
;
107 -(void)flagsChanged
: (NSEvent
*)pEvent
;
108 -(void)sendMouseEventToFrame
:(NSEvent
*)pEvent button
:(USHORT
)nButton eventtype
:(USHORT
)nEvent
;
109 -(MacOSBOOL
)sendKeyInputAndReleaseToFrame
: (USHORT
)nKeyCode character
: (sal_Unicode
)aChar
;
110 -(MacOSBOOL
)sendKeyInputAndReleaseToFrame
: (USHORT
)nKeyCode character
: (sal_Unicode
)aChar modifiers
: (unsigned int)nMod
;
111 -(MacOSBOOL
)sendKeyToFrameDirect
: (USHORT
)nKeyCode character
: (sal_Unicode
)aChar modifiers
: (unsigned int)nMod
;
112 -(MacOSBOOL
)sendSingleCharacter
:(NSEvent
*)pEvent
;
113 -(MacOSBOOL
)handleKeyDownException
:(NSEvent
*)pEvent
;
117 -(void)insertText
:(id
)aString
;
118 -(void)insertTab
: (id
)aSender
;
119 -(void)insertBacktab
: (id
)aSender
;
120 -(void)moveLeft
: (id
)aSender
;
121 -(void)moveLeftAndModifySelection
: (id
)aSender
;
122 -(void)moveBackwardAndModifySelection
: (id
)aSender
;
123 -(void)moveRight
: (id
)aSender
;
124 -(void)moveRightAndModifySelection
: (id
)aSender
;
125 -(void)moveForwardAndModifySelection
: (id
)aSender
;
126 -(void)moveUp
: (id
)aSender
;
127 -(void)moveDown
: (id
)aSender
;
128 -(void)moveWordBackward
: (id
)aSender
;
129 -(void)moveWordBackwardAndModifySelection
: (id
)aSender
;
130 -(void)moveWordLeftAndModifySelection
: (id
)aSender
;
131 -(void)moveWordForward
: (id
)aSender
;
132 -(void)moveWordForwardAndModifySelection
: (id
)aSender
;
133 -(void)moveWordRightAndModifySelection
: (id
)aSender
;
134 -(void)moveToEndOfLine
: (id
)aSender
;
135 -(void)moveToEndOfLineAndModifySelection
: (id
)aSender
;
136 -(void)moveToBeginningOfLine
: (id
)aSender
;
137 -(void)moveToBeginningOfLineAndModifySelection
: (id
)aSender
;
138 -(void)moveToEndOfParagraph
: (id
)aSender
;
139 -(void)moveToEndOfParagraphAndModifySelection
: (id
)aSender
;
140 -(void)moveToBeginningOfParagraph
: (id
)aSender
;
141 -(void)moveToBeginningOfParagraphAndModifySelection
: (id
)aSender
;
142 -(void)moveParagraphForward
: (id
)aSender
;
143 -(void)moveParagraphForwardAndModifySelection
: (id
)aSender
;
144 -(void)moveParagraphBackward
: (id
)aSender
;
145 -(void)moveParagraphBackwardAndModifySelection
: (id
)aSender
;
146 -(void)moveToEndOfDocument
: (id
)aSender
;
147 -(void)moveToEndOfDocumentAndModifySelection
: (id
)aSender
;
148 -(void)moveToBeginningOfDocument
: (id
)aSender
;
149 -(void)moveToBeginningOfDocumentAndModifySelection
: (id
)aSender
;
150 -(void)insertNewline
: (id
)aSender
;
151 -(void)deleteBackward
: (id
)aSender
;
152 -(void)deleteForward
: (id
)aSender
;
153 -(void)cancelOperation
: (id
)aSender
;
154 -(void)deleteBackwardByDecomposingPreviousCharacter
: (id
)aSender
;
155 -(void)deleteWordBackward
: (id
)aSender
;
156 -(void)deleteWordForward
: (id
)aSender
;
157 -(void)deleteToBeginningOfLine
: (id
)aSender
;
158 -(void)deleteToEndOfLine
: (id
)aSender
;
159 -(void)deleteToBeginningOfParagraph
: (id
)aSender
;
160 -(void)deleteToEndOfParagraph
: (id
)aSender
;
161 -(void)insertLineBreak
: (id
)aSender
;
162 -(void)insertParagraphSeparator
: (id
)aSender
;
163 -(void)selectWord
: (id
)aSender
;
164 -(void)selectLine
: (id
)aSender
;
165 -(void)selectParagraph
: (id
)aSender
;
166 -(void)selectAll
: (id
)aSender
;
167 -(void)noop
: (id
)aSender
;
168 /* set the correct pointer for our view */
169 -(void)resetCursorRects
;
170 -(::com::sun::star::accessibility::XAccessibleContext
*)accessibleContext
;
171 -(id
)parentAttribute
;
172 -(NSView
*)viewElementForParent
;
174 Event hook for D&D service.
176 A drag operation will be invoked on a NSView using
177 the method 'dragImage'. This method requires the
178 actual mouse event initiating this drag operation.
179 Mouse events can only be received by subclassing
180 NSView and overriding methods like 'mouseDown' etc.
181 hence we implement a event hook here so that the
182 D&D service can register as listener for mouse
183 messages and use the last 'mouseDown' or
184 'mouseDragged' message to initiate the drag
187 -(void)registerMouseEventListener
: (id
)theListener
;
188 -(void)unregisterMouseEventListener
: (id
)theListener
;
190 /* NSDraggingDestination protocol methods
192 -(NSDragOperation
)draggingEntered
:(id
<NSDraggingInfo
>)sender
;
193 -(NSDragOperation
)draggingUpdated
:(id
<NSDraggingInfo
>)sender
;
194 -(void)draggingExited
:(id
<NSDraggingInfo
>)sender
;
195 -(MacOSBOOL
)prepareForDragOperation
:(id
<NSDraggingInfo
>)sender
;
196 -(MacOSBOOL
)performDragOperation
:(id
<NSDraggingInfo
>)sender
;
197 -(void)concludeDragOperation
:(id
<NSDraggingInfo
>)sender
;
199 -(void)registerDraggingDestinationHandler
:(id
)theHandler
;
200 -(void)unregisterDraggingDestinationHandler
:(id
)theHandler
;