javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtinput.cpp
branchRCL_3
changeset 60 6c158198356e
parent 19 04becd199f91
equal deleted inserted replaced
59:e5618cc85d74 60:6c158198356e
    22 // CSwtInput::NewL
    22 // CSwtInput::NewL
    23 // ---------------------------------------------------------------------------
    23 // ---------------------------------------------------------------------------
    24 //
    24 //
    25 CSwtInput* CSwtInput::NewL(TSwtPeer aPeer, TInt aId)
    25 CSwtInput* CSwtInput::NewL(TSwtPeer aPeer, TInt aId)
    26 {
    26 {
    27     CSwtInput* self = new(ELeave) CSwtInput(aPeer, aId);
    27     CSwtInput* self = new(ELeave) CSwtInput(aPeer);
       
    28     CleanupStack::PushL(self);
       
    29     self->ConstructL(aId);
       
    30     CleanupStack::Pop(self);
    28     return self;
    31     return self;
    29 }
    32 }
    30 
    33 
    31 // ---------------------------------------------------------------------------
    34 // ---------------------------------------------------------------------------
    32 // CSwtInput::CSwtInput
    35 // CSwtInput::CSwtInput
    33 // ---------------------------------------------------------------------------
    36 // ---------------------------------------------------------------------------
    34 //
    37 //
    35 CSwtInput::CSwtInput(TSwtPeer aPeer, TInt aId)
    38 CSwtInput::CSwtInput(TSwtPeer aPeer)
    36         : iPeer(aPeer)
    39         : iPeer(aPeer)
       
    40         , iType(KErrNotFound)
       
    41         , iLocation(KErrNotFound)
    37 {
    42 {
    38     iType = KErrNotFound;
    43 }
    39     iLocation = KErrNotFound;
    44 
       
    45 void CSwtInput::ConstructL(TInt aId)
       
    46 {
    40     RArray<CSwtMobileDevice::TSwtHwInput> inputs;
    47     RArray<CSwtMobileDevice::TSwtHwInput> inputs;
    41     CSwtMobileDevice::GetHwInputs(inputs);
    48     CleanupClosePushL(inputs);
       
    49     CSwtMobileDevice::GetHwInputsL(inputs);
    42     if (aId < inputs.Count())
    50     if (aId < inputs.Count())
    43     {
    51     {
    44         iType = inputs[aId].iType;
    52         iType = inputs[aId].iType;
    45         iLocation = inputs[aId].iLocation;
    53         iLocation = inputs[aId].iLocation;
    46     }
    54     }
    47     inputs.Close();
    55     CleanupStack::PopAndDestroy(&inputs);
    48 }
    56 }
       
    57 
    49 
    58 
    50 // ---------------------------------------------------------------------------
    59 // ---------------------------------------------------------------------------
    51 // CSwtInput::~CSwtInput
    60 // CSwtInput::~CSwtInput
    52 // ---------------------------------------------------------------------------
    61 // ---------------------------------------------------------------------------
    53 //
    62 //