class CAlfViewportLayout : public CAlfLayout |
// Aim is to zoom into one of the grids of icons using a viewport layout. // Create a anchor layout and grid layout into the parent anchor layout and // populate it with application icons. // The viewport layout sits in the middle of the screen. parent->SetRelativeAnchorRect(1, EAlfAnchorOriginHCenter, EAlfAnchorOriginVCenter, TAlfRealPoint(-0.2, -0.2), EAlfAnchorOriginHCenter, EAlfAnchorOriginVCenter, TAlfRealPoint(0.2, 0.2)); // Create the viewport. CAlfViewportLayout* viewport = CAlfViewportLayout::AddNewL(*this, parent); // Set our virtual coordinate system to be based on the number of items in the grid (KNumGridItems). viewport->SetVirtualSize(TAlfRealSize(KNumGridItems, 1.0), 0); // Set the size and position of the viewport to look at the middle icon in the list. viewport->SetViewportSize(TAlfRealSize(2, 1.0/6.0), 0); viewport->SetViewportPos(TAlfRealPoint(TReal32(KNumGridItems/2)-1.0f, 5.0/12.0), 0); // This anchor layout will contain a strip of large icons clipped by the viewport window. CAlfAnchorLayout* zoomedParent = CAlfAnchorLayout::AddNewL(*this, viewport);
Public Member Functions | |
---|---|
CAlfViewportLayout() | |
~CAlfViewportLayout() | |
IMPORT_C CAlfViewportLayout * | AddNewL(CAlfControl &, CAlfLayout *) |
IMPORT_C TAlfXYMetric | BaseUnit() |
IMPORT_C void | ConstructL(CAlfControl &) |
IMPORT_C CAlfVisual * | FindTag(const TDesC8 &) |
IMPORT_C void | RemoveAndDestroyAllD() |
IMPORT_C void | SetViewportPos(const TAlfRealPoint &, TInt) |
IMPORT_C void | SetViewportSize(const TAlfRealSize &, TInt) |
IMPORT_C void | SetVirtualSize(const TAlfRealSize &, TInt) |
IMPORT_C void | UpdateChildrenLayout(TInt) |
Protected Member Functions | |
---|---|
IMPORT_C void | DoRemoveAndDestroyAllD() |
IMPORT_C void | PropertyOwnerExtension(const TUid &, TAny **) |
Inherited Enumerations | |
---|---|
CAlfLayout:TExpansionFlags |
Private Attributes | |
---|---|
TViewportLayoutPrivateData * | iViewportLayoutData |
IMPORT_C CAlfViewportLayout * | AddNewL | ( | CAlfControl & | aOwnerControl, |
CAlfLayout * | aParentLayout = 0 | |||
) | [static] |
Two-phased constructor, which attach new object into the control.
CAlfControl & aOwnerControl | Control that owns this new obejct. |
CAlfLayout * aParentLayout = 0 | If given, the new object is set as child. |
IMPORT_C void | ConstructL | ( | CAlfControl & | aOwner | ) | [virtual] |
Second-phase constructor.
CAlfControl & aOwner |
IMPORT_C void | DoRemoveAndDestroyAllD | ( | ) | [protected, virtual] |
From CAlfVisual CAlfVisual
IMPORT_C CAlfVisual * | FindTag | ( | const TDesC8 & | aTag | ) | [virtual] |
CAlfVisual Finds a visual whose tag descriptor contains a specific tag.
CAlfLayout::FindTag() extends the search into child visuals, covering recursively entire visual hierarchies.
Todo: how should several visuals with matching tag to be handled ??
CAlfVisual::Tag() CAlfVisual::SetTagL() CAlfVisual::IsTagged() CAlfVisual::FindTag()
const TDesC8 & aTag | Tag to look for. If this tag is found as a part of a visual's colon-separated tag descriptor, it is treated as a match and the visual is returned. The tag to look for cannot contain separator characters (:). |
IMPORT_C void | PropertyOwnerExtension | ( | const TUid & | aExtensionUid, |
TAny ** | aExtensionParams | |||
) | [protected, virtual] |
! future proofing
IMPORT_C void | SetViewportPos | ( | const TAlfRealPoint & | aPos, |
TInt | aTransitionTime | |||
) |
Set position of the viewport area.
This is the offset of the "window" we are using to look at the visual.
const TAlfRealPoint & aPos | |
TInt aTransitionTime | The time it will take to complete moving the viewport area. |
IMPORT_C void | SetViewportSize | ( | const TAlfRealSize & | aSize, |
TInt | aTransitionTime | |||
) |
Set size of the viewport area.
This is the size of the "window" we are using to look at the visual.
const TAlfRealSize & aSize | The size of the viewport in the units defined by SetVirtualSize(). |
TInt aTransitionTime | The time it will take to complete the resizing of the viewport area. |
IMPORT_C void | SetVirtualSize | ( | const TAlfRealSize & | aSize, |
TInt | aTransitionTime | |||
) |
Set virtual size of the viewable area.
This is different from the physical size of the viewport - it defines the coordinate space that is used for scrolling. To use a normalised (u, v) coordinate mapping system, set aSize to (,1.0, 1.0).
const TAlfRealSize & aSize | The bottom-right corner of the child visual, in the units you wish to use for positioning the viewport. |
TInt aTransitionTime | The time it will take to complete the resizing of the virtual size. |
IMPORT_C void | UpdateChildrenLayout | ( | TInt | aTransitionTime = 0 | ) | [virtual] |
CAlfVisual Update the layout of all children. Subclasses can call this to recalculate the layout of all children.
TInt aTransitionTime = 0 | Time for layout transition in milliseconds. Any negative value uses value given in CAlfEnv::StaticSetLayoutTransitionTime() |
TViewportLayoutPrivateData * | iViewportLayoutData | [private] |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.