Namespaces
Variants
Actions

TSS001673 - Change display mode and trigger orientation change

Jump to: navigation, search


Knowledge base identifier with text.png
Article Metadata

Tested with
Devices(s): Tested on: Nokia N95, Nokia N78,
Nokia N96, Nokia 5800 XpressMusic,
Nokia N8-00

Compatibility
Platform(s): S60 3rd Edition, FP1
S60 3rd Edition, FP2
S60 5th Edition
Symbian^3

Article
Keywords: KPSUidUikon, KUikLayoutState
Created: (23 Aug 2011)
Last edited: Forum Nokia KB (23 Aug 2011)
Note.png
Note: The required header, uikoninternalpskeys.h, is not available in the Symbian^3 SDK.

Description

This solution enables you to change the display mode and trigger the orientation change to all open apps.

Solution

Here is the code snippet for rotating orientation. KPSUidUikon is part of uikon_status_api.

CWsScreenDevice* dev = CEikonEnv::Static()->ScreenDevice();
// Orientation to landscape
TInt err = RProperty::Set( KPSUidUikon, KUikLayoutState, 1 );
if ( err == KErrNone )
{
dev->SetScreenMode( 0 );
}
// Orientation to portrait
TInt err = RProperty::Set( KPSUidUikon, KUikLayoutState, 0 );
if ( err == KErrNone )
{
dev->SetScreenMode( 0 );
}

For Symbian^3, KUikPreferredOrientation will be used to get the corresponding rotation of the device.

TInt orientation;
TInt err = RProperty::Get( KPSUidUikon, KUikPreferredOrientation, orientation );
User::LeaveIfError( err );

Comments

(no comments yet)

This page was last modified on 23 August 2011, at 07:13.
122 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2012 All rights reserved