Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include <sot/object.hxx>
31 : : #include <editeng/eeitem.hxx>
32 : : #include <vcl/waitobj.hxx>
33 : :
34 : : #include <editeng/flditem.hxx>
35 : : #include <svx/svdogrp.hxx>
36 : : #include <tools/urlobj.hxx>
37 : : #include <vcl/help.hxx>
38 : : #include <svx/bmpmask.hxx>
39 : : #include <svx/svdotext.hxx>
40 : : #include <sfx2/app.hxx>
41 : : #include <sfx2/dispatch.hxx>
42 : : #include <sfx2/bindings.hxx>
43 : : #include <svx/svdpagv.hxx>
44 : : #include <svtools/imapobj.hxx>
45 : : #include <svx/svxids.hrc>
46 : : #include <svx/obj3d.hxx>
47 : : #include <svx/polysc3d.hxx>
48 : :
49 : : #include <sfx2/viewfrm.hxx>
50 : :
51 : : #include "anminfo.hxx"
52 : : #include "imapinfo.hxx"
53 : : #include "app.hrc"
54 : : #include "glob.hrc"
55 : : #include "strings.hrc"
56 : : #include "res_bmp.hrc"
57 : :
58 : : #include "app.hxx"
59 : : #include "GraphicDocShell.hxx"
60 : : #include "fudraw.hxx"
61 : : #include "ViewShell.hxx"
62 : : #include "FrameView.hxx"
63 : : #include "View.hxx"
64 : : #include "Window.hxx"
65 : : #include "drawdoc.hxx"
66 : : #include "DrawDocShell.hxx"
67 : : #include "Client.hxx"
68 : : #include "sdresid.hxx"
69 : : #include "drawview.hxx"
70 : : #include "fusel.hxx"
71 : : #include <svl/aeitem.hxx>
72 : : #include <vcl/msgbox.hxx>
73 : : #include "slideshow.hxx"
74 : : #include <svx/sdrhittesthelper.hxx>
75 : :
76 : : using namespace ::com::sun::star;
77 : :
78 : : namespace sd {
79 : :
80 [ # # ][ # # ]: 0 : TYPEINIT1( FuDraw, FuPoor );
81 : :
82 : : /*************************************************************************
83 : : |*
84 : : |* Base-class for all drawmodul-specific functions
85 : : |*
86 : : \************************************************************************/
87 : :
88 : 130 : FuDraw::FuDraw(ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView,
89 : : SdDrawDocument* pDoc, SfxRequest& rReq) :
90 : : FuPoor(pViewSh, pWin, pView, pDoc, rReq),
91 : : bMBDown(sal_False),
92 : : bDragHelpLine(sal_False),
93 : 130 : bPermanent(sal_False)
94 : : {
95 : 130 : }
96 : :
97 : : /*************************************************************************
98 : : |*
99 : : |* Destruktor
100 : : |*
101 : : \************************************************************************/
102 : :
103 : 130 : FuDraw::~FuDraw()
104 : : {
105 [ + - ]: 130 : mpView->BrkAction();
106 [ - + ]: 130 : }
107 : :
108 : : /*************************************************************************
109 : : |*
110 : : |* MouseButtonDown-event
111 : : |*
112 : : \************************************************************************/
113 : :
114 : 0 : sal_Bool FuDraw::MouseButtonDown(const MouseEvent& rMEvt)
115 : : {
116 : : // remember button state for creation of own MouseEvents
117 : 0 : SetMouseButtonCode(rMEvt.GetButtons());
118 : :
119 : 0 : sal_Bool bReturn = sal_False;
120 : :
121 : 0 : bDragHelpLine = sal_False;
122 : :
123 : 0 : aMDPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() );
124 : :
125 [ # # ]: 0 : if ( rMEvt.IsLeft() )
126 : : {
127 [ # # ]: 0 : FrameView* pFrameView = mpViewShell->GetFrameView();
128 : :
129 : 0 : bool bOrtho = sal_False;
130 : :
131 : 0 : sal_Bool bRestricted = sal_True;
132 : :
133 [ # # ]: 0 : if (mpView->IsDragObj())
134 : : {
135 : : // object is dragged (move, resize,...)
136 : 0 : const SdrHdl* pHdl = mpView->GetDragStat().GetHdl();
137 : :
138 [ # # ][ # # ]: 0 : if (!pHdl || (!pHdl->IsCornerHdl() && !pHdl->IsVertexHdl()))
[ # # ][ # # ]
139 : : {
140 : : // Move
141 : 0 : bRestricted = sal_False;
142 : : }
143 : : }
144 : :
145 : : // #i33136#
146 [ # # ][ # # ]: 0 : if(bRestricted && doConstructOrthogonal())
[ # # ][ # # ]
147 : : {
148 : : // Restrict movement:
149 : : // rectangle->quadrat, ellipse->circle etc.
150 : 0 : bOrtho = !rMEvt.IsShift();
151 : : }
152 : : else
153 : : {
154 : 0 : bOrtho = rMEvt.IsShift() != pFrameView->IsOrtho();
155 : : }
156 : :
157 [ # # ]: 0 : if (!mpView->IsSnapEnabled())
158 : 0 : mpView->SetSnapEnabled(sal_True);
159 : 0 : sal_Bool bSnapModPressed = rMEvt.IsMod1();
160 : :
161 : 0 : sal_Bool bGridSnap = pFrameView->IsGridSnap();
162 : 0 : bGridSnap = (bSnapModPressed != bGridSnap);
163 : :
164 [ # # ]: 0 : if (mpView->IsGridSnap() != bGridSnap)
165 : 0 : mpView->SetGridSnap(bGridSnap);
166 : :
167 : 0 : sal_Bool bBordSnap = pFrameView->IsBordSnap();
168 : 0 : bBordSnap = (bSnapModPressed != bBordSnap);
169 : :
170 [ # # ]: 0 : if (mpView->IsBordSnap() != bBordSnap)
171 : 0 : mpView->SetBordSnap(bBordSnap);
172 : :
173 : 0 : sal_Bool bHlplSnap = pFrameView->IsHlplSnap();
174 : 0 : bHlplSnap = (bSnapModPressed != bHlplSnap);
175 : :
176 [ # # ]: 0 : if (mpView->IsHlplSnap() != bHlplSnap)
177 : 0 : mpView->SetHlplSnap(bHlplSnap);
178 : :
179 : 0 : sal_Bool bOFrmSnap = pFrameView->IsOFrmSnap();
180 : 0 : bOFrmSnap = (bSnapModPressed != bOFrmSnap);
181 : :
182 [ # # ]: 0 : if (mpView->IsOFrmSnap() != bOFrmSnap)
183 : 0 : mpView->SetOFrmSnap(bOFrmSnap);
184 : :
185 : 0 : sal_Bool bOPntSnap = pFrameView->IsOPntSnap();
186 : 0 : bOPntSnap = (bSnapModPressed != bOPntSnap);
187 : :
188 [ # # ]: 0 : if (mpView->IsOPntSnap() != bOPntSnap)
189 : 0 : mpView->SetOPntSnap(bOPntSnap);
190 : :
191 : 0 : sal_Bool bOConSnap = pFrameView->IsOConSnap();
192 : 0 : bOConSnap = (bSnapModPressed != bOConSnap);
193 : :
194 [ # # ]: 0 : if (mpView->IsOConSnap() != bOConSnap)
195 : 0 : mpView->SetOConSnap(bOConSnap);
196 : :
197 : 0 : sal_Bool bAngleSnap = rMEvt.IsShift() == !pFrameView->IsAngleSnapEnabled();
198 : :
199 [ # # ]: 0 : if (mpView->IsAngleSnapEnabled() != bAngleSnap)
200 : 0 : mpView->SetAngleSnapEnabled(bAngleSnap);
201 : :
202 [ # # ]: 0 : if (mpView->IsOrtho() != bOrtho)
203 : 0 : mpView->SetOrtho(bOrtho);
204 : :
205 : 0 : sal_Bool bCenter = rMEvt.IsMod2();
206 : :
207 [ # # ]: 0 : if ( mpView->IsCreate1stPointAsCenter() != bCenter ||
[ # # # # ]
208 : 0 : mpView->IsResizeAtCenter() != bCenter )
209 : : {
210 : 0 : mpView->SetCreate1stPointAsCenter(bCenter);
211 : 0 : mpView->SetResizeAtCenter(bCenter);
212 : : }
213 : :
214 : 0 : SdrPageView* pPV = 0;
215 [ # # ]: 0 : sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
216 : :
217 : : // look only for HelpLines when they are visible (!)
218 : 0 : sal_Bool bHelpLine(sal_False);
219 [ # # ]: 0 : if(mpView->IsHlplVisible())
220 [ # # ]: 0 : bHelpLine = mpView->PickHelpLine(aMDPos, nHitLog, *mpWindow, nHelpLine, pPV);
221 [ # # ]: 0 : sal_Bool bHitHdl = (mpView->PickHandle(aMDPos) != NULL);
222 : :
223 [ # # # # : 0 : if ( bHelpLine
# # ]
[ # # # # ]
[ # # ][ # # ]
224 : 0 : && !mpView->IsCreateObj()
225 : 0 : && ((mpView->GetEditMode() == SDREDITMODE_EDIT && !bHitHdl) || (rMEvt.IsShift() && bSnapModPressed)) )
226 : : {
227 [ # # ]: 0 : mpWindow->CaptureMouse();
228 [ # # ]: 0 : mpView->BegDragHelpLine(nHelpLine, pPV);
229 : 0 : bDragHelpLine = mpView->IsDragHelpLine();
230 : 0 : bReturn = sal_True;
231 : : }
232 : : }
233 : 0 : ForcePointer(&rMEvt);
234 : :
235 : 0 : return bReturn;
236 : : }
237 : :
238 : : /*************************************************************************
239 : : |*
240 : : |* MouseMove-event
241 : : |*
242 : : \************************************************************************/
243 : :
244 : 0 : sal_Bool FuDraw::MouseMove(const MouseEvent& rMEvt)
245 : : {
246 [ # # ]: 0 : FrameView* pFrameView = mpViewShell->GetFrameView();
247 [ # # ]: 0 : Point aPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() );
248 : :
249 : 0 : bool bOrtho = sal_False;
250 : :
251 : 0 : sal_Bool bRestricted = sal_True;
252 : :
253 [ # # ]: 0 : if (mpView->IsDragObj())
254 : : {
255 : : // object is dragged (move, resize, ...)
256 : 0 : const SdrHdl* pHdl = mpView->GetDragStat().GetHdl();
257 : :
258 [ # # ][ # # ]: 0 : if (!pHdl || (!pHdl->IsCornerHdl() && !pHdl->IsVertexHdl()))
[ # # ][ # # ]
259 : : {
260 : : // Move
261 : 0 : bRestricted = sal_False;
262 : : }
263 : : }
264 : :
265 [ # # ][ # # ]: 0 : if (mpView->IsAction())
266 : : {
267 : : // #i33136#
268 [ # # ][ # # ]: 0 : if(bRestricted && doConstructOrthogonal())
[ # # ][ # # ]
269 : : {
270 : : // Restrict movement:
271 : : // rectangle->quadrat, ellipse->circle etc.
272 : 0 : bOrtho = !rMEvt.IsShift();
273 : : }
274 : : else
275 : : {
276 : 0 : bOrtho = rMEvt.IsShift() != pFrameView->IsOrtho();
277 : : }
278 : :
279 : 0 : sal_Bool bSnapModPressed = rMEvt.IsMod2();
280 [ # # ][ # # ]: 0 : mpView->SetDragWithCopy(rMEvt.IsMod1() && pFrameView->IsDragWithCopy());
281 : :
282 : 0 : sal_Bool bGridSnap = pFrameView->IsGridSnap();
283 : 0 : bGridSnap = (bSnapModPressed != bGridSnap);
284 : :
285 [ # # ]: 0 : if (mpView->IsGridSnap() != bGridSnap)
286 : 0 : mpView->SetGridSnap(bGridSnap);
287 : :
288 : 0 : sal_Bool bBordSnap = pFrameView->IsBordSnap();
289 : 0 : bBordSnap = (bSnapModPressed != bBordSnap);
290 : :
291 [ # # ]: 0 : if (mpView->IsBordSnap() != bBordSnap)
292 : 0 : mpView->SetBordSnap(bBordSnap);
293 : :
294 : 0 : sal_Bool bHlplSnap = pFrameView->IsHlplSnap();
295 : 0 : bHlplSnap = (bSnapModPressed != bHlplSnap);
296 : :
297 [ # # ]: 0 : if (mpView->IsHlplSnap() != bHlplSnap)
298 : 0 : mpView->SetHlplSnap(bHlplSnap);
299 : :
300 : 0 : sal_Bool bOFrmSnap = pFrameView->IsOFrmSnap();
301 : 0 : bOFrmSnap = (bSnapModPressed != bOFrmSnap);
302 : :
303 [ # # ]: 0 : if (mpView->IsOFrmSnap() != bOFrmSnap)
304 : 0 : mpView->SetOFrmSnap(bOFrmSnap);
305 : :
306 : 0 : sal_Bool bOPntSnap = pFrameView->IsOPntSnap();
307 : 0 : bOPntSnap = (bSnapModPressed != bOPntSnap);
308 : :
309 [ # # ]: 0 : if (mpView->IsOPntSnap() != bOPntSnap)
310 : 0 : mpView->SetOPntSnap(bOPntSnap);
311 : :
312 : 0 : sal_Bool bOConSnap = pFrameView->IsOConSnap();
313 : 0 : bOConSnap = (bSnapModPressed != bOConSnap);
314 : :
315 [ # # ]: 0 : if (mpView->IsOConSnap() != bOConSnap)
316 : 0 : mpView->SetOConSnap(bOConSnap);
317 : :
318 : 0 : sal_Bool bAngleSnap = rMEvt.IsShift() == !pFrameView->IsAngleSnapEnabled();
319 : :
320 [ # # ]: 0 : if (mpView->IsAngleSnapEnabled() != bAngleSnap)
321 : 0 : mpView->SetAngleSnapEnabled(bAngleSnap);
322 : :
323 [ # # ]: 0 : if (mpView->IsOrtho() != bOrtho)
324 : 0 : mpView->SetOrtho(bOrtho);
325 : :
326 : 0 : sal_Bool bCenter = rMEvt.IsMod2();
327 : :
328 [ # # ]: 0 : if ( mpView->IsCreate1stPointAsCenter() != bCenter ||
[ # # # # ]
329 : 0 : mpView->IsResizeAtCenter() != bCenter )
330 : : {
331 : 0 : mpView->SetCreate1stPointAsCenter(bCenter);
332 : 0 : mpView->SetResizeAtCenter(bCenter);
333 : : }
334 : :
335 [ # # ]: 0 : if ( mpView->IsDragHelpLine() )
336 [ # # ]: 0 : mpView->MovDragHelpLine(aPos);
337 : : }
338 : :
339 [ # # ]: 0 : sal_Bool bReturn = mpView->MouseMove(rMEvt, mpWindow);
340 : :
341 [ # # ][ # # ]: 0 : if (mpView->IsAction())
342 : : {
343 : : // Because the flag set back if necessary in MouseMove
344 [ # # ]: 0 : if (mpView->IsOrtho() != bOrtho)
345 : 0 : mpView->SetOrtho(bOrtho);
346 : : }
347 : :
348 [ # # ]: 0 : ForcePointer(&rMEvt);
349 : :
350 : 0 : return bReturn;
351 : : }
352 : :
353 : : /*************************************************************************
354 : : |*
355 : : |* MouseButtonUp-event
356 : : |*
357 : : \************************************************************************/
358 : :
359 : 0 : sal_Bool FuDraw::MouseButtonUp(const MouseEvent& rMEvt)
360 : : {
361 [ # # ]: 0 : if ( mpView->IsDragHelpLine() )
362 : 0 : mpView->EndDragHelpLine();
363 : :
364 [ # # ]: 0 : if ( bDragHelpLine )
365 : : {
366 [ # # ]: 0 : Rectangle aOutputArea(Point(0,0), mpWindow->GetOutputSizePixel());
367 : :
368 [ # # ][ # # ]: 0 : if ( !aOutputArea.IsInside(rMEvt.GetPosPixel()) )
369 [ # # ]: 0 : mpView->GetSdrPageView()->DeleteHelpLine(nHelpLine);
370 : :
371 [ # # ]: 0 : mpWindow->ReleaseMouse();
372 : : }
373 : :
374 : 0 : FrameView* pFrameView = mpViewShell->GetFrameView();
375 : 0 : mpView->SetOrtho( pFrameView->IsOrtho() );
376 : 0 : mpView->SetAngleSnapEnabled( pFrameView->IsAngleSnapEnabled() );
377 : 0 : mpView->SetSnapEnabled(sal_True);
378 : 0 : mpView->SetCreate1stPointAsCenter(sal_False);
379 : 0 : mpView->SetResizeAtCenter(sal_False);
380 : 0 : mpView->SetDragWithCopy(pFrameView->IsDragWithCopy());
381 : 0 : mpView->SetGridSnap(pFrameView->IsGridSnap());
382 : 0 : mpView->SetBordSnap(pFrameView->IsBordSnap());
383 : 0 : mpView->SetHlplSnap(pFrameView->IsHlplSnap());
384 : 0 : mpView->SetOFrmSnap(pFrameView->IsOFrmSnap());
385 : 0 : mpView->SetOPntSnap(pFrameView->IsOPntSnap());
386 : 0 : mpView->SetOConSnap(pFrameView->IsOConSnap());
387 : :
388 : 0 : bIsInDragMode = sal_False;
389 : 0 : ForcePointer(&rMEvt);
390 : 0 : FuPoor::MouseButtonUp(rMEvt);
391 : :
392 : 0 : return sal_False;
393 : : }
394 : :
395 : : /*************************************************************************
396 : : |*
397 : : |* Process keyboard-events
398 : : |*
399 : : |* When processing a KeyEvent the returnvalue is sal_True, otherwise sal_False.
400 : : |*
401 : : \************************************************************************/
402 : :
403 : 0 : sal_Bool FuDraw::KeyInput(const KeyEvent& rKEvt)
404 : : {
405 : 0 : sal_Bool bReturn = sal_False;
406 : :
407 [ # # # # : 0 : switch ( rKEvt.GetKeyCode().GetCode() )
# # ]
408 : : {
409 : : case KEY_ESCAPE:
410 : : {
411 : 0 : bReturn = FuDraw::cancel();
412 : : }
413 : 0 : break;
414 : :
415 : : case KEY_DELETE:
416 : : case KEY_BACKSPACE:
417 : : {
418 [ # # ]: 0 : if (!mpDocSh->IsReadOnly())
419 : : {
420 [ # # ][ # # ]: 0 : if ( mpView && mpView->IsPresObjSelected(sal_False, sal_True, sal_False, sal_True) )
[ # # ]
421 : : {
422 [ # # ][ # # ]: 0 : InfoBox(mpWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
[ # # ][ # # ]
[ # # ]
423 : : }
424 : : else
425 : : {
426 : : // Falls IP-Client aktiv, werden die Pointer
427 : : // auf das OLE- und das alte Graphic-Object
428 : : // am SdClient zurueckgesetzt, damit bei
429 : : // ::SelectionHasChanged nach dem Loeschen
430 : : // nicht mehr versucht wird, ein Grafik-Objekt
431 : : // zu restaurieren, das gar nicht mehr existiert.
432 : : // Alle anderen OLE-Objekte sind davon nicht
433 : : // betroffen
434 : : OSL_ASSERT (mpViewShell->GetViewShell()!=NULL);
435 : : Client* pIPClient = static_cast<Client*>(
436 [ # # ][ # # ]: 0 : mpViewShell->GetViewShell()->GetIPClient());
437 [ # # ][ # # ]: 0 : if (pIPClient && pIPClient->IsObjectInPlaceActive())
[ # # ][ # # ]
438 : 0 : pIPClient->SetSdrGrafObj(NULL);
439 : :
440 : : // wait-mousepointer while deleting object
441 [ # # ][ # # ]: 0 : WaitObject aWait( (Window*)mpViewShell->GetActiveWindow() );
442 : : // delete object
443 [ # # ][ # # ]: 0 : mpView->DeleteMarked();
444 : : }
445 : : }
446 : 0 : bReturn = sal_True;
447 : : }
448 : 0 : break;
449 : :
450 : : case KEY_TAB:
451 : : {
452 : 0 : KeyCode aCode = rKEvt.GetKeyCode();
453 : :
454 [ # # ][ # # ]: 0 : if ( !aCode.IsMod1() && !aCode.IsMod2() )
[ # # ]
455 : : {
456 : : // Moved next line which was a bugfix itself into
457 : : // the scope which really does the object selection travel
458 : : // and thus is allowed to call SelectionHasChanged().
459 : :
460 : : // Switch to FuSelect.
461 : : mpViewShell->GetViewFrame()->GetDispatcher()->Execute(
462 : : SID_OBJECT_SELECT,
463 [ # # ][ # # ]: 0 : SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
464 : :
465 : : // changeover to the next object
466 [ # # ][ # # ]: 0 : if(!mpView->MarkNextObj( !aCode.IsShift() ))
467 : : {
468 : : // No next object: go over open end and
469 : : // get first from the other side
470 [ # # ]: 0 : mpView->UnmarkAllObj();
471 [ # # ]: 0 : mpView->MarkNextObj(!aCode.IsShift());
472 : : }
473 : :
474 [ # # ]: 0 : if(mpView->AreObjectsMarked())
475 [ # # ][ # # ]: 0 : mpView->MakeVisible(mpView->GetAllMarkedRect(), *mpWindow);
476 : :
477 : 0 : bReturn = sal_True;
478 : : }
479 : : }
480 : 0 : break;
481 : :
482 : : case KEY_END:
483 : : {
484 : 0 : KeyCode aCode = rKEvt.GetKeyCode();
485 : :
486 [ # # ]: 0 : if ( aCode.IsMod1() )
487 : : {
488 : : // mark last object
489 [ # # ]: 0 : mpView->UnmarkAllObj();
490 [ # # ]: 0 : mpView->MarkNextObj(sal_False);
491 : :
492 [ # # ]: 0 : if(mpView->AreObjectsMarked())
493 [ # # ][ # # ]: 0 : mpView->MakeVisible(mpView->GetAllMarkedRect(), *mpWindow);
494 : :
495 : 0 : bReturn = sal_True;
496 : : }
497 : : }
498 : 0 : break;
499 : :
500 : : case KEY_HOME:
501 : : {
502 : 0 : KeyCode aCode = rKEvt.GetKeyCode();
503 : :
504 [ # # ]: 0 : if ( aCode.IsMod1() )
505 : : {
506 : : // mark first object
507 [ # # ]: 0 : mpView->UnmarkAllObj();
508 [ # # ]: 0 : mpView->MarkNextObj(sal_True);
509 : :
510 [ # # ]: 0 : if(mpView->AreObjectsMarked())
511 [ # # ][ # # ]: 0 : mpView->MakeVisible(mpView->GetAllMarkedRect(), *mpWindow);
512 : :
513 : 0 : bReturn = sal_True;
514 : : }
515 : : }
516 : 0 : break;
517 : :
518 : : default:
519 : 0 : break;
520 : : }
521 : :
522 [ # # ]: 0 : if (!bReturn)
523 : : {
524 : 0 : bReturn = FuPoor::KeyInput(rKEvt);
525 : : }
526 : : else
527 : : {
528 : 0 : mpWindow->ReleaseMouse();
529 : : }
530 : :
531 : 0 : return (bReturn);
532 : : }
533 : :
534 : : /*************************************************************************
535 : : |*
536 : : |* Aktivate function
537 : : |*
538 : : \************************************************************************/
539 : :
540 : 405 : void FuDraw::Activate()
541 : : {
542 : 405 : FuPoor::Activate();
543 : 405 : ForcePointer();
544 : 405 : }
545 : :
546 : : /*************************************************************************
547 : : |*
548 : : |* Deaktivate function
549 : : |*
550 : : \************************************************************************/
551 : :
552 : 405 : void FuDraw::Deactivate()
553 : : {
554 : 405 : FuPoor::Deactivate();
555 : 405 : }
556 : :
557 : :
558 : : /*************************************************************************
559 : : |*
560 : : |* Toggle mouse-pointer
561 : : |*
562 : : \************************************************************************/
563 : :
564 : 405 : void FuDraw::ForcePointer(const MouseEvent* pMEvt)
565 : : {
566 : 405 : Point aPnt;
567 : 405 : sal_uInt16 nModifier = 0;
568 : 405 : sal_Bool bLeftDown = sal_False;
569 : 405 : sal_Bool bDefPointer = sal_True;
570 : :
571 [ - + ]: 405 : if (pMEvt)
572 : : {
573 [ # # ]: 0 : aPnt = mpWindow->PixelToLogic(pMEvt->GetPosPixel());
574 : 0 : nModifier = pMEvt->GetModifier();
575 : 0 : bLeftDown = pMEvt->IsLeft();
576 : : }
577 : : else
578 : : {
579 [ + - ][ + - ]: 405 : aPnt = mpWindow->PixelToLogic(mpWindow->GetPointerPosPixel());
580 : : }
581 : :
582 [ - + ]: 405 : if (mpView->IsDragObj())
583 : : {
584 [ # # ][ # # ]: 0 : if (SD_MOD()->GetWaterCan() && !mpView->PickHandle(aPnt))
[ # # ][ # # ]
[ # # ]
585 : : {
586 : : /******************************************************************
587 : : * Giesskannenmodus
588 : : ******************************************************************/
589 : 0 : bDefPointer = sal_False;
590 [ # # ]: 0 : mpWindow->SetPointer(Pointer(POINTER_FILL));
591 : : }
592 : : }
593 : : else
594 : : {
595 [ + - ]: 405 : SdrHdl* pHdl = mpView->PickHandle(aPnt);
596 : :
597 [ + - ][ - + ]: 405 : if (SD_MOD()->GetWaterCan() && !pHdl)
[ # # ][ - + ]
598 : : {
599 : : /******************************************************************
600 : : * Giesskannenmodus
601 : : ******************************************************************/
602 : 0 : bDefPointer = sal_False;
603 [ # # ]: 0 : mpWindow->SetPointer(Pointer(POINTER_FILL));
604 : : }
605 [ + - ][ - + ]: 810 : else if (!pHdl &&
[ - + ]
606 [ + - ][ + - ]: 405 : mpViewShell->GetViewFrame()->HasChildWindow(SvxBmpMaskChildWindow::GetChildWindowId()))
[ + - ]
607 : : {
608 : : /******************************************************************
609 : : * Pipettenmodus
610 : : ******************************************************************/
611 [ # # ][ # # ]: 0 : SvxBmpMask* pMask = (SvxBmpMask*) mpViewShell->GetViewFrame()->GetChildWindow(SvxBmpMaskChildWindow::GetChildWindowId())->GetWindow();
[ # # ]
612 : :
613 [ # # ][ # # ]: 0 : if (pMask && pMask->IsEyedropping())
[ # # ][ # # ]
614 : : {
615 : 0 : bDefPointer = sal_False;
616 [ # # ]: 0 : mpWindow->SetPointer(Pointer(POINTER_REFHAND));
617 : : }
618 : : }
619 [ + - ][ + - ]: 405 : else if (!mpView->IsAction())
620 : : {
621 : 405 : SdrObject* pObj = NULL;
622 : 405 : SdrPageView* pPV = NULL;
623 [ + - ]: 405 : SdrViewEvent aVEvt;
624 : 405 : SdrHitKind eHit = SDRHIT_NONE;
625 : 405 : SdrDragMode eDragMode = mpView->GetDragMode();
626 : :
627 [ - + ]: 405 : if (pMEvt)
628 : : {
629 [ # # ]: 0 : eHit = mpView->PickAnything(*pMEvt, SDRMOUSEMOVE, aVEvt);
630 : : }
631 : :
632 [ - + ][ # # ]: 405 : if ((eDragMode == SDRDRAG_ROTATE) && (eHit == SDRHIT_MARKEDOBJECT))
633 : : {
634 : : // The goal of this request is show always the rotation-arrow for 3D-objects at rotation-modus
635 : : // Independent of the settings at Extras->Optionen->Grafik "Objekte immer verschieben"
636 : : // 2D-objects acquit in an other way. Otherwise, the rotation of 3d-objects around any axises
637 : : // wouldn't be possible per default.
638 : 0 : const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
639 [ # # ][ # # ]: 0 : SdrObject* pObject = rMarkList.GetMark(0)->GetMarkedSdrObj();
640 [ # # ][ # # ]: 0 : if ((pObject->ISA(E3dObject)) && (rMarkList.GetMarkCount() == 1))
[ # # ][ # # ]
[ # # ]
641 : : {
642 [ # # ]: 0 : mpWindow->SetPointer(Pointer(POINTER_ROTATE));
643 : 0 : bDefPointer = sal_False; // Otherwise it'll be calles Joes routine and the mousepointer will reconfigurate again
644 : : }
645 : : }
646 : :
647 [ + - ]: 405 : if (eHit == SDRHIT_NONE)
648 : : {
649 : : // found nothing -> look after at the masterpage
650 [ + - ]: 405 : mpView->PickObj(aPnt, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER);
651 : : }
652 [ # # ]: 0 : else if (eHit == SDRHIT_UNMARKEDOBJECT)
653 : : {
654 : 0 : pObj = aVEvt.pObj;
655 : : }
656 [ # # ][ # # ]: 0 : else if (eHit == SDRHIT_TEXTEDITOBJ && this->ISA(FuSelection))
[ # # ][ # # ]
[ # # ]
657 : : {
658 [ # # ]: 0 : sal_uInt16 nSdrObjKind = aVEvt.pObj->GetObjIdentifier();
659 : :
660 [ # # ][ # # ]: 0 : if ( nSdrObjKind != OBJ_TEXT &&
[ # # ][ # # ]
[ # # ]
661 : : nSdrObjKind != OBJ_TITLETEXT &&
662 : : nSdrObjKind != OBJ_OUTLINETEXT &&
663 [ # # ]: 0 : aVEvt.pObj->IsEmptyPresObj() )
664 : : {
665 : 0 : pObj = NULL;
666 : 0 : bDefPointer = sal_False;
667 [ # # ]: 0 : mpWindow->SetPointer(Pointer(POINTER_ARROW));
668 : : }
669 : : }
670 : :
671 [ - + ][ # # ]: 405 : if (pObj && pMEvt && !pMEvt->IsMod2() && this->ISA(FuSelection))
[ # # ][ # # ]
[ # # ][ # # ]
[ - + ]
672 : : {
673 : : // Auf Animation oder ImageMap pruefen
674 [ # # ]: 0 : bDefPointer = !SetPointer(pObj, aPnt);
675 : :
676 [ # # ][ # # ]: 0 : if (bDefPointer && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dPolyScene)))
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
677 : : {
678 : : // In die Gruppe hineinschauen
679 [ # # ][ # # ]: 0 : if (mpView->PickObj(aPnt, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER | SDRSEARCH_DEEP))
680 [ # # ]: 0 : bDefPointer = !SetPointer(pObj, aPnt);
681 : : }
682 [ + - ]: 405 : }
683 : : }
684 : : }
685 : :
686 [ + - ]: 405 : if (bDefPointer)
687 : : {
688 : : mpWindow->SetPointer(mpView->GetPreferedPointer(
689 [ + - ][ + - ]: 405 : aPnt, mpWindow, nModifier, bLeftDown));
690 : : }
691 : 405 : }
692 : :
693 : : /*************************************************************************
694 : : |*
695 : : |* Set cursor for animaton or imagemap
696 : : |*
697 : : \************************************************************************/
698 : :
699 : 0 : sal_Bool FuDraw::SetPointer(SdrObject* pObj, const Point& rPos)
700 : : {
701 : 0 : sal_Bool bSet = sal_False;
702 : :
703 : 0 : sal_Bool bAnimationInfo = (!mpDocSh->ISA(GraphicDocShell) &&
704 [ # # ][ # # ]: 0 : mpDoc->GetAnimationInfo(pObj)) ? sal_True:sal_False;
705 : :
706 : 0 : sal_Bool bImageMapInfo = sal_False;
707 : :
708 [ # # ]: 0 : if (!bAnimationInfo)
709 [ # # ]: 0 : bImageMapInfo = mpDoc->GetIMapInfo(pObj) ? sal_True:sal_False;
710 : :
711 [ # # ][ # # ]: 0 : if (bAnimationInfo || bImageMapInfo)
712 : : {
713 : 0 : const SetOfByte* pVisiLayer = &mpView->GetSdrPageView()->GetVisibleLayers();
714 [ # # ]: 0 : sal_uInt16 nHitLog(sal_uInt16 (mpWindow->PixelToLogic(Size(HITPIX,0)).Width()));
715 : 0 : long n2HitLog(nHitLog * 2);
716 : 0 : Point aHitPosR(rPos);
717 : 0 : Point aHitPosL(rPos);
718 : 0 : Point aHitPosT(rPos);
719 : 0 : Point aHitPosB(rPos);
720 : :
721 : 0 : aHitPosR.X() += n2HitLog;
722 : 0 : aHitPosL.X() -= n2HitLog;
723 : 0 : aHitPosT.Y() += n2HitLog;
724 : 0 : aHitPosB.Y() -= n2HitLog;
725 : :
726 [ # # ][ # # ]: 0 : if ( !pObj->IsClosedObj() ||
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
727 [ # # ]: 0 : ( SdrObjectPrimitiveHit(*pObj, aHitPosR, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) &&
728 [ # # ]: 0 : SdrObjectPrimitiveHit(*pObj, aHitPosL, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) &&
729 [ # # ]: 0 : SdrObjectPrimitiveHit(*pObj, aHitPosT, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) &&
730 [ # # ]: 0 : SdrObjectPrimitiveHit(*pObj, aHitPosB, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false)))
731 : : {
732 : : /**********************************************************
733 : : * hit inside the object (without margin) or open object
734 : : ********************************************************/
735 : :
736 [ # # ]: 0 : if (bAnimationInfo)
737 : : {
738 : : /******************************************************
739 : : * Click-Action
740 : : ******************************************************/
741 [ # # ]: 0 : SdAnimationInfo* pInfo = mpDoc->GetAnimationInfo(pObj);
742 : :
743 [ # # ][ # # ]: 0 : if ((mpView->ISA(DrawView) &&
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
744 : : (pInfo->meClickAction == presentation::ClickAction_BOOKMARK ||
745 : : pInfo->meClickAction == presentation::ClickAction_DOCUMENT ||
746 : : pInfo->meClickAction == presentation::ClickAction_PREVPAGE ||
747 : : pInfo->meClickAction == presentation::ClickAction_NEXTPAGE ||
748 : : pInfo->meClickAction == presentation::ClickAction_FIRSTPAGE ||
749 : : pInfo->meClickAction == presentation::ClickAction_LASTPAGE ||
750 : : pInfo->meClickAction == presentation::ClickAction_VERB ||
751 : : pInfo->meClickAction == presentation::ClickAction_PROGRAM ||
752 : : pInfo->meClickAction == presentation::ClickAction_MACRO ||
753 : : pInfo->meClickAction == presentation::ClickAction_SOUND))
754 : : ||
755 [ # # ][ # # ]: 0 : (mpView->ISA(DrawView) &&
756 [ # # ][ # # ]: 0 : SlideShow::IsRunning( mpViewShell->GetViewShellBase() ) &&
757 : : (pInfo->meClickAction == presentation::ClickAction_VANISH ||
758 : : pInfo->meClickAction == presentation::ClickAction_INVISIBLE ||
759 : : pInfo->meClickAction == presentation::ClickAction_STOPPRESENTATION ||
760 : : (pInfo->mbActive &&
761 : : ( pInfo->meEffect != presentation::AnimationEffect_NONE ||
762 : : pInfo->meTextEffect != presentation::AnimationEffect_NONE )))))
763 : : {
764 : : // Animations-Objekt
765 : 0 : bSet = sal_True;
766 [ # # ]: 0 : mpWindow->SetPointer(Pointer(POINTER_REFHAND));
767 : : }
768 : : }
769 [ # # ][ # # ]: 0 : else if (bImageMapInfo &&
[ # # ]
770 [ # # ]: 0 : mpDoc->GetHitIMapObject(pObj, rPos, *mpWindow))
771 : : {
772 : : /******************************************************
773 : : * ImageMap
774 : : ******************************************************/
775 : 0 : bSet = sal_True;
776 [ # # ]: 0 : mpWindow->SetPointer(Pointer(POINTER_REFHAND));
777 : : }
778 : : }
779 : : }
780 : :
781 : 0 : return bSet;
782 : : }
783 : :
784 : :
785 : :
786 : : /*************************************************************************
787 : : |*
788 : : |* Response of doubleclick
789 : : |*
790 : : \************************************************************************/
791 : :
792 : 0 : void FuDraw::DoubleClick(const MouseEvent& rMEvt)
793 : : {
794 [ # # ]: 0 : sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
795 : :
796 [ # # ]: 0 : if ( mpView->AreObjectsMarked() )
797 : : {
798 : 0 : const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
799 : :
800 [ # # ]: 0 : if (rMarkList.GetMarkCount() == 1)
801 : : {
802 : 0 : SdrMark* pMark = rMarkList.GetMark(0);
803 : 0 : SdrObject* pObj = pMark->GetMarkedSdrObj();
804 : :
805 : 0 : sal_uInt32 nInv = pObj->GetObjInventor();
806 : 0 : sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier();
807 : :
808 [ # # ][ # # ]: 0 : if (nInv == SdrInventor && nSdrObjKind == OBJ_OLE2)
809 : : {
810 : 0 : DrawDocShell* pDocSh = mpDoc->GetDocSh();
811 : :
812 [ # # ]: 0 : if ( !pDocSh->IsUIActive() )
813 : : {
814 : : /**********************************************************
815 : : * activate OLE-object
816 : : **********************************************************/
817 : 0 : mpViewShell->ActivateObject( (SdrOle2Obj*) pObj, 0);
818 : 0 : }
819 : : }
820 [ # # ][ # # ]: 0 : else if (nInv == SdrInventor && nSdrObjKind == OBJ_GRAF && pObj->IsEmptyPresObj() )
[ # # ][ # # ]
821 : : {
822 : : mpViewShell->GetViewFrame()->
823 : : GetDispatcher()->Execute( SID_INSERT_GRAPHIC,
824 : 0 : SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
825 : : }
826 [ # # ][ # # : 0 : else if ( ( pObj->ISA(SdrTextObj) || pObj->ISA(SdrObjGroup) ) &&
# # # # #
# ][ # # ]
827 : 0 : !SD_MOD()->GetWaterCan() &&
828 : 0 : mpViewShell->GetFrameView()->IsDoubleClickTextEdit() &&
829 : 0 : !mpDocSh->IsReadOnly())
830 : : {
831 [ # # ]: 0 : SfxUInt16Item aItem(SID_TEXTEDIT, 2);
832 : : mpViewShell->GetViewFrame()->GetDispatcher()->
833 : : Execute(SID_TEXTEDIT, SFX_CALLMODE_ASYNCHRON |
834 [ # # ][ # # ]: 0 : SFX_CALLMODE_RECORD, &aItem, 0L);
[ # # ]
835 : : }
836 [ # # ][ # # ]: 0 : else if (nInv == SdrInventor && nSdrObjKind == OBJ_GRUP)
837 : : {
838 : : // hit group -> select subobject
839 : 0 : mpView->UnMarkAll();
840 : 0 : mpView->MarkObj(aMDPos, nHitLog, rMEvt.IsShift(), sal_True);
841 : : }
842 : : }
843 : : }
844 : : else
845 : 0 : mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
846 : 0 : }
847 : :
848 : : /*************************************************************************
849 : : |*
850 : : |* Help-event
851 : : |*
852 : : \************************************************************************/
853 : :
854 : 0 : sal_Bool FuDraw::RequestHelp(const HelpEvent& rHEvt)
855 : : {
856 : 0 : sal_Bool bReturn = sal_False;
857 : :
858 [ # # ][ # # ]: 0 : if (Help::IsBalloonHelpEnabled() || Help::IsQuickHelpEnabled())
[ # # ]
859 : : {
860 [ # # ]: 0 : SdrViewEvent aVEvt;
861 : :
862 [ # # ][ # # ]: 0 : MouseEvent aMEvt(mpWindow->GetPointerPosPixel(), 1, 0, MOUSE_LEFT);
863 : :
864 [ # # ]: 0 : SdrHitKind eHit = mpView->PickAnything(aMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
865 : :
866 : 0 : SdrObject* pObj = aVEvt.pObj;
867 : :
868 [ # # ][ # # ]: 0 : if (eHit != SDRHIT_NONE && pObj != NULL)
869 : : {
870 [ # # ]: 0 : Point aPosPixel = rHEvt.GetMousePosPixel();
871 : :
872 [ # # ]: 0 : bReturn = SetHelpText(pObj, aPosPixel, aVEvt);
873 : :
874 [ # # ][ # # ]: 0 : if (!bReturn && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dPolyScene)))
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
875 : : {
876 : : // In die Gruppe hineinschauen
877 : 0 : SdrPageView* pPV = NULL;
878 : :
879 [ # # ][ # # ]: 0 : Point aPos(mpWindow->PixelToLogic(mpWindow->ScreenToOutputPixel(aPosPixel)));
880 : :
881 [ # # ][ # # ]: 0 : if (mpView->PickObj(aPos, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER | SDRSEARCH_DEEP))
882 [ # # ]: 0 : bReturn = SetHelpText(pObj, aPosPixel, aVEvt);
883 : : }
884 [ # # ]: 0 : }
885 : : }
886 : :
887 [ # # ]: 0 : if (!bReturn)
888 : : {
889 : 0 : bReturn = FuPoor::RequestHelp(rHEvt);
890 : : }
891 : :
892 : 0 : return(bReturn);
893 : : }
894 : :
895 : :
896 : :
897 : : /*************************************************************************
898 : : |*
899 : : |* Command-event
900 : : |*
901 : : \************************************************************************/
902 : :
903 : 0 : sal_Bool FuDraw::SetHelpText(SdrObject* pObj, const Point& rPosPixel, const SdrViewEvent& rVEvt)
904 : : {
905 : 0 : sal_Bool bSet = sal_False;
906 [ # # ]: 0 : String aHelpText;
907 [ # # ][ # # ]: 0 : Point aPos(mpWindow->PixelToLogic(mpWindow->ScreenToOutputPixel(rPosPixel)));
908 : :
909 : : // URL fuer IMapObject unter Pointer ist Hilfetext
910 [ # # ][ # # ]: 0 : if ( mpDoc->GetIMapInfo(pObj) )
911 : : {
912 [ # # ]: 0 : IMapObject* pIMapObj = mpDoc->GetHitIMapObject(pObj, aPos, *mpWindow );
913 : :
914 [ # # ]: 0 : if ( pIMapObj )
915 : : {
916 : : // show name
917 [ # # ]: 0 : aHelpText = pIMapObj->GetAltText();
918 : :
919 [ # # ]: 0 : if (aHelpText.Len() == 0)
920 : : {
921 : : // show url if no name is available
922 [ # # ][ # # ]: 0 : aHelpText = INetURLObject::decode( pIMapObj->GetURL(), '%', INetURLObject::DECODE_WITH_CHARSET );
[ # # ]
923 : : }
924 : : }
925 : : }
926 [ # # ][ # # ]: 0 : else if (!mpDocSh->ISA(GraphicDocShell) && mpDoc->GetAnimationInfo(pObj))
[ # # ][ # # ]
[ # # ][ # # ]
927 : : {
928 [ # # ]: 0 : SdAnimationInfo* pInfo = mpDoc->GetAnimationInfo(pObj);
929 : :
930 [ # # # # : 0 : switch (pInfo->meClickAction)
# # # # #
# # # ]
931 : : {
932 : : case presentation::ClickAction_PREVPAGE:
933 : : {
934 : : // jump to the prior page
935 [ # # ][ # # ]: 0 : aHelpText = String(SdResId(STR_CLICK_ACTION_PREVPAGE));
[ # # ][ # # ]
936 : : }
937 : 0 : break;
938 : :
939 : : case presentation::ClickAction_NEXTPAGE:
940 : : {
941 : : // jump to the next page
942 [ # # ][ # # ]: 0 : aHelpText = String(SdResId(STR_CLICK_ACTION_NEXTPAGE));
[ # # ][ # # ]
943 : : }
944 : 0 : break;
945 : :
946 : : case presentation::ClickAction_FIRSTPAGE:
947 : : {
948 : : // jump to the first page
949 [ # # ][ # # ]: 0 : aHelpText = String(SdResId(STR_CLICK_ACTION_FIRSTPAGE));
[ # # ][ # # ]
950 : : }
951 : 0 : break;
952 : :
953 : : case presentation::ClickAction_LASTPAGE:
954 : : {
955 : : // jump to the last page
956 [ # # ][ # # ]: 0 : aHelpText = String(SdResId(STR_CLICK_ACTION_LASTPAGE));
[ # # ][ # # ]
957 : : }
958 : 0 : break;
959 : :
960 : : case presentation::ClickAction_BOOKMARK:
961 : : {
962 : : // jump to object/page
963 [ # # ][ # # ]: 0 : aHelpText = String(SdResId(STR_CLICK_ACTION_BOOKMARK));
[ # # ][ # # ]
964 [ # # ]: 0 : aHelpText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
965 [ # # ][ # # ]: 0 : aHelpText.Append( String(INetURLObject::decode( pInfo->GetBookmark(), '%', INetURLObject::DECODE_WITH_CHARSET ) ));
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
966 : : }
967 : 0 : break;
968 : :
969 : : case presentation::ClickAction_DOCUMENT:
970 : : {
971 : : // jump to document (object/page)
972 [ # # ][ # # ]: 0 : aHelpText = String(SdResId(STR_CLICK_ACTION_DOCUMENT));
[ # # ][ # # ]
973 [ # # ]: 0 : aHelpText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
974 [ # # ][ # # ]: 0 : aHelpText.Append( String(INetURLObject::decode( pInfo->GetBookmark(), '%', INetURLObject::DECODE_WITH_CHARSET ) ));
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
975 : : }
976 : 0 : break;
977 : :
978 : : case presentation::ClickAction_PROGRAM:
979 : : {
980 : : // execute program
981 [ # # ][ # # ]: 0 : aHelpText = String(SdResId(STR_CLICK_ACTION_PROGRAM));
[ # # ][ # # ]
982 [ # # ]: 0 : aHelpText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
983 [ # # ][ # # ]: 0 : aHelpText.Append( String(INetURLObject::decode( pInfo->GetBookmark(), '%', INetURLObject::DECODE_WITH_CHARSET ) ));
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
984 : : }
985 : 0 : break;
986 : :
987 : : case presentation::ClickAction_MACRO:
988 : : {
989 : : // execute program
990 [ # # ][ # # ]: 0 : aHelpText = String(SdResId(STR_CLICK_ACTION_MACRO));
[ # # ][ # # ]
991 [ # # ]: 0 : aHelpText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
992 : :
993 [ # # ][ # # ]: 0 : if ( SfxApplication::IsXScriptURL( pInfo->GetBookmark() ) )
[ # # ][ # # ]
994 : : {
995 [ # # ][ # # ]: 0 : aHelpText.Append( pInfo->GetBookmark() );
[ # # ]
996 : : }
997 : : else
998 : : {
999 [ # # ]: 0 : String sBookmark( pInfo->GetBookmark() );
1000 : 0 : sal_Unicode cToken = '.';
1001 [ # # ][ # # ]: 0 : aHelpText.Append( sBookmark.GetToken( 2, cToken ) );
[ # # ]
1002 [ # # ]: 0 : aHelpText.Append( cToken );
1003 [ # # ][ # # ]: 0 : aHelpText.Append( sBookmark.GetToken( 1, cToken ) );
[ # # ]
1004 [ # # ]: 0 : aHelpText.Append( cToken );
1005 [ # # ][ # # ]: 0 : aHelpText.Append( sBookmark.GetToken( 0, cToken ) );
[ # # ][ # # ]
1006 : : }
1007 : : }
1008 : 0 : break;
1009 : :
1010 : : case presentation::ClickAction_SOUND:
1011 : : {
1012 : : // play-back sound
1013 [ # # ][ # # ]: 0 : aHelpText = String(SdResId(STR_CLICK_ACTION_SOUND));
[ # # ][ # # ]
1014 : : }
1015 : 0 : break;
1016 : :
1017 : : case presentation::ClickAction_VERB:
1018 : : {
1019 : : // execute OLE-verb
1020 [ # # ][ # # ]: 0 : aHelpText = String(SdResId(STR_CLICK_ACTION_VERB));
[ # # ][ # # ]
1021 : : }
1022 : 0 : break;
1023 : :
1024 : : case presentation::ClickAction_STOPPRESENTATION:
1025 : : {
1026 : : // quit presentation
1027 [ # # ][ # # ]: 0 : aHelpText = String(SdResId(STR_CLICK_ACTION_STOPPRESENTATION));
[ # # ][ # # ]
1028 : : }
1029 : 0 : break;
1030 : : default:
1031 : 0 : break;
1032 : : }
1033 : : }
1034 [ # # ]: 0 : else if (rVEvt.pURLField)
1035 : : {
1036 : : /**************************************************************
1037 : : * URL-Field
1038 : : **************************************************************/
1039 [ # # ][ # # ]: 0 : aHelpText = INetURLObject::decode( rVEvt.pURLField->GetURL(), '%', INetURLObject::DECODE_WITH_CHARSET );
1040 : : }
1041 : :
1042 [ # # ]: 0 : if (aHelpText.Len())
1043 : : {
1044 : 0 : bSet = sal_True;
1045 [ # # ][ # # ]: 0 : Rectangle aLogicPix = mpWindow->LogicToPixel(pObj->GetLogicRect());
1046 : 0 : Rectangle aScreenRect(mpWindow->OutputToScreenPixel(aLogicPix.TopLeft()),
1047 [ # # ]: 0 : mpWindow->OutputToScreenPixel(aLogicPix.BottomRight()));
[ # # # # ]
[ # # ]
1048 : :
1049 [ # # ][ # # ]: 0 : if (Help::IsBalloonHelpEnabled())
1050 [ # # ]: 0 : Help::ShowBalloon( (Window*)mpWindow, rPosPixel, aScreenRect, aHelpText);
1051 [ # # ][ # # ]: 0 : else if (Help::IsQuickHelpEnabled())
1052 [ # # ]: 0 : Help::ShowQuickHelp( (Window*)mpWindow, aScreenRect, aHelpText);
1053 : : }
1054 : :
1055 [ # # ]: 0 : return bSet;
1056 : : }
1057 : :
1058 : :
1059 : : /** is called when the currenct function should be aborted. <p>
1060 : : This is used when a function gets a KEY_ESCAPE but can also
1061 : : be called directly.
1062 : :
1063 : : @returns true if a active function was aborted
1064 : : */
1065 : 0 : bool FuDraw::cancel()
1066 : : {
1067 : 0 : bool bReturn = false;
1068 : :
1069 [ # # ]: 0 : if ( mpView->IsAction() )
1070 : : {
1071 : 0 : mpView->BrkAction();
1072 : 0 : bReturn = true;
1073 : : }
1074 [ # # ]: 0 : else if ( mpView->IsTextEdit() )
1075 : : {
1076 : 0 : mpView->SdrEndTextEdit();
1077 : 0 : bReturn = true;
1078 : :
1079 : 0 : SfxBindings& rBindings = mpViewShell->GetViewFrame()->GetBindings();
1080 : 0 : rBindings.Invalidate( SID_PARASPACE_INCREASE );
1081 : 0 : rBindings.Invalidate( SID_PARASPACE_DECREASE );
1082 : : }
1083 [ # # ]: 0 : else if ( mpView->AreObjectsMarked() )
1084 : : {
1085 : 0 : const SdrHdlList& rHdlList = mpView->GetHdlList();
1086 : 0 : SdrHdl* pHdl = rHdlList.GetFocusHdl();
1087 : :
1088 [ # # ]: 0 : if(pHdl)
1089 : : {
1090 : 0 : ((SdrHdlList&)rHdlList).ResetFocusHdl();
1091 : : }
1092 : : else
1093 : : {
1094 : 0 : mpView->UnmarkAll();
1095 : : }
1096 : :
1097 : : // Switch to FuSelect.
1098 : : mpViewShell->GetViewFrame()->GetDispatcher()->Execute(
1099 : : SID_OBJECT_SELECT,
1100 : 0 : SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
1101 : :
1102 : 0 : bReturn = true;
1103 : : }
1104 : :
1105 : 0 : return bReturn;
1106 : : }
1107 : :
1108 : : } // end of namespace sd
1109 : :
1110 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|