LCOV - code coverage report
Current view: top level - framework/source/uifactory - statusbarfactory.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 10 18 55.6 %
Date: 2015-06-13 12:38:46 Functions: 5 8 62.5 %
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             : #include <com/sun/star/frame/ModuleManager.hpp>
      21             : 
      22             : #include <uifactory/menubarfactory.hxx>
      23             : #include <uielement/statusbarwrapper.hxx>
      24             : 
      25             : #include <cppuhelper/supportsservice.hxx>
      26             : #include <vcl/svapp.hxx>
      27             : #include <rtl/ustrbuf.hxx>
      28             : 
      29             : using namespace com::sun::star::uno;
      30             : using namespace com::sun::star::lang;
      31             : using namespace com::sun::star::frame;
      32             : using namespace com::sun::star::beans;
      33             : using namespace com::sun::star::util;
      34             : using namespace ::com::sun::star::ui;
      35             : 
      36             : using namespace framework;
      37             : 
      38             : namespace {
      39             : 
      40        6426 : class StatusBarFactory :  public MenuBarFactory
      41             : {
      42             : public:
      43             :     StatusBarFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext );
      44             : 
      45           0 :     virtual OUString SAL_CALL getImplementationName()
      46             :         throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
      47             :     {
      48           0 :         return OUString("com.sun.star.comp.framework.StatusBarFactory");
      49             :     }
      50             : 
      51           0 :     virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
      52             :         throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
      53             :     {
      54           0 :         return cppu::supportsService(this, ServiceName);
      55             :     }
      56             : 
      57           0 :     virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
      58             :         throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
      59             :     {
      60           0 :         css::uno::Sequence< OUString > aSeq(1);
      61           0 :         aSeq[0] = "com.sun.star.ui.StatusBarFactory";
      62           0 :         return aSeq;
      63             :     }
      64             : 
      65             :     // XUIElementFactory
      66             :     virtual css::uno::Reference< css::ui::XUIElement > SAL_CALL createUIElement( const OUString& ResourceURL, const css::uno::Sequence< css::beans::PropertyValue >& Args ) throw ( css::container::NoSuchElementException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
      67             : };
      68             : 
      69        3213 : StatusBarFactory::StatusBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ) :
      70        3213 :     MenuBarFactory( xContext )
      71             : {
      72        3213 : }
      73             : 
      74             : // XUIElementFactory
      75        3213 : Reference< XUIElement > SAL_CALL StatusBarFactory::createUIElement(
      76             :     const OUString& ResourceURL,
      77             :     const Sequence< PropertyValue >& Args )
      78             : throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception )
      79             : {
      80             :     Reference< ::com::sun::star::ui::XUIElement > xStatusBar(
      81        3213 :             static_cast<OWeakObject *>(new StatusBarWrapper(m_xContext)), UNO_QUERY);
      82        3213 :     MenuBarFactory::CreateUIElement(ResourceURL, Args, NULL, "private:resource/statusbar/", xStatusBar, m_xContext);
      83        3213 :     return xStatusBar;
      84             : }
      85             : 
      86             : }
      87             : 
      88             : extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
      89        3213 : com_sun_star_comp_framework_StatusBarFactory_get_implementation(
      90             :     css::uno::XComponentContext *context,
      91             :     css::uno::Sequence<css::uno::Any> const &)
      92             : {
      93        3213 :     return cppu::acquire(new StatusBarFactory(context));
      94             : }
      95             : 
      96             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11