Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Full-screen mode on touch UI

From Wiki
Jump to: navigation, search
Article Metadata
Compatibility
Platform(s): S60 5th Edition
S60 5th Edition
Article
Keywords: AknLayoutUtils::LayoutMetricsRect(), AknLayoutUtils::EApplicationWindow, AknLayoutUtils::EControlPane, AknLayoutUtils::CbaLocation(), AknLayoutUtils::TAknCbaLocation
Created: Damavik (18 Dec 2008)
Last edited: hamishwillee (18 Sep 2012)

Contents

Overview

Devices built on S60 5th Edition Touch UI API don't have hardware CBA buttons, thus it is obvious that if we want to use full-screen mode we shouldn't hide the control pane. Otherwise the user is unable to access menu etc.

To calculate actual full-screen mode application rectangle (e.g. taking into consideration the rectangular control pane), we could utilize usage of the Avkon helper class AknLayoutUtils.


MMP file

LIBRARY avkon.lib
LIBRARY eikcore.lib
CAPABILITY could be self-signed


Header file

class CAknViewClass: public CAknView ...
{
...
public:
void ConstructL();
void SetFullRect();
private:
void CalculateFullscreenRect();
private:
TRect iFullRect;
...
};
class CAknAppUiClass: public CAknAppUi
{
...
protected:
void HandleResourceChangeL( TInt aType );
 
private:
CAknViewClass* iViewInstance;
...
};


Source file

#include <AknUtils.h> 
...
void CAknViewClass::ConstructL()
{
...
// Calculate actual full-screen mode rect
CalculateFullscreenRect();
// Set view extent
SetRect(iFullRect);
...
}
 
void CAknViewClass:SetFullRect()
{
SetRect(iFullRect);
}
...
void CAknViewClass::CalculateFullscreenRect()
{
// Window that fills the entire screen
TRect temp_rect;
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EApplicationWindow, temp_rect);
iFullRect = temp_rect;
 
// Rect that occupied by control pane (i.e. CBA)
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, temp_rect);
 
// Calculate final rect which depends on CBA location
AknLayoutUtils::TAknCbaLocation cba_location = AknLayoutUtils::CbaLocation();
 
switch(cba_location) {
case AknLayoutUtils::EAknCbaLocationBottom:
iFullRect.iBr.iY -= temp_rect.Height();
break;
 
case AknLayoutUtils::EAknCbaLocationLeft:
iFullRect.iTl.iX += temp_rect.Width();
break;
 
case AknLayoutUtils::EAknCbaLocationRight:
iFullRect.iBr.iX -= temp_rect.Width();
break;
 
default:
break;
}
}
CAknAppUiClass::HandleResourceChangeL( TInt aType )
{
...
iViewInstance->CalculateFullscreenRect();
 
iViewInstance->SetFullRect();
...
}


Postconditions

Full-screen mode could be enabled in applications with support for touch UI.


See also

How to make a full-screen application using Symbian C++

This page was last modified on 18 September 2012, at 05:33.
39 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×