mtpfws/mtpfw/dataproviders/dataproviderapi/src/mtpobjectmgrquerytypes.cpp
changeset 0 d0791faffa3f
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @publishedPartner
       
    19 */
       
    20 
       
    21 #include <d32dbms.h>
       
    22 #include <mtp/mtpobjectmgrquerytypes.h>
       
    23 
       
    24 EXPORT_C TMTPObjectMgrQueryParams::TMTPObjectMgrQueryParams(TUint32 aStorageId, TUint32 aFormatCode, TUint32 aParentHandle, TUint32 aDpId) :
       
    25     iStorageId(aStorageId),
       
    26     iFormatCode(aFormatCode),
       
    27     iParentHandle(aParentHandle),
       
    28     iDpId(aDpId)
       
    29     {
       
    30     
       
    31     }
       
    32 
       
    33 EXPORT_C RMTPObjectMgrQueryContext::RMTPObjectMgrQueryContext() :
       
    34     iContext(NULL)
       
    35     {
       
    36     
       
    37     }
       
    38     
       
    39 EXPORT_C void RMTPObjectMgrQueryContext::Close()
       
    40     {
       
    41     if (iContext)
       
    42         {
       
    43         RDbView* view(reinterpret_cast<RDbView*>(iContext));
       
    44         view->Close();
       
    45         delete view;
       
    46         iContext = NULL;
       
    47         }
       
    48     }
       
    49     
       
    50 EXPORT_C TBool RMTPObjectMgrQueryContext::QueryComplete() const
       
    51     {
       
    52     return (!IsOpen());
       
    53     }
       
    54     
       
    55 EXPORT_C RDbView& RMTPObjectMgrQueryContext::DbView()
       
    56     {
       
    57     __ASSERT_DEBUG(iContext, User::Invariant());
       
    58     return (*reinterpret_cast<RDbView*>(iContext));
       
    59     }
       
    60     
       
    61 EXPORT_C void RMTPObjectMgrQueryContext::OpenL()
       
    62     {
       
    63     iContext = reinterpret_cast<TAny*>(new(ELeave) RDbView);
       
    64     }
       
    65     
       
    66 EXPORT_C TBool RMTPObjectMgrQueryContext::IsOpen() const
       
    67     {
       
    68     return (iContext != NULL);
       
    69     }