kernel/eka/ewsrv/ky_capt.cpp
changeset 247 d8d70de2bd36
parent 0 a41df078684a
child 257 3e88ff8f41d5
equal deleted inserted replaced
201:43365a9b78a3 247:d8d70de2bd36
     1 // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    39 //
    39 //
    40 	{
    40 	{
    41 	iCKarray.Close();
    41 	iCKarray.Close();
    42 	}
    42 	}
    43 
    43 
       
    44 /**
       
    45 @note This function can Leave and does not obey the
       
    46 coding standard
       
    47 */
    44 void CCaptureKeys::CheckCaptureKey(const TCaptureKey& aCaptureKey)
    48 void CCaptureKeys::CheckCaptureKey(const TCaptureKey& aCaptureKey)
    45 	{
    49 	{
    46 
    50 
    47 	if ((aCaptureKey.iModifiers.iValue&~aCaptureKey.iModifiers.iMask)!=0)
    51 	if ((aCaptureKey.iModifiers.iValue&~aCaptureKey.iModifiers.iMask)!=0)
    48 		User::Leave(KErrArgument);
    52 		User::Leave(KErrArgument);
    67 	captureKey.iKeyCodePattern.iFiller = aPriority;// Priority is stored in spare data member 'iFiller'
    71 	captureKey.iKeyCodePattern.iFiller = aPriority;// Priority is stored in spare data member 'iFiller'
    68 	CheckCaptureKey(captureKey);
    72 	CheckCaptureKey(captureKey);
    69 	User::LeaveIfError(iCKarray.Insert(captureKey,0));
    73 	User::LeaveIfError(iCKarray.Insert(captureKey,0));
    70 	}
    74 	}
    71 
    75 
       
    76 /**
       
    77 @note This function can Leave and does not obey the
       
    78 coding standard
       
    79 */
    72 EXPORT_C void CCaptureKeys::SetCaptureKey(TUint32 aHandle, const TCaptureKey& aCaptureKey)
    80 EXPORT_C void CCaptureKeys::SetCaptureKey(TUint32 aHandle, const TCaptureKey& aCaptureKey)
    73 //
    81 //
    74 // Finds the first capture-key from the list that matches the handle and sets
    82 // Finds the first capture-key from the list that matches the handle and sets
    75 // it to the new value.
    83 // it to the new value.
    76 //
    84 //
    77 	{
    85 	{
    78 
    86 
    79 	SetCaptureKey(aHandle,aCaptureKey,0);
    87 	SetCaptureKey(aHandle,aCaptureKey,0);
    80 	}
    88 	}
    81 
    89 
       
    90 /**
       
    91 @note This function can Leave and does not obey the
       
    92 coding standard
       
    93 */
    82 EXPORT_C void CCaptureKeys::SetCaptureKey(TUint32 aHandle, const TCaptureKey& aCaptureKey, TUint8 aPriority)
    94 EXPORT_C void CCaptureKeys::SetCaptureKey(TUint32 aHandle, const TCaptureKey& aCaptureKey, TUint8 aPriority)
    83 //
    95 //
    84 // Finds the first capture-key from the list that matches the handle and sets
    96 // Finds the first capture-key from the list that matches the handle and sets
    85 // it to the new value.
    97 // it to the new value.
    86 //
    98 //
    92 	TCaptureKey ck;
   104 	TCaptureKey ck;
    93 	ck.iHandle=aHandle;
   105 	ck.iHandle=aHandle;
    94 	TInt r=iCKarray.Find(ck);
   106 	TInt r=iCKarray.Find(ck);
    95 	if (r>=0)
   107 	if (r>=0)
    96 		iCKarray[r]=captureKey;
   108 		iCKarray[r]=captureKey;
    97 	}
       
    98 
       
    99 void CCaptureKeys::removeCaptureKey(TUint aIndex)
       
   100 //
       
   101 // Removes the capture-key at the given aIndex from the list
       
   102 //
       
   103 	{
       
   104 
       
   105 	iCKarray.Remove(aIndex);
       
   106 	}
   109 	}
   107 
   110 
   108 EXPORT_C void CCaptureKeys::CancelCaptureKey(TUint32 aHandle)
   111 EXPORT_C void CCaptureKeys::CancelCaptureKey(TUint32 aHandle)
   109 //
   112 //
   110 // Removes the first capture-key from the list that matches the handle;
   113 // Removes the first capture-key from the list that matches the handle;