tdf#154285 Check upper bound of arguments in SbRtl_Minute function
[LibreOffice.git] / sd / source / ui / inc / framework / factories / BasicViewFactory.hxx
blob47a2aea5b8ae66654c2dd8e54147190a7ed8f3b5
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 #pragma once
22 #include <com/sun/star/drawing/framework/XResourceFactory.hpp>
23 #include <com/sun/star/lang/XInitialization.hpp>
25 #include <comphelper/compbase.hxx>
26 #include <rtl/ref.hxx>
28 #include <vcl/vclptr.hxx>
29 #include <memory>
31 namespace com::sun::star::drawing::framework { class XConfigurationController; }
32 namespace com::sun::star::drawing::framework { class XPane; }
34 namespace sd {
35 class DrawController;
36 class ViewShell;
37 class ViewShellBase;
38 class FrameView;
40 class SfxViewFrame;
41 namespace vcl { class Window; }
43 namespace sd::framework {
45 typedef comphelper::WeakComponentImplHelper <
46 css::drawing::framework::XResourceFactory
47 > BasicViewFactoryInterfaceBase;
49 /** Factory for the frequently used standard views of the drawing framework:
50 private:resource/view/
51 private:resource/view/ImpressView
52 private:resource/view/GraphicView
53 private:resource/view/OutlineView
54 private:resource/view/NotesView
55 private:resource/view/HandoutView
56 private:resource/view/SlideSorter
57 private:resource/view/PresentationView
58 private:resource/view/TaskPane
59 For some views in some panes this class also acts as a cache.
61 class BasicViewFactory final
62 : public BasicViewFactoryInterfaceBase
64 public:
65 BasicViewFactory(const rtl::Reference<::sd::DrawController>& rxController);
66 virtual ~BasicViewFactory() override;
68 virtual void disposing(std::unique_lock<std::mutex>&) override;
70 // XViewFactory
72 virtual css::uno::Reference<css::drawing::framework::XResource>
73 SAL_CALL createResource (
74 const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId) override;
76 virtual void SAL_CALL releaseResource (
77 const css::uno::Reference<css::drawing::framework::XResource>& xView) override;
79 private:
80 css::uno::Reference<css::drawing::framework::XConfigurationController>
81 mxConfigurationController;
82 class ViewDescriptor;
83 class ViewShellContainer;
84 std::unique_ptr<ViewShellContainer> mpViewShellContainer;
85 ViewShellBase* mpBase;
86 FrameView* mpFrameView;
88 class ViewCache;
89 ScopedVclPtr<vcl::Window> mpWindow;
90 std::shared_ptr<ViewCache> mpViewCache;
92 css::uno::Reference<css::drawing::framework::XPane> mxLocalPane;
94 std::shared_ptr<ViewDescriptor> CreateView (
95 const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
96 SfxViewFrame& rFrame,
97 vcl::Window& rWindow,
98 const css::uno::Reference<css::drawing::framework::XPane>& rxPane,
99 FrameView* pFrameView,
100 const bool bIsCenterView);
102 std::shared_ptr<ViewShell> CreateViewShell (
103 const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
104 SfxViewFrame& rFrame,
105 vcl::Window& rWindow,
106 FrameView* pFrameView);
108 void ActivateCenterView (
109 const std::shared_ptr<ViewDescriptor>& rpDescriptor);
111 void ReleaseView (
112 const std::shared_ptr<ViewDescriptor>& rpDescriptor,
113 bool bDoNotCache);
115 bool IsCacheable (
116 const std::shared_ptr<ViewDescriptor>& rpDescriptor);
118 std::shared_ptr<ViewDescriptor> GetViewFromCache (
119 const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
120 const css::uno::Reference<css::drawing::framework::XPane>& rxPane);
123 } // end of namespace sd::framework
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */