src/hbinput/inputwidgets/hbinputpopupbase.cpp
changeset 30 80e4d18b72f5
equal deleted inserted replaced
28:b7da29130b0e 30:80e4d18b72f5
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (developer.feedback@nokia.com)
       
     6 **
       
     7 ** This file is part of the HbInput module of the UI Extensions for Mobile.
       
     8 **
       
     9 ** GNU Lesser General Public License Usage
       
    10 ** This file may be used under the terms of the GNU Lesser General Public
       
    11 ** License version 2.1 as published by the Free Software Foundation and
       
    12 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
       
    13 ** Please review the following information to ensure the GNU Lesser General
       
    14 ** Public License version 2.1 requirements will be met:
       
    15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    16 **
       
    17 ** In addition, as a special exception, Nokia gives you certain additional
       
    18 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    20 **
       
    21 ** If you have questions regarding the use of this file, please contact
       
    22 ** Nokia at developer.feedback@nokia.com.
       
    23 **
       
    24 ****************************************************************************/
       
    25 #include "hbinputpopupbase.h"
       
    26 #include "hbinputpopupbase_p.h"
       
    27 
       
    28 #include <hbinputmethod.h>
       
    29 
       
    30 /*!
       
    31 @stable
       
    32 @hbinput
       
    33 \class HbInputPopupBase
       
    34 \brief Base class for input popups
       
    35 
       
    36 HbInputPopupBase creates a layer on top of HbDialog and it is
       
    37 used as a base class for all popups that are used with virtual
       
    38 keyboards. Inherited popup is set as an inactive panel and
       
    39 popup priority is set based on the focused editor.
       
    40 
       
    41 \sa HbDialog
       
    42 */
       
    43 HbInputPopupBase::HbInputPopupBase(QGraphicsItem *parent)
       
    44     : HbDialog(*new HbInputPopupBasePrivate(), parent)
       
    45 {
       
    46 }
       
    47 
       
    48 /*!
       
    49 Constructs input popup
       
    50 */
       
    51 HbInputPopupBase::HbInputPopupBase(HbInputPopupBasePrivate &dd, QGraphicsItem *parent)
       
    52     : HbDialog(dd, parent)
       
    53 {
       
    54 }
       
    55 
       
    56 /*!
       
    57 Destructs the object.
       
    58 */
       
    59 HbInputPopupBase::~HbInputPopupBase()
       
    60 {
       
    61 }
       
    62 
       
    63 /*!
       
    64 /reimp
       
    65 */
       
    66 void HbInputPopupBase::showEvent(QShowEvent *event)
       
    67 {
       
    68     Q_D(HbInputPopupBase);
       
    69 
       
    70     // Make sure the input popup never steals focus.
       
    71     setFlag(QGraphicsItem::ItemIsPanel, true);
       
    72     d->mActivePopup = false;
       
    73     setActive(false);
       
    74 
       
    75     HbInputMethod *inputMethod = HbInputMethod::activeInputMethod();
       
    76     if (inputMethod && inputMethod->focusObject()) {
       
    77         d->setPriority(inputMethod->focusObject()->editorPriority());
       
    78     }
       
    79 
       
    80     HbDialog::showEvent(event);
       
    81 }
       
    82 
       
    83 // End of file