src/gui/kernel/qt_s60_p.h
changeset 37 758a864f9613
parent 33 3e2da88830cd
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
    85 const TInt KInternalStatusPaneChange = 0x50000000;
    85 const TInt KInternalStatusPaneChange = 0x50000000;
    86 
    86 
    87 //this macro exists because EColor16MAP enum value doesn't exist in Symbian OS 9.2
    87 //this macro exists because EColor16MAP enum value doesn't exist in Symbian OS 9.2
    88 #define Q_SYMBIAN_ECOLOR16MAP TDisplayMode(13)
    88 #define Q_SYMBIAN_ECOLOR16MAP TDisplayMode(13)
    89 
    89 
    90 class QS60ThreadLocalData
    90 class Q_AUTOTEST_EXPORT QS60ThreadLocalData
    91 {
    91 {
    92 public:
    92 public:
    93     QS60ThreadLocalData();
    93     QS60ThreadLocalData();
    94     ~QS60ThreadLocalData();
    94     ~QS60ThreadLocalData();
    95     bool usingCONEinstances;
    95     bool usingCONEinstances;
   139     int virtualMouseRequired : 1;
   139     int virtualMouseRequired : 1;
   140     int qtOwnsS60Environment : 1;
   140     int qtOwnsS60Environment : 1;
   141     int supportsPremultipliedAlpha : 1;
   141     int supportsPremultipliedAlpha : 1;
   142     int avkonComponentsSupportTransparency : 1;
   142     int avkonComponentsSupportTransparency : 1;
   143     int menuBeingConstructed : 1;
   143     int menuBeingConstructed : 1;
   144     int memoryLimitForHwRendering;
       
   145     QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type
   144     QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type
       
   145 
       
   146     enum ScanCodeState {
       
   147         Unpressed,
       
   148         KeyDown,
       
   149         KeyDownAndKey
       
   150     };
       
   151     QHash<TInt, ScanCodeState> scanCodeStates;
       
   152 
   146     static inline void updateScreenSize();
   153     static inline void updateScreenSize();
   147     inline RWsSession& wsSession();
   154     inline RWsSession& wsSession();
   148     static inline RWindowGroup& windowGroup();
   155     static inline RWindowGroup& windowGroup();
   149     inline CWsScreenDevice* screenDevice();
   156     inline CWsScreenDevice* screenDevice();
   150     static inline CCoeAppUi* appUi();
   157     static inline CCoeAppUi* appUi();
   153     static inline CEikStatusPane* statusPane();
   160     static inline CEikStatusPane* statusPane();
   154     static inline CCoeControl* statusPaneSubPane(TInt aPaneId);
   161     static inline CCoeControl* statusPaneSubPane(TInt aPaneId);
   155     static inline CAknTitlePane* titlePane();
   162     static inline CAknTitlePane* titlePane();
   156     static inline CAknContextPane* contextPane();
   163     static inline CAknContextPane* contextPane();
   157     static inline CEikButtonGroupContainer* buttonGroupContainer();
   164     static inline CEikButtonGroupContainer* buttonGroupContainer();
   158 #endif
   165     static void setStatusPaneAndButtonGroupVisibility(bool statusPaneVisible, bool buttonGroupVisible);
       
   166 #endif
       
   167     static void controlVisibilityChanged(CCoeControl *control, bool visible);
   159 
   168 
   160 #ifdef Q_OS_SYMBIAN
   169 #ifdef Q_OS_SYMBIAN
   161     TTrapHandler *s60InstalledTrapHandler;
   170     TTrapHandler *s60InstalledTrapHandler;
   162 #endif
   171 #endif
   163 };
   172 };
   164 
   173 
   165 QS60Data* qGlobalS60Data();
   174 Q_AUTOTEST_EXPORT QS60Data* qGlobalS60Data();
   166 #define S60 qGlobalS60Data()
   175 #define S60 qGlobalS60Data()
   167 
   176 
   168 class QAbstractLongTapObserver
   177 class QAbstractLongTapObserver
   169 {
   178 {
   170 public:
   179 public:
   200     void setIgnoreFocusChanged(bool enabled) { m_ignoreFocusChanged = enabled; }
   209     void setIgnoreFocusChanged(bool enabled) { m_ignoreFocusChanged = enabled; }
   201     void CancelLongTapTimer();
   210     void CancelLongTapTimer();
   202 
   211 
   203     void setFocusSafely(bool focus);
   212     void setFocusSafely(bool focus);
   204 
   213 
       
   214     bool isControlActive();
       
   215 
   205 #ifdef Q_WS_S60
   216 #ifdef Q_WS_S60
   206     void FadeBehindPopup(bool fade){ popupFader.FadeBehindPopup( this, this, fade); }
   217     void FadeBehindPopup(bool fade){ popupFader.FadeBehindPopup( this, this, fade); }
   207     void HandleStatusPaneSizeChange();
   218     void HandleStatusPaneSizeChange();
   208 
   219 
   209 protected: // from MAknFadedComponent
   220 protected: // from MAknFadedComponent
   221     void FocusChanged(TDrawNow aDrawNow);
   232     void FocusChanged(TDrawNow aDrawNow);
   222 
   233 
   223 private:
   234 private:
   224     void HandlePointerEvent(const TPointerEvent& aPointerEvent);
   235     void HandlePointerEvent(const TPointerEvent& aPointerEvent);
   225     TKeyResponse OfferKeyEvent(const TKeyEvent& aKeyEvent,TEventCode aType);
   236     TKeyResponse OfferKeyEvent(const TKeyEvent& aKeyEvent,TEventCode aType);
       
   237     TKeyResponse sendSymbianKeyEvent(const TKeyEvent &keyEvent, QEvent::Type type);
   226     TKeyResponse sendKeyEvent(QWidget *widget, QKeyEvent *keyEvent);
   238     TKeyResponse sendKeyEvent(QWidget *widget, QKeyEvent *keyEvent);
       
   239     TKeyResponse handleVirtualMouse(const TKeyEvent& keyEvent,TEventCode type);
   227     bool sendMouseEvent(QWidget *widget, QMouseEvent *mEvent);
   240     bool sendMouseEvent(QWidget *widget, QMouseEvent *mEvent);
   228     void sendMouseEvent(
   241     void sendMouseEvent(
   229             QWidget *receiver,
   242             QWidget *receiver,
   230             QEvent::Type type,
   243             QEvent::Type type,
   231             const QPoint &globalPos,
   244             const QPoint &globalPos,
   234     void processTouchEvent(int pointerNumber, TPointerEvent::TType type, QPointF screenPos, qreal pressure);
   247     void processTouchEvent(int pointerNumber, TPointerEvent::TType type, QPointF screenPos, qreal pressure);
   235     void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation );
   248     void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation );
   236 #ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
   249 #ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
   237     void translateAdvancedPointerEvent(const TAdvancedPointerEvent *event);
   250     void translateAdvancedPointerEvent(const TAdvancedPointerEvent *event);
   238 #endif
   251 #endif
       
   252 
       
   253 public:
   239     void handleClientAreaChange();
   254     void handleClientAreaChange();
   240 
   255 
   241 private:
   256 private:
   242     static QSymbianControl *lastFocusedControl;
   257     static QSymbianControl *lastFocusedControl;
   243 
   258 
   276   virtualMouseRequired(0),
   291   virtualMouseRequired(0),
   277   qtOwnsS60Environment(0),
   292   qtOwnsS60Environment(0),
   278   supportsPremultipliedAlpha(0),
   293   supportsPremultipliedAlpha(0),
   279   avkonComponentsSupportTransparency(0),
   294   avkonComponentsSupportTransparency(0),
   280   menuBeingConstructed(0),
   295   menuBeingConstructed(0),
   281   memoryLimitForHwRendering(0),
       
   282   s60ApplicationFactory(0)
   296   s60ApplicationFactory(0)
   283 #ifdef Q_OS_SYMBIAN
   297 #ifdef Q_OS_SYMBIAN
   284   ,s60InstalledTrapHandler(0)
   298   ,s60InstalledTrapHandler(0)
   285 #endif
   299 #endif
   286 {
   300 {