src/hbinput/inputwidgets/hbinputscreenshotwidget.cpp
changeset 34 ed14f46c0e55
parent 7 923ff622b8b9
equal deleted inserted replaced
31:7516d6d86cf5 34:ed14f46c0e55
    33 #include "hbframedrawerpool_p.h"
    33 #include "hbframedrawerpool_p.h"
    34 
    34 
    35 #include "hbinputvkbwidget.h"
    35 #include "hbinputvkbwidget.h"
    36 
    36 
    37 /*!
    37 /*!
    38 @proto
    38 @stable
    39 @hbinput
    39 @hbinput
    40 \class HbInputVkbWidget
    40 \class HbInputScreenshotWidget
    41 \brief A base class for touch keypads.
    41 \brief The HbInputScreenshotWidget class provides screenshots of virtual keyboards for animation purposes.
    42 
    42 
    43 This class implements default mechanisms for opening and closing touch keypads.
    43 This class is used, for example, in HbInputVkbWidget when it shows an animation during a virtual keyboard change.
    44 It know how to operate in landscape and in portait modes and it know how
       
    45 implement split view -mechasnism for S60 QT UI's Hb library. It also implements
       
    46 closing mechansim, where used is able to close the touch keypad by sliding it downwards
       
    47 with a finger. This class also implements background drawing for touch keypads.
       
    48 */
    44 */
    49 
    45 
    50 /// @cond
    46 /// @cond
    51 
    47 
    52 class HbInputScreenshotWidgetPrivate : public HbWidgetPrivate
    48 class HbInputScreenshotWidgetPrivate : public HbWidgetPrivate
    76 
    72 
    77 
    73 
    78 /// @endcond
    74 /// @endcond
    79 
    75 
    80 /*!
    76 /*!
    81 Costructs the object.
    77 Constructor.
    82 */
    78 */
    83 HbInputScreenshotWidget::HbInputScreenshotWidget(QGraphicsItem *parent)
    79 HbInputScreenshotWidget::HbInputScreenshotWidget(QGraphicsItem *parent)
    84     : HbWidget(*new HbInputScreenshotWidgetPrivate, parent)
    80     : HbWidget(*new HbInputScreenshotWidgetPrivate, parent)
    85 {
    81 {
    86     Q_D(HbInputScreenshotWidget);
    82     Q_D(HbInputScreenshotWidget);
    97     setFlag(QGraphicsItem::ItemIsPanel, true);
    93     setFlag(QGraphicsItem::ItemIsPanel, true);
    98     setActive(false);
    94     setActive(false);
    99 }
    95 }
   100 
    96 
   101 /*!
    97 /*!
   102 Destructs the object.
    98 Destructor.
   103 */
    99 */
   104 HbInputScreenshotWidget::~HbInputScreenshotWidget()
   100 HbInputScreenshotWidget::~HbInputScreenshotWidget()
   105 {
   101 {
   106 }
   102 }
   107 
   103 
       
   104 /*!
       
   105 Sets \a pixmap as the current pixmap of the widget.
       
   106 */
   108 void HbInputScreenshotWidget::setScreenshot(QPixmap &pixmap)
   107 void HbInputScreenshotWidget::setScreenshot(QPixmap &pixmap)
   109 {
   108 {
   110     Q_D(HbInputScreenshotWidget);
   109     Q_D(HbInputScreenshotWidget);
   111     d->mPixmap = pixmap;
   110     d->mPixmap = pixmap;
   112 
   111 
   120         d->mIconDrawer = HbFrameDrawerPool::get(HbInputVkbHandleIcon, HbFrameDrawer::OnePiece, handleSize);
   119         d->mIconDrawer = HbFrameDrawerPool::get(HbInputVkbHandleIcon, HbFrameDrawer::OnePiece, handleSize);
   121     }
   120     }
   122 }
   121 }
   123 
   122 
   124 /*!
   123 /*!
   125 handles mouse press event.
   124 Handles a mouse press event.
   126 */
   125 */
   127 void HbInputScreenshotWidget::mousePressEvent(QGraphicsSceneMouseEvent *event)
   126 void HbInputScreenshotWidget::mousePressEvent(QGraphicsSceneMouseEvent *event)
   128 {
   127 {
   129     Q_UNUSED(event);
   128     Q_UNUSED(event);
   130 }
   129 }
   131 
   130 
   132 /*!
   131 /*!
   133 Handles mouse release event.
   132 Handles a mouse release event.
   134 */
   133 */
   135 void HbInputScreenshotWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
   134 void HbInputScreenshotWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
   136 {
   135 {
   137     Q_UNUSED(event);
   136     Q_UNUSED(event);
   138 }
   137 }
   139 
   138 
   140 /*!
   139 /*!
   141 The paint method. Draws the widget.
   140 Draws the widget. Parameters \a option and \a widget are not used.
   142 */
   141 */
   143 void HbInputScreenshotWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
   142 void HbInputScreenshotWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
   144 {
   143 {
   145     Q_UNUSED(option);
   144     Q_UNUSED(option);
   146     Q_UNUSED(widget);
   145     Q_UNUSED(widget);
   163     }
   162     }
   164 }
   163 }
   165 
   164 
   166 
   165 
   167 /*!
   166 /*!
   168 shape function actually refines the bounding rect. This function is used for collision detection
   167 Returns the bounding area of the widget as a graphical shape,
   169 and hit test.
   168 which can be used for collision detection and hit test.
   170 */
   169 */
   171 QPainterPath HbInputScreenshotWidget::shape() const
   170 QPainterPath HbInputScreenshotWidget::shape() const
   172 {
   171 {
   173     QRectF rect = boundingRect();
   172     QRectF rect = boundingRect();
   174     QPainterPath path;
   173     QPainterPath path;