LCOV - code coverage report
Current view: top level - cui/source/inc - acccfg.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 0 12 0.0 %
Date: 2015-06-13 12:38:46 Functions: 0 5 0.0 %
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_CUI_SOURCE_INC_ACCCFG_HXX
      21             : #define INCLUDED_CUI_SOURCE_INC_ACCCFG_HXX
      22             : 
      23             : #include <com/sun/star/beans/XPropertySet.hpp>
      24             : #include <com/sun/star/container/XIndexContainer.hpp>
      25             : #include <com/sun/star/frame/XModuleManager.hpp>
      26             : #include <com/sun/star/ui/XUIConfigurationManager.hpp>
      27             : #include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
      28             : #include <com/sun/star/frame/XStorable.hpp>
      29             : #include <com/sun/star/uno/XComponentContext.hpp>
      30             : #include <com/sun/star/lang/XSingleComponentFactory.hpp>
      31             : #include <com/sun/star/script/browse/XBrowseNode.hpp>
      32             : #include <com/sun/star/container/XNameAccess.hpp>
      33             : #include <com/sun/star/frame/XFrame.hpp>
      34             : 
      35             : #include <algorithm>
      36             : 
      37             : #include <vcl/fixed.hxx>
      38             : #include <vcl/button.hxx>
      39             : #include <vcl/dialog.hxx>
      40             : #include <vcl/lstbox.hxx>
      41             : #include <vcl/group.hxx>
      42             : #include <svtools/svtabbx.hxx>
      43             : #include <svtools/treelistbox.hxx>
      44             : #include <sfx2/tabdlg.hxx>
      45             : #include <sfx2/basedlgs.hxx>
      46             : #include "cfgutil.hxx"
      47             : 
      48             : class SfxMacroInfoItem;
      49             : class SfxConfigGroupListBox;
      50             : class SfxConfigFunctionListBox;
      51             : class SfxAcceleratorConfigPage;
      52             : class SfxStringItem;
      53             : 
      54             : class SfxAccCfgTabListBox_Impl : public SvTabListBox
      55             : {
      56             :     VclPtr<SfxAcceleratorConfigPage>   m_pAccelConfigPage;
      57             : 
      58             :     void                        KeyInput( const KeyEvent &rKEvt ) SAL_OVERRIDE;
      59             : 
      60             : protected:
      61             :     virtual void                InitEntry(SvTreeListEntry*, const OUString&, const Image&,
      62             :                                           const Image&, SvLBoxButtonKind eButtonKind) SAL_OVERRIDE;
      63             : 
      64             : public:
      65           0 :     SfxAccCfgTabListBox_Impl(vcl::Window *pParent, WinBits nStyle)
      66             :         : SvTabListBox(pParent, nStyle)
      67           0 :         , m_pAccelConfigPage(NULL)
      68             :     {
      69           0 :     }
      70             :     virtual ~SfxAccCfgTabListBox_Impl();
      71             :     virtual void dispose() SAL_OVERRIDE;
      72             : 
      73           0 :     void SetAccelConfigPage(SfxAcceleratorConfigPage* pAccelConfigPage)
      74             :     {
      75           0 :         m_pAccelConfigPage = pAccelConfigPage;
      76           0 :     }
      77             : 
      78             :     void ReplaceEntry( sal_uInt16 nPos, const OUString &rStr );
      79             : };
      80             : 
      81             : // class SfxAcceleratorConfigPage ----------------------------------------
      82             : 
      83           0 : struct TAccInfo
      84             : {
      85             :     public:
      86           0 :         TAccInfo(      sal_Int32 nKeyPos ,
      87             :                        sal_Int32 nListPos,
      88             :                  const vcl::KeyCode& aKey )
      89             :             : m_nKeyPos        (nKeyPos  )
      90             :             , m_nListPos       (nListPos )
      91             :             , m_bIsConfigurable(true ) /**< its important to set sal_True as default -
      92             :                                                 because only fix entries will be disabled later ... */
      93             :             , m_sCommand       (         )
      94           0 :             , m_aKey           (aKey     )
      95           0 :         {}
      96             : 
      97           0 :         bool isConfigured() const
      98             :         {
      99           0 :             return (m_nKeyPos>-1 && m_nListPos>-1 && !m_sCommand.isEmpty());
     100             :         }
     101             : 
     102             :         sal_Int32 m_nKeyPos;
     103             :         sal_Int32 m_nListPos;
     104             :         bool m_bIsConfigurable;
     105             :         OUString m_sCommand;
     106             :         vcl::KeyCode m_aKey;
     107             : };
     108             : 
     109             : namespace sfx2
     110             : {
     111             :     class FileDialogHelper;
     112             : }
     113             : 
     114             : class SfxAcceleratorConfigPage : public SfxTabPage
     115             : {
     116             :     friend class SfxAccCfgTabListBox_Impl;
     117             : private:
     118             :     const SfxMacroInfoItem*         m_pMacroInfoItem;
     119             :     const SfxStringItem*            m_pStringItem;
     120             :     const SfxStringItem*            m_pFontItem;
     121             :     sfx2::FileDialogHelper*         m_pFileDlg;
     122             : 
     123             :     VclPtr<SfxAccCfgTabListBox_Impl>       m_pEntriesBox;
     124             :     VclPtr<RadioButton>                    m_pOfficeButton;
     125             :     VclPtr<RadioButton>                    m_pModuleButton;
     126             :     VclPtr<PushButton>                     m_pChangeButton;
     127             :     VclPtr<PushButton>                     m_pRemoveButton;
     128             :     VclPtr<SfxConfigGroupListBox>          m_pGroupLBox;
     129             :     VclPtr<SfxConfigFunctionListBox>       m_pFunctionBox;
     130             :     VclPtr<SvTreeListBox>                  m_pKeyBox;
     131             :     VclPtr<PushButton>                     m_pLoadButton;
     132             :     VclPtr<PushButton>                     m_pSaveButton;
     133             :     VclPtr<PushButton>                     m_pResetButton;
     134             :     OUString                        aLoadAccelConfigStr;
     135             :     OUString                        aSaveAccelConfigStr;
     136             :     OUString                        aFilterAllStr;
     137             :     OUString                        aFilterCfgStr;
     138             :     SfxStylesInfo_Impl              m_aStylesInfo;
     139             :     bool                        m_bStylesInfoInitialized;
     140             : 
     141             :     css::uno::Reference< css::uno::XComponentContext >     m_xContext;
     142             :     css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xGlobal;
     143             :     css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xModule;
     144             :     css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xAct;
     145             :     css::uno::Reference< css::container::XNameAccess > m_xUICmdDescription;
     146             :     css::uno::Reference< css::frame::XFrame > m_xFrame;
     147             : 
     148             :     OUString m_sModuleLongName;
     149             :     OUString m_sModuleShortName;
     150             :     OUString m_sModuleUIName;
     151             : 
     152             :     DECL_LINK(ChangeHdl, void *);
     153             :     DECL_LINK(RemoveHdl, void *);
     154             :     DECL_LINK(                  SelectHdl, Control * );
     155             :     DECL_LINK(Save, void *);
     156             :     DECL_LINK(Load, void *);
     157             :     DECL_LINK(Default, void *);
     158             :     DECL_LINK(RadioHdl, void *);
     159             : 
     160             :     DECL_LINK(LoadHdl, void *);
     161             :     DECL_LINK(SaveHdl, void *);
     162             : 
     163             :     OUString                    GetLabel4Command(const OUString& rCommand);
     164             :     void                        InitAccCfg();
     165             :     sal_uLong                   MapKeyCodeToPos( const vcl::KeyCode &rCode ) const;
     166             :     static css::uno::Reference< css::frame::XModel > SearchForAlreadyLoadedDoc(const OUString& sName);
     167             :     void                        StartFileDialog( WinBits nBits, const OUString& rTitle );
     168             : 
     169             :     void                        Init(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& pAccMgr);
     170             :     void                        ResetConfig();
     171             : 
     172             :     static void                 CreateCustomItems( SvTreeListEntry* pEntry, const OUString& aCol1, const OUString& aCol2 );
     173             : 
     174             : public:
     175             :                                 SfxAcceleratorConfigPage( vcl::Window *pParent, const SfxItemSet& rItemSet );
     176             :     virtual                     ~SfxAcceleratorConfigPage();
     177             :     virtual void                dispose() SAL_OVERRIDE;
     178             : 
     179             :     virtual bool                FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
     180             :     virtual void                Reset( const SfxItemSet* ) SAL_OVERRIDE;
     181             : 
     182             :     void                        Apply(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& pAccMgr);
     183             : };
     184             : 
     185             : #endif
     186             : 
     187             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11