LCOV - code coverage report
Current view: top level - desktop/source/deployment/manager - dp_commandenvironments.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 3 4 75.0 %
Date: 2012-08-25 Functions: 6 8 75.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 3 8 37.5 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #ifndef INCLUDED_DP_COMMANDENVIRONMENTS_HXX
      30                 :            : #define INCLUDED_DP_COMMANDENVIRONMENTS_HXX
      31                 :            : 
      32                 :            : #include "cppuhelper/compbase3.hxx"
      33                 :            : #include "ucbhelper/content.hxx"
      34                 :            : #include "com/sun/star/uno/Type.hxx"
      35                 :            : 
      36                 :            : namespace css = ::com::sun::star;
      37                 :            : 
      38                 :            : namespace dp_manager {
      39                 :            : 
      40                 :            : /**
      41                 :            :    This command environment is to be used when an extension is temporarily
      42                 :            :    stored in the "tmp" repository. It prevents all kind of user interaction.
      43                 :            :  */
      44                 :            : class BaseCommandEnv
      45                 :            :     : public ::cppu::WeakImplHelper3< css::ucb::XCommandEnvironment,
      46                 :            :                                       css::task::XInteractionHandler,
      47                 :            :                                       css::ucb::XProgressHandler >
      48                 :            : {
      49                 :            : protected:
      50                 :            :     css::uno::Reference< css::uno::XComponentContext > m_xContext;
      51                 :            :     css::uno::Reference< css::task::XInteractionHandler> m_forwardHandler;
      52                 :            : 
      53                 :            :     void handle_(bool approve, bool abort,
      54                 :            :                  css::uno::Reference< css::task::XInteractionRequest> const & xRequest );
      55                 :            : public:
      56                 :            :     virtual ~BaseCommandEnv();
      57                 :            :     BaseCommandEnv();
      58                 :            :     BaseCommandEnv(
      59                 :            :         css::uno::Reference< css::task::XInteractionHandler> const & handler);
      60                 :            : 
      61                 :            :     // XCommandEnvironment
      62                 :            :     virtual css::uno::Reference<css::task::XInteractionHandler > SAL_CALL
      63                 :            :     getInteractionHandler() throw (css::uno::RuntimeException);
      64                 :            :     virtual css::uno::Reference<css::ucb::XProgressHandler >
      65                 :            :     SAL_CALL getProgressHandler() throw (css::uno::RuntimeException);
      66                 :            : 
      67                 :            :     // XInteractionHandler
      68                 :            :     virtual void SAL_CALL handle(
      69                 :            :         css::uno::Reference<css::task::XInteractionRequest > const & xRequest )
      70                 :            :         throw (css::uno::RuntimeException);
      71                 :            : 
      72                 :            :     // XProgressHandler
      73                 :            :     virtual void SAL_CALL push( css::uno::Any const & Status )
      74                 :            :         throw (css::uno::RuntimeException);
      75                 :            :     virtual void SAL_CALL update( css::uno::Any const & Status )
      76                 :            :         throw (css::uno::RuntimeException);
      77                 :            :     virtual void SAL_CALL pop() throw (css::uno::RuntimeException);
      78                 :            : };
      79                 :            : 
      80         [ -  + ]:          8 : class TmpRepositoryCommandEnv : public BaseCommandEnv
      81                 :            : {
      82                 :            : public:
      83                 :            :     TmpRepositoryCommandEnv();
      84                 :            :     TmpRepositoryCommandEnv(css::uno::Reference< css::task::XInteractionHandler> const & handler);
      85                 :            : 
      86                 :            : // XInteractionHandler
      87                 :            :     virtual void SAL_CALL handle(
      88                 :            :         css::uno::Reference<css::task::XInteractionRequest > const & xRequest )
      89                 :            :         throw (css::uno::RuntimeException);
      90                 :            : 
      91                 :            : };
      92                 :            : 
      93                 :            : /** this class is for use in XPackageManager::synchronize.
      94                 :            : 
      95                 :            :     It handles particular license cases.
      96                 :            :  */
      97         [ -  + ]:        992 : class LicenseCommandEnv : public BaseCommandEnv
      98                 :            : {
      99                 :            : private:
     100                 :            :     ::rtl::OUString m_repository;
     101                 :            :     bool m_bSuppressLicense;
     102                 :            : public:
     103                 :            :     LicenseCommandEnv() : m_bSuppressLicense(false) {};
     104                 :            :     LicenseCommandEnv(
     105                 :            :         css::uno::Reference< css::task::XInteractionHandler> const & handler,
     106                 :            :         bool bSuppressLicense,
     107                 :            :         ::rtl::OUString const & repository);
     108                 :            : 
     109                 :            : // XInteractionHandler
     110                 :            :     virtual void SAL_CALL handle(
     111                 :            :         css::uno::Reference<css::task::XInteractionRequest > const & xRequest )
     112                 :            :         throw (css::uno::RuntimeException);
     113                 :            : 
     114                 :            : };
     115                 :            : 
     116                 :            : /** this class is for use in XPackageManager::checkPrerequisites
     117                 :            : 
     118                 :            :     It always prohibits a license interaction
     119                 :            :  */
     120         [ #  # ]:          0 : class NoLicenseCommandEnv : public BaseCommandEnv
     121                 :            : {
     122                 :            : 
     123                 :            : public:
     124                 :            :     NoLicenseCommandEnv(){};
     125                 :            :     NoLicenseCommandEnv(css::uno::Reference< css::task::XInteractionHandler> const & handler);
     126                 :            : 
     127                 :            : // XInteractionHandler
     128                 :            :     virtual void SAL_CALL handle(
     129                 :            :         css::uno::Reference<css::task::XInteractionRequest > const & xRequest )
     130                 :            :         throw (css::uno::RuntimeException);
     131                 :            : 
     132                 :            : };
     133                 :            : 
     134                 :            : /* For use in XExtensionManager::addExtension in the call to
     135                 :            :    XPackage::checkPrerequisites
     136                 :            :    It prevents all user interactions. The license is always accepted.
     137                 :            :    It remembers if there was a platform or a dependency exception in
     138                 :            :    the member m_bException. if there was any other exception then m_bUnknownException
     139                 :            :    is set.
     140                 :            : 
     141                 :            :  */
     142         [ -  + ]:          4 : class SilentCheckPrerequisitesCommandEnv : public BaseCommandEnv
     143                 :            : {
     144                 :            : public:
     145                 :            :     SilentCheckPrerequisitesCommandEnv();
     146                 :            :     // XInteractionHandler
     147                 :            :     virtual void SAL_CALL handle(
     148                 :            :         css::uno::Reference<css::task::XInteractionRequest > const & xRequest )
     149                 :            :         throw (css::uno::RuntimeException);
     150                 :            : 
     151                 :            :     // Set to true if a PlatformException or a DependencyException were handled.
     152                 :            :     css::uno::Any m_Exception;
     153                 :            :     // Set to true if an unknown exception was handled.
     154                 :            :     css::uno::Any m_UnknownException;
     155                 :            : };
     156                 :            : 
     157                 :            : }
     158                 :            : 
     159                 :            : #endif
     160                 :            : 
     161                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10