LibreOffice Module vcl (master)  1
salframeview.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_VCL_INC_OSX_SALFRAMEVIEW_H
21 #define INCLUDED_VCL_INC_OSX_SALFRAMEVIEW_H
22 
23 #include <osx/a11ywrapper.h>
24 
25 enum class SalEvent;
26 
27 @interface SalFrameWindow : NSWindow<NSWindowDelegate>
28 {
31 }
32 -(id)initWithSalFrame: (AquaSalFrame*)pFrame;
33 -(BOOL)canBecomeKeyWindow;
34 -(void)displayIfNeeded;
35 -(void)windowDidBecomeKey: (NSNotification*)pNotification;
36 -(void)windowDidResignKey: (NSNotification*)pNotification;
37 -(void)windowDidChangeScreen: (NSNotification*)pNotification;
38 -(void)windowDidMove: (NSNotification*)pNotification;
39 -(void)windowDidResize: (NSNotification*)pNotification;
40 -(void)windowDidMiniaturize: (NSNotification*)pNotification;
41 -(void)windowDidDeminiaturize: (NSNotification*)pNotification;
42 -(BOOL)windowShouldClose: (NSNotification*)pNotification;
43 //-(void)willEncodeRestorableState:(NSCoder*)pCoderState;
44 //-(void)didDecodeRestorableState:(NSCoder*)pCoderState;
45 //-(void)windowWillEnterVersionBrowser:(NSNotification*)pNotification;
46 -(void)dockMenuItemTriggered: (id)sender;
47 -(AquaSalFrame*)getSalFrame;
48 -(BOOL)containsMouse;
49 -(css::uno::Reference < css::accessibility::XAccessibleContext >)accessibleContext;
50 
51 /* NSDraggingDestination protocol methods
52  */
53 -(NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
54 -(NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
55 -(void)draggingExited:(id <NSDraggingInfo>)sender;
56 -(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
57 -(BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
58 -(void)concludeDragOperation:(id <NSDraggingInfo>)sender;
59 
60 -(void)registerDraggingDestinationHandler:(id)theHandler;
61 -(void)unregisterDraggingDestinationHandler:(id)theHandler;
62 @end
63 
64 @interface SalFrameView : AquaA11yWrapper <NSTextInputClient>
65 {
67 
68  // for NSTextInput/NSTextInputClient
69  NSEvent* mpLastEvent;
73  NSRange mMarkedRange;
74  NSRange mSelectedRange;
77  NSEvent* mpLastSuperEvent;
78 
79  // #i102807# used by magnify event handler
80  NSTimeInterval mfLastMagnifyTime;
81  float mfMagnifyDeltaSum;
82 }
83 +(void)unsetMouseFrame: (AquaSalFrame*)pFrame;
84 -(id)initWithSalFrame: (AquaSalFrame*)pFrame;
85 -(AquaSalFrame*)getSalFrame;
86 -(BOOL)acceptsFirstResponder;
87 -(BOOL)acceptsFirstMouse: (NSEvent *)pEvent;
88 -(BOOL)isOpaque;
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:(sal_uInt16)nButton eventtype:(SalEvent)nEvent;
109 -(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar;
110 -(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod;
111 -(BOOL)sendKeyToFrameDirect: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod;
112 -(BOOL)sendSingleCharacter:(NSEvent*)pEvent;
113 -(BOOL)handleKeyDownException:(NSEvent*)pEvent;
114 -(void)clearLastEvent;
115 /*
116  text action methods
117 */
118 -(void)insertText:(id)aString replacementRange:(NSRange)replacementRange;
119 -(void)insertTab: (id)aSender;
120 -(void)insertBacktab: (id)aSender;
121 -(void)moveLeft: (id)aSender;
122 -(void)moveLeftAndModifySelection: (id)aSender;
123 -(void)moveBackwardAndModifySelection: (id)aSender;
124 -(void)moveRight: (id)aSender;
125 -(void)moveRightAndModifySelection: (id)aSender;
126 -(void)moveForwardAndModifySelection: (id)aSender;
127 -(void)moveUp: (id)aSender;
128 -(void)moveDown: (id)aSender;
129 -(void)moveWordBackward: (id)aSender;
130 -(void)moveWordBackwardAndModifySelection: (id)aSender;
131 -(void)moveWordLeftAndModifySelection: (id)aSender;
132 -(void)moveWordForward: (id)aSender;
133 -(void)moveWordForwardAndModifySelection: (id)aSender;
134 -(void)moveWordRightAndModifySelection: (id)aSender;
135 -(void)moveToEndOfLine: (id)aSender;
136 -(void)moveToRightEndOfLine: (id)aSender;
137 -(void)moveToLeftEndOfLine: (id)aSender;
138 -(void)moveToEndOfLineAndModifySelection: (id)aSender;
139 -(void)moveToRightEndOfLineAndModifySelection: (id)aSender;
140 -(void)moveToLeftEndOfLineAndModifySelection: (id)aSender;
141 -(void)moveToBeginningOfLine: (id)aSender;
142 -(void)moveToBeginningOfLineAndModifySelection: (id)aSender;
143 -(void)moveToEndOfParagraph: (id)aSender;
144 -(void)moveToEndOfParagraphAndModifySelection: (id)aSender;
145 -(void)moveToBeginningOfParagraph: (id)aSender;
146 -(void)moveToBeginningOfParagraphAndModifySelection: (id)aSender;
147 -(void)moveParagraphForward: (id)aSender;
148 -(void)moveParagraphForwardAndModifySelection: (id)aSender;
149 -(void)moveParagraphBackward: (id)aSender;
150 -(void)moveParagraphBackwardAndModifySelection: (id)aSender;
151 -(void)moveToEndOfDocument: (id)aSender;
152 -(void)scrollToEndOfDocument: (id)aSender;
153 -(void)moveToEndOfDocumentAndModifySelection: (id)aSender;
154 -(void)moveToBeginningOfDocument: (id)aSender;
155 -(void)scrollToBeginningOfDocument: (id)aSender;
156 -(void)moveToBeginningOfDocumentAndModifySelection: (id)aSender;
157 -(void)insertNewline: (id)aSender;
158 -(void)deleteBackward: (id)aSender;
159 -(void)deleteForward: (id)aSender;
160 -(void)cancelOperation: (id)aSender;
161 -(void)deleteBackwardByDecomposingPreviousCharacter: (id)aSender;
162 -(void)deleteWordBackward: (id)aSender;
163 -(void)deleteWordForward: (id)aSender;
164 -(void)deleteToBeginningOfLine: (id)aSender;
165 -(void)deleteToEndOfLine: (id)aSender;
166 -(void)deleteToBeginningOfParagraph: (id)aSender;
167 -(void)deleteToEndOfParagraph: (id)aSender;
168 -(void)insertLineBreak: (id)aSender;
169 -(void)insertParagraphSeparator: (id)aSender;
170 -(void)selectWord: (id)aSender;
171 -(void)selectLine: (id)aSender;
172 -(void)selectParagraph: (id)aSender;
173 -(void)selectAll: (id)aSender;
174 -(void)noop: (id)aSender;
175 /* set the correct pointer for our view */
176 -(void)resetCursorRects;
177 -(css::accessibility::XAccessibleContext *)accessibleContext;
178 -(id)parentAttribute;
179 -(NSWindow*)windowForParent;
180 /*
181  Event hook for D&D service.
182 
183  A drag operation will be invoked on a NSView using
184  the method 'dragImage'. This method requires the
185  actual mouse event initiating this drag operation.
186  Mouse events can only be received by subclassing
187  NSView and overriding methods like 'mouseDown' etc.
188  hence we implement an event hook here so that the
189  D&D service can register as listener for mouse
190  messages and use the last 'mouseDown' or
191  'mouseDragged' message to initiate the drag
192  operation.
193 */
194 -(void)registerMouseEventListener: (id)theListener;
195 -(void)unregisterMouseEventListener: (id)theListener;
196 
197 /* NSDraggingDestination protocol methods
198  */
199 -(NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
200 -(NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
201 -(void)draggingExited:(id <NSDraggingInfo>)sender;
202 -(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
203 -(BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
204 -(void)concludeDragOperation:(id <NSDraggingInfo>)sender;
205 
206 -(void)registerDraggingDestinationHandler:(id)theHandler;
207 -(void)unregisterDraggingDestinationHandler:(id)theHandler;
208 
209 @end
210 
211 #endif // INCLUDED_VCL_INC_OSX_SALFRAMEVIEW_H
212 
213 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SAL_CALL mouseEntered(const css::awt::MouseEvent &e) override
id mpMouseEventListener
Definition: salframeview.h:77
NSRange mMarkedRange
Definition: salframeview.h:75
BOOL mbNeedSpecialKeyHandle
Definition: salframeview.h:72
DECL_LISTENERMULTIPLEXER_END void SAL_CALL mouseDragged(const css::awt::MouseEvent &e) override
AquaSalFrame * mpFrame
Definition: salframeview.h:30
BOOL mbInKeyInput
Definition: salframeview.h:73
sal_uInt16 sal_Unicode
const wchar_t *typedef BOOL
NSTimeInterval mfLastMagnifyTime
Definition: salframeview.h:82
void SAL_CALL mouseMoved(const css::awt::MouseEvent &e) override
BOOL mbKeyHandled
Definition: salframeview.h:74
SalEvent
Definition: salwtype.hxx:40
NSEvent * mpLastEvent
Definition: salframeview.h:71
NSRange mSelectedRange
Definition: salframeview.h:76
id mDraggingDestinationHandler
Definition: salframeview.h:31
AquaSalFrame * mpFrame
Definition: salframeview.h:68
NSEvent * mpLastSuperEvent
Definition: salframeview.h:79
void SAL_CALL mouseExited(const css::awt::MouseEvent &e) override
float mfMagnifyDeltaSum
Definition: salframeview.h:83
id mDraggingDestinationHandler
Definition: salframeview.h:78
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo