Update ooo320-m1
[ooovba.git] / sd / source / ui / framework / factories / BasicViewFactory.hxx
blob3499232e594e3d9aa3a57f5821bf56d8b9dc2fdf
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: BasicViewFactory.hxx,v $
11 * $Revision: 1.3 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #ifndef SD_FRAMEWORK_BASIC_VIEW_FACTORY_HXX
33 #define SD_FRAMEWORK_BASIC_VIEW_FACTORY_HXX
35 #include "MutexOwner.hxx"
37 #include <com/sun/star/drawing/framework/XResourceFactory.hpp>
38 #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
39 #include <com/sun/star/drawing/framework/XPane.hpp>
40 #include <com/sun/star/frame/XController.hpp>
41 #include <com/sun/star/lang/XInitialization.hpp>
42 #include <com/sun/star/uno/XComponentContext.hpp>
44 #include <cppuhelper/compbase2.hxx>
45 #include <osl/mutex.hxx>
47 #include <boost/shared_ptr.hpp>
48 #include <boost/scoped_ptr.hpp>
50 namespace css = ::com::sun::star;
52 namespace sd {
53 class ViewShell;
54 class ViewShellBase;
55 class FrameView;
57 class SfxViewFrame;
58 class Window;
60 namespace {
62 typedef ::cppu::WeakComponentImplHelper2 <
63 css::drawing::framework::XResourceFactory,
64 css::lang::XInitialization
65 > BasicViewFactoryInterfaceBase;
67 } // end of anonymous namespace.
72 namespace sd { namespace framework {
74 /** Factory for the frequently used standard views of the drawing framework:
75 private:resource/view/
76 private:resource/view/ImpressView
77 private:resource/view/GraphicView
78 private:resource/view/OutlineView
79 private:resource/view/NotesView
80 private:resource/view/HandoutView
81 private:resource/view/SlideSorter
82 private:resource/view/PresentationView
83 private:resource/view/TaskPane
84 For some views in some panes this class also acts as a cache.
86 class BasicViewFactory
87 : private sd::MutexOwner,
88 public BasicViewFactoryInterfaceBase
90 public:
91 BasicViewFactory (
92 const css::uno::Reference<css::uno::XComponentContext>& rxContext);
93 virtual ~BasicViewFactory (void);
95 virtual void SAL_CALL disposing (void);
98 // XViewFactory
100 virtual css::uno::Reference<css::drawing::framework::XResource>
101 SAL_CALL createResource (
102 const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId)
103 throw(css::uno::RuntimeException);
105 virtual void SAL_CALL releaseResource (
106 const css::uno::Reference<css::drawing::framework::XResource>& xView)
107 throw(css::uno::RuntimeException);
110 // XInitialization
112 virtual void SAL_CALL initialize(
113 const css::uno::Sequence<css::uno::Any>& aArguments)
114 throw (css::uno::Exception, css::uno::RuntimeException);
116 private:
117 css::uno::Reference<css::drawing::framework::XConfigurationController>
118 mxConfigurationController;
119 class ViewDescriptor;
120 class ViewShellContainer;
121 ::boost::scoped_ptr<ViewShellContainer> mpViewShellContainer;
122 ViewShellBase* mpBase;
123 FrameView* mpFrameView;
125 class ViewCache;
126 ::boost::shared_ptr<ViewCache> mpViewCache;
128 css::uno::Reference<css::drawing::framework::XPane> mxLocalPane;
130 ::boost::shared_ptr<ViewDescriptor> CreateView (
131 const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
132 SfxViewFrame& rFrame,
133 ::Window& rWindow,
134 const css::uno::Reference<css::drawing::framework::XPane>& rxPane,
135 FrameView* pFrameView);
137 ::boost::shared_ptr<ViewShell> CreateViewShell (
138 const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
139 SfxViewFrame& rFrame,
140 ::Window& rWindow,
141 FrameView* pFrameView);
143 void ActivateCenterView (
144 const ::boost::shared_ptr<ViewDescriptor>& rpDescriptor);
146 void ReleaseView (
147 const ::boost::shared_ptr<ViewDescriptor>& rpDescriptor,
148 bool bDoNotCache = false);
150 bool IsCacheable (
151 const ::boost::shared_ptr<ViewDescriptor>& rpDescriptor);
153 ::boost::shared_ptr<ViewDescriptor> GetViewFromCache (
154 const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
155 const css::uno::Reference<css::drawing::framework::XPane>& rxPane);
158 } } // end of namespace sd::framework
160 #endif