LibreOffice Module sd (master) 1
SlsInsertionIndicatorHandler.hxx
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#pragma once
21
23
24#include <view/SlsLayouter.hxx>
25
26namespace sd::slidesorter { class SlideSorter; }
27namespace sd::slidesorter::view {
28class InsertAnimator;
29class InsertionIndicatorOverlay;
30}
31
32class SdTransferable;
33
35
40{
41public:
43 ~InsertionIndicatorHandler() COVERITY_NOEXCEPT_FALSE;
44
46 static Mode GetModeFromDndAction (const sal_Int8 nDndAction);
47
50 void Start (const bool bIsOverSourceView);
51
55
61 {
62 public:
63 ForceShowContext (std::shared_ptr<InsertionIndicatorHandler> pHandler);
64 ~ForceShowContext() COVERITY_NOEXCEPT_FALSE;
65 private:
66 const std::shared_ptr<InsertionIndicatorHandler> mpHandler;
67 };
68
72 void UpdateIndicatorIcon (const SdTransferable* pTransferable);
73
76 void UpdatePosition (
77 const Point& rMouseModelPosition,
78 const Mode eMode);
79 void UpdatePosition (
80 const Point& rMouseModelPosition,
81 const sal_Int8 nDndAction);
82
85 bool IsActive() const { return mbIsActive;}
86
90 sal_Int32 GetInsertionPageIndex() const;
91
98 const sal_Int32 nInsertionIndex,
99 const Mode eMode) const;
104 bool IsInsertionTrivial (const sal_Int8 nDndAction);
105
106private:
108 std::shared_ptr<view::InsertAnimator> mpInsertAnimator;
109 std::shared_ptr<view::InsertionIndicatorOverlay> mpInsertionIndicatorOverlay;
118
119 void SetPosition (
120 const Point& rPoint,
121 const Mode eMode);
122 std::shared_ptr<view::InsertAnimator> const & GetInsertAnimator();
123
132 void ForceShow();
133 void ForceEnd();
134};
135
136} // end of namespace ::sd::slidesorter::controller
137
138/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Show previews for all the slides in a document and allow the user to insert or delete slides and modi...
Definition: SlideSorter.hxx:62
AnimationMode
In some circumstances we have to avoid animation and jump to the final animation state immediately.
Definition: SlsAnimator.hxx:45
This context make sure that the insertion indicator is shown (provided that the clipboard is not empt...
Manage the visibility and location of the insertion indicator.
sal_Int32 GetInsertionPageIndex() const
Return the insertion index that corresponds with the current graphical location of the insertion indi...
std::shared_ptr< view::InsertAnimator > const & GetInsertAnimator()
void UpdatePosition(const Point &rMouseModelPosition, const Mode eMode)
Set the position of the insertion marker to the given coordinates.
void ForceShow()
Make the insertion indicator visible (that is the show part) and keep it visible, even when the mouse...
std::shared_ptr< view::InsertionIndicatorOverlay > mpInsertionIndicatorOverlay
void End(const controller::Animator::AnimationMode eMode)
Deactivate the insertion marker.
bool IsInsertionTrivial(const sal_Int32 nInsertionIndex, const Mode eMode) const
Determine whether moving the current selection to the current position of the insertion marker would ...
void UpdateIndicatorIcon(const SdTransferable *pTransferable)
Update the indicator icon from the current transferable (from the clipboard or an active drag and dro...
void Start(const bool bIsOverSourceView)
Activate the insertion marker at the given coordinates.
bool IsActive() const
Return whether the insertion marker is active.
Collect all values concerning the logical and visual properties of the insertion position that is use...
Mode
signed char sal_Int8