17a32b0c8SAndre Fischer /**************************************************************
27a32b0c8SAndre Fischer  *
37a32b0c8SAndre Fischer  * Licensed to the Apache Software Foundation (ASF) under one
47a32b0c8SAndre Fischer  * or more contributor license agreements.  See the NOTICE file
57a32b0c8SAndre Fischer  * distributed with this work for additional information
67a32b0c8SAndre Fischer  * regarding copyright ownership.  The ASF licenses this file
77a32b0c8SAndre Fischer  * to you under the Apache License, Version 2.0 (the
87a32b0c8SAndre Fischer  * "License"); you may not use this file except in compliance
97a32b0c8SAndre Fischer  * with the License.  You may obtain a copy of the License at
107a32b0c8SAndre Fischer  *
117a32b0c8SAndre Fischer  *   http://www.apache.org/licenses/LICENSE-2.0
127a32b0c8SAndre Fischer  *
137a32b0c8SAndre Fischer  * Unless required by applicable law or agreed to in writing,
147a32b0c8SAndre Fischer  * software distributed under the License is distributed on an
157a32b0c8SAndre Fischer  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
167a32b0c8SAndre Fischer  * KIND, either express or implied.  See the License for the
177a32b0c8SAndre Fischer  * specific language governing permissions and limitations
187a32b0c8SAndre Fischer  * under the License.
197a32b0c8SAndre Fischer  *
207a32b0c8SAndre Fischer  *************************************************************/
217a32b0c8SAndre Fischer 
227a32b0c8SAndre Fischer #ifndef SD_SIDEBAR_FACTORY_HXX
237a32b0c8SAndre Fischer #define SD_SIDEBAR_FACTORY_HXX
247a32b0c8SAndre Fischer 
257a32b0c8SAndre Fischer #include <cppuhelper/compbase4.hxx>
267a32b0c8SAndre Fischer #include <cppuhelper/basemutex.hxx>
277a32b0c8SAndre Fischer #include <rtl/ref.hxx>
287a32b0c8SAndre Fischer #include "framework/Pane.hxx"
297a32b0c8SAndre Fischer 
307a32b0c8SAndre Fischer #include <com/sun/star/ui/XUIElementFactory.hpp>
317a32b0c8SAndre Fischer #include <com/sun/star/uno/XComponentContext.hpp>
327a32b0c8SAndre Fischer #include <com/sun/star/lang/XInitialization.hpp>
337a32b0c8SAndre Fischer 
347a32b0c8SAndre Fischer #include <map>
357a32b0c8SAndre Fischer #include <boost/noncopyable.hpp>
367a32b0c8SAndre Fischer #include <boost/shared_ptr.hpp>
377a32b0c8SAndre Fischer 
387a32b0c8SAndre Fischer 
397a32b0c8SAndre Fischer namespace css = ::com::sun::star;
407a32b0c8SAndre Fischer namespace cssu = ::com::sun::star::uno;
417a32b0c8SAndre Fischer 
427a32b0c8SAndre Fischer 
437a32b0c8SAndre Fischer namespace sd {
447a32b0c8SAndre Fischer     class ViewShellBase;
457a32b0c8SAndre Fischer }
467a32b0c8SAndre Fischer 
477a32b0c8SAndre Fischer namespace sd { namespace sidebar {
487a32b0c8SAndre Fischer 
497a32b0c8SAndre Fischer namespace
507a32b0c8SAndre Fischer {
51*02c50d82SAndre Fischer     typedef ::cppu::WeakComponentImplHelper3 <
527a32b0c8SAndre Fischer         css::lang::XInitialization,
537a32b0c8SAndre Fischer         css::ui::XUIElementFactory,
547a32b0c8SAndre Fischer         css::lang::XEventListener
557a32b0c8SAndre Fischer         > SidebarFactoryInterfaceBase;
567a32b0c8SAndre Fischer }
577a32b0c8SAndre Fischer 
587a32b0c8SAndre Fischer 
597a32b0c8SAndre Fischer /** This factory creates both XUIElements (for sidebar panels) and
607a32b0c8SAndre Fischer     a drawing framework pane.
617a32b0c8SAndre Fischer 
627a32b0c8SAndre Fischer     The drawing framework pane is a container for the SidebarViewShell
637a32b0c8SAndre Fischer     which is necessary to run the legacy implementations of the task
647a32b0c8SAndre Fischer     pane panels.
657a32b0c8SAndre Fischer 
667a32b0c8SAndre Fischer     Control and information flow is like this:
677a32b0c8SAndre Fischer 
687a32b0c8SAndre Fischer     When one of the old task panels is requested to be displayed in
697a32b0c8SAndre Fischer     the sidebar this factory is called for
707a32b0c8SAndre Fischer     XUIElementFactory::createUIElement().
717a32b0c8SAndre Fischer     One of the arguments, the window, is then exported into the
727a32b0c8SAndre Fischer     drawing framework as pane.  After this the drawing framework is
737a32b0c8SAndre Fischer     used to create the SidebarViewShell (once known as
747a32b0c8SAndre Fischer     TaskPaneViewShell or ToolPanelViewShell) and the requested panel.
757a32b0c8SAndre Fischer */
767a32b0c8SAndre Fischer class SidebarFactory
777a32b0c8SAndre Fischer     : private ::boost::noncopyable,
787a32b0c8SAndre Fischer       private ::cppu::BaseMutex,
797a32b0c8SAndre Fischer       public SidebarFactoryInterfaceBase
807a32b0c8SAndre Fischer {
817a32b0c8SAndre Fischer public:
827a32b0c8SAndre Fischer     static ::rtl::OUString SAL_CALL getImplementationName (void);
837a32b0c8SAndre Fischer     static cssu::Reference<cssu::XInterface> SAL_CALL createInstance (
847a32b0c8SAndre Fischer         const cssu::Reference<css::lang::XMultiServiceFactory>& rxFactory);
857a32b0c8SAndre Fischer     static cssu::Sequence<rtl::OUString> SAL_CALL getSupportedServiceNames (void);
867a32b0c8SAndre Fischer 
877a32b0c8SAndre Fischer     SidebarFactory (const cssu::Reference<cssu::XComponentContext>& rxContext);
887a32b0c8SAndre Fischer     virtual ~SidebarFactory (void);
897a32b0c8SAndre Fischer 
907a32b0c8SAndre Fischer     virtual void SAL_CALL disposing (void);
917a32b0c8SAndre Fischer 
927a32b0c8SAndre Fischer 
937a32b0c8SAndre Fischer     // XInitialization
947a32b0c8SAndre Fischer 
957a32b0c8SAndre Fischer     virtual void SAL_CALL initialize(
967a32b0c8SAndre Fischer         const css::uno::Sequence<css::uno::Any>& aArguments)
977a32b0c8SAndre Fischer         throw (css::uno::Exception, css::uno::RuntimeException);
987a32b0c8SAndre Fischer 
997a32b0c8SAndre Fischer 
1007a32b0c8SAndre Fischer     // XUIElementFactory
1017a32b0c8SAndre Fischer 
1027a32b0c8SAndre Fischer     cssu::Reference<css::ui::XUIElement> SAL_CALL createUIElement (
1037a32b0c8SAndre Fischer         const ::rtl::OUString& rsResourceURL,
1047a32b0c8SAndre Fischer         const ::cssu::Sequence<css::beans::PropertyValue>& rArguments)
1057a32b0c8SAndre Fischer         throw(
1067a32b0c8SAndre Fischer             css::container::NoSuchElementException,
1077a32b0c8SAndre Fischer             css::lang::IllegalArgumentException,
1087a32b0c8SAndre Fischer             cssu::RuntimeException);
1097a32b0c8SAndre Fischer 
1107a32b0c8SAndre Fischer 
1117a32b0c8SAndre Fischer     // XEventListener
1127a32b0c8SAndre Fischer 
1137a32b0c8SAndre Fischer     virtual void SAL_CALL disposing (const ::css::lang::EventObject& rEvent)
1147a32b0c8SAndre Fischer         throw(cssu::RuntimeException);
1157a32b0c8SAndre Fischer };
1167a32b0c8SAndre Fischer 
1177a32b0c8SAndre Fischer 
1187a32b0c8SAndre Fischer } } // end of namespace sd::sidebar
1197a32b0c8SAndre Fischer 
1207a32b0c8SAndre Fischer #endif
121