openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1478828 - in /openoffice/trunk/main: sfx2/inc/sfx2/sidebar/ svx/source/sidebar/insert/
Date Fri, 03 May 2013 15:08:26 GMT
Author: af
Date: Fri May  3 15:08:26 2013
New Revision: 1478828

URL: http://svn.apache.org/r1478828
Log:
122218: Added more missing files.

Added:
    openoffice/trunk/main/svx/source/sidebar/insert/
    openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.cxx   (with props)
    openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.hrc   (with props)
    openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.hxx   (with props)
    openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.src   (with props)
    openoffice/trunk/main/svx/source/sidebar/insert/SimpleToolBoxController.cxx   (with props)
    openoffice/trunk/main/svx/source/sidebar/insert/SimpleToolBoxController.hxx   (with props)
Modified:
    openoffice/trunk/main/sfx2/inc/sfx2/sidebar/Tools.hxx

Modified: openoffice/trunk/main/sfx2/inc/sfx2/sidebar/Tools.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/inc/sfx2/sidebar/Tools.hxx?rev=1478828&r1=1478827&r2=1478828&view=diff
==============================================================================
--- openoffice/trunk/main/sfx2/inc/sfx2/sidebar/Tools.hxx (original)
+++ openoffice/trunk/main/sfx2/inc/sfx2/sidebar/Tools.hxx Fri May  3 15:08:26 2013
@@ -29,7 +29,9 @@
 #include "sfx2/dllapi.h"
 
 #include <com/sun/star/awt/Gradient.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
 #include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/util/URL.hpp>
 
 
 #define A2S(s) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)))

Added: openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.cxx?rev=1478828&view=auto
==============================================================================
--- openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.cxx (added)
+++ openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.cxx Fri May  3 15:08:26
2013
@@ -0,0 +1,419 @@
+/**************************************************************
+ * 
+ * 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_svx.hxx"
+
+#include "InsertPropertyPanel.hxx"
+#include "InsertPropertyPanel.hrc"
+#include "SimpleToolBoxController.hxx"
+#include "sfx2/sidebar/CommandInfoProvider.hxx"
+
+#include <sfx2/sidebar/Theme.hxx>
+#include <sfx2/sidebar/Tools.hxx>
+#include <sfx2/sidebar/ControlFactory.hxx>
+
+#include <svx/dialmgr.hxx>
+#include <svtools/miscopt.hxx>
+#include <vcl/toolbox.hxx>
+#include <sfx2/tbxctrl.hxx>
+#include <framework/sfxhelperfunctions.hxx>
+#include <framework/imageproducer.hxx>
+#include <comphelper/processfactory.hxx>
+#include <cppuhelper/compbase1.hxx>
+#include <cppuhelper/basemutex.hxx>
+
+#include <com/sun/star/frame/XStatusListener.hpp>
+
+using namespace css;
+using namespace cssu;
+using ::rtl::OUString;
+
+#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
+
+namespace svx { namespace sidebar {
+
+
+InsertPropertyPanel::InsertPropertyPanel (
+    Window* pParent,
+    const cssu::Reference<css::frame::XFrame>& rxFrame)
+    :	Control(pParent, SVX_RES(RID_SIDEBAR_INSERT_PANEL)),
+        mpStandardShapesBackground(sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this)),
+        mpStandardShapesToolBox(sfx2::sidebar::ControlFactory::CreateToolBox(
+                mpStandardShapesBackground.get(),
+                SVX_RES(TB_INSERT_STANDARD))),
+        mpCustomShapesBackground(sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this)),
+        mpCustomShapesToolBox(sfx2::sidebar::ControlFactory::CreateToolBox(
+                mpCustomShapesBackground.get(),
+                SVX_RES(TB_INSERT_CUSTOM))),
+        maControllers(),
+        mxFrame(rxFrame)
+{
+    SetupToolBox(*mpStandardShapesToolBox);
+    SetupToolBox(*mpCustomShapesToolBox);
+    FreeResource();
+    
+    UpdateIcons();
+
+    mpStandardShapesToolBox->Show();
+    mpCustomShapesToolBox->Show();
+
+    // Listen to all tool box selection events.
+    Window* pTopWindow = pParent;
+    while (pTopWindow->GetParent() != NULL)
+        pTopWindow = pTopWindow->GetParent();
+    pTopWindow->AddChildEventListener(LINK(this, InsertPropertyPanel, WindowEventListener));
+}
+
+
+
+
+InsertPropertyPanel::~InsertPropertyPanel (void)
+{
+    ControllerContainer aControllers;
+    aControllers.swap(maControllers);
+    for (ControllerContainer::iterator iController(aControllers.begin()), iEnd(aControllers.end());
+         iController!=iEnd;
+         ++iController)
+    {
+        Reference<lang::XComponent> xComponent (iController->second.mxController,
UNO_QUERY);
+        if (xComponent.is())
+            xComponent->dispose();
+    }
+
+    // Remove window child listener.
+    Window* pTopWindow = this;
+    while (pTopWindow->GetParent() != NULL)
+        pTopWindow = pTopWindow->GetParent();
+    pTopWindow->RemoveChildEventListener(LINK(this, InsertPropertyPanel, WindowEventListener));
+
+    mpStandardShapesToolBox.reset();
+    mpCustomShapesToolBox.reset();
+    mpStandardShapesBackground.reset();
+    mpCustomShapesBackground.reset();
+}
+
+
+
+
+void InsertPropertyPanel::SetupToolBox (ToolBox& rToolBox)
+{
+    const sal_uInt16 nItemCount (rToolBox.GetItemCount());
+    for (sal_uInt16 nItemIndex=0; nItemIndex<nItemCount; ++nItemIndex)
+        CreateController(rToolBox.GetItemId(nItemIndex));
+
+    rToolBox.SetDropdownClickHdl(LINK(this, InsertPropertyPanel, DropDownClickHandler));
+    rToolBox.SetClickHdl(LINK(this, InsertPropertyPanel, ClickHandler));
+    rToolBox.SetDoubleClickHdl(LINK(this, InsertPropertyPanel, DoubleClickHandler));
+    rToolBox.SetSelectHdl(LINK(this, InsertPropertyPanel, SelectHandler));
+	rToolBox.SetActivateHdl(LINK(this, InsertPropertyPanel, Activate));
+	rToolBox.SetDeactivateHdl(LINK(this, InsertPropertyPanel, Deactivate));
+
+    rToolBox.SetSizePixel(rToolBox.CalcWindowSizePixel());
+}
+
+
+
+
+IMPL_LINK(InsertPropertyPanel, DropDownClickHandler, ToolBox*, pToolBox)
+{
+    if (pToolBox != NULL)
+    {
+        Reference<frame::XToolbarController> xController (GetControllerForItemId(pToolBox->GetCurItemId()));
+        if (xController.is())
+        {
+            Reference<awt::XWindow> xWindow = xController->createPopupWindow();
+            if (xWindow.is() )
+                xWindow->setFocus();
+        }
+    }
+    return 1;
+}
+
+
+
+
+IMPL_LINK(InsertPropertyPanel, ClickHandler, ToolBox*, pToolBox)
+{
+    if (pToolBox == NULL)
+        return 0;
+    
+    Reference<frame::XToolbarController> xController (GetControllerForItemId(pToolBox->GetCurItemId()));
+    if (xController.is())
+        xController->click();
+
+    return 1;
+}
+
+
+
+
+IMPL_LINK(InsertPropertyPanel, DoubleClickHandler, ToolBox*, pToolBox)
+{
+    if (pToolBox == NULL)
+        return 0;
+    
+    Reference<frame::XToolbarController> xController (GetControllerForItemId(pToolBox->GetCurItemId()));
+    if (xController.is())
+        xController->doubleClick();
+
+    return 1;
+}
+
+
+
+
+IMPL_LINK(InsertPropertyPanel, SelectHandler, ToolBox*, pToolBox)
+{
+    if (pToolBox == NULL)
+        return 0;
+
+    Reference<frame::XToolbarController> xController (GetControllerForItemId(pToolBox->GetCurItemId()));
+    if (xController.is())
+        xController->execute((sal_Int16)pToolBox->GetModifier());
+
+    return 1;
+}
+
+
+
+
+IMPL_LINK(InsertPropertyPanel, WindowEventListener, VclSimpleEvent*, pEvent)
+{
+    // We will be getting a lot of window events (well, basically all
+    // of them), so reject early everything that is not connected to
+    // toolbox selection.
+    if (pEvent == NULL)
+        return 1;
+    if ( ! pEvent->ISA(VclWindowEvent))
+        return 1;
+    if (pEvent->GetId() != VCLEVENT_TOOLBOX_SELECT)
+        return 1;
+
+    ToolBox* pToolBox = dynamic_cast<ToolBox*>(dynamic_cast<VclWindowEvent*>(pEvent)->GetWindow());
+    if (pToolBox == NULL)
+        return 1;
+
+    // Extract name of (sub)toolbar from help id.
+    OUString sToolbarName (rtl::OStringToOUString(pToolBox->GetHelpId(), RTL_TEXTENCODING_UTF8));
+    if (sToolbarName.getLength() == 0)
+        return 1;
+    const util::URL aURL (sfx2::sidebar::Tools::GetURL(sToolbarName));
+    if (aURL.Path.getLength() == 0)
+        return 1;
+            
+    // Get item id.
+    sal_uInt16 nId = pToolBox->GetCurItemId();
+    if (nId == 0)
+        return 1;
+
+    // Get toolbar controller.
+    const sal_uInt16 nItemId (GetItemIdForSubToolbarName(aURL.Path));
+    Reference<frame::XSubToolbarController> xController (GetControllerForItemId(nItemId),
UNO_QUERY);
+    if ( ! xController.is())
+        return 1;
+
+    const OUString sCommand (pToolBox->GetItemCommand(nId));
+    ControllerContainer::iterator iController (maControllers.find(nItemId));
+    if (iController != maControllers.end())
+        iController->second.msCurrentCommand = sCommand;
+    xController->functionSelected(sCommand);
+
+    const sal_Bool bBigImages (SvtMiscOptions().AreCurrentSymbolsLarge());
+    const bool bIsHighContrastActive (sfx2::sidebar::Theme::IsHighContrastMode());
+    Image aImage (framework::GetImageFromURL(mxFrame, sCommand, bBigImages, bIsHighContrastActive));
+    pToolBox->SetItemImage(iController->first, aImage);
+
+    return 1;
+}
+
+
+
+
+IMPL_LINK(InsertPropertyPanel, Activate, ToolBox*, EMPTYARG)
+{
+    return 1;
+}
+
+
+
+
+IMPL_LINK(InsertPropertyPanel, Deactivate, ToolBox*, EMPTYARG)
+{
+    return 1;
+}
+
+
+
+
+void InsertPropertyPanel::CreateController (
+    const sal_uInt16 nItemId)
+{
+    ToolBox* pToolBox = GetToolBoxForItemId(nItemId);
+    if (pToolBox != NULL)
+    {
+        ItemDescriptor aDescriptor;
+
+        const OUString sCommandName (pToolBox->GetItemCommand(nItemId));
+
+        // Create a controller for the new item.
+        aDescriptor.mxController.set(
+            static_cast<XWeak*>(::framework::CreateToolBoxController(
+                    mxFrame,
+                    pToolBox,
+                    nItemId,
+                    sCommandName)),
+            UNO_QUERY);
+        if ( ! aDescriptor.mxController.is())
+            aDescriptor.mxController.set(
+                static_cast<XWeak*>(new SimpleToolBoxController(mxFrame, *pToolBox,
nItemId, sCommandName)),
+                UNO_QUERY);
+        if ( ! aDescriptor.mxController.is())
+            return;
+
+        // Get dispatch object for the command.
+        aDescriptor.maURL = sfx2::sidebar::Tools::GetURL(sCommandName);
+        aDescriptor.msCurrentCommand = sCommandName;
+        aDescriptor.mxDispatch = sfx2::sidebar::Tools::GetDispatch(mxFrame, aDescriptor.maURL);
+        if ( ! aDescriptor.mxDispatch.is())
+            return;
+
+        // Initialize the controller with eg a service factory.
+        Reference<lang::XInitialization> xInitialization (aDescriptor.mxController,
UNO_QUERY);
+        if (xInitialization.is())
+        {
+            beans::PropertyValue aPropValue;
+            std::vector<Any> aPropertyVector;
+
+            aPropValue.Name = A2S("Frame");
+            aPropValue.Value <<= mxFrame;
+            aPropertyVector.push_back(makeAny(aPropValue));
+    
+            aPropValue.Name = A2S("ServiceManager");
+            aPropValue.Value <<= ::comphelper::getProcessServiceFactory();
+            aPropertyVector.push_back(makeAny(aPropValue));
+    
+            aPropValue.Name = A2S("CommandURL");
+            aPropValue.Value <<= sCommandName;
+            aPropertyVector.push_back(makeAny(aPropValue));
+    
+            Sequence<Any> aArgs (comphelper::containerToSequence(aPropertyVector));
+            xInitialization->initialize(aArgs);
+        }
+        
+        Reference<util::XUpdatable> xUpdatable (aDescriptor.mxController, UNO_QUERY);
+        if (xUpdatable.is())
+            xUpdatable->update();
+
+        // Add label.
+        const OUString sLabel (sfx2::sidebar::CommandInfoProvider::Instance().GetLabelForCommand(
+                sCommandName,
+                mxFrame));
+        pToolBox->SetQuickHelpText(nItemId, sLabel);
+
+        // Add item to toolbox.
+        pToolBox->EnableItem(nItemId);
+        maControllers.insert(::std::make_pair(nItemId, aDescriptor));
+    }
+}
+
+
+
+
+ToolBox* InsertPropertyPanel::GetToolBoxForItemId (const sal_uInt16 nItemId) const
+{
+    switch(nItemId)
+    {
+        case TBI_STANDARD_LINE:
+        case TBI_STANDARD_ARROW:
+        case TBI_STANDARD_RECTANGLE:
+        case TBI_STANDARD_ELLIPSE:
+        case TBI_STANDARD_TEXT:
+        case TBI_STANDARD_LINES:
+        case TBI_STANDARD_CONNECTORS:
+        case TBI_STANDARD_ARROWS:
+            return mpStandardShapesToolBox.get();
+
+        case TBI_CUSTOM_BASICS:
+        case TBI_CUSTOM_SYMBOLS:
+        case TBI_CUSTOM_ARROWS:
+        case TBI_CUSTOM_FLOWCHARTS:
+        case TBI_CUSTOM_CALLOUTS:
+        case TBI_CUSTOM_STARS:
+            return mpCustomShapesToolBox.get();
+
+        default:
+            return NULL;
+    }
+}
+
+
+
+
+Reference<frame::XToolbarController> InsertPropertyPanel::GetControllerForItemId (const
sal_uInt16 nItemId) const
+{
+    ControllerContainer::const_iterator iController (maControllers.find(nItemId));
+    if (iController != maControllers.end())
+        return iController->second.mxController;
+    else
+        return NULL;
+}
+
+
+
+
+sal_uInt16 InsertPropertyPanel::GetItemIdForSubToolbarName (const OUString& rsSubToolbarName)
const
+{
+    for (ControllerContainer::const_iterator iController(maControllers.begin()), iEnd(maControllers.end());
+         iController!=iEnd;
+         ++iController)
+    {
+        Reference<frame::XSubToolbarController> xSubToolbarController (iController->second.mxController,
UNO_QUERY);
+        if (xSubToolbarController.is())
+            if (xSubToolbarController->getSubToolbarName().equals(rsSubToolbarName))
+                return iController->first;
+    }
+    return NULL;
+}
+
+
+
+
+void InsertPropertyPanel::UpdateIcons (void)
+{
+    const sal_Bool bBigImages (SvtMiscOptions().AreCurrentSymbolsLarge());
+    const bool bIsHighContrastActive (sfx2::sidebar::Theme::IsHighContrastMode());
+    
+    for (ControllerContainer::iterator iController(maControllers.begin()), iEnd(maControllers.end());
+         iController!=iEnd;
+         ++iController)
+    {
+        const ::rtl::OUString sCommandURL (iController->second.msCurrentCommand);
+        Image aImage (framework::GetImageFromURL(mxFrame, sCommandURL, bBigImages, bIsHighContrastActive));
+        ToolBox* pToolBox = GetToolBoxForItemId(iController->first);
+        if (pToolBox != NULL)
+            pToolBox->SetItemImage(iController->first, aImage);
+    }
+}
+
+
+
+
+} } // end of namespace svx::sidebar

Propchange: openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.hrc
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.hrc?rev=1478828&view=auto
==============================================================================
--- openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.hrc (added)
+++ openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.hrc Fri May  3 15:08:26
2013
@@ -0,0 +1,42 @@
+/**************************************************************
+ * 
+ * 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 "svx/dialogs.hrc"
+
+#define TB_INSERT_STANDARD  1
+#define TB_INSERT_CUSTOM    2
+
+
+#define TBI_STANDARD_LINE	    10
+#define TBI_STANDARD_ARROW      11
+#define TBI_STANDARD_RECTANGLE	12
+#define TBI_STANDARD_ELLIPSE    13
+#define TBI_STANDARD_TEXT       14
+#define TBI_STANDARD_LINES	    15
+#define TBI_STANDARD_CONNECTORS 16
+#define TBI_STANDARD_ARROWS     17
+
+#define TBI_CUSTOM_BASICS	    20
+#define TBI_CUSTOM_SYMBOLS	    21
+#define TBI_CUSTOM_ARROWS	    22
+#define TBI_CUSTOM_FLOWCHARTS	23
+#define TBI_CUSTOM_CALLOUTS	    24
+#define TBI_CUSTOM_STARS        25

Propchange: openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.hrc
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.hxx?rev=1478828&view=auto
==============================================================================
--- openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.hxx (added)
+++ openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.hxx Fri May  3 15:08:26
2013
@@ -0,0 +1,96 @@
+/**************************************************************
+ * 
+ * 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 SVX_SIDEBAR_INSERT_PROPERTY_PAGE_HXX
+#define SVX_SIDEBAR_INSERT_PROPERTY_PAGE_HXX
+
+#include <boost/scoped_ptr.hpp>
+
+#include <vcl/ctrl.hxx>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XToolbarController.hpp>
+
+#include <map>
+
+
+namespace css = ::com::sun::star;
+namespace cssu = ::com::sun::star::uno;
+
+class ToolBox;
+
+namespace svx { namespace sidebar {
+
+class InsertPropertyPanel
+    : public Control
+{
+public:
+    InsertPropertyPanel (
+        Window* pParent,
+        const cssu::Reference<css::frame::XFrame>& rxFrame);
+    virtual ~InsertPropertyPanel (void);
+
+private:
+	::boost::scoped_ptr<Window> mpStandardShapesBackground;
+    ::boost::scoped_ptr<ToolBox> mpStandardShapesToolBox;
+	::boost::scoped_ptr<Window> mpCustomShapesBackground;
+    ::boost::scoped_ptr<ToolBox> mpCustomShapesToolBox;
+    class ItemDescriptor
+    {
+    public:
+        cssu::Reference<css::frame::XToolbarController> mxController;
+        css::util::URL maURL;
+        rtl::OUString msCurrentCommand;
+        cssu::Reference<css::frame::XDispatch> mxDispatch;
+    };
+    typedef ::std::map<sal_uInt16, ItemDescriptor> ControllerContainer;
+    ControllerContainer maControllers;
+    const cssu::Reference<css::frame::XFrame> mxFrame;
+
+    /** Add listeners to toolbox and update its size to match its
+        content.
+    */
+    void SetupToolBox (ToolBox& rToolBox);
+    cssu::Reference<css::frame::XToolbarController> GetControllerForItemId (
+        const sal_uInt16 nItemId) const;
+    ToolBox* GetToolBoxForItemId (const sal_uInt16 nItemId) const;
+    sal_uInt16 GetItemIdForSubToolbarName (
+        const ::rtl::OUString& rsCOmmandName) const;
+    
+    /** Create toolbox controller for one item.
+    */
+    void CreateController (
+        const sal_uInt16 nItemId);
+    void UpdateIcons (void);
+
+    DECL_LINK(DropDownClickHandler, ToolBox*);
+    DECL_LINK(ClickHandler, ToolBox*);
+    DECL_LINK(DoubleClickHandler, ToolBox*);
+    DECL_LINK(SelectHandler, ToolBox*);
+    DECL_LINK(WindowEventListener, VclSimpleEvent*);
+    DECL_LINK(Activate, ToolBox*);
+    DECL_LINK(Deactivate, ToolBox*);
+};
+
+
+} } // end of namespace ::svx::sidebar
+
+#endif

Propchange: openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.hxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.src
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.src?rev=1478828&view=auto
==============================================================================
--- openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.src (added)
+++ openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.src Fri May  3 15:08:26
2013
@@ -0,0 +1,146 @@
+/**************************************************************
+ * 
+ * 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 "InsertPropertyPanel.hrc"
+#include <sfx2/sidebar/ResourceDefinitions.hrc>
+#include "helpid.hrc"                       
+
+#define FIRST_LINE_Y    SECTIONPAGE_MARGIN_VERTICAL_TOP
+#define SECOND_LINE_Y   FIRST_LINE_Y + TOOLBOX_ITEM_HEIGHT + CONTROL_SPACING_VERTICAL  +
1
+
+Control RID_SIDEBAR_INSERT_PANEL
+{
+    OutputSize = TRUE;
+	DialogControl = TRUE;
+	Border = FALSE;
+
+	Size = MAP_APPFONT(
+          PROPERTYPAGE_WIDTH,
+          SECTIONPAGE_MARGIN_VERTICAL_TOP 
+          + TOOLBOX_ITEM_HEIGHT * 2 
+          + CONTROL_SPACING_VERTICAL
+          + SECTIONPAGE_MARGIN_VERTICAL_BOT);
+	HelpID = HID_SIDEBAR_INSERT_PANEL;
+	Text = "Insert";
+	
+	ToolBox TB_INSERT_STANDARD
+	{
+		SVLook = TRUE ;
+		Pos = MAP_APPFONT (SECTIONPAGE_MARGIN_HORIZONTAL, FIRST_LINE_Y);
+		Size = MAP_APPFONT (TOOLBOX_ITEM_WIDTH * 6 + TOOLBOX_ITEM_DD_WIDTH, TOOLBOX_ITEM_HEIGHT)
;
+		TabStop = TRUE ;
+		HelpID = HID_SIDEBAR_INSERT_TOOLBOX;
+		Text = "Insert Shapes";
+		ItemList =
+		{
+			ToolBoxItem
+			{
+				Identifier = TBI_STANDARD_LINE;
+                Command = ".uno:Line";
+			};
+			ToolBoxItem
+			{
+				Identifier = TBI_STANDARD_ARROW;
+                Command = ".uno:LineArrowEnd";
+			};
+			ToolBoxItem
+			{
+				Identifier = TBI_STANDARD_RECTANGLE;
+                Command = ".uno:Rect";
+			};
+			ToolBoxItem
+			{
+				Identifier = TBI_STANDARD_ELLIPSE;
+                Command = ".uno:Ellipse";
+			};
+			ToolBoxItem
+			{
+				Identifier = TBI_STANDARD_TEXT;
+                Command = ".uno:Text";
+			};
+			ToolBoxItem
+			{
+				Identifier = TBI_STANDARD_LINES;
+                Command = ".uno:LineToolbox";
+			};
+			ToolBoxItem
+			{
+				Identifier = TBI_STANDARD_CONNECTORS;
+                Command = ".uno:ConnectorToolbox";
+			};
+			ToolBoxItem
+			{
+				Identifier = TBI_STANDARD_ARROWS;
+                Command = ".uno:ArrowsToolbox";
+                DropDown = TRUE;
+			};
+        };
+    };
+
+	ToolBox TB_INSERT_CUSTOM
+	{
+		SVLook = TRUE ;
+		Pos = MAP_APPFONT (SECTIONPAGE_MARGIN_HORIZONTAL, SECOND_LINE_Y);
+		Size = MAP_APPFONT (TOOLBOX_ITEM_DD_WIDTH * 6, TOOLBOX_ITEM_HEIGHT) ;
+		TabStop = TRUE ;
+		HelpID = HID_SIDEBAR_INSERT_TOOLBOX;
+		Text = "Insert";
+		ItemList =
+		{
+			ToolBoxItem
+			{
+				Identifier = TBI_CUSTOM_BASICS;
+                Command = ".uno:BasicShapes";
+                DropDown = TRUE;
+			};
+			ToolBoxItem
+			{
+				Identifier = TBI_CUSTOM_SYMBOLS;
+                Command = ".uno:SymbolShapes";
+                DropDown = TRUE;
+			};
+			ToolBoxItem
+			{
+				Identifier = TBI_CUSTOM_ARROWS;
+                Command = ".uno:ArrowShapes";
+                DropDown = TRUE;
+			};
+			ToolBoxItem
+			{
+				Identifier = TBI_CUSTOM_FLOWCHARTS;
+                Command = ".uno:FlowChartShapes";
+                DropDown = TRUE;
+            };
+			ToolBoxItem
+			{
+				Identifier = TBI_CUSTOM_CALLOUTS;
+                Command = ".uno:CalloutShapes";
+                DropDown = TRUE;
+			};
+			ToolBoxItem
+			{
+				Identifier = TBI_CUSTOM_STARS;
+                Command = ".uno:StarShapes";
+                DropDown = TRUE;
+			};
+		};
+	};
+};

Propchange: openoffice/trunk/main/svx/source/sidebar/insert/InsertPropertyPanel.src
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/trunk/main/svx/source/sidebar/insert/SimpleToolBoxController.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/insert/SimpleToolBoxController.cxx?rev=1478828&view=auto
==============================================================================
--- openoffice/trunk/main/svx/source/sidebar/insert/SimpleToolBoxController.cxx (added)
+++ openoffice/trunk/main/svx/source/sidebar/insert/SimpleToolBoxController.cxx Fri May  3
15:08:26 2013
@@ -0,0 +1,85 @@
+/**************************************************************
+ * 
+ * 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_svx.hxx"
+
+#include "SimpleToolBoxController.hxx"
+
+#include <comphelper/processfactory.hxx>
+#include <vcl/toolbox.hxx>
+#include <vos/mutex.hxx>
+#include <vcl/svapp.hxx>
+
+
+using namespace ::com::sun::star;
+
+namespace svx { namespace sidebar {
+
+SimpleToolBoxController::SimpleToolBoxController(
+    const cssu::Reference<css::frame::XFrame>& rxFrame,
+    ToolBox& rToolBox,
+    const sal_uInt16 nItemId,
+    const rtl::OUString& rsCommand)
+    : svt::ToolboxController(::comphelper::getProcessServiceFactory(), rxFrame, rsCommand),
+      mrToolbox(rToolBox),
+      mnItemId(nItemId)
+{
+}
+
+
+
+
+SimpleToolBoxController::~SimpleToolBoxController (void)
+{
+}
+
+
+
+
+void SAL_CALL SimpleToolBoxController::statusChanged (const css::frame::FeatureStateEvent&
rEvent)
+    throw (cssu::RuntimeException)
+{
+    vos::OGuard aSolarMutexGuard (Application::GetSolarMutex());
+
+    if (m_bDisposed)
+        return;
+
+    mrToolbox.EnableItem(mnItemId, rEvent.IsEnabled);
+
+    sal_uInt16 nItemBits = mrToolbox.GetItemBits(mnItemId);
+    nItemBits &= ~TIB_CHECKABLE;
+    TriState eState = STATE_NOCHECK;
+
+    sal_Bool bValue;
+    if (rEvent.State >>= bValue)
+    {
+        // Boolean, treat it as checked/unchecked
+        mrToolbox.CheckItem(mnItemId, bValue);
+        if ( bValue )
+            eState = STATE_CHECK;
+        nItemBits |= TIB_CHECKABLE;
+    }
+
+    mrToolbox.SetItemState(mnItemId, eState);
+    mrToolbox.SetItemBits(mnItemId, nItemBits);
+}
+
+} } // end of namespace svx::sidebar

Propchange: openoffice/trunk/main/svx/source/sidebar/insert/SimpleToolBoxController.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/trunk/main/svx/source/sidebar/insert/SimpleToolBoxController.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/insert/SimpleToolBoxController.hxx?rev=1478828&view=auto
==============================================================================
--- openoffice/trunk/main/svx/source/sidebar/insert/SimpleToolBoxController.hxx (added)
+++ openoffice/trunk/main/svx/source/sidebar/insert/SimpleToolBoxController.hxx Fri May  3
15:08:26 2013
@@ -0,0 +1,54 @@
+/**************************************************************
+ * 
+ * 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 SVX_SIDEBAR_INSERT_SIMPLE_TOOLBOX_CONTROLLER_HXX
+#define SVX_SIDEBAR_INSERT_SIMPLE_TOOLBOX_CONTROLLER_HXX
+
+#include <svtools/toolboxcontroller.hxx>
+
+namespace css = ::com::sun::star;
+namespace cssu = ::com::sun::star::uno;
+
+namespace svx { namespace sidebar {
+
+class SimpleToolBoxController : public svt::ToolboxController
+{
+public:
+    SimpleToolBoxController(
+        const cssu::Reference<css::frame::XFrame>& rxFrame,
+        ToolBox& rToolBox,
+        const sal_uInt16 nItTemId,
+        const rtl::OUString& rsComand);
+    virtual ~SimpleToolBoxController (void);
+
+    // XStatusListener
+    virtual void SAL_CALL statusChanged (const css::frame::FeatureStateEvent& rEvent)
+        throw (cssu::RuntimeException);
+
+private:
+    ToolBox& mrToolbox;
+    const sal_uInt16 mnItemId;
+};
+
+} } // end of namespace svx::sidebar
+
+
+#endif

Propchange: openoffice/trunk/main/svx/source/sidebar/insert/SimpleToolBoxController.hxx
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message