javaextensions/bluetooth/bluetoothcommons/inc.s60/bluetoothnamelookup.h
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2008 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 
       
    19 #ifndef BLUETOOTHNAMELOOKUP_H
       
    20 #define BLUETOOTHNAMELOOKUP_H
       
    21 
       
    22 #include <bt_sock.h>
       
    23 #include "logger.h"
       
    24 #include "bluetoothfunctionserver.h"
       
    25 #include "monitor.h"
       
    26 
       
    27 namespace java
       
    28 {
       
    29 namespace bluetooth
       
    30 {
       
    31 
       
    32 class BluetoothNameLookup: public CActive
       
    33 {
       
    34 public:
       
    35 
       
    36     OS_IMPORT static BluetoothNameLookup* NewL();
       
    37 
       
    38     OS_IMPORT ~BluetoothNameLookup();
       
    39 
       
    40     void RunL();
       
    41 
       
    42     void DoCancel();
       
    43 
       
    44     OS_IMPORT std::wstring * doDeviceNameLookupL(TInt64 devAddr);
       
    45 
       
    46 private:
       
    47     //Create Lookup object and add to active scheduler
       
    48     BluetoothNameLookup():CActive(EPriorityStandard)
       
    49     {
       
    50         CActiveScheduler::Add(this);
       
    51     }
       
    52 
       
    53 
       
    54     void constructL();
       
    55 
       
    56     void nameLookupCompleted(int aStatus, std::wstring* deviceName);
       
    57 private:
       
    58 
       
    59     int mLookupStatus;
       
    60     std::wstring* mLookupName;
       
    61 
       
    62     RSocketServ mSocketServ;
       
    63     RHostResolver mHostResolver;
       
    64     TInquirySockAddr mSockAddr;
       
    65     TNameEntry mNameEntry;
       
    66     // Name Lookup Data
       
    67     CActiveSchedulerWait* mLookupMonitor;
       
    68 };
       
    69 
       
    70 } //end namespace bluetooth
       
    71 } //end namespace java
       
    72 
       
    73 #endif // BLUETOOTHNAMELOOKUP_H