LCOV - code coverage report
Current view: top level - ucb/source/ucp/file - filinsreq.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 18 32 56.2 %
Date: 2014-11-03 Functions: 12 17 70.6 %
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             : 
      21             : #ifndef INCLUDED_UCB_SOURCE_UCP_FILE_FILINSREQ_HXX
      22             : #define INCLUDED_UCB_SOURCE_UCP_FILE_FILINSREQ_HXX
      23             : 
      24             : #include <rtl/ustring.hxx>
      25             : #include <com/sun/star/uno/XInterface.hpp>
      26             : #include <com/sun/star/task/XInteractionAbort.hpp>
      27             : #include <com/sun/star/ucb/XInteractionSupplyName.hpp>
      28             : #include <com/sun/star/task/XInteractionRequest.hpp>
      29             : #include <cppuhelper/implbase1.hxx>
      30             : 
      31             : 
      32             : namespace fileaccess {
      33             : 
      34             : 
      35             :     class shell;
      36             : 
      37             : 
      38        2934 : class XInteractionSupplyNameImpl : public cppu::WeakImplHelper1<
      39             :     css::ucb::XInteractionSupplyName >
      40             :     {
      41             :     public:
      42             : 
      43        1467 :         XInteractionSupplyNameImpl()
      44        1467 :             : m_bSelected(false)
      45             :         {
      46        1467 :         }
      47             : 
      48           0 :         virtual void SAL_CALL select()
      49             :             throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
      50             :         {
      51           0 :             m_bSelected = true;
      52           0 :         }
      53             : 
      54           0 :         void SAL_CALL setName(const OUString& Name)
      55             :             throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
      56             :         {
      57           0 :             m_aNewName = Name;
      58           0 :         }
      59             : 
      60           0 :         OUString getName() const
      61             :         {
      62           0 :             return m_aNewName;
      63             :         }
      64             : 
      65        1467 :         bool isSelected() const
      66             :         {
      67        1467 :             return m_bSelected;
      68             :         }
      69             : 
      70             :     private:
      71             : 
      72             :         bool          m_bSelected;
      73             :         OUString m_aNewName;
      74             :     };
      75             : 
      76             : 
      77             : 
      78        2934 :     class XInteractionAbortImpl : public cppu::WeakImplHelper1<
      79             :         css::task::XInteractionAbort >
      80             :     {
      81             :     public:
      82             : 
      83        1467 :         XInteractionAbortImpl()
      84        1467 :             : m_bSelected(false)
      85             :         {
      86        1467 :         }
      87             : 
      88           0 :         virtual void SAL_CALL select()
      89             :             throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
      90             :         {
      91           0 :             m_bSelected = true;
      92           0 :         }
      93             : 
      94             : 
      95        1467 :         bool isSelected() const
      96             :         {
      97        1467 :             return m_bSelected;
      98             :         }
      99             : 
     100             :     private:
     101             : 
     102             :         bool          m_bSelected;
     103             :     };
     104             : 
     105             : 
     106             : 
     107        2934 :     class XInteractionRequestImpl : public cppu::WeakImplHelper1<
     108             :         css::task::XInteractionRequest >
     109             :     {
     110             :     public:
     111             : 
     112             :         XInteractionRequestImpl(
     113             :             const OUString& aClashingName,
     114             :             const com::sun::star::uno::Reference<
     115             :             com::sun::star::uno::XInterface>& xOrigin,
     116             :             shell* pShell,
     117             :             sal_Int32 CommandId);
     118             : 
     119             :         ::com::sun::star::uno::Any SAL_CALL getRequest(  )
     120             :             throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     121             : 
     122             :         com::sun::star::uno::Sequence<
     123             :             com::sun::star::uno::Reference<
     124             :             com::sun::star::task::XInteractionContinuation > > SAL_CALL
     125           0 :         getContinuations(  )
     126             :             throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
     127             :         {
     128           0 :             return m_aSeq;
     129             :         }
     130             : 
     131        1467 :         bool aborted() const
     132             :         {
     133        1467 :             return p2->isSelected();
     134             :         }
     135             : 
     136        1467 :         OUString newName() const
     137             :         {
     138        1467 :             if( p1->isSelected() )
     139           0 :                 return p1->getName();
     140             :             else
     141        1467 :                 return OUString();
     142             :         }
     143             : 
     144             :     private:
     145             : 
     146             :         XInteractionSupplyNameImpl* p1;
     147             :         XInteractionAbortImpl* p2;
     148             :         sal_Int32 m_nErrorCode,m_nMinorError;
     149             : 
     150             :         com::sun::star::uno::Sequence<
     151             :             com::sun::star::uno::Reference<
     152             :             com::sun::star::task::XInteractionContinuation > > m_aSeq;
     153             : 
     154             :         OUString m_aClashingName;
     155             :         com::sun::star::uno::Reference<
     156             :             com::sun::star::uno::XInterface> m_xOrigin;
     157             :     };
     158             : 
     159             : }
     160             : 
     161             : 
     162             : #endif
     163             : 
     164             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10