windowing/windowserver/nga/SERVER/renderorientationtracker.h
changeset 188 1b081cb0800b
equal deleted inserted replaced
187:9f66f99ee56f 188:1b081cb0800b
       
     1 // Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This material, including documentation and any related
       
     4 // computer programs, is protected by copyright controlled by
       
     5 // Nokia. All rights are reserved. Copying, including
       
     6 // reproducing, storing, adapting or translating, any
       
     7 // or all of this material requires the prior written consent of
       
     8 // Nokia. This material also contains confidential
       
     9 // information which may not be disclosed to others without the
       
    10 // prior written consent of Nokia.
       
    11 //
       
    12 // Description:
       
    13 // Render Orientation Tracking and Publication
       
    14 // 
       
    15 
       
    16 #ifndef renderorientationtracker_h
       
    17 #define renderorientationtracker_h
       
    18 
       
    19 #include <e32std.h>
       
    20 #include <e32base.h>
       
    21 #include <e32property.h>
       
    22 #include <w32std.h>
       
    23 #include <wspublishandsubscribedata.h>
       
    24 
       
    25 // Values for the device orientation that we receive via P&S from the Theme Server
       
    26 // Todo FIX THIS Category UID!!!
       
    27 const TUid  KThemeOrientationCategory   = {0x20022E82}; // == KHbPsHardwareCoarseOrientationCategoryUid 
       
    28 const TUint KThemeOrientationKey        = 0x4F726965; // == KHbPsHardwareCoarseOrientationKey 
       
    29 
       
    30 typedef TRenderOrientation TRenderOrientationTrackingType; 
       
    31 
       
    32 class CWsWindowGroup;
       
    33 
       
    34 class CWsRenderOrienationTracker : public CActive
       
    35     {
       
    36 public:  
       
    37     static CWsRenderOrienationTracker* NewL();
       
    38     ~CWsRenderOrienationTracker();
       
    39 
       
    40     void CheckRenderOrientation();
       
    41 
       
    42 private:   
       
    43     CWsRenderOrienationTracker();
       
    44     void ConstructL();
       
    45     
       
    46     void RequestDeviceOrientationNotification();
       
    47     void CancelDeviceOrientationNotification();
       
    48     
       
    49     // CActive
       
    50     void RunL();
       
    51     void DoCancel();
       
    52     
       
    53     TInt DoOrientationTracking();
       
    54     TInt GetThemeOrientation(TRenderOrientation& aThemeOrientation);
       
    55     TInt PublishOrientation(const TRenderOrientation aRenderOrientation);
       
    56     TInt DoPublishOrientation(const TRenderOrientation aRenderOrientation);
       
    57     TInt GetIndicatedOrientation(TRenderOrientationTrackingType& aOrientationTrackingType);
       
    58     TInt CheckWindowGroupOrientation(const CWsWindowGroup& aWinGroup, TRenderOrientationTrackingType& aOrientationTrackingType);
       
    59     TBool UseableGroupWindow(const CWsWindowGroup& aWinGroup) const;
       
    60     TInt GetFocusWindowOrientation(TRenderOrientationTrackingType& aOrientationTrackingType);
       
    61     TInt FindOrientationFromWindowTree(TRenderOrientationTrackingType& aOrientationTrackingType);    
       
    62     void SetHALOrientation(const TRenderOrientation aRenderOrientation);
       
    63     
       
    64 private:    
       
    65     TRenderOrientationTrackingType  iRenderOrientationTrackingType;    
       
    66     TRenderOrientation              iPublishedRenderOrientation;
       
    67     RProperty                       iThemeOrientationProperty;
       
    68     RProperty                       iRenderOrientationPublisher;
       
    69     };
       
    70 
       
    71 #endif