LCOV - code coverage report
Current view: top level - xmlhelp/source/cxxhelp/provider - provider.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 0 11 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_XMLHELP_SOURCE_CXXHELP_PROVIDER_PROVIDER_HXX
      21             : #define INCLUDED_XMLHELP_SOURCE_CXXHELP_PROVIDER_PROVIDER_HXX
      22             : 
      23             : #include <rtl/ustring.hxx>
      24             : #include <osl/mutex.hxx>
      25             : #include <ucbhelper/providerhelper.hxx>
      26             : #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
      27             : #include <com/sun/star/container/XContainerListener.hpp>
      28             : #include <com/sun/star/container/XContainer.hpp>
      29             : #include <com/sun/star/lang/XComponent.hpp>
      30             : 
      31             : namespace chelp {
      32             : 
      33             : // UNO service name for the provider. This name will be used by the UCB to
      34             : // create instances of the provider.
      35             : 
      36             : #define MYUCP_CONTENT_PROVIDER_SERVICE_NAME1   "com.sun.star.help.XMLHelp"
      37             : 
      38             : #define MYUCP_CONTENT_PROVIDER_SERVICE_NAME2  "com.sun.star.ucb.HelpContentProvider"
      39             : 
      40             : // URL scheme. This is the scheme the provider will be able to create
      41             : // contents for. The UCB will select the provider ( i.e. in order to create
      42             : // contents ) according to this scheme.
      43             : 
      44             : #define MYUCP_URL_SCHEME        "vnd.sun.star.help"
      45             : #define MYUCP_CONTENT_TYPE      "application/vnd.sun.star.xmlhelp"    // UCB Content Type.
      46             : 
      47             :     class Databases;
      48             : 
      49             :     class ContentProvider :
      50             :         public ::ucbhelper::ContentProviderImplHelper,
      51             :         public ::com::sun::star::container::XContainerListener,
      52             :         public ::com::sun::star::lang::XComponent
      53             :     {
      54             :     public:
      55             :         explicit ContentProvider(
      56             :             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
      57             : 
      58             :         virtual ~ContentProvider();
      59             : 
      60             :         // XInterface
      61             :         virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType )
      62             :             throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
      63             :         virtual void SAL_CALL acquire()
      64             :             throw() SAL_OVERRIDE;
      65             :         virtual void SAL_CALL release()
      66             :             throw() SAL_OVERRIDE;
      67             : 
      68             :         // XTypeProvider
      69             :         virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
      70             :             throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
      71             :         virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
      72             :             throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
      73             : 
      74             :         // XServiceInfo
      75             :         virtual OUString SAL_CALL getImplementationName()
      76             :             throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
      77             :         virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
      78             :             throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
      79             :         virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
      80             :             throw( css::uno::RuntimeException,
      81             :                    std::exception ) SAL_OVERRIDE;
      82             : 
      83             :         static OUString getImplementationName_Static();
      84             : 
      85             :         static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
      86             : 
      87             :         static css::uno::Reference< css::lang::XSingleServiceFactory > createServiceFactory(
      88             :                 const css::uno::Reference< css::lang::XMultiServiceFactory >& rxServiceMgr );
      89             : 
      90             :         // XContentProvider
      91             :         virtual css::uno::Reference< css::ucb::XContent > SAL_CALL queryContent(
      92             :                 const css::uno::Reference< css::ucb::XContentIdentifier >& Identifier )
      93             :             throw( css::ucb::IllegalIdentifierException,
      94             :                    css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
      95             : 
      96             :         // Additional interfaces
      97             : 
      98             :         // XComponent
      99             : 
     100             :         virtual void SAL_CALL
     101             :         dispose(  )
     102             :             throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     103             : 
     104             :         virtual void SAL_CALL
     105           0 :         addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener )
     106             :             throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     107             :         {
     108             :             (void)xListener;
     109           0 :         }
     110             : 
     111             :         virtual void SAL_CALL
     112           0 :         removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener )
     113             :             throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     114             :         {
     115             :             (void)aListener;
     116           0 :         }
     117             : 
     118             :         // XConainerListener ( deriver from XEventListener )
     119             : 
     120             :         virtual void SAL_CALL
     121           0 :         disposing( const ::com::sun::star::lang::EventObject& Source )
     122             :             throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     123             :         {
     124             :             (void)Source;
     125           0 :             m_xContainer = com::sun::star::uno::Reference<com::sun::star::container::XContainer>(0);
     126           0 :         }
     127             : 
     128             :         virtual void SAL_CALL
     129           0 :         elementInserted( const ::com::sun::star::container::ContainerEvent& Event )
     130             :             throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     131             :         {
     132             :             (void)Event;
     133           0 :         }
     134             : 
     135             :         virtual void SAL_CALL
     136           0 :         elementRemoved( const ::com::sun::star::container::ContainerEvent& Event )
     137             :             throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     138             :         {
     139             :             (void)Event;
     140           0 :         }
     141             : 
     142             :         virtual void SAL_CALL
     143             :         elementReplaced( const ::com::sun::star::container::ContainerEvent& Event )
     144             :             throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     145             : 
     146             :         // Non-interface methods.
     147             : 
     148             :     private:
     149             : 
     150             :         osl::Mutex     m_aMutex;
     151             :         bool           isInitialized;
     152             :         OUString  m_aScheme;
     153             :         Databases*     m_pDatabases;
     154             :         com::sun::star::uno::Reference<com::sun::star::container::XContainer> m_xContainer;
     155             : 
     156             :         // private methods
     157             : 
     158             :         void init();
     159             : 
     160             :         ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
     161             :         getConfiguration() const;
     162             : 
     163             :         static ::com::sun::star::uno::Reference< ::com::sun::star::container::XHierarchicalNameAccess >
     164             :         getHierAccess( const ::com::sun::star::uno::Reference<  ::com::sun::star::lang::XMultiServiceFactory >& sProvider,
     165             :                        const char* file );
     166             : 
     167             :         static OUString
     168             :         getKey( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XHierarchicalNameAccess >& xHierAccess,
     169             :                 const char* key );
     170             : 
     171             :         static bool
     172             :         getBooleanKey(
     173             :                     const ::com::sun::star::uno::Reference<
     174             :                     ::com::sun::star::container::XHierarchicalNameAccess >& xHierAccess,
     175             :                     const char* key);
     176             : 
     177             :         static void subst( OUString& instpath );
     178             :     };
     179             : 
     180             : }
     181             : 
     182             : #endif
     183             : 
     184             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11