src/gui/kernel/qt_s60_p.h
branchGCC_SURGE
changeset 31 5daf16870df6
parent 30 5dc02b23752f
child 33 3e2da88830cd
equal deleted inserted replaced
27:93b982ccede2 31:5daf16870df6
    60 #include "QtGui/qfont.h"
    60 #include "QtGui/qfont.h"
    61 #include "QtGui/qimage.h"
    61 #include "QtGui/qimage.h"
    62 #include "QtGui/qevent.h"
    62 #include "QtGui/qevent.h"
    63 #include "qpointer.h"
    63 #include "qpointer.h"
    64 #include "qapplication.h"
    64 #include "qapplication.h"
       
    65 #include "qelapsedtimer.h"
    65 #include <w32std.h>
    66 #include <w32std.h>
    66 #include <coecntrl.h>
    67 #include <coecntrl.h>
    67 #include <eikenv.h>
    68 #include <eikenv.h>
    68 #include <eikappui.h>
    69 #include <eikappui.h>
    69 
    70 
   100     int screenWidthInTwips;
   101     int screenWidthInTwips;
   101     int screenHeightInTwips;
   102     int screenHeightInTwips;
   102     int defaultDpiX;
   103     int defaultDpiX;
   103     int defaultDpiY;
   104     int defaultDpiY;
   104     WId curWin;
   105     WId curWin;
   105     int virtualMouseLastKey;
       
   106     enum PressedKeys {
   106     enum PressedKeys {
   107         Select = 0x1,
   107         Select = 0x1,
   108         Right = 0x2,
   108         Right = 0x2,
   109         Down = 0x4,
   109         Down = 0x4,
   110         Left = 0x8,
   110         Left = 0x8,
   111         Up = 0x10
   111         Up = 0x10,
       
   112         LeftUp = 0x20,
       
   113         RightUp = 0x40,
       
   114         RightDown = 0x80,
       
   115         LeftDown = 0x100
   112     };
   116     };
   113     int virtualMousePressedKeys; // of the above type, but avoids casting problems
   117     int virtualMousePressedKeys; // of the above type, but avoids casting problems
   114     int virtualMouseAccel;
   118     int virtualMouseAccelDX;
       
   119     int virtualMouseAccelDY;
       
   120     QElapsedTimer virtualMouseAccelTimeout;
   115     int virtualMouseMaxAccel;
   121     int virtualMouseMaxAccel;
   116 #ifndef Q_SYMBIAN_FIXED_POINTER_CURSORS
   122 #ifndef Q_SYMBIAN_FIXED_POINTER_CURSORS
   117     int brokenPointerCursors : 1;
   123     int brokenPointerCursors : 1;
   118 #endif
   124 #endif
   119     int hasTouchscreen : 1;
   125     int hasTouchscreen : 1;
   153 class QLongTapTimer;
   159 class QLongTapTimer;
   154 
   160 
   155 
   161 
   156 class QSymbianControl : public CCoeControl, public QAbstractLongTapObserver
   162 class QSymbianControl : public CCoeControl, public QAbstractLongTapObserver
   157 #ifdef Q_WS_S60
   163 #ifdef Q_WS_S60
   158 , public MAknFadedComponent
   164 , public MAknFadedComponent, public MEikStatusPaneObserver
   159 #endif
   165 #endif
   160 {
   166 {
   161 public:
   167 public:
   162     DECLARE_TYPE_ID(0x51740000) // Fun fact: the two first values are "Qt" in ASCII.
   168     DECLARE_TYPE_ID(0x51740000) // Fun fact: the two first values are "Qt" in ASCII.
   163 
   169 
   181 
   187 
   182     void setFocusSafely(bool focus);
   188     void setFocusSafely(bool focus);
   183 
   189 
   184 #ifdef Q_WS_S60
   190 #ifdef Q_WS_S60
   185     void FadeBehindPopup(bool fade){ popupFader.FadeBehindPopup( this, this, fade); }
   191     void FadeBehindPopup(bool fade){ popupFader.FadeBehindPopup( this, this, fade); }
       
   192     void HandleStatusPaneSizeChange();
   186 
   193 
   187 protected: // from MAknFadedComponent
   194 protected: // from MAknFadedComponent
   188     TInt CountFadedComponents() {return 1;}
   195     TInt CountFadedComponents() {return 1;}
   189     CCoeControl* FadedComponent(TInt /*aIndex*/) {return this;}
   196     CCoeControl* FadedComponent(TInt /*aIndex*/) {return this;}
   190 #else
   197 #else
   219     static QSymbianControl *lastFocusedControl;
   226     static QSymbianControl *lastFocusedControl;
   220 
   227 
   221 private:
   228 private:
   222     QWidget *qwidget;
   229     QWidget *qwidget;
   223     QLongTapTimer* m_longTapDetector;
   230     QLongTapTimer* m_longTapDetector;
       
   231     QElapsedTimer m_doubleClickTimer;
   224     bool m_ignoreFocusChanged : 1;
   232     bool m_ignoreFocusChanged : 1;
   225     bool m_symbianPopupIsOpen : 1;
   233     bool m_symbianPopupIsOpen : 1;
   226 
   234 
   227 #ifdef Q_WS_S60
   235 #ifdef Q_WS_S60
   228     // Fader object used to fade everything except this menu and the CBA.
   236     // Fader object used to fade everything except this menu and the CBA.
   243     S60->screenWidthInPixels = params.iPixelSize.iWidth;
   251     S60->screenWidthInPixels = params.iPixelSize.iWidth;
   244     S60->screenHeightInPixels = params.iPixelSize.iHeight;
   252     S60->screenHeightInPixels = params.iPixelSize.iHeight;
   245     S60->screenWidthInTwips = params.iTwipsSize.iWidth;
   253     S60->screenWidthInTwips = params.iTwipsSize.iWidth;
   246     S60->screenHeightInTwips = params.iTwipsSize.iHeight;
   254     S60->screenHeightInTwips = params.iTwipsSize.iHeight;
   247 
   255 
   248     S60->virtualMouseMaxAccel = qMax(S60->screenHeightInPixels, S60->screenWidthInPixels) / 20;
   256     S60->virtualMouseMaxAccel = qMax(S60->screenHeightInPixels, S60->screenWidthInPixels) / 10;
   249 
   257 
   250     TReal inches = S60->screenHeightInTwips / (TReal)KTwipsPerInch;
   258     TReal inches = S60->screenHeightInTwips / (TReal)KTwipsPerInch;
   251     S60->defaultDpiY = S60->screenHeightInPixels / inches;
   259     S60->defaultDpiY = S60->screenHeightInPixels / inches;
   252     inches = S60->screenWidthInTwips / (TReal)KTwipsPerInch;
   260     inches = S60->screenWidthInTwips / (TReal)KTwipsPerInch;
   253     S60->defaultDpiX = S60->screenWidthInPixels / inches;
   261     S60->defaultDpiX = S60->screenWidthInPixels / inches;