Update git submodules
[LibreOffice.git] / sd / source / ui / slidesorter / inc / controller / SlsSlotManager.hxx
blob57de8422ac4062f00cf7f4296fcec06ca1a1ebbb
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 .
19 #pragma once
21 #include <model/SlsSharedPageDescriptor.hxx>
22 #include <tools/link.hxx>
23 #include <rtl/ustring.hxx>
25 class AbstractSvxNameDialog;
26 class SfxItemSet;
27 class SfxRequest;
29 namespace sd::slidesorter
31 class SlideSorter;
34 namespace sd::slidesorter::controller
36 /** This manager takes over the work of handling slot calls from the
37 controller of the slide sorter.
39 class SlotManager
41 public:
42 /** Create a new slot manager that handles slot calls for the controller
43 of a slide sorter.
44 @param rController
45 The controller for which to handle the slot calls.
47 SlotManager(SlideSorter& rSlideSorter);
49 void FuTemporary(SfxRequest& rRequest);
50 void FuPermanent(SfxRequest& rRequest);
51 void FuSupport(SfxRequest& rRequest);
52 void GetMenuState(SfxItemSet& rSet);
53 void GetClipboardState(SfxItemSet& rSet);
54 void GetStatusBarState(SfxItemSet& rSet);
55 void ExecCtrl(SfxRequest& rRequest);
56 void GetAttrState(SfxItemSet& rSet);
58 /** Exclude or include one slide or all selected slides.
59 @param rpDescriptor
60 When the pointer is empty then apply the new state to all
61 selected pages. Otherwise apply the new state to just the
62 specified state.
64 void ChangeSlideExclusionState(const model::SharedPageDescriptor& rpDescriptor,
65 const bool bExcludeSlide);
67 /** Call this after a change from normal mode to master mode or back.
68 The affected slots are invalidated.
70 void NotifyEditModeChange();
72 private:
73 /// The controller for which we manage the slot calls.
74 SlideSorter& mrSlideSorter;
76 /** The implementation is a copy of the code for SID_RENAMEPAGE in
77 drviews2.cxx.
79 void RenameSlide(const SfxRequest& rRequest);
80 DECL_LINK(RenameSlideHdl, AbstractSvxNameDialog&, bool);
81 DECL_STATIC_LINK(SlotManager, RenameSlideTooltipHdl, AbstractSvxNameDialog&, OUString);
82 bool RenameSlideFromDrawViewShell(sal_uInt16 nPageId, const OUString& rName);
84 /** Handle SID_INSERTPAGE slot calls.
86 void InsertSlide(SfxRequest& rRequest);
88 void DuplicateSelectedSlides(SfxRequest& rRequest);
90 /** Use one of several ways to determine where to insert a new page.
91 This can be the current selection or the insertion indicator.
93 sal_Int32 GetInsertionPosition() const;
96 } // end of namespace ::sd::slidesorter::controller
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */