openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1423885 [1/2] - in /openoffice/branches/sidebar: ./ main/framework/ main/framework/inc/services/ main/framework/source/register/ main/framework/source/services/ main/framework/util/ main/offapi/com/sun/star/ui/ main/offapi/com/sun/star/uti...
Date Wed, 19 Dec 2012 15:29:32 GMT
Author: af
Date: Wed Dec 19 15:29:30 2012
New Revision: 1423885

URL: http://svn.apache.org/viewvc?rev=1423885&view=rev
Log:
i121420: Sidebar can read configuration and display XUIElements provided by extension.

Added:
    openoffice/branches/sidebar/main/framework/inc/services/ContextChangeEventMultiplexer.hxx
    openoffice/branches/sidebar/main/framework/source/services/ContextChangeEventMultiplexer.cxx
    openoffice/branches/sidebar/main/offapi/com/sun/star/ui/XContextChangeEventListener.idl
    openoffice/branches/sidebar/main/offapi/com/sun/star/ui/XContextChangeEventMultiplexer.idl
    openoffice/branches/sidebar/main/offapi/com/sun/star/ui/XContextChangeListener.idl
    openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu   (with props)
    openoffice/branches/sidebar/main/sfx2/inc/sfx2/SidebarChildWindow.hxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/
    openoffice/branches/sidebar/main/sfx2/source/sidebar/ContentPanelDescriptor.hxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/ContentPanelManager.cxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/ContentPanelManager.hxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/Context.cxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/Context.hxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/Deck.cxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/Deck.hxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/DeckDescriptor.hxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/Panel.cxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/Panel.hxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/Sidebar.cxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/Sidebar.hxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/SidebarChildWindow.cxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/SidebarController.cxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/SidebarController.hxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/SidebarDockingWindow.cxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/SidebarDockingWindow.hxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/SidebarLayouter.cxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/SidebarLayouter.hxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/TabBar.cxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/TabBar.hxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/TitleBar.cxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/TitleBar.hxx
    openoffice/branches/sidebar/main/svx/inc/svx/sidebar/
    openoffice/branches/sidebar/main/svx/inc/svx/sidebar/ContextChangeEventMultiplexer.hxx
    openoffice/branches/sidebar/main/svx/source/sidebar/
    openoffice/branches/sidebar/main/svx/source/sidebar/ContextChangeEventMultiplexer.cxx
Modified:
    openoffice/branches/sidebar/.gitignore
    openoffice/branches/sidebar/main/framework/Library_fwk.mk
    openoffice/branches/sidebar/main/framework/source/register/registerservices.cxx
    openoffice/branches/sidebar/main/framework/util/fwk.component
    openoffice/branches/sidebar/main/offapi/com/sun/star/ui/ContextChangeEventMultiplexer.idl
    openoffice/branches/sidebar/main/offapi/com/sun/star/ui/makefile.mk
    openoffice/branches/sidebar/main/offapi/com/sun/star/util/makefile.mk
    openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
    openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/makefile.mk
    openoffice/branches/sidebar/main/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs
    openoffice/branches/sidebar/main/postprocess/packregistry/makefile.mk
    openoffice/branches/sidebar/main/sc/source/ui/app/scdll.cxx
    openoffice/branches/sidebar/main/sc/source/ui/view/tabvwsh.cxx
    openoffice/branches/sidebar/main/sc/uiconfig/scalc/menubar/menubar.xml
    openoffice/branches/sidebar/main/sd/source/ui/app/sddll2.cxx
    openoffice/branches/sidebar/main/sd/source/ui/view/ViewShellBase.cxx
    openoffice/branches/sidebar/main/sd/source/ui/view/drvwshrg.cxx
    openoffice/branches/sidebar/main/sd/source/ui/view/outlnvsh.cxx
    openoffice/branches/sidebar/main/sd/uiconfig/sdraw/menubar/menubar.xml
    openoffice/branches/sidebar/main/sd/uiconfig/simpress/menubar/menubar.xml
    openoffice/branches/sidebar/main/sfx2/Library_sfx.mk
    openoffice/branches/sidebar/main/sfx2/Package_inc.mk
    openoffice/branches/sidebar/main/sfx2/inc/sfx2/sfxsids.hrc
    openoffice/branches/sidebar/main/sfx2/sdi/frmslots.sdi
    openoffice/branches/sidebar/main/sfx2/sdi/sfx.sdi
    openoffice/branches/sidebar/main/sfx2/source/dialog/dialog.src
    openoffice/branches/sidebar/main/sfx2/source/inc/helpid.hrc
    openoffice/branches/sidebar/main/sfx2/source/view/viewfrm.cxx
    openoffice/branches/sidebar/main/svx/Library_svx.mk
    openoffice/branches/sidebar/main/svx/Package_inc.mk
    openoffice/branches/sidebar/main/svx/inc/svx/svxids.hrc
    openoffice/branches/sidebar/main/sw/source/ui/app/swmodule.cxx
    openoffice/branches/sidebar/main/sw/source/ui/uiview/view0.cxx
    openoffice/branches/sidebar/main/sw/uiconfig/swriter/menubar/menubar.xml

Modified: openoffice/branches/sidebar/.gitignore
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/.gitignore?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/.gitignore (original)
+++ openoffice/branches/sidebar/.gitignore Wed Dec 19 15:29:30 2012
@@ -70,3 +70,9 @@ TAGS
 /*/*/unxso???.pro
 /*/*/unxmac??
 /*/*/unxmac??.pro
+
+ext_sources/*
+main/external/*
+main/postprocess/rebase/no_rebase.txt
+main/postprocess/rebase/no_rebase.txt
+main/solar.sh

Modified: openoffice/branches/sidebar/main/framework/Library_fwk.mk
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/framework/Library_fwk.mk?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/framework/Library_fwk.mk (original)
+++ openoffice/branches/sidebar/main/framework/Library_fwk.mk Wed Dec 19 15:29:30 2012
@@ -116,7 +116,7 @@ $(eval $(call gb_Library_add_exception_o
 	framework/source/services/backingcomp \
 	framework/source/services/backingwindow \
 	framework/source/services/desktop \
-	framework/source/services/EventMultiplexer \
+	framework/source/services/ContextChangeEventMultiplexer \
 	framework/source/services/frame \
 	framework/source/services/modelwinservice \
 	framework/source/services/modulemanager \

Added: openoffice/branches/sidebar/main/framework/inc/services/ContextChangeEventMultiplexer.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/framework/inc/services/ContextChangeEventMultiplexer.hxx?rev=1423885&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/framework/inc/services/ContextChangeEventMultiplexer.hxx (added)
+++ openoffice/branches/sidebar/main/framework/inc/services/ContextChangeEventMultiplexer.hxx Wed Dec 19 15:29:30 2012
@@ -0,0 +1,122 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+
+
+#ifndef __FRAMEWORK_SERVICES_CONTEXT_CHANGE_EVENT_MULTIPLEXER_HXX_
+#define __FRAMEWORK_SERVICES_CONTEXT_CHANGE_EVENT_MULTIPLEXER_HXX_
+
+#include <com/sun/star/ui/XContextChangeEventMultiplexer.hpp>
+
+#include <cppuhelper/compbase3.hxx>
+#include <cppuhelper/basemutex.hxx>
+
+#include "macros/xserviceinfo.hxx"
+
+namespace
+{
+    typedef ::cppu::WeakComponentImplHelper3 <
+        css::ui::XContextChangeEventMultiplexer,
+        css::lang::XSingleComponentFactory,
+        css::lang::XServiceInfo
+        > ContextChangeEventMultiplexerInterfaceBase;
+}
+
+
+namespace css = ::com::sun::star;
+namespace cssu = ::com::sun::star::uno;
+namespace cssl = ::com::sun::star::lang;
+
+namespace framework {
+
+class ContextChangeEventMultiplexer
+    : private ::boost::noncopyable,
+      private ::cppu::BaseMutex,
+      public ContextChangeEventMultiplexerInterfaceBase
+{
+public:
+    ContextChangeEventMultiplexer(const cssu::Reference<css::uno::XComponentContext>& rxContext);
+    virtual ~ContextChangeEventMultiplexer (void);
+    
+    // XContextChangeEventMultiplexer
+    virtual void SAL_CALL addContextChangeEventListener (
+        const cssu::Reference<css::ui::XContextChangeEventListener>& rxListener,
+        const cssu::Reference<cssu::XInterface>& rxEventFocus)
+        throw(cssu::RuntimeException, cssl::IllegalArgumentException);
+    virtual void SAL_CALL removeContextChangeEventListener (
+        const cssu::Reference<css::ui::XContextChangeEventListener>& rxListener,
+        const cssu::Reference<cssu::XInterface>& rxEventFocus)
+        throw(cssu::RuntimeException, cssl::IllegalArgumentException);
+    virtual void SAL_CALL removeAllContextChangeEventListeners (
+        const cssu::Reference<css::ui::XContextChangeEventListener>& rxListener)
+        throw(cssu::RuntimeException, cssl::IllegalArgumentException);
+    virtual void SAL_CALL broadcastContextChangeEvent (
+        const css::ui::ContextChangeEventObject& rContextChangeEventObject,
+        const cssu::Reference<cssu::XInterface>& rxEventFocus)
+        throw(cssu::RuntimeException);
+
+    // XSingleComponentFactory
+    virtual cssu::Reference<cssu::XInterface> SAL_CALL createInstanceWithContext (
+        const cssu::Reference<cssu::XComponentContext>& rxContext)
+        throw (cssu::Exception, cssu::RuntimeException);
+    virtual cssu::Reference<cssu::XInterface > SAL_CALL createInstanceWithArgumentsAndContext (
+        const cssu::Sequence<cssu::Any>& rArguments,
+        const cssu::Reference<cssu::XComponentContext>& rxContext)
+        throw (cssu::Exception, cssu::RuntimeException);
+
+    // XServiceInfo
+    virtual ::rtl::OUString SAL_CALL getImplementationName (void)
+        throw (cssu::RuntimeException);
+    virtual sal_Bool SAL_CALL supportsService  (
+        const ::rtl::OUString& rsServiceName)
+        throw (cssu::RuntimeException);
+    virtual cssu::Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames (void)
+        throw (cssu::RuntimeException);
+
+    static ::rtl::OUString SAL_CALL impl_getStaticImplementationName (void);
+    static cssu::Reference<cssu::XInterface> SAL_CALL impl_createFactory (
+        const cssu::Reference<cssl::XMultiServiceFactory>& xServiceManager);
+
+private:
+    typedef ::std::vector<cssu::Reference<css::ui::XContextChangeEventListener> > ListenerContainer;
+    typedef ::std::map<cssu::Reference<cssu::XInterface>, ListenerContainer> ListenerMap;
+    ListenerMap maListeners;
+
+    /** Notify all listeners in the container that is associated with
+        the given event focus.
+
+        Typically called twice from broadcastEvent(), once for the
+        given event focus and onece for NULL.
+    */
+    void BroadcastEventToSingleContainer (
+        const css::ui::ContextChangeEventObject& rEventObject,
+        const cssu::Reference<cssu::XInterface>& rxEventFocus);
+
+    static cssu::Sequence< ::rtl::OUString > SAL_CALL static_GetSupportedServiceNames (void);
+    static cssu::Reference<cssu::XInterface> SAL_CALL static_CreateInstance (
+        const cssu::Reference<cssu::XComponentContext>& rxComponentContext)
+        throw (cssu::Exception);
+};
+
+} // end of namespace framework
+
+#endif
+

Modified: openoffice/branches/sidebar/main/framework/source/register/registerservices.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/framework/source/register/registerservices.cxx?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/framework/source/register/registerservices.cxx (original)
+++ openoffice/branches/sidebar/main/framework/source/register/registerservices.cxx Wed Dec 19 15:29:30 2012
@@ -86,7 +86,7 @@
 #include <uifactory/windowcontentfactorymanager.hxx>
 #include <services/substitutepathvars.hxx>
 #include <services/pathsettings.hxx>
-#include <services/EventMultiplexer.hxx>
+#include <services/ContextChangeEventMultiplexer.hxx>
 
 COMPONENTGETIMPLEMENTATIONENVIRONMENT
 
@@ -129,6 +129,6 @@ COMPONENTGETFACTORY	(	IFFACTORY( ::frame
                         IFFACTORY( ::framework::TabWindowService                        )   else
                         IFFACTORY( ::framework::SubstitutePathVariables			        )	else
 						IFFACTORY( ::framework::PathSettings					        )   else
-						IFFACTORY( ::framework::EventMultiplexer				        )
+						IFFACTORY( ::framework::ContextChangeEventMultiplexer			)
 			)
 

Added: openoffice/branches/sidebar/main/framework/source/services/ContextChangeEventMultiplexer.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/framework/source/services/ContextChangeEventMultiplexer.cxx?rev=1423885&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/framework/source/services/ContextChangeEventMultiplexer.cxx (added)
+++ openoffice/branches/sidebar/main/framework/source/services/ContextChangeEventMultiplexer.cxx Wed Dec 19 15:29:30 2012
@@ -0,0 +1,279 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#include "precompiled_framework.hxx"
+
+#include "services/ContextChangeEventMultiplexer.hxx"
+#include "services.h"
+
+using ::rtl::OUString;
+
+#define A2S(s) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
+
+namespace framework {
+
+#define IMPLEMENTATION_NAME "org.apache.openoffice.comp.framework.ContextChangeEventMultiplexer"
+#define SERVICE_NAME "com.sun.star.ui.ContextChangeEventMultiplexer"
+#define SINGLETON_NAME "org.apache.openoffice.comp.framework.ContextChangeEventMultiplexerSigleton"
+
+
+ContextChangeEventMultiplexer::ContextChangeEventMultiplexer (
+    const cssu::Reference<css::uno::XComponentContext>& rxContext)
+    : ContextChangeEventMultiplexerInterfaceBase(m_aMutex),
+      maListeners()
+{
+    (void)rxContext;
+}
+
+
+
+
+ContextChangeEventMultiplexer::~ContextChangeEventMultiplexer (void)
+{
+    maListeners.clear();
+}
+
+
+
+
+// XContextChangeEventMultiplexer
+
+void SAL_CALL ContextChangeEventMultiplexer::addContextChangeEventListener (
+    const cssu::Reference<css::ui::XContextChangeEventListener>& rxListener,
+    const cssu::Reference<cssu::XInterface>& rxEventFocus)
+    throw(cssu::RuntimeException,cssl::IllegalArgumentException)
+{
+    if ( ! rxListener.is())
+        throw css::lang::IllegalArgumentException(
+            A2S("can not add an empty reference"),
+            static_cast<XWeak*>(this),
+            0);
+
+    ListenerMap::iterator iListenerContainer (maListeners.find(rxEventFocus));
+    if (iListenerContainer == maListeners.end())
+    {
+        // Create a new listener container for the event focus.
+        iListenerContainer = maListeners.insert(
+            ListenerMap::value_type(
+                rxEventFocus,
+                ListenerContainer())).first;
+    }
+    if (iListenerContainer != maListeners.end())
+    {
+        ListenerContainer& rContainer (iListenerContainer->second);
+        if (::std::find(rContainer.begin(), rContainer.end(), rxListener) == rContainer.end())
+            rContainer.push_back(rxListener);
+        else
+        {
+            // The listener was added for the same event focus
+            // previously.  That is an error.
+            throw cssl::IllegalArgumentException(A2S("listener added twice"), static_cast<XWeak*>(this), 0);
+        }
+    }
+}
+
+
+
+
+void SAL_CALL ContextChangeEventMultiplexer::removeContextChangeEventListener (
+    const cssu::Reference<css::ui::XContextChangeEventListener>& rxListener,
+    const cssu::Reference<cssu::XInterface>& rxEventFocus)
+    throw(cssu::RuntimeException,cssl::IllegalArgumentException)
+{
+    if ( ! rxListener.is())
+        throw cssl::IllegalArgumentException(A2S("can not remove an empty reference"), static_cast<XWeak*>(this), 0);
+
+    ListenerMap::iterator iListenerContainer (maListeners.find(rxEventFocus));
+    if (iListenerContainer != maListeners.end())
+    {
+        ListenerContainer& rContainer (iListenerContainer->second);
+        const ListenerContainer::iterator iListener (::std::find(rContainer.begin(), rContainer.end(), rxListener));
+        if (iListener != rContainer.end())
+            rContainer.erase(iListener);
+    }
+ 
+}
+
+
+
+
+void SAL_CALL ContextChangeEventMultiplexer::removeAllContextChangeEventListeners (
+    const cssu::Reference<css::ui::XContextChangeEventListener>& rxListener)
+    throw(cssu::RuntimeException,cssl::IllegalArgumentException)
+{
+    if ( ! rxListener.is())
+        throw cssl::IllegalArgumentException(A2S("can not remove an empty reference"), static_cast<XWeak*>(this), 0);
+
+    for (ListenerMap::iterator
+             iContainer(maListeners.begin()),
+             iEnd(maListeners.end());
+         iContainer!=iEnd;
+         ++iContainer)
+    {
+        const ListenerContainer::iterator iListener (::std::find(iContainer->second.begin(), iContainer->second.end(), rxListener));
+        if (iListener != iContainer->second.end())
+            iContainer->second.erase(iListener);
+    }
+}
+
+
+
+
+
+void SAL_CALL ContextChangeEventMultiplexer::broadcastContextChangeEvent (
+    const css::ui::ContextChangeEventObject& rEventObject,
+    const cssu::Reference<cssu::XInterface>& rxEventFocus)
+    throw(cssu::RuntimeException)
+{
+    BroadcastEventToSingleContainer(rEventObject, rxEventFocus);
+    if (rxEventFocus.is())
+        BroadcastEventToSingleContainer(rEventObject, NULL);
+}
+
+
+
+
+void ContextChangeEventMultiplexer::BroadcastEventToSingleContainer (
+    const css::ui::ContextChangeEventObject& rEventObject,
+    const cssu::Reference<cssu::XInterface>& rxEventFocus)
+{
+    ListenerMap::iterator iListenerContainer (maListeners.find(rxEventFocus));
+    if (iListenerContainer != maListeners.end())
+    {
+        // Create a copy of the listener container to avoid problems
+        // when one of the called listeners calls add... or remove...
+        ListenerContainer aContainer (iListenerContainer->second);
+        for (ListenerContainer::const_iterator
+                 iListener(aContainer.begin()),
+                 iEnd(aContainer.end());
+             iListener!=iEnd;
+             ++iListener)
+        {
+            (*iListener)->notifyContextChangeEvent(rEventObject);
+        }
+    }
+}
+
+
+
+
+// XSingleComponentFactory
+
+cssu::Reference<cssu::XInterface> SAL_CALL ContextChangeEventMultiplexer::createInstanceWithContext (
+    const cssu::Reference<cssu::XComponentContext>& rxContext)
+    throw (cssu::Exception, cssu::RuntimeException)
+{
+    (void)rxContext;
+    return cssu::Reference<cssu::XInterface>();
+}
+
+
+
+
+cssu::Reference<cssu::XInterface > SAL_CALL ContextChangeEventMultiplexer::createInstanceWithArgumentsAndContext (
+    const cssu::Sequence<cssu::Any>& rArguments,
+    const cssu::Reference<cssu::XComponentContext>& rxContext)
+    throw (cssu::Exception, cssu::RuntimeException)
+{
+    (void)rArguments;
+    (void)rxContext;
+    return cssu::Reference<cssu::XInterface>();
+}
+
+
+
+
+// XServiceInfo
+
+::rtl::OUString SAL_CALL ContextChangeEventMultiplexer::getImplementationName (void)
+    throw(cssu::RuntimeException)
+{
+    return impl_getStaticImplementationName();
+}
+
+
+
+
+
+sal_Bool SAL_CALL ContextChangeEventMultiplexer::supportsService (
+    const ::rtl::OUString& rsServiceName)
+    throw (cssu::RuntimeException)
+{
+    return ::comphelper::findValue(static_GetSupportedServiceNames(), rsServiceName, sal_True).getLength() != 0;
+}
+
+
+
+
+cssu::Sequence<OUString> SAL_CALL ContextChangeEventMultiplexer::getSupportedServiceNames (void)
+    throw (cssu::RuntimeException)
+{
+    return static_GetSupportedServiceNames();
+}
+
+
+
+
+// Local and static methods.
+
+OUString SAL_CALL ContextChangeEventMultiplexer::impl_getStaticImplementationName (void)
+{
+    return A2S(IMPLEMENTATION_NAME);
+}
+
+
+
+
+cssu::Sequence<OUString> SAL_CALL ContextChangeEventMultiplexer::static_GetSupportedServiceNames (void)
+{
+    cssu::Sequence<OUString> aServiceNames (2);
+    aServiceNames[0] = A2S(SERVICE_NAME);
+    aServiceNames[1] = A2S(SINGLETON_NAME);
+    return aServiceNames;
+}
+
+
+
+
+cssu::Reference<cssu::XInterface> ContextChangeEventMultiplexer::impl_createFactory (
+    const cssu::Reference<cssl::XMultiServiceFactory>& rxServiceManager)
+{
+    (void)rxServiceManager;
+    return cppu::createSingleComponentFactory(
+        ContextChangeEventMultiplexer::static_CreateInstance,
+        ContextChangeEventMultiplexer::impl_getStaticImplementationName(),
+        ContextChangeEventMultiplexer::static_GetSupportedServiceNames()
+        );
+}
+
+
+
+
+cssu::Reference<cssu::XInterface> SAL_CALL ContextChangeEventMultiplexer::static_CreateInstance (
+    const cssu::Reference<cssu::XComponentContext>& rxComponentContext)
+    throw (cssu::Exception)
+{
+    ContextChangeEventMultiplexer* pObject = new ContextChangeEventMultiplexer(rxComponentContext);
+    cssu::Reference<cssu::XInterface> xService (static_cast<XWeak*>(pObject), cssu::UNO_QUERY);
+    return xService;
+}
+
+}  // end of namespace framework

Modified: openoffice/branches/sidebar/main/framework/util/fwk.component
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/framework/util/fwk.component?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/framework/util/fwk.component (original)
+++ openoffice/branches/sidebar/main/framework/util/fwk.component Wed Dec 19 15:29:30 2012
@@ -45,8 +45,8 @@
   <implementation name="com.sun.star.comp.framework.DocumentAcceleratorConfiguration">
     <service name="com.sun.star.ui.DocumentAcceleratorConfiguration"/>
   </implementation>
-  <implementation name="org.apache.openoffice.comp.framework.EventMultiplexer">
-    <service name="com.sun.star.util.EventMultiplexer"/>
+  <implementation name="org.apache.openoffice.comp.framework.ContextChangeEventMultiplexer">
+    <service name="com.sun.star.ui.ContextChangeEventMultiplexer"/>
     <singleton name="com.sun.star.ui.ContextChangeEventMultiplexer"/>
   </implementation>
   <implementation name="com.sun.star.comp.framework.Frame">

Modified: openoffice/branches/sidebar/main/offapi/com/sun/star/ui/ContextChangeEventMultiplexer.idl
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/offapi/com/sun/star/ui/ContextChangeEventMultiplexer.idl?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/offapi/com/sun/star/ui/ContextChangeEventMultiplexer.idl (original)
+++ openoffice/branches/sidebar/main/offapi/com/sun/star/ui/ContextChangeEventMultiplexer.idl Wed Dec 19 15:29:30 2012
@@ -23,8 +23,8 @@
 #ifndef __com_sun_star_ui_ContextChangeEventMultiplexer_idl__
 #define __com_sun_star_ui_ContextChangeEventMultiplexer_idl__
 
-#ifndef __com_sun_star_util_XEventMultiplexer_idl__
-#include <com/sun/star/util/XEventMultiplexer.idl>
+#ifndef __com_sun_star_ui_XContextChangeEventMultiplexer_idl__
+#include <com/sun/star/ui/XContextChangeEventMultiplexer.idl>
 #endif
 
 module com {  module sun {  module star {  module ui {
@@ -33,7 +33,7 @@ module com {  module sun {  module star 
 
     A typical listener for context changes is the sidebar.
 */
-singleton ContextChangeEventMultiplexer : com::sun::star::util::XEventMultiplexer;
+singleton ContextChangeEventMultiplexer : com::sun::star::ui::XContextChangeEventMultiplexer;
 
 }; }; }; }; // com.sun.star.ui
 

Added: openoffice/branches/sidebar/main/offapi/com/sun/star/ui/XContextChangeEventListener.idl
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/offapi/com/sun/star/ui/XContextChangeEventListener.idl?rev=1423885&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/offapi/com/sun/star/ui/XContextChangeEventListener.idl (added)
+++ openoffice/branches/sidebar/main/offapi/com/sun/star/ui/XContextChangeEventListener.idl Wed Dec 19 15:29:30 2012
@@ -0,0 +1,47 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#ifndef __com_sun_star_ui_XContextChangeEventListener_idl__
+#define __com_sun_star_ui_XContextChangeEventListener_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __com_sun_star_lang_XEventListener_idl__
+#include <com/sun/star/lang/XEventListener.idl>
+#endif
+
+#ifndef __com_sun_star_ui_ContextChangeEventObject_idl__
+#include <com/sun/star/ui/ContextChangeEventObject.idl>
+#endif
+
+module com { module sun { module star { module ui {
+
+interface XContextChangeEventListener : ::com::sun::star::lang::XEventListener 
+{
+    [oneway] void notifyContextChangeEvent (
+        [in] com::sun::star::ui::ContextChangeEventObject event);
+} ;
+
+} ; } ; } ; } ;
+
+#endif

Added: openoffice/branches/sidebar/main/offapi/com/sun/star/ui/XContextChangeEventMultiplexer.idl
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/offapi/com/sun/star/ui/XContextChangeEventMultiplexer.idl?rev=1423885&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/offapi/com/sun/star/ui/XContextChangeEventMultiplexer.idl (added)
+++ openoffice/branches/sidebar/main/offapi/com/sun/star/ui/XContextChangeEventMultiplexer.idl Wed Dec 19 15:29:30 2012
@@ -0,0 +1,131 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+
+
+#ifndef __com_sun_star_ui_XContextChangeEventMultiplexer_idl__
+#define __com_sun_star_ui_XContextChangeEventMultiplexer_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __com_sun_star_ui_XContextChangeEventListener_idl__
+#include <com/sun/star/ui/XContextChangeEventListener.idl>
+#endif
+
+#ifndef __com_sun_star_ui_ContextChangeEventObject_idl__
+#include <com/sun/star/ui/ContextChangeEventObject.idl>
+#endif
+
+#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
+#include <com/sun/star/lang/IllegalArgumentException.idl>
+#endif
+
+
+module com { module sun { module star { module ui {
+
+/** Provide a central access point for a group of events.
+
+    Listeners can be added with a simple restriction on the event source.
+    They are only called for events that originate at the specified source.
+
+    Event providers can broadcast an event to all interested listeners.
+
+    The XEventMultiplexer interface is typically implemented as a singleton
+*/
+interface XContextChangeEventMultiplexer : ::com::sun::star::uno::XInterface 
+{
+    /** Add an event listener that is called only when events are broadcast for the specified
+        event focus.
+
+        @param xListener
+            An empty reference results in an InvalidArgumentException.
+
+            One listener may be added more than once for different
+            event foci.  Adding a listener a second time for the same
+            event focus results in an InvalidArgumentException.
+            
+        @param xEventFocus
+            An empty reference is a valid value.  In this case the
+            registered listener will be called for every event
+            broadcast, regardless of its event focus.
+
+            The event focus may or may not be the source of the event.
+              
+            A typical example for an event focus is the XController of
+            a view.  Using an XController restricts events passed to
+            a listener to events that belong to one view.
+
+        @throws com::sun::star::lang::IllegalArgumentException
+            
+    */
+    void addContextChangeEventListener (
+        [in] com::sun::star::ui::XContextChangeEventListener xListener,
+        [in] com::sun::star::uno::XInterface xEventFocus)
+        raises (com::sun::star::lang::IllegalArgumentException);
+
+    /** Remove an event listener for the specified event focus.
+
+        When the same listener was added for other event foci then
+        these associations remain unmodified.
+
+        @param xListener
+            An empty reference results in an InvalidArgumentException.
+
+            When the listener is not registered for the given event
+            focus then an InvalidArgumentException is thrown.
+            
+        @param xEventFocus
+            The listener is only removed for this event focus.
+            An empty reference is a valid value.
+
+        @throws com::sun::star::lang::IllegalArgumentException
+    */
+    void removeContextChangeEventListener (
+        [in] com::sun::star::ui::XContextChangeEventListener xListener,
+        [in] com::sun::star::uno::XInterface xEventFocus)
+        raises (com::sun::star::lang::IllegalArgumentException);
+
+    /** Remove an event listener for all event foci.
+
+        @param xListener
+            An empty reference results in an InvalidArgumentException.
+
+            It is not an error when the listener is not registered for any event focus.
+
+        @throws com::sun::star::lang::IllegalArgumentException
+    */
+    void removeAllContextChangeEventListeners (
+        [in] com::sun::star::ui::XContextChangeEventListener xListener)
+        raises (com::sun::star::lang::IllegalArgumentException);
+
+
+    /** Call all event listeners that where added for the specified event focus.
+    */
+    [oneway] void broadcastContextChangeEvent (
+        [in] com::sun::star::ui::ContextChangeEventObject aEvent,
+        [in] com::sun::star::uno::XInterface xEventFocus);    
+} ;
+
+} ; } ; } ; } ;
+
+#endif

Added: openoffice/branches/sidebar/main/offapi/com/sun/star/ui/XContextChangeListener.idl
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/offapi/com/sun/star/ui/XContextChangeListener.idl?rev=1423885&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/offapi/com/sun/star/ui/XContextChangeListener.idl (added)
+++ openoffice/branches/sidebar/main/offapi/com/sun/star/ui/XContextChangeListener.idl Wed Dec 19 15:29:30 2012
@@ -0,0 +1,51 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+
+
+#ifndef __com_sun_star_util_XEventListener_idl__
+#define __com_sun_star_util_XEventListener_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __com_sun_star_lang_XEventListener_idl__
+#include <com/sun/star/lang/XEventListener.idl>
+#endif
+
+#ifndef __com_sun_star_lang_EventObject_idl__
+#include <com/sun/star/lang/EventObject.idl>
+#endif
+
+module com { module sun { module star { module util {
+
+/** Generic event listener.
+*/
+interface XEventListener : ::com::sun::star::lang::XEventListener 
+{
+    [oneway] void notifyEvent (
+        [in] com::sun::star::lang::EventObject event);
+} ;
+
+} ; } ; } ; } ;
+
+#endif

Modified: openoffice/branches/sidebar/main/offapi/com/sun/star/ui/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/offapi/com/sun/star/ui/makefile.mk?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/offapi/com/sun/star/ui/makefile.mk (original)
+++ openoffice/branches/sidebar/main/offapi/com/sun/star/ui/makefile.mk Wed Dec 19 15:29:30 2012
@@ -68,6 +68,8 @@ IDLFILES=\
     XAcceleratorConfiguration.idl               \
     XContextMenuInterception.idl                \
     XContextMenuInterceptor.idl                 \
+	XContextChangeEventListener.idl				\
+	XContextChangeEventMultiplexer.idl			\
     XDockingAreaAcceptor.idl                    \
     XImageManager.idl                           \
     XModuleUIConfigurationManager.idl           \

Modified: openoffice/branches/sidebar/main/offapi/com/sun/star/util/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/offapi/com/sun/star/util/makefile.mk?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/offapi/com/sun/star/util/makefile.mk (original)
+++ openoffice/branches/sidebar/main/offapi/com/sun/star/util/makefile.mk Wed Dec 19 15:29:30 2012
@@ -48,7 +48,6 @@ IDLFILES=\
 	Duration.idl\
 	ElementChange.idl \
 	Endianness.idl \
-	EventMultiplexer.idl \
 	FileIOException.idl\
 	InvalidStateException.idl\
 	Language.idl\
@@ -83,8 +82,6 @@ IDLFILES=\
 	XCloseable.idl\
 	XCloseBroadcaster.idl\
 	XCloseListener.idl\
-	XEventListener.idl\
-	XEventMultiplexer.idl\
 	XFlushable.idl\
 	XFlushListener.idl\
 	XImportable.idl\

Modified: openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu (original)
+++ openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu Wed Dec 19 15:29:30 2012
@@ -5332,6 +5332,11 @@
                     <value xml:lang="en-US">Task Pane</value>
                 </prop>
             </node>
+            <node oor:name=".uno:Sidebar" oor:op="replace">
+                <prop oor:name="Label" oor:type="xs:string">
+                    <value xml:lang="en-US">Sidebar</value>
+                </prop>
+            </node>
             <node oor:name=".uno:TestMode" oor:op="replace">
                 <prop oor:name="Label" oor:type="xs:string">
                     <value xml:lang="en-US">Test Mode On/Off</value>

Added: openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu?rev=1423885&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Modified: openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/makefile.mk?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/makefile.mk (original)
+++ openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/makefile.mk Wed Dec 19 15:29:30 2012
@@ -64,6 +64,7 @@ LOCALIZEDFILES= \
     WriterWebWindowState.xcu \
     WriterCommands.xcu\
     GenericCategories.xcu\
+	Sidebar.xcu
 
 XCUFILES= \
     $(LOCALIZEDFILES) \

Modified: openoffice/branches/sidebar/main/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs (original)
+++ openoffice/branches/sidebar/main/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs Wed Dec 19 15:29:30 2012
@@ -42,13 +42,13 @@
       <prop oor:name="Application" oor:type="xs:string" oor:localized="false">
         <info>
           <desc>Name of the application.  Known values are:
-          writer, calc, impress, draw, base</desc>
+          any, writer, calc, impress, draw, base</desc>
         </info>
         <value></value>
       </prop>
       <prop oor:name="ApplicationContext" oor:type="xs:string" oor:localized="false">
         <info>
-          <desc>Name of an application specific context.</desc>
+          <desc>Name of an application specific context.  The special name "any" matches any context name.</desc>
         </info>
         <value></value>
       </prop>
@@ -98,6 +98,12 @@
         </info>
         <value></value>
       </prop>
+      <prop oor:name="TitleBarIsOptional" oor:type="xs:boolean">
+        <info>
+          <desc>When true then the title bar can be ommitted when the panel is the only panel in a deck.</desc>
+        </info>
+        <value>false</value>
+      </prop>
       <prop oor:name="Id" oor:type="xs:string" oor:localized="false">
         <info>
           <desc>Internally used to identify the panel.</desc>
@@ -145,15 +151,20 @@
     </group>
   </templates>
   <component>
-    <set oor:name="DeckList" oor:node-type="Deck">
+    <group oor:name="Content">
       <info>
-        <desc>Contains all registered sidebar decks.</desc>
+        <desc>Description of the decks and panels that can be displayed in the content area of the sidebar.</desc>
       </info>
-    </set>
-    <set oor:name="PanelList" oor:node-type="Panel">
-      <info>
-        <desc>Contains all registered sidebar content panels.</desc>
-      </info>
-    </set>
+      <set oor:name="DeckList" oor:node-type="Deck">
+        <info>
+          <desc>Contains all registered sidebar decks.</desc>
+        </info>
+      </set>
+      <set oor:name="PanelList" oor:node-type="Panel">
+        <info>
+          <desc>Contains all registered sidebar content panels.</desc>
+        </info>
+      </set>
+    </group>
   </component>
 </oor:component-schema>

Modified: openoffice/branches/sidebar/main/postprocess/packregistry/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/postprocess/packregistry/makefile.mk?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/postprocess/packregistry/makefile.mk (original)
+++ openoffice/branches/sidebar/main/postprocess/packregistry/makefile.mk Wed Dec 19 15:29:30 2012
@@ -196,6 +196,7 @@ MY_FILES_main = \
     $(MY_XCS)/Office/UI/GenericCategories.xcs \
     $(MY_XCS)/Office/UI/GenericCommands.xcs \
     $(MY_XCS)/Office/UI/GlobalSettings.xcs \
+    $(MY_XCS)/Office/UI/Sidebar.xcs \
     $(MY_XCS)/Office/UI/StartModuleCommands.xcs \
     $(MY_XCS)/Office/UI/StartModuleWindowState.xcs \
     $(MY_XCS)/Office/UI/WindowContentFactories.xcs \
@@ -259,6 +260,7 @@ MY_FILES_main = \
     $(MY_XCU)/Office/UI/Factories.xcu \
     $(MY_XCU)/Office/UI/GenericCategories.xcu \
     $(MY_XCU)/Office/UI/GenericCommands.xcu \
+    $(MY_XCU)/Office/UI/Sidebar.xcu \
     $(MY_XCU)/Office/UI/StartModuleCommands.xcu \
     $(MY_XCU)/Office/UI/StartModuleWindowState.xcu \
     $(MY_XCU)/Office/UI.xcu \

Modified: openoffice/branches/sidebar/main/sc/source/ui/app/scdll.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/app/scdll.cxx?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sc/source/ui/app/scdll.cxx (original)
+++ openoffice/branches/sidebar/main/sc/source/ui/app/scdll.cxx Wed Dec 19 15:29:30 2012
@@ -37,6 +37,7 @@
 
 #include <sot/clsids.hxx>
 #include <sfx2/taskpane.hxx>
+#include <sfx2/SidebarChildWindow.hxx>
 #include <sfx2/docfilt.hxx>
 #include <sfx2/fcontnr.hxx>
 #include <sfx2/docfile.hxx>
@@ -262,7 +263,8 @@ void ScDLL::Init()
 
     // common SFX controller
     ::sfx2::TaskPaneWrapper::RegisterChildWindow( sal_False, pMod );
-
+    ::sfx2::SidebarChildWindow::RegisterChildWindow(NULL, pMod);
+    
 	// Svx-StatusBar-Controller
 	SvxInsertStatusBarControl		::RegisterControl(SID_ATTR_INSERT,		pMod);
 	SvxSelectionModeControl			::RegisterControl(SID_STATUS_SELMODE,	pMod);

Modified: openoffice/branches/sidebar/main/sc/source/ui/view/tabvwsh.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/view/tabvwsh.cxx?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sc/source/ui/view/tabvwsh.cxx (original)
+++ openoffice/branches/sidebar/main/sc/source/ui/view/tabvwsh.cxx Wed Dec 19 15:29:30 2012
@@ -38,6 +38,7 @@
 #include <sfx2/viewfrm.hxx>
 #include <sfx2/bindings.hxx>
 #include <sfx2/app.hxx>
+#include <sfx2/SidebarChildWindow.hxx>
 #include <avmedia/mediaplayer.hxx>
 
 #include "tabvwsh.hxx"
@@ -65,6 +66,7 @@ SFX_IMPL_INTERFACE(ScTabViewShell,SfxVie
 	SFX_CHILDWINDOW_REGISTRATION(SfxTemplateDialogWrapper::GetChildWindowId());
 	SFX_CHILDWINDOW_CONTEXT_REGISTRATION(SID_NAVIGATOR);
 	SFX_CHILDWINDOW_REGISTRATION(SID_TASKPANE);
+	SFX_CHILDWINDOW_REGISTRATION(::sfx2::SidebarChildWindow::GetChildWindowId());
 	SFX_CHILDWINDOW_REGISTRATION(ScNameDlgWrapper::GetChildWindowId());
 	SFX_CHILDWINDOW_REGISTRATION(ScSolverDlgWrapper::GetChildWindowId());
     SFX_CHILDWINDOW_REGISTRATION(ScOptSolverDlgWrapper::GetChildWindowId());

Modified: openoffice/branches/sidebar/main/sc/uiconfig/scalc/menubar/menubar.xml
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/uiconfig/scalc/menubar/menubar.xml?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sc/uiconfig/scalc/menubar/menubar.xml (original)
+++ openoffice/branches/sidebar/main/sc/uiconfig/scalc/menubar/menubar.xml Wed Dec 19 15:29:30 2012
@@ -144,6 +144,7 @@
 			<menu:menuitem menu:id=".uno:ViewDataSourceBrowser"/>
 			<menu:menuitem menu:id=".uno:Navigator"/>
       <menu:menuitem menu:id=".uno:TaskPane"/>
+      <menu:menuitem menu:id=".uno:Sidebar"/>
       <menu:menuseparator/>
 			<menu:menuitem menu:id=".uno:FullScreen"/>
 			<menu:menuitem menu:id=".uno:Zoom"/>

Modified: openoffice/branches/sidebar/main/sd/source/ui/app/sddll2.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/app/sddll2.cxx?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/app/sddll2.cxx (original)
+++ openoffice/branches/sidebar/main/sd/source/ui/app/sddll2.cxx Wed Dec 19 15:29:30 2012
@@ -63,6 +63,7 @@
 
 #include <svx/layctrl.hxx>
 #include <svx/subtoolboxcontrol.hxx>
+#include <sfx2/SidebarChildWindow.hxx>
 
 #include "sddll.hxx"
 #define _SD_DIACTRL_CXX
@@ -137,6 +138,7 @@ void SdDLL::RegisterControllers()
 	::sd::LeftPaneImpressChildWindow::RegisterChildWindow(0, pMod);
 	::sd::LeftPaneDrawChildWindow::RegisterChildWindow(0, pMod);
 	::sd::ToolPanelChildWindow::RegisterChildWindow(0, pMod);
+    ::sfx2::SidebarChildWindow::RegisterChildWindow(NULL, pMod);
 
 	SvxFillToolBoxControl::RegisterControl(0, pMod);
 	SvxLineStyleToolBoxControl::RegisterControl(0, pMod);

Modified: openoffice/branches/sidebar/main/sd/source/ui/view/ViewShellBase.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/view/ViewShellBase.cxx?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/view/ViewShellBase.cxx (original)
+++ openoffice/branches/sidebar/main/sd/source/ui/view/ViewShellBase.cxx Wed Dec 19 15:29:30 2012
@@ -41,6 +41,7 @@
 #include "glob.hrc"
 #include "unokywds.hxx"
 #include <svx/svxids.hrc>
+#include <svx/sidebar/ContextChangeEventMultiplexer.hxx>
 #include "DrawDocShell.hxx"
 #include <sfx2/app.hxx>
 #include "PaneChildWindows.hxx"
@@ -403,6 +404,11 @@ void ViewShellBase::LateInit (const ::rt
         if (pFrameView != NULL)
             pFrameView->SetViewShellTypeOnLoad(pViewShell->GetShellType());
     }
+
+    ContextChangeEventMultiplexer::NotifyContextChange(
+        GetController(),
+        ContextChangeEventMultiplexer::Application_Impress,
+        ContextChangeEventMultiplexer::Context_Default);
 }
 
 

Modified: openoffice/branches/sidebar/main/sd/source/ui/view/drvwshrg.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/view/drvwshrg.cxx?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/view/drvwshrg.cxx (original)
+++ openoffice/branches/sidebar/main/sd/source/ui/view/drvwshrg.cxx Wed Dec 19 15:29:30 2012
@@ -33,6 +33,7 @@
 #include <svx/imapdlg.hxx>
 #include <svx/colrctrl.hxx>
 #include <sfx2/objface.hxx>
+#include <sfx2/SidebarChildWindow.hxx>
 #include <svx/f3dchild.hxx>
 #include <svx/tbxcustomshapes.hxx>
 
@@ -89,6 +90,7 @@ SFX_IMPL_INTERFACE(DrawViewShell, SfxShe
 	SFX_CHILDWINDOW_REGISTRATION( ::sd::SpellDialogChildWindow::GetChildWindowId() );
 	SFX_CHILDWINDOW_REGISTRATION( SID_SEARCH_DLG );
 	SFX_CHILDWINDOW_REGISTRATION( ::avmedia::MediaPlayer::GetChildWindowId() );
+	SFX_CHILDWINDOW_REGISTRATION(::sfx2::SidebarChildWindow::GetChildWindowId());
 }
 
 
@@ -115,6 +117,7 @@ SFX_IMPL_INTERFACE(GraphicViewShell, Sfx
 	SFX_CHILDWINDOW_REGISTRATION( ::sd::SpellDialogChildWindow::GetChildWindowId() );
 	SFX_CHILDWINDOW_REGISTRATION( SID_SEARCH_DLG );
 	SFX_CHILDWINDOW_REGISTRATION( ::avmedia::MediaPlayer::GetChildWindowId() );
+	SFX_CHILDWINDOW_REGISTRATION(::sfx2::SidebarChildWindow::GetChildWindowId());
 }
 
 TYPEINIT1( GraphicViewShell, DrawViewShell );

Modified: openoffice/branches/sidebar/main/sd/source/ui/view/outlnvsh.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/view/outlnvsh.cxx?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/view/outlnvsh.cxx (original)
+++ openoffice/branches/sidebar/main/sd/source/ui/view/outlnvsh.cxx Wed Dec 19 15:29:30 2012
@@ -52,6 +52,7 @@
 #include <editeng/editstat.hxx>
 #include <svl/itempool.hxx>
 #include <sfx2/tplpitem.hxx>
+#include <sfx2/SidebarChildWindow.hxx>
 #include <svx/svdorect.hxx>
 #include <sot/formats.hxx>
 #include <com/sun/star/linguistic2/XThesaurus.hpp>
@@ -128,6 +129,7 @@ SFX_IMPL_INTERFACE(OutlineViewShell, Sfx
 	SFX_CHILDWINDOW_REGISTRATION( SvxHlinkDlgWrapper::GetChildWindowId() );
 	SFX_CHILDWINDOW_REGISTRATION( ::sd::SpellDialogChildWindow::GetChildWindowId() );
 	SFX_CHILDWINDOW_REGISTRATION( SID_SEARCH_DLG );
+	SFX_CHILDWINDOW_REGISTRATION(::sfx2::SidebarChildWindow::GetChildWindowId());
 }
 
 

Modified: openoffice/branches/sidebar/main/sd/uiconfig/sdraw/menubar/menubar.xml
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/uiconfig/sdraw/menubar/menubar.xml?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/uiconfig/sdraw/menubar/menubar.xml (original)
+++ openoffice/branches/sidebar/main/sd/uiconfig/sdraw/menubar/menubar.xml Wed Dec 19 15:29:30 2012
@@ -129,6 +129,7 @@
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:Navigator"/>
       <menu:menuitem menu:id=".uno:TaskPane"/>
+      <menu:menuitem menu:id=".uno:Sidebar"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:Zoom"/>
     </menu:menupopup>

Modified: openoffice/branches/sidebar/main/sd/uiconfig/simpress/menubar/menubar.xml
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/uiconfig/simpress/menubar/menubar.xml?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/uiconfig/simpress/menubar/menubar.xml (original)
+++ openoffice/branches/sidebar/main/sd/uiconfig/simpress/menubar/menubar.xml Wed Dec 19 15:29:30 2012
@@ -120,6 +120,7 @@
 			</menu:menu>
 			<menu:menuseparator/>
       <menu:menuitem menu:id=".uno:TaskPane"/>
+      <menu:menuitem menu:id=".uno:Sidebar"/>
       <menu:menuitem menu:id=".uno:LeftPaneImpress"/>
 			<menu:menuitem menu:id=".uno:AvailableToolbars"/>
 			<menu:menuitem menu:id=".uno:StatusBarVisible"/>

Modified: openoffice/branches/sidebar/main/sfx2/Library_sfx.mk
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/Library_sfx.mk?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/Library_sfx.mk (original)
+++ openoffice/branches/sidebar/main/sfx2/Library_sfx.mk Wed Dec 19 15:29:30 2012
@@ -213,6 +213,16 @@ $(eval $(call gb_Library_add_exception_o
 	sfx2/source/menu/virtmenu \
 	sfx2/source/notify/eventsupplier \
 	sfx2/source/notify/hintpost \
+	sfx2/source/sidebar/SidebarChildWindow \
+	sfx2/source/sidebar/SidebarDockingWindow \
+	sfx2/source/sidebar/SidebarController \
+	sfx2/source/sidebar/ContentPanelManager \
+	sfx2/source/sidebar/Deck \
+	sfx2/source/sidebar/Panel \
+	sfx2/source/sidebar/SidebarLayouter \
+	sfx2/source/sidebar/TabBar \
+	sfx2/source/sidebar/TitleBar \
+	sfx2/source/sidebar/Context \
 	sfx2/source/statbar/stbitem \
 	sfx2/source/toolbox/imgmgr \
 	sfx2/source/toolbox/tbxitem \

Modified: openoffice/branches/sidebar/main/sfx2/Package_inc.mk
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/Package_inc.mk?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/Package_inc.mk (original)
+++ openoffice/branches/sidebar/main/sfx2/Package_inc.mk Wed Dec 19 15:29:30 2012
@@ -131,3 +131,4 @@ $(eval $(call gb_Package_add_file,sfx2_i
 $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/viewfac.hxx,sfx2/viewfac.hxx))
 $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/viewfrm.hxx,sfx2/viewfrm.hxx))
 $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/viewsh.hxx,sfx2/viewsh.hxx))
+$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/SidebarChildWindow.hxx,sfx2/SidebarChildWindow.hxx))

Added: openoffice/branches/sidebar/main/sfx2/inc/sfx2/SidebarChildWindow.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/inc/sfx2/SidebarChildWindow.hxx?rev=1423885&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/inc/sfx2/SidebarChildWindow.hxx (added)
+++ openoffice/branches/sidebar/main/sfx2/inc/sfx2/SidebarChildWindow.hxx Wed Dec 19 15:29:30 2012
@@ -0,0 +1,52 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#ifndef SFX_SIDEBAR_CHILD_WINDOW_HXX
+#define SFX_SIDEBAR_CHILD_WINDOW_HXX
+
+#include "sfx2/childwin.hxx"
+
+
+namespace sfx2 {
+
+/** Outer container of the sidbar window.
+
+    Has to be registered for every application via the
+    RegisterChildWindow() method from the RegisterControllers() method
+    of the applications DLL.
+*/
+class SFX2_DLLPUBLIC SidebarChildWindow
+    : public SfxChildWindow
+{
+public:
+    SidebarChildWindow(
+        Window* pParent,
+        sal_uInt16 nId,
+        SfxBindings* pBindings,
+        SfxChildWinInfo* pInfo);
+
+    SFX_DECL_CHILDWINDOW(SidebarChildWindow);
+};
+
+
+} // end of namespace sfx2
+
+#endif

Modified: openoffice/branches/sidebar/main/sfx2/inc/sfx2/sfxsids.hrc
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/inc/sfx2/sfxsids.hrc?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/inc/sfx2/sfxsids.hrc (original)
+++ openoffice/branches/sidebar/main/sfx2/inc/sfx2/sfxsids.hrc Wed Dec 19 15:29:30 2012
@@ -860,6 +860,7 @@
 #define SID_TASKPANE                        (SID_SVX_START + 370)
 #define SID_ZOOM_NEXT                       (SID_SVX_START + 402)
 #define SID_ZOOM_PREV                       (SID_SVX_START + 403)
+#define SID_SIDEBAR                         (SID_SVX_START + 413)
 #define SID_INET_DLG                        (SID_SVX_START + 416)
 #define SID_AUTO_CORRECT_DLG                (SID_SVX_START + 424)
 #define SID_SD_AUTOPILOT                    (SID_SVX_START + 425)

Modified: openoffice/branches/sidebar/main/sfx2/sdi/frmslots.sdi
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/sdi/frmslots.sdi?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/sdi/frmslots.sdi (original)
+++ openoffice/branches/sidebar/main/sfx2/sdi/frmslots.sdi Wed Dec 19 15:29:30 2012
@@ -51,6 +51,11 @@ interface Window
 		ExecMethod = ChildWindowExecute ;
 		StateMethod = ChildWindowState ;
 	]
+	SID_SIDEBAR // status(final|play)
+	[
+		ExecMethod = ChildWindowExecute ;
+		StateMethod = ChildWindowState ;
+	]
 	SID_SHOW_BROWSER // ole(no) api(final/play/rec)
 	[
 		ExecMethod = ChildWindowExecute ;

Modified: openoffice/branches/sidebar/main/sfx2/sdi/sfx.sdi
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/sdi/sfx.sdi?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/sdi/sfx.sdi (original)
+++ openoffice/branches/sidebar/main/sfx2/sdi/sfx.sdi Wed Dec 19 15:29:30 2012
@@ -3983,6 +3983,32 @@ SfxBoolItem TaskPane SID_TASKPANE
 ]
 
 //--------------------------------------------------------------------------
+SfxBoolItem Sidebar SID_SIDEBAR
+[
+	/* flags: */
+	AutoUpdate = TRUE,
+	Cachable = Cachable,
+	FastCall = FALSE,
+	HasCoreId = FALSE,
+	HasDialog = FALSE,
+	ReadOnlyDoc = TRUE,
+	Toggle = FALSE,
+	Container = FALSE,
+	RecordAbsolute = FALSE,
+	RecordPerSet;
+	Asynchron;
+
+	Readonly = FALSE,
+
+	/* config: */
+	AccelConfig = TRUE,
+	MenuConfig = TRUE,
+	StatusBarConfig = FALSE,
+	ToolBoxConfig = TRUE,
+	GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
 SfxVoidItem RestoreEditingView SID_RESTORE_EDITING_VIEW
 
 [

Modified: openoffice/branches/sidebar/main/sfx2/source/dialog/dialog.src
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/source/dialog/dialog.src?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/source/dialog/dialog.src (original)
+++ openoffice/branches/sidebar/main/sfx2/source/dialog/dialog.src Wed Dec 19 15:29:30 2012
@@ -103,6 +103,10 @@ String SID_TASKPANE
 {
     Text [ en-US ] = "Task Pane";
 };
+String SID_SIDEBAR
+{
+    Text [ en-US ] = "Sidebar";
+};
 
 ErrorBox MSG_ERROR_WRONG_CONFIRM
 {

Modified: openoffice/branches/sidebar/main/sfx2/source/inc/helpid.hrc
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/source/inc/helpid.hrc?rev=1423885&r1=1423884&r2=1423885&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/source/inc/helpid.hrc (original)
+++ openoffice/branches/sidebar/main/sfx2/source/inc/helpid.hrc Wed Dec 19 15:29:30 2012
@@ -332,6 +332,8 @@
 #define HID_TASKPANE_VIEW_MENU                                  "SFX2_HID_TASKPANE_VIEW_MENU"
 #define HID_DOCINFOSECURITY                                     "SFX2_HID_DOCINFOSECURITY"
 
+#define HID_SIDEBAR_WINDOW                                     "SFX2_HID_SIDEBAR_WINDOW"
+
 #endif // #ifndef _SFX_HELPID_HRC
 
 // ******************************************************************* EOF

Added: openoffice/branches/sidebar/main/sfx2/source/sidebar/ContentPanelDescriptor.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/source/sidebar/ContentPanelDescriptor.hxx?rev=1423885&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/source/sidebar/ContentPanelDescriptor.hxx (added)
+++ openoffice/branches/sidebar/main/sfx2/source/sidebar/ContentPanelDescriptor.hxx Wed Dec 19 15:29:30 2012
@@ -0,0 +1,45 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#ifndef SFX_SIDEBAR_CONTENT_PANEL_DESCRIPTOR_HXX
+#define SFX_SIDEBAR_CONTENT_PANEL_DESCRIPTOR_HXX
+
+#include "Context.hxx"
+
+
+namespace sfx2 {
+
+class ContentPanelDescriptor
+{
+public:
+    ::rtl::OUString msTitle;
+    sal_Bool mbIsTitleBarOptional;
+    ::rtl::OUString msId;
+    ::rtl::OUString msDeckId;
+    ::rtl::OUString msHelpURL;
+    ::std::vector<Context> maContexts;
+    ::rtl::OUString msLayout;
+    ::rtl::OUString msImplementationURL;
+};
+
+} // end of namespace sfx2
+
+#endif

Added: openoffice/branches/sidebar/main/sfx2/source/sidebar/ContentPanelManager.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/source/sidebar/ContentPanelManager.cxx?rev=1423885&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/source/sidebar/ContentPanelManager.cxx (added)
+++ openoffice/branches/sidebar/main/sfx2/source/sidebar/ContentPanelManager.cxx Wed Dec 19 15:29:30 2012
@@ -0,0 +1,231 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#include "precompiled_sfx2.hxx"
+
+#include "ContentPanelManager.hxx"
+#include <unotools/confignode.hxx>
+#include <comphelper/componentcontext.hxx>
+
+
+#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
+
+using ::rtl::OUString;
+using namespace css;
+using namespace cssu;
+
+namespace sfx2 {
+
+
+class ContentPanelManager::Deleter
+{
+public:
+    void operator() (ContentPanelManager* pObject)
+    {
+        delete pObject;
+    }
+};
+
+
+SharedContentPanelManager ContentPanelManager::Instance (void)
+{
+    static SharedContentPanelManager mpInstance;
+
+    if ( ! mpInstance)
+    {
+        mpInstance.reset(new ContentPanelManager(), ContentPanelManager::Deleter());
+    }
+    
+    return mpInstance;
+}
+
+
+
+
+ContentPanelManager::ContentPanelManager (void)
+    : maDecks(),
+      maPanels()
+{
+    ReadDeckList();
+    ReadPanelList();
+}
+
+
+
+
+ContentPanelManager::~ContentPanelManager (void)
+{
+}
+
+
+
+
+void ContentPanelManager::CallForBestMatchingDeck (
+    const ::boost::function<void(const DeckDescriptor&)>& rFunctor,
+    const Context& rContext) const
+{
+    sal_Int32 nBestMatch (Context::NoMatch);
+    const DeckContainer::const_iterator iEnd (maDecks.end());
+    DeckContainer::const_iterator iBestDeck (iEnd);
+    
+    for (DeckContainer::const_iterator iDeck(maDecks.begin());
+         iDeck!=iEnd;
+         ++iDeck)
+    {
+        const sal_Int32 nMatch (rContext.EvaluateMatch((*iDeck)->maContexts));
+        if (nMatch < nBestMatch)
+        {
+            // Found a better matching decks.
+            nBestMatch = nMatch;
+            iBestDeck = iDeck;
+            if (nBestMatch == Context::OptimalMatch)
+            {
+                // We will not find a better match.
+                break;
+            }
+        }
+    }
+    if (iBestDeck != iEnd)
+        rFunctor(**iBestDeck);
+}
+
+
+
+
+void ContentPanelManager::CallForMatchingPanels (
+    const ::boost::function<void(const ContentPanelDescriptor&)>& rFunctor,
+    const Context& rContext,
+    const ::rtl::OUString& rsDeckId) const
+{
+    for (PanelContainer::const_iterator
+             iPanel(maPanels.begin()),
+             iEnd(maPanels.end());
+         iPanel!=iEnd;
+         ++iPanel)
+    {
+        const ContentPanelDescriptor& rPanelDescriptor (**iPanel);
+        if (rPanelDescriptor.msDeckId.equals(rsDeckId))
+            if (rContext.EvaluateMatch(rPanelDescriptor.maContexts) != Context::NoMatch)
+                rFunctor(rPanelDescriptor);
+    }
+}
+
+
+
+
+void ContentPanelManager::ReadDeckList (void)
+{
+    const ::comphelper::ComponentContext aContext (::comphelper::getProcessServiceFactory());
+    const ::utl::OConfigurationTreeRoot aDeckRootNode (
+        aContext,
+        A2S("org.openoffice.Office.UI.Sidebar/Content/DeckList"),
+        false);
+    if ( ! aDeckRootNode.isValid() )
+        return;
+
+    const Sequence<OUString> aDeckNodeNames (aDeckRootNode.getNodeNames());
+    const sal_Int32 nCount (aDeckNodeNames.getLength());
+    maDecks.reserve(nCount);
+    for (sal_Int32 nIndex(0); nIndex<nCount; ++nIndex)
+    {
+        const ::utl::OConfigurationNode aDeckNode (aDeckRootNode.openNode(aDeckNodeNames[nIndex]));
+        if ( ! aDeckNode.isValid())
+            continue;
+
+        ::boost::shared_ptr<DeckDescriptor> pDeckDescriptor (new DeckDescriptor());
+
+        pDeckDescriptor->msTitle = ::comphelper::getString(aDeckNode.getNodeValue("Title"));
+        pDeckDescriptor->msId = ::comphelper::getString(aDeckNode.getNodeValue("Id"));
+        pDeckDescriptor->msIconURL = ::comphelper::getString(aDeckNode.getNodeValue("IconURL"));
+        pDeckDescriptor->msHelpURL = ::comphelper::getString(aDeckNode.getNodeValue("HelpURL"));
+        ReadContextList(aDeckNode.openNode("ContextList"), pDeckDescriptor->maContexts);
+
+        maDecks.push_back(pDeckDescriptor);
+    }
+}
+
+
+
+
+void ContentPanelManager::ReadPanelList (void)
+{
+    const ::comphelper::ComponentContext aContext (::comphelper::getProcessServiceFactory());
+    const ::utl::OConfigurationTreeRoot aPanelRootNode (
+        aContext,
+        A2S("org.openoffice.Office.UI.Sidebar/Content/PanelList"),
+        false);
+    if ( ! aPanelRootNode.isValid() )
+        return;
+
+    const Sequence<OUString> aPanelNodeNames (aPanelRootNode.getNodeNames());
+    const sal_Int32 nCount (aPanelNodeNames.getLength());
+    maPanels.reserve(nCount);
+    for (sal_Int32 nIndex(0); nIndex<nCount; ++nIndex)
+    {
+        const ::utl::OConfigurationNode aPanelNode (aPanelRootNode.openNode(aPanelNodeNames[nIndex]));
+        if ( ! aPanelNode.isValid())
+            continue;
+
+        ::boost::shared_ptr<ContentPanelDescriptor> pPanelDescriptor (new ContentPanelDescriptor());
+
+        pPanelDescriptor->msTitle = ::comphelper::getString(
+            aPanelNode.getNodeValue("Title"));
+        pPanelDescriptor->mbIsTitleBarOptional = ::comphelper::getBOOL(
+            aPanelNode.getNodeValue("TitleBarIsOptional"));
+        pPanelDescriptor->msId = ::comphelper::getString(
+            aPanelNode.getNodeValue("Id"));
+        pPanelDescriptor->msDeckId = ::comphelper::getString(
+            aPanelNode.getNodeValue("DeckId"));
+        pPanelDescriptor->msHelpURL = ::comphelper::getString(
+            aPanelNode.getNodeValue("HelpURL"));
+        pPanelDescriptor->msLayout = ::comphelper::getString(
+            aPanelNode.getNodeValue("Layout"));
+        pPanelDescriptor->msImplementationURL = ::comphelper::getString(
+            aPanelNode.getNodeValue("ImplementationURL"));
+        ReadContextList(aPanelNode.openNode("ContextList"), pPanelDescriptor->maContexts);
+
+        maPanels.push_back(pPanelDescriptor);
+    }
+}
+
+
+
+
+void ContentPanelManager::ReadContextList (
+    const ::utl::OConfigurationNode& rNode,
+    ::std::vector<Context>& rContextContainer) const
+{
+    const Sequence<OUString> aChildNodeNames (rNode.getNodeNames());
+    const sal_Int32 nCount (aChildNodeNames.getLength());
+    rContextContainer.resize(nCount);
+    for (sal_Int32 nIndex(0); nIndex<nCount; ++nIndex)
+    {
+        const ::utl::OConfigurationNode aChildNode (rNode.openNode(aChildNodeNames[nIndex]));
+        Context& rContext (rContextContainer[nIndex]);
+
+        rContext.msApplication = ::comphelper::getString(aChildNode.getNodeValue("Application"));
+        rContext.msContext = ::comphelper::getString(aChildNode.getNodeValue("ApplicationContext"));
+    }
+}
+
+   
+
+} // end of namespace sfx2

Added: openoffice/branches/sidebar/main/sfx2/source/sidebar/ContentPanelManager.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/source/sidebar/ContentPanelManager.hxx?rev=1423885&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/source/sidebar/ContentPanelManager.hxx (added)
+++ openoffice/branches/sidebar/main/sfx2/source/sidebar/ContentPanelManager.hxx Wed Dec 19 15:29:30 2012
@@ -0,0 +1,80 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#ifndef SFX_CONTENT_PANEL_SIDEBAR_HXX
+#define SFX_CONTENT_PANEL_SIDEBAR_HXX
+
+#include "DeckDescriptor.hxx"
+#include "ContentPanelDescriptor.hxx"
+
+#include <boost/shared_ptr.hpp>
+
+
+
+namespace css = ::com::sun::star;
+namespace cssu = ::com::sun::star::uno;
+
+namespace sfx2 {
+
+class ContentPanelManager;
+typedef ::boost::shared_ptr<ContentPanelManager> SharedContentPanelManager;
+
+
+/** Read the content of the Sidebar.xcu file and provide access
+    methods so that the sidebar can easily decide which content panels
+    to display for a certain context.
+*/
+class ContentPanelManager
+{
+public:
+    static SharedContentPanelManager Instance (void);
+
+    void CallForBestMatchingDeck (
+        const ::boost::function<void(const DeckDescriptor&)>& rFunctor,
+        const Context& rContext) const;
+
+    void CallForMatchingPanels (
+        const ::boost::function<void(const ContentPanelDescriptor&)>& rFunctor,
+        const Context& rContext,
+        const ::rtl::OUString& rsDeckId) const;
+
+private:
+    ContentPanelManager (void);
+    ~ContentPanelManager (void);
+    class Deleter;
+    friend class Deleter;
+
+    typedef ::std::vector<boost::shared_ptr<DeckDescriptor> > DeckContainer;
+    typedef ::std::vector<boost::shared_ptr<ContentPanelDescriptor> > PanelContainer;
+    DeckContainer maDecks;
+    PanelContainer maPanels;
+
+    void ReadDeckList (void);
+    void ReadPanelList (void);
+    void ReadContextList (
+        const ::utl::OConfigurationNode& rNode,
+        ::std::vector<Context>& rContextContainer) const;
+};
+
+
+} // end of namespace sfx2
+
+#endif

Added: openoffice/branches/sidebar/main/sfx2/source/sidebar/Context.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/source/sidebar/Context.cxx?rev=1423885&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/source/sidebar/Context.cxx (added)
+++ openoffice/branches/sidebar/main/sfx2/source/sidebar/Context.cxx Wed Dec 19 15:29:30 2012
@@ -0,0 +1,101 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#include "precompiled_sfx2.hxx"
+
+#include "Context.hxx"
+
+#define AnyApplicationName "any"
+#define AnyContextName "any"
+
+namespace sfx2 {
+
+const sal_Int32 Context::NoMatch = 4;
+const sal_Int32 Context::OptimalMatch = 0;  // Neither application nor context name is "any".
+
+#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
+
+Context::Context (void)
+    : msApplication(A2S(AnyApplicationName)),
+      msContext(A2S(AnyContextName))
+{
+}
+
+
+
+
+Context::Context (
+    const ::rtl::OUString& rsApplication,
+    const ::rtl::OUString& rsContext)
+    : msApplication(rsApplication),
+      msContext(rsContext)
+{
+}
+
+
+
+
+sal_Int32 Context::EvaluateMatch (
+    const Context& rOther) const
+{
+    const bool bApplicationNameIsAny (rOther.msApplication.equalsAscii(AnyApplicationName));
+    if (rOther.msApplication.equals(msApplication) || bApplicationNameIsAny)
+    {
+        // Application name matches.
+        const bool bContextNameIsAny (rOther.msContext.equalsAscii(AnyContextName));
+        if (rOther.msContext.equals(msContext) || bContextNameIsAny)
+        {
+            // Context name matches.
+            return (bApplicationNameIsAny ? 1 : 0)
+                + (bContextNameIsAny ? 2 : 0);
+        }
+    }
+    return NoMatch;
+}
+
+
+
+
+sal_Int32 Context::EvaluateMatch (const ::std::vector<Context>& rOthers) const
+{
+    sal_Int32 nBestMatch (NoMatch);
+    
+    for (::std::vector<Context>::const_iterator
+             iContext(rOthers.begin()),
+             iEnd(rOthers.end());
+         iContext!=iEnd;
+         ++iContext)
+    {
+        const sal_Int32 nMatch (EvaluateMatch(*iContext));
+        if (nMatch < nBestMatch)
+        {
+            if (nMatch == OptimalMatch)
+            {
+                // We will find no better match so stop searching.
+                return OptimalMatch;
+            }
+            nBestMatch = nMatch;
+        }
+    }
+    return nBestMatch;
+}
+
+} // end of namespace sfx2

Added: openoffice/branches/sidebar/main/sfx2/source/sidebar/Context.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/source/sidebar/Context.hxx?rev=1423885&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/source/sidebar/Context.hxx (added)
+++ openoffice/branches/sidebar/main/sfx2/source/sidebar/Context.hxx Wed Dec 19 15:29:30 2012
@@ -0,0 +1,63 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#ifndef SFX_SIDEBAR_CONTEXT_HXX
+#define SFX_SIDEBAR_CONTEXT_HXX
+
+#include "rtl/ustring.hxx"
+
+
+namespace sfx2 {
+
+class Context
+{
+public:
+    ::rtl::OUString msApplication;
+    ::rtl::OUString msContext;
+
+    Context (void);
+    Context (
+        const ::rtl::OUString& rsApplication,
+        const ::rtl::OUString& rsContext);
+    
+    /** When two contexts are matched against each other then
+        application or context name may have the wildcard value 'any'.
+        In order to prefer matches without wildcards over matches with
+        wildcards we introduce a integer evaluation for matches.
+    */
+    const static sal_Int32 NoMatch;
+    const static sal_Int32 OptimalMatch;
+
+    /** Return the numeric value that describes how good the match
+        between two contexts is.
+        Smaller values represent better matches.
+    */
+    sal_Int32 EvaluateMatch (const Context& rOther) const;
+
+    /** Return the best match against the given list of contexts.
+    */
+    sal_Int32 EvaluateMatch (const ::std::vector<Context>& rOthers) const;
+};
+
+
+} // end of namespace sfx2
+
+#endif

Added: openoffice/branches/sidebar/main/sfx2/source/sidebar/Deck.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/source/sidebar/Deck.cxx?rev=1423885&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/source/sidebar/Deck.cxx (added)
+++ openoffice/branches/sidebar/main/sfx2/source/sidebar/Deck.cxx Wed Dec 19 15:29:30 2012
@@ -0,0 +1,73 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#include "precompiled_sfx2.hxx"
+
+#include "Deck.hxx"
+#include "TitleBar.hxx"
+#include "DeckDescriptor.hxx"
+
+
+namespace sfx2 {
+
+Deck::Deck (
+    const DeckDescriptor& rDeckDescriptor,
+    Window* pParentWindow)
+    : Window(pParentWindow),
+      msId(rDeckDescriptor.msId),
+      mpTitleBar(new TitleBar(rDeckDescriptor.msTitle, true, this))
+{
+    SetBackground(Wallpaper());
+}
+
+
+
+
+Deck::~Deck (void)
+{
+}
+
+
+
+
+const ::rtl::OUString& Deck::GetId (void) const
+{
+    return msId;
+}
+
+
+
+
+TitleBar* Deck::GetTitleBar (void) const
+{
+    return mpTitleBar;
+}
+
+
+
+
+void Deck::Paint (const Rectangle& rUpdateArea)
+{
+    Window::Paint(rUpdateArea);
+}
+
+
+} // end of namespace sfx2

Added: openoffice/branches/sidebar/main/sfx2/source/sidebar/Deck.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/source/sidebar/Deck.hxx?rev=1423885&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/source/sidebar/Deck.hxx (added)
+++ openoffice/branches/sidebar/main/sfx2/source/sidebar/Deck.hxx Wed Dec 19 15:29:30 2012
@@ -0,0 +1,61 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#ifndef SFX_SIDEBAR_DECK_HXX
+#define SFX_SIDEBAR_DECK_HXX
+
+#include "vcl/window.hxx"
+
+
+namespace sfx2 {
+
+class DeckDescriptor;
+class TitleBar;
+
+
+/** This is the parent window of the panels.
+    It displays the deck title.
+*/
+class Deck
+    : public Window
+{
+public:
+    Deck (
+        const DeckDescriptor& rDeckDescriptor,
+        Window* pParentWindow);
+    virtual ~Deck (void);
+
+    const ::rtl::OUString& GetId (void) const;
+    TitleBar* GetTitleBar (void) const;
+    
+    virtual void Paint (const Rectangle& rUpdateArea);
+
+private:
+    const ::rtl::OUString msTitle;
+    const ::rtl::OUString msId;
+
+    TitleBar* mpTitleBar;
+};
+
+
+} // end of namespace sfx2
+
+#endif

Added: openoffice/branches/sidebar/main/sfx2/source/sidebar/DeckDescriptor.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/source/sidebar/DeckDescriptor.hxx?rev=1423885&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/source/sidebar/DeckDescriptor.hxx (added)
+++ openoffice/branches/sidebar/main/sfx2/source/sidebar/DeckDescriptor.hxx Wed Dec 19 15:29:30 2012
@@ -0,0 +1,43 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#ifndef SFX_SIDEBAR_DECK_DESCRIPTOR_HXX
+#define SFX_SIDEBAR_DECK_DESCRIPTOR_HXX
+
+#include "Context.hxx"
+#include <vector>
+
+
+namespace sfx2 {
+
+class DeckDescriptor
+{
+public:
+    ::rtl::OUString msTitle;
+    ::rtl::OUString msId;
+    ::rtl::OUString msIconURL;
+    ::rtl::OUString msHelpURL;
+    ::std::vector<Context> maContexts;
+};
+
+} // end of namespace sfx2
+
+#endif



Mime
View raw message