camerauis/cameraxui/cxengine/tsrc/unit/system_include/harvesterclient.cpp
branchRCL_3
changeset 54 bac7acad7cb3
parent 53 61bc0f252b2b
child 57 2c87b2808fd7
equal deleted inserted replaced
53:61bc0f252b2b 54:bac7acad7cb3
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #include "cxutils.h"
       
    19 #include "harvesterclient.h"
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /*!
       
    25 * RHarvesterClient::RHarvesterClient
       
    26 */
       
    27 RHarvesterClient::RHarvesterClient()
       
    28 {
       
    29 
       
    30 }
       
    31 
       
    32 
       
    33 /*!
       
    34 * open connection.
       
    35 */
       
    36 int RHarvesterClient::Connect()
       
    37 {
       
    38     return KErrNone;
       
    39 }
       
    40 
       
    41 
       
    42 
       
    43 /*!
       
    44 * close connection.
       
    45 */
       
    46 void RHarvesterClient::Close()
       
    47 {
       
    48     // nothing to do
       
    49 }
       
    50 
       
    51 
       
    52 
       
    53 /*!
       
    54 * register observer for receiving harvestcomplete callbacks.
       
    55 */
       
    56 void RHarvesterClient::SetObserver(MHarvestObserver* aObserver)
       
    57 {
       
    58     CX_DEBUG_ENTER_FUNCTION();
       
    59     mObserver = aObserver;
       
    60     CX_DEBUG_EXIT_FUNCTION();
       
    61 }
       
    62 
       
    63 
       
    64 
       
    65 /*!
       
    66 * remove observer for any harvest complete callbacks.
       
    67 */
       
    68 void RHarvesterClient::RemoveObserver(MHarvestObserver* aObserver)
       
    69 {
       
    70     CX_DEBUG_ENTER_FUNCTION();
       
    71 
       
    72     if(aObserver == mObserver) {
       
    73         mObserver = NULL;
       
    74     }
       
    75 
       
    76     CX_DEBUG_EXIT_FUNCTION();
       
    77 }
       
    78 
       
    79 
       
    80 /*!
       
    81 * harvest file
       
    82 */
       
    83 void RHarvesterClient::HarvestFile(const TDesC& aURI, RArray<TUint32> &aAlbumIds, TBool aAddLocation)
       
    84 {
       
    85     Q_UNUSED(aAlbumIds);
       
    86     Q_UNUSED(aAddLocation);
       
    87 
       
    88     int error = KErrNone;
       
    89 
       
    90     if (aURI == KNullDesC) {
       
    91         error = KErrNotFound;
       
    92     }
       
    93 
       
    94     if (mObserver) {
       
    95         TFileName filename = aURI;
       
    96         // file harvested, inform clients
       
    97         mObserver->HarvestingComplete(filename, error);
       
    98     }
       
    99 
       
   100 }