LibreOffice Module sd (master) 1
BasicViewFactory.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 <com/sun/star/drawing/framework/XResourceFactory.hpp>
23#include <com/sun/star/lang/XInitialization.hpp>
24
26#include <rtl/ref.hxx>
27
28#include <vcl/vclptr.hxx>
29#include <memory>
30
31namespace com::sun::star::drawing::framework { class XConfigurationController; }
32namespace com::sun::star::drawing::framework { class XPane; }
33
34namespace sd {
35class DrawController;
36class ViewShell;
37class ViewShellBase;
38class FrameView;
39}
40class SfxViewFrame;
41namespace vcl { class Window; }
42
43namespace sd::framework {
44
46 css::drawing::framework::XResourceFactory
48
63{
64public:
66 virtual ~BasicViewFactory() override;
67
68 virtual void disposing(std::unique_lock<std::mutex>&) override;
69
70 // XViewFactory
71
72 virtual css::uno::Reference<css::drawing::framework::XResource>
73 SAL_CALL createResource (
74 const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId) override;
75
76 virtual void SAL_CALL releaseResource (
77 const css::uno::Reference<css::drawing::framework::XResource>& xView) override;
78
79private:
80 css::uno::Reference<css::drawing::framework::XConfigurationController>
82 class ViewDescriptor;
84 std::unique_ptr<ViewShellContainer> mpViewShellContainer;
87
88 class ViewCache;
90 std::shared_ptr<ViewCache> mpViewCache;
91
92 css::uno::Reference<css::drawing::framework::XPane> mxLocalPane;
93
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);
101
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);
107
108 void ActivateCenterView (
109 const std::shared_ptr<ViewDescriptor>& rpDescriptor);
110
111 void ReleaseView (
112 const std::shared_ptr<ViewDescriptor>& rpDescriptor,
113 bool bDoNotCache);
114
115 bool IsCacheable (
116 const std::shared_ptr<ViewDescriptor>& rpDescriptor);
117
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);
121};
122
123} // end of namespace sd::framework
124
125/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
View for MDIFrame.
Definition: FrameView.hxx:36
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
Factory for the frequently used standard views of the drawing framework: private:resource/view/ priva...
virtual void disposing(std::unique_lock< std::mutex > &) override
std::unique_ptr< ViewShellContainer > mpViewShellContainer
std::shared_ptr< ViewCache > mpViewCache
std::shared_ptr< ViewDescriptor > CreateView(const css::uno::Reference< css::drawing::framework::XResourceId > &rxViewId, SfxViewFrame &rFrame, vcl::Window &rWindow, const css::uno::Reference< css::drawing::framework::XPane > &rxPane, FrameView *pFrameView, const bool bIsCenterView)
ScopedVclPtr< vcl::Window > mpWindow
css::uno::Reference< css::drawing::framework::XConfigurationController > mxConfigurationController
BasicViewFactory(const rtl::Reference<::sd::DrawController > &rxController)
void ReleaseView(const std::shared_ptr< ViewDescriptor > &rpDescriptor, bool bDoNotCache)
virtual css::uno::Reference< css::drawing::framework::XResource > SAL_CALL createResource(const css::uno::Reference< css::drawing::framework::XResourceId > &rxViewId) override
std::shared_ptr< ViewShell > CreateViewShell(const css::uno::Reference< css::drawing::framework::XResourceId > &rxViewId, SfxViewFrame &rFrame, vcl::Window &rWindow, FrameView *pFrameView)
void ActivateCenterView(const std::shared_ptr< ViewDescriptor > &rpDescriptor)
bool IsCacheable(const std::shared_ptr< ViewDescriptor > &rpDescriptor)
virtual void SAL_CALL releaseResource(const css::uno::Reference< css::drawing::framework::XResource > &xView) override
std::shared_ptr< ViewDescriptor > GetViewFromCache(const css::uno::Reference< css::drawing::framework::XResourceId > &rxViewId, const css::uno::Reference< css::drawing::framework::XPane > &rxPane)
css::uno::Reference< css::drawing::framework::XPane > mxLocalPane
comphelper::WeakComponentImplHelper< css::drawing::framework::XResourceFactory > BasicViewFactoryInterfaceBase