bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / framework / factories / BasicViewFactory.hxx
blobf2278bb35a7a98570e2d8cb23d22ac27645bcc1c
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 #ifndef INCLUDED_SD_SOURCE_UI_FRAMEWORK_FACTORIES_BASICVIEWFACTORY_HXX
21 #define INCLUDED_SD_SOURCE_UI_FRAMEWORK_FACTORIES_BASICVIEWFACTORY_HXX
23 #include "MutexOwner.hxx"
25 #include <com/sun/star/drawing/framework/XResourceFactory.hpp>
26 #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
27 #include <com/sun/star/drawing/framework/XPane.hpp>
28 #include <com/sun/star/frame/XController.hpp>
29 #include <com/sun/star/lang/XInitialization.hpp>
30 #include <com/sun/star/uno/XComponentContext.hpp>
32 #include <cppuhelper/compbase2.hxx>
33 #include <osl/mutex.hxx>
35 #include <boost/shared_ptr.hpp>
36 #include <boost/scoped_ptr.hpp>
37 #include <vcl/vclptr.hxx>
39 namespace sd {
40 class ViewShell;
41 class ViewShellBase;
42 class FrameView;
44 class SfxViewFrame;
45 namespace vcl { class Window; }
47 namespace {
49 typedef ::cppu::WeakComponentImplHelper2 <
50 css::drawing::framework::XResourceFactory,
51 css::lang::XInitialization
52 > BasicViewFactoryInterfaceBase;
54 } // end of anonymous namespace.
56 namespace sd { namespace framework {
58 /** Factory for the frequently used standard views of the drawing framework:
59 private:resource/view/
60 private:resource/view/ImpressView
61 private:resource/view/GraphicView
62 private:resource/view/OutlineView
63 private:resource/view/NotesView
64 private:resource/view/HandoutView
65 private:resource/view/SlideSorter
66 private:resource/view/PresentationView
67 private:resource/view/TaskPane
68 For some views in some panes this class also acts as a cache.
70 class BasicViewFactory
71 : private sd::MutexOwner,
72 public BasicViewFactoryInterfaceBase
74 public:
75 BasicViewFactory (
76 const css::uno::Reference<css::uno::XComponentContext>& rxContext);
77 virtual ~BasicViewFactory();
79 virtual void SAL_CALL disposing() SAL_OVERRIDE;
81 // XViewFactory
83 virtual css::uno::Reference<css::drawing::framework::XResource>
84 SAL_CALL createResource (
85 const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId)
86 throw(css::uno::RuntimeException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, std::exception) SAL_OVERRIDE;
88 virtual void SAL_CALL releaseResource (
89 const css::uno::Reference<css::drawing::framework::XResource>& xView)
90 throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
92 // XInitialization
94 virtual void SAL_CALL initialize(
95 const css::uno::Sequence<css::uno::Any>& aArguments)
96 throw (css::uno::Exception, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
98 private:
99 css::uno::Reference<css::drawing::framework::XConfigurationController>
100 mxConfigurationController;
101 class ViewDescriptor;
102 class ViewShellContainer;
103 ::boost::scoped_ptr<ViewShellContainer> mpViewShellContainer;
104 ViewShellBase* mpBase;
105 FrameView* mpFrameView;
107 class ViewCache;
108 ScopedVclPtr<vcl::Window> mpWindow;
109 ::boost::shared_ptr<ViewCache> mpViewCache;
111 css::uno::Reference<css::drawing::framework::XPane> mxLocalPane;
113 ::boost::shared_ptr<ViewDescriptor> CreateView (
114 const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
115 SfxViewFrame& rFrame,
116 vcl::Window& rWindow,
117 const css::uno::Reference<css::drawing::framework::XPane>& rxPane,
118 FrameView* pFrameView,
119 const bool bIsCenterView);
121 ::boost::shared_ptr<ViewShell> CreateViewShell (
122 const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
123 SfxViewFrame& rFrame,
124 vcl::Window& rWindow,
125 FrameView* pFrameView,
126 const bool bIsCenterView);
128 void ActivateCenterView (
129 const ::boost::shared_ptr<ViewDescriptor>& rpDescriptor);
131 void ReleaseView (
132 const ::boost::shared_ptr<ViewDescriptor>& rpDescriptor,
133 bool bDoNotCache = false);
135 bool IsCacheable (
136 const ::boost::shared_ptr<ViewDescriptor>& rpDescriptor);
138 ::boost::shared_ptr<ViewDescriptor> GetViewFromCache (
139 const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
140 const css::uno::Reference<css::drawing::framework::XPane>& rxPane);
143 } } // end of namespace sd::framework
145 #endif
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */