LCOV - code coverage report
Current view: top level - framework/inc/uielement - toolbarmerger.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 1 3 33.3 %
Date: 2015-06-13 12:38:46 Functions: 2 7 28.6 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_TOOLBARMERGER_HXX
      21             : #define INCLUDED_FRAMEWORK_INC_UIELEMENT_TOOLBARMERGER_HXX
      22             : 
      23             : #include <uielement/comboboxtoolbarcontroller.hxx>
      24             : #include <uielement/imagebuttontoolbarcontroller.hxx>
      25             : #include <uielement/togglebuttontoolbarcontroller.hxx>
      26             : #include <uielement/buttontoolbarcontroller.hxx>
      27             : #include <uielement/spinfieldtoolbarcontroller.hxx>
      28             : #include <uielement/edittoolbarcontroller.hxx>
      29             : #include <uielement/dropdownboxtoolbarcontroller.hxx>
      30             : #include <uielement/commandinfo.hxx>
      31             : 
      32             : #include <com/sun/star/beans/PropertyValue.hpp>
      33             : 
      34             : #include <svtools/toolboxcontroller.hxx>
      35             : 
      36             : #include <rtl/ustring.hxx>
      37             : #include <vcl/toolbox.hxx>
      38             : 
      39             : namespace framework
      40             : {
      41             : 
      42       55130 : struct AddonsParams
      43             : {
      44             :     OUString aImageId;
      45             :     OUString aTarget;
      46             :     OUString aControlType;
      47             : };
      48             : 
      49           0 : struct AddonToolbarItem
      50             : {
      51             :     OUString aCommandURL;
      52             :     OUString aLabel;
      53             :     OUString aImageIdentifier;
      54             :     OUString aTarget;
      55             :     OUString aContext;
      56             :     OUString aControlType;
      57             :     sal_uInt16      nWidth;
      58             : };
      59             : 
      60             : typedef ::std::vector< AddonToolbarItem > AddonToolbarItemContainer;
      61             : 
      62           0 : struct ReferenceToolbarPathInfo
      63             : {
      64             :     VclPtr<ToolBox>    pToolbar;
      65             :     sal_uInt16         nPos;
      66             :     bool               bResult;
      67             : };
      68             : 
      69             : class ToolBarMerger
      70             : {
      71             :     public:
      72             :         static bool       IsCorrectContext( const OUString& aContext, const OUString& aModuleIdentifier );
      73             : 
      74             :         static bool       ConvertSeqSeqToVector( const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& rSequence,
      75             :                                                  AddonToolbarItemContainer& rContainer );
      76             : 
      77             :         static void       ConvertSequenceToValues( const css::uno::Sequence< css::beans::PropertyValue >& rSequence,
      78             :                                                    OUString& rCommandURL,
      79             :                                                    OUString& rLabel,
      80             :                                                    OUString& rImageIdentifier,
      81             :                                                    OUString& rTarget,
      82             :                                                    OUString& rContext,
      83             :                                                    OUString& rControlType,
      84             :                                                    sal_uInt16&      rWidth );
      85             : 
      86             :         static ReferenceToolbarPathInfo FindReferencePoint( ToolBox*               pToolbar,
      87             :                                                             const OUString& rReferencePoint );
      88             : 
      89             :         static bool       ProcessMergeOperation( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
      90             :                                                  ToolBox*                         pToolbar,
      91             :                                                  sal_uInt16                       nPos,
      92             :                                                  sal_uInt16&                      rItemId,
      93             :                                                  CommandToInfoMap&                rCommandMap,
      94             :                                                  const OUString&           rModuleIdentifier,
      95             :                                                  const OUString&           rMergeCommand,
      96             :                                                  const OUString&           rMergeCommandParameter,
      97             :                                                  const AddonToolbarItemContainer& rItems );
      98             : 
      99             :         static bool       ProcessMergeFallback( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
     100             :                                                 ToolBox*                         pToolbar,
     101             :                                                 sal_uInt16                       nPos,
     102             :                                                 sal_uInt16&                      rItemId,
     103             :                                                 CommandToInfoMap&                rCommandMap,
     104             :                                                 const OUString&           rModuleIdentifier,
     105             :                                                 const OUString&           rMergeCommand,
     106             :                                                 const OUString&           rMergeFallback,
     107             :                                                 const AddonToolbarItemContainer& rItems );
     108             : 
     109             :         static bool       MergeItems( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
     110             :                                       ToolBox*                  pToolbar,
     111             :                                       sal_uInt16                nPos,
     112             :                                       sal_uInt16                nModIndex,
     113             :                                       sal_uInt16&               rItemId,
     114             :                                       CommandToInfoMap&         rCommandMap,
     115             :                                       const OUString&    rModuleIdentifier,
     116             :                                       const AddonToolbarItemContainer& rAddonToolbarItems );
     117             : 
     118             :         static bool       ReplaceItem( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
     119             :                                        ToolBox*                  pToolbar,
     120             :                                        sal_uInt16                nPos,
     121             :                                        sal_uInt16&               rItemId,
     122             :                                        CommandToInfoMap&         rCommandMap,
     123             :                                        const OUString&    rModuleIdentifier,
     124             :                                        const AddonToolbarItemContainer& rAddonToolbarItems );
     125             : 
     126             :         static bool       RemoveItems( ToolBox*                  pToolbar,
     127             :                                        sal_uInt16                nPos,
     128             :                                        const OUString&    rMergeCommandParameter );
     129             : 
     130             :         static ::cppu::OWeakObject* CreateController(
     131             :             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext,
     132             :             const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & xFrame,
     133             :             ToolBox*               pToolbar,
     134             :             const OUString& rCommandURL,
     135             :             sal_uInt16             nId,
     136             :             sal_uInt16             nWidth,
     137             :             const OUString& rControlType );
     138             : 
     139             :         static void CreateToolbarItem( ToolBox* pToolbox,
     140             :                                        CommandToInfoMap& rCommandMap,
     141             :                                        sal_uInt16 nPos,
     142             :                                        sal_uInt16 nItemId,
     143             :                                        const AddonToolbarItem& rAddonToolbarItem );
     144             : 
     145             :     private:
     146             :         ToolBarMerger( const ToolBarMerger& ) SAL_DELETED_FUNCTION;
     147             :         ToolBarMerger& operator=( const ToolBarMerger& ) SAL_DELETED_FUNCTION;
     148             : };
     149             : 
     150             : } // namespace framework
     151             : 
     152             : #endif // INCLUDED_FRAMEWORK_INC_UIELEMENT_TOOLBARMERGER_HXX
     153             : 
     154             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11