Branch libreoffice-5-0-4
[LibreOffice.git] / vcl / inc / osx / salframeview.h
blob93f8b8f42634d1420f293720bbacafd2f22bd155
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_VCL_INC_OSX_SALFRAMEVIEW_H
21 #define INCLUDED_VCL_INC_OSX_SALFRAMEVIEW_H
23 #include "osx/a11ywrapper.h"
25 @interface SalFrameWindow : NSWindow<NSWindowDelegate>
27 AquaSalFrame* mpFrame;
28 id mDraggingDestinationHandler;
30 -(id)initWithSalFrame: (AquaSalFrame*)pFrame;
31 -(BOOL)canBecomeKeyWindow;
32 -(void)displayIfNeeded;
33 -(void)windowDidBecomeKey: (NSNotification*)pNotification;
34 -(void)windowDidResignKey: (NSNotification*)pNotification;
35 -(void)windowDidChangeScreen: (NSNotification*)pNotification;
36 -(void)windowDidMove: (NSNotification*)pNotification;
37 -(void)windowDidResize: (NSNotification*)pNotification;
38 -(void)windowDidMiniaturize: (NSNotification*)pNotification;
39 -(void)windowDidDeminiaturize: (NSNotification*)pNotification;
40 -(BOOL)windowShouldClose: (NSNotification*)pNotification;
41 //-(void)willEncodeRestorableState:(NSCoder*)pCoderState;
42 //-(void)didDecodeRestorableState:(NSCoder*)pCoderState;
43 //-(void)windowWillEnterVersionBrowser:(NSNotification*)pNotification;
44 -(void)dockMenuItemTriggered: (id)sender;
45 -(AquaSalFrame*)getSalFrame;
46 -(BOOL)containsMouse;
47 -(::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >)accessibleContext;
49 /* NSDraggingDestination protocol methods
51 -(NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
52 -(NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
53 -(void)draggingExited:(id <NSDraggingInfo>)sender;
54 -(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
55 -(BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
56 -(void)concludeDragOperation:(id <NSDraggingInfo>)sender;
58 -(void)registerDraggingDestinationHandler:(id)theHandler;
59 -(void)unregisterDraggingDestinationHandler:(id)theHandler;
60 @end
62 @interface SalFrameView : AquaA11yWrapper <NSTextInputClient>
64 AquaSalFrame* mpFrame;
66 // for NSTextInput/NSTextInputClient
67 NSEvent* mpLastEvent;
68 BOOL mbNeedSpecialKeyHandle;
69 BOOL mbInKeyInput;
70 BOOL mbKeyHandled;
71 NSRange mMarkedRange;
72 NSRange mSelectedRange;
73 id mpMouseEventListener;
74 id mDraggingDestinationHandler;
75 NSEvent* mpLastSuperEvent;
77 // #i102807# used by magnify event handler
78 NSTimeInterval mfLastMagnifyTime;
79 float mfMagnifyDeltaSum;
81 +(void)unsetMouseFrame: (AquaSalFrame*)pFrame;
82 -(id)initWithSalFrame: (AquaSalFrame*)pFrame;
83 -(AquaSalFrame*)getSalFrame;
84 -(BOOL)acceptsFirstResponder;
85 -(BOOL)acceptsFirstMouse: (NSEvent *)pEvent;
86 -(BOOL)isOpaque;
87 -(void)drawRect: (NSRect)aRect;
88 -(void)mouseDown: (NSEvent*)pEvent;
89 -(void)mouseDragged: (NSEvent*)pEvent;
90 -(void)mouseUp: (NSEvent*)pEvent;
91 -(void)mouseMoved: (NSEvent*)pEvent;
92 -(void)mouseEntered: (NSEvent*)pEvent;
93 -(void)mouseExited: (NSEvent*)pEvent;
94 -(void)rightMouseDown: (NSEvent*)pEvent;
95 -(void)rightMouseDragged: (NSEvent*)pEvent;
96 -(void)rightMouseUp: (NSEvent*)pEvent;
97 -(void)otherMouseDown: (NSEvent*)pEvent;
98 -(void)otherMouseDragged: (NSEvent*)pEvent;
99 -(void)otherMouseUp: (NSEvent*)pEvent;
100 -(void)scrollWheel: (NSEvent*)pEvent;
101 -(void)magnifyWithEvent: (NSEvent*)pEvent;
102 -(void)rotateWithEvent: (NSEvent*)pEvent;
103 -(void)swipeWithEvent: (NSEvent*)pEvent;
104 -(void)keyDown: (NSEvent*)pEvent;
105 -(void)flagsChanged: (NSEvent*)pEvent;
106 -(void)sendMouseEventToFrame:(NSEvent*)pEvent button:(sal_uInt16)nButton eventtype:(sal_uInt16)nEvent;
107 -(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar;
108 -(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod;
109 -(BOOL)sendKeyToFrameDirect: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod;
110 -(BOOL)sendSingleCharacter:(NSEvent*)pEvent;
111 -(BOOL)handleKeyDownException:(NSEvent*)pEvent;
112 -(void)clearLastEvent;
114 text action methods
116 -(void)insertText:(id)aString replacementRange:(NSRange)replacementRange;
117 -(void)insertTab: (id)aSender;
118 -(void)insertBacktab: (id)aSender;
119 -(void)moveLeft: (id)aSender;
120 -(void)moveLeftAndModifySelection: (id)aSender;
121 -(void)moveBackwardAndModifySelection: (id)aSender;
122 -(void)moveRight: (id)aSender;
123 -(void)moveRightAndModifySelection: (id)aSender;
124 -(void)moveForwardAndModifySelection: (id)aSender;
125 -(void)moveUp: (id)aSender;
126 -(void)moveDown: (id)aSender;
127 -(void)moveWordBackward: (id)aSender;
128 -(void)moveWordBackwardAndModifySelection: (id)aSender;
129 -(void)moveWordLeftAndModifySelection: (id)aSender;
130 -(void)moveWordForward: (id)aSender;
131 -(void)moveWordForwardAndModifySelection: (id)aSender;
132 -(void)moveWordRightAndModifySelection: (id)aSender;
133 -(void)moveToEndOfLine: (id)aSender;
134 -(void)moveToRightEndOfLine: (id)aSender;
135 -(void)moveToLeftEndOfLine: (id)aSender;
136 -(void)moveToEndOfLineAndModifySelection: (id)aSender;
137 -(void)moveToRightEndOfLineAndModifySelection: (id)aSender;
138 -(void)moveToLeftEndOfLineAndModifySelection: (id)aSender;
139 -(void)moveToBeginningOfLine: (id)aSender;
140 -(void)moveToBeginningOfLineAndModifySelection: (id)aSender;
141 -(void)moveToEndOfParagraph: (id)aSender;
142 -(void)moveToEndOfParagraphAndModifySelection: (id)aSender;
143 -(void)moveToBeginningOfParagraph: (id)aSender;
144 -(void)moveToBeginningOfParagraphAndModifySelection: (id)aSender;
145 -(void)moveParagraphForward: (id)aSender;
146 -(void)moveParagraphForwardAndModifySelection: (id)aSender;
147 -(void)moveParagraphBackward: (id)aSender;
148 -(void)moveParagraphBackwardAndModifySelection: (id)aSender;
149 -(void)moveToEndOfDocument: (id)aSender;
150 -(void)scrollToEndOfDocument: (id)aSender;
151 -(void)moveToEndOfDocumentAndModifySelection: (id)aSender;
152 -(void)moveToBeginningOfDocument: (id)aSender;
153 -(void)scrollToBeginningOfDocument: (id)aSender;
154 -(void)moveToBeginningOfDocumentAndModifySelection: (id)aSender;
155 -(void)insertNewline: (id)aSender;
156 -(void)deleteBackward: (id)aSender;
157 -(void)deleteForward: (id)aSender;
158 -(void)cancelOperation: (id)aSender;
159 -(void)deleteBackwardByDecomposingPreviousCharacter: (id)aSender;
160 -(void)deleteWordBackward: (id)aSender;
161 -(void)deleteWordForward: (id)aSender;
162 -(void)deleteToBeginningOfLine: (id)aSender;
163 -(void)deleteToEndOfLine: (id)aSender;
164 -(void)deleteToBeginningOfParagraph: (id)aSender;
165 -(void)deleteToEndOfParagraph: (id)aSender;
166 -(void)insertLineBreak: (id)aSender;
167 -(void)insertParagraphSeparator: (id)aSender;
168 -(void)selectWord: (id)aSender;
169 -(void)selectLine: (id)aSender;
170 -(void)selectParagraph: (id)aSender;
171 -(void)selectAll: (id)aSender;
172 -(void)noop: (id)aSender;
173 /* set the correct pointer for our view */
174 -(void)resetCursorRects;
175 -(::com::sun::star::accessibility::XAccessibleContext *)accessibleContext;
176 -(id)parentAttribute;
177 -(NSWindow*)windowForParent;
179 Event hook for D&D service.
181 A drag operation will be invoked on a NSView using
182 the method 'dragImage'. This method requires the
183 actual mouse event initiating this drag operation.
184 Mouse events can only be received by subclassing
185 NSView and overriding methods like 'mouseDown' etc.
186 hence we implement a event hook here so that the
187 D&D service can register as listener for mouse
188 messages and use the last 'mouseDown' or
189 'mouseDragged' message to initiate the drag
190 operation.
192 -(void)registerMouseEventListener: (id)theListener;
193 -(void)unregisterMouseEventListener: (id)theListener;
195 /* NSDraggingDestination protocol methods
197 -(NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
198 -(NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
199 -(void)draggingExited:(id <NSDraggingInfo>)sender;
200 -(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
201 -(BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
202 -(void)concludeDragOperation:(id <NSDraggingInfo>)sender;
204 -(void)registerDraggingDestinationHandler:(id)theHandler;
205 -(void)unregisterDraggingDestinationHandler:(id)theHandler;
207 @end
209 #endif // INCLUDED_VCL_INC_OSX_SALFRAMEVIEW_H
211 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */