camerauis/cameraxui/cxui/src/cxuicapturekeyhandler.cpp
branchRCL_3
changeset 24 bac7acad7cb3
parent 23 61bc0f252b2b
child 25 2c87b2808fd7
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
     1 /*
       
     2 * Copyright (c) 2009-2010 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 <QVariant>
       
    19 #include <QKeyEvent>
       
    20 
       
    21 #include "cxuicapturekeyhandler.h"
       
    22 #ifdef Q_OS_SYMBIAN
       
    23 #include "cxuicapturekeyhandler_symbian_p.h"
       
    24 #else
       
    25 #include "cxuicapturekeyhandler_desktop_p.h"
       
    26 #endif
       
    27 
       
    28 #include "cxutils.h"
       
    29 #include "cxeengine.h"
       
    30 #include "cxenamespace.h"
       
    31 #include "cxefeaturemanager.h"
       
    32 
       
    33 
       
    34 
       
    35 CxuiCaptureKeyHandler::CxuiCaptureKeyHandler(CxeEngine &aEngine) :
       
    36         d_ptr(NULL)
       
    37 {
       
    38     d_ptr = new CxuiCaptureKeyHandlerPrivate(aEngine, this);
       
    39     
       
    40     d_ptr->startListeningKeys();
       
    41 }
       
    42 
       
    43 CxuiCaptureKeyHandler::~CxuiCaptureKeyHandler()
       
    44 {    
       
    45     CX_DEBUG_ENTER_FUNCTION();
       
    46 
       
    47     Q_D(CxuiCaptureKeyHandler);
       
    48     d->stopListeningKeys();
       
    49 
       
    50     delete d;
       
    51 
       
    52     CX_DEBUG_EXIT_FUNCTION();
       
    53 }
       
    54 
       
    55 void CxuiCaptureKeyHandler::startListeningKeys()
       
    56 {
       
    57     Q_D(CxuiCaptureKeyHandler);
       
    58     d->startListeningKeys();
       
    59 }
       
    60 
       
    61 void CxuiCaptureKeyHandler::stopListeningKeys()
       
    62 {
       
    63     Q_D(CxuiCaptureKeyHandler);
       
    64     d->stopListeningKeys();
       
    65 }
       
    66 
       
    67 bool CxuiCaptureKeyHandler::isAutofocusKeyPressed()
       
    68 {
       
    69     Q_D(CxuiCaptureKeyHandler);
       
    70     return d->isAutofocusKeyPressed();
       
    71 }
       
    72 
       
    73 bool CxuiCaptureKeyHandler::isCaptureKeyPressed()
       
    74 {
       
    75     Q_D(CxuiCaptureKeyHandler);
       
    76     return d->isCaptureKeyPressed();
       
    77 }
       
    78 
       
    79 bool CxuiCaptureKeyHandler::handleKeyEvent(QEvent *event)
       
    80 {
       
    81     Q_D(CxuiCaptureKeyHandler);
       
    82     return d->handleKeyEvent(event);
       
    83 }
       
    84 
       
    85 // end of file