1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: BasicViewFactory.hxx,v $
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
;
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
92 const css::uno::Reference
<css::uno::XComponentContext
>& rxContext
);
93 virtual ~BasicViewFactory (void);
95 virtual void SAL_CALL
disposing (void);
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
);
112 virtual void SAL_CALL
initialize(
113 const css::uno::Sequence
<css::uno::Any
>& aArguments
)
114 throw (css::uno::Exception
, css::uno::RuntimeException
);
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
;
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
,
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
,
141 FrameView
* pFrameView
);
143 void ActivateCenterView (
144 const ::boost::shared_ptr
<ViewDescriptor
>& rpDescriptor
);
147 const ::boost::shared_ptr
<ViewDescriptor
>& rpDescriptor
,
148 bool bDoNotCache
= false);
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