LibreOffice Module sd (master) 1
SlsSelectionManager.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
22#include <sal/types.h>
23#include <tools/link.hxx>
24#include <vector>
25#include <memory>
26
27class SdPage;
28
29namespace sd::slidesorter
30{
31class SlideSorter;
32}
33
35{
36class SlideSorterController;
37class SelectionObserver;
38
47{
48public:
51 SelectionManager(SlideSorter& rSlideSorter);
52
54
63 void DeleteSelectedPages(const bool bSelectFollowingPage = true);
64
70
79
87
96 sal_Int32 GetInsertionPosition() const;
97
101 void SetInsertionPosition(const sal_Int32 nInsertionPosition);
102
103 const std::shared_ptr<SelectionObserver>& GetSelectionObserver() const
104 {
105 return mpSelectionObserver;
106 }
107
108private:
111
112 ::std::vector<Link<LinkParamNone*, void>> maSelectionChangeListeners;
113
119
120 std::shared_ptr<SelectionObserver> mpSelectionObserver;
121
127 void DeleteSelectedNormalPages(const ::std::vector<SdPage*>& rSelectedNormalPages);
128
134 void DeleteSelectedMasterPages(const ::std::vector<SdPage*>& rSelectedMasterPages);
135};
136
137} // end of namespace ::sd::slidesorter::controller
138
139/* 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
This class is a part of the controller and handles the selection of slides.
void SetInsertionPosition(const sal_Int32 nInsertionPosition)
Store an insertion position temporarily.
void AddSelectionChangeListener(const Link< LinkParamNone *, void > &rListener)
Add a listener that is called when the selection of the slide sorter changes.
sal_Int32 mnInsertionPosition
The insertion position is only temporarily valid.
sal_Int32 GetInsertionPosition() const
Return the position where to insert pasted slides based on the current selection.
void DeleteSelectedMasterPages(const ::std::vector< SdPage * > &rSelectedMasterPages)
Delete the given list of master pages.
void DeleteSelectedPages(const bool bSelectFollowingPage=true)
Delete the currently selected slides.
void SelectionHasChanged()
Call this method after the selection has changed (possible several calls to the PageSelector) to inva...
std::shared_ptr< SelectionObserver > mpSelectionObserver
const std::shared_ptr< SelectionObserver > & GetSelectionObserver() const
void RemoveSelectionChangeListener(const Link< LinkParamNone *, void > &rListener)
Remove a listener that was called when the selection of the slide sorter changes.
::std::vector< Link< LinkParamNone *, void > > maSelectionChangeListeners
SelectionManager(SlideSorter &rSlideSorter)
Create a new SelectionManager for the given slide sorter.
void DeleteSelectedNormalPages(const ::std::vector< SdPage * > &rSelectedNormalPages)
Delete the given list of normal pages.