LCOV - code coverage report
Current view: top level - framework/inc/uielement - uicommanddescription.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 6 8 75.0 %
Date: 2015-06-13 12:38:46 Functions: 2 3 66.7 %
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_UICOMMANDDESCRIPTION_HXX
      21             : #define INCLUDED_FRAMEWORK_INC_UIELEMENT_UICOMMANDDESCRIPTION_HXX
      22             : 
      23             : #include <unordered_map>
      24             : #include <stdtypes.h>
      25             : #include <com/sun/star/lang/XServiceInfo.hpp>
      26             : #include <com/sun/star/container/XNameAccess.hpp>
      27             : #include <com/sun/star/frame/XModuleManager2.hpp>
      28             : #include <com/sun/star/uno/XComponentContext.hpp>
      29             : 
      30             : #include <cppuhelper/basemutex.hxx>
      31             : #include <cppuhelper/compbase2.hxx>
      32             : #include <cppuhelper/supportsservice.hxx>
      33             : #include <rtl/ustring.hxx>
      34             : 
      35             : namespace framework
      36             : {
      37             : typedef ::cppu::WeakComponentImplHelper2< com::sun::star::lang::XServiceInfo,
      38             :         com::sun::star::container::XNameAccess > UICommandDescription_BASE;
      39             : 
      40             : class UICommandDescription : private cppu::BaseMutex,
      41             :                              public UICommandDescription_BASE
      42             : {
      43             :     public:
      44             :         UICommandDescription( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
      45             :         virtual ~UICommandDescription();
      46             : 
      47           2 :         virtual OUString SAL_CALL getImplementationName()
      48             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
      49             :         {
      50           2 :             return OUString("com.sun.star.comp.framework.UICommandDescription");
      51             :         }
      52             : 
      53           0 :         virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
      54             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
      55             :         {
      56           0 :             return cppu::supportsService(this, ServiceName);
      57             :         }
      58             : 
      59           1 :         virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
      60             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
      61             :         {
      62           1 :             css::uno::Sequence< OUString > aSeq(1);
      63           1 :             aSeq[0] = "com.sun.star.frame.UICommandDescription";
      64           1 :             return aSeq;
      65             :         }
      66             : 
      67             : private:
      68             :         // XNameAccess
      69             :         virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
      70             :             throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      71             : 
      72             :         virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames()
      73             :             throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      74             : 
      75             :         virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
      76             :             throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      77             : 
      78             :         // XElementAccess
      79             :         virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
      80             :             throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      81             :         virtual sal_Bool SAL_CALL hasElements()
      82             :             throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      83             : 
      84             : public:
      85             :         typedef std::unordered_map< OUString,
      86             :                                     OUString,
      87             :                                     OUStringHash,
      88             :                                     std::equal_to< OUString > > ModuleToCommandFileMap;
      89             : 
      90             :         typedef std::unordered_map< OUString,
      91             :                                     css::uno::Reference< css::container::XNameAccess >,
      92             :                                     OUStringHash,
      93             :                                     std::equal_to< OUString > > UICommandsHashMap;
      94             : 
      95             :     protected:
      96             :         UICommandDescription( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& rxContext, bool  );
      97             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > impl_createConfigAccess(const OUString& _sName);
      98             :         void impl_fillElements(const sal_Char* _pName);
      99             :         bool                                                                            m_bConfigRead;
     100             :         OUString                                                                       m_aPrivateResourceURL;
     101             :         ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >        m_xContext;
     102             :         ModuleToCommandFileMap                                                              m_aModuleToCommandFileMap;
     103             :         UICommandsHashMap                                                                   m_aUICommandsHashMap;
     104             :         ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >        m_xGenericUICommands;
     105             :         ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager2 >        m_xModuleManager;
     106             : };
     107             : 
     108             : } // namespace framework
     109             : 
     110             : #endif // __FRAMEWORK_SERVICES_UICOMMANDDESCRPTION_HXX_
     111             : 
     112             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11