CAlfCompositionSource Class Reference

class CAlfCompositionSource : public CAlfCompositionClientBase

Example1: // to set target semitransparent CAlfCompositionSource* me = CAlfCompositionSource::NewL(iMyDrawableWindow); me->EnableAlpha(); me->SetOpacity(0.5f); //... delete me; // deletion of client will restore state to original

Example2: // to fade in for composition target class CMyClass: public CBase, private MAlfCompositionObserver { CMyClass():iOpacity(0) { } ConstructL() { // ... iAlfCompositionSource = CAlfCompositionSource::NewL(iMyDrawableWindow); iAlfCompositionSource->EnableAlpha(); iAlfCompositionSource->SetOpacity(iOpacity); }

void FrameReady(TInt aScreenNumber) { if (iOpacity < 1) { iOpacity += 0.03; // just follow refresh linearly iAlfCompositionSource->SetOpacity(iOpacity); } else { // fade in complete, no need to have composition cntrl anymore delete iAlfCompositionSource; iAlfCompositionSource = 0; } }

Example 3: // To grant other application / process a priviledged rights to modify composition target const TInt mySuperSecretKeyForHost1 = 0x000FAB10; const TInt flagsForHost1 = EAlfAllowChangeExtent | EAlfAllowChangeAlpha; // but not rotation

CAlfCompositionSource* me = CAlfCompositionSource::NewL(iMyDrawableWindow); TInt generatedKey = me->CreatePermissionToken(0x000FAB10, flagsForHost1);

PassGeneratedKeyToHost(generatedKey); // it already knows the other key..

TBD, will the generates key work even after composition source destroys the CAlfCompositionSource instance

Inherits from

Public Member Functions
~CAlfCompositionSource()
IMPORT_C voidAddCompositionObserverL(MAlfCompositionObserver &, TInt)
IMPORT_C TIntCreatePermissionToken(TInt, TInt)
IMPORT_C TIntEnableAlpha(TBool)
IMPORT_C voidEnableKeyboard(TBool, TInt)
IMPORT_C CAlfCompositionSource *NewL(RWindow &)
IMPORT_C voidRemoveObserver(MAlfCompositionObserver &)
IMPORT_C TIntSetExtent(const TRect &, TInt)
IMPORT_C voidSetIsBackgroundAnim(TBool)
IMPORT_C TIntSetOpacity(TReal32)
IMPORT_C TIntSetRotation(TInt)
IMPORT_C TIntSetSourceRect(const TRect &)
IMPORT_C TIntSetZOrder(const CAlfCompositionClientBase &, TBool, TInt)
Protected Member Functions
voidConstructL(TInt, TInt, TInt)
voidConstructL(RWindow &)
TInt Handle()
IMPORT_C voidHandleEventL(TInt, TAny *)
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CAlfCompositionClientBase::CAlfCompositionClientBase(TInt)
CAlfCompositionClientBase::Handle()const
CAlfCompositionClientBase::RequestEventL(TInt,RAlfBridgerClient *)
CAlfCompositionClientBase::RunError(TInt)
CAlfCompositionClientBase::SendEvent(TInt,const TAny *,TInt)
CAlfCompositionClientBase::SetHandleL(TInt)
CAlfCompositionClientBase::~CAlfCompositionClientBase()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Inherited Enumerations
CActive:TPriority
CAlfCompositionClientBase:TAlfCompositionPermission
Protected Attributes
CAlfCompositionSourceData *iData
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

~CAlfCompositionSource()

IMPORT_C~CAlfCompositionSource()

Member Functions Documentation

AddCompositionObserverL(MAlfCompositionObserver &, TInt)

IMPORT_C voidAddCompositionObserverL(MAlfCompositionObserver &aObserver,
TIntaScreenNumber = 0
)

Adds composition observer for better synchronization

Parameters

MAlfCompositionObserver & aObserver
TInt aScreenNumber = 0

ConstructL(TInt, TInt, TInt)

voidConstructL(TIntaHandle1,
TIntaHandle2,
TIntaScreenNumber
)[protected, virtual]

Parameters

TInt aHandle1
TInt aHandle2
TInt aScreenNumber

ConstructL(RWindow &)

voidConstructL(RWindow &aClientWindow)[protected, virtual]

Parameters

RWindow & aClientWindow

CreatePermissionToken(TInt, TInt)

IMPORT_C TIntCreatePermissionToken(TIntaKey,
TIntaPermissionFlags
)

Creates handle based on key Flags define which kind of operations are allowed by host application using the token. Same token can be used multiple times for different clients.

Parameters

TInt aKey
TInt aPermissionFlags

EnableAlpha(TBool)

IMPORT_C TIntEnableAlpha(TBoolaEnable = ETrue)

Enables / disables alpha on composition target

Parameters

TBool aEnable = ETrue

EnableKeyboard(TBool, TInt)

IMPORT_C voidEnableKeyboard(TBoolaEnable,
TIntaScreen
)

Internal For testing applications on extrenal screen

Parameters

TBool aEnable
TInt aScreen

Handle()

TInt Handle()[protected]

HandleEventL(TInt, TAny *)

IMPORT_C voidHandleEventL(TIntaEventType,
TAny *aEventData
)[protected, virtual]

Parameters

TInt aEventType
TAny * aEventData

NewL(RWindow &)

IMPORT_C CAlfCompositionSource *NewL(RWindow &aClientWindow)[static]

Constructor

Parameters

RWindow & aClientWindow

RemoveObserver(MAlfCompositionObserver &)

IMPORT_C voidRemoveObserver(MAlfCompositionObserver &aObserver)

Removes composition observer

Parameters

MAlfCompositionObserver & aObserver

SetExtent(const TRect &, TInt)

IMPORT_C TIntSetExtent(const TRect &aRect,
TIntaScreen
)

Defines extent of the composition target on a defined screen Does not affect on hit testing, keyboard focus etc. but is just additional information for composition

Parameters

const TRect & aRect
TInt aScreen

SetIsBackgroundAnim(TBool)

IMPORT_C voidSetIsBackgroundAnim(TBoolaIsBg)

Makes this composition target system wide background surface any other target that was previously used as bg anim will be discarded < should this require some capability like WriteDeviceData ?>

Parameters

TBool aIsBg

SetOpacity(TReal32)

IMPORT_C TIntSetOpacity(TReal32aOpacity)

Set constant opacity 0.0 - 1.0f multiplier that will be applied to composition target <in practice, only 256 different shades supported>

Parameters

TReal32 aOpacity

SetRotation(TInt)

IMPORT_C TIntSetRotation(TIntaRotationInDegrees)

rotation of composition target <in practice, only 90 degree steps supported, value given will be rounded to closest rotation>

Parameters

TInt aRotationInDegrees

SetSourceRect(const TRect &)

IMPORT_C TIntSetSourceRect(const TRect &aRect)

Defines extent of the composition source rectangle

Parameters

const TRect & aRect

SetZOrder(const CAlfCompositionClientBase &, TBool, TInt)

IMPORT_C TIntSetZOrder(const CAlfCompositionClientBase &aNode,
TBoolaAbove,
TIntaKey = -1
)

Consult owner about the usage and restrictions

Defines the composition order. On success returns token that can be used to create new CAlfCompositionSource object to control union of theses two composition targets as single object for convenience

Does not affect on hit testing, keyboard focus etc.

Parameters

const CAlfCompositionClientBase & aNode
TBool aAbove
TInt aKey = -1

Member Data Documentation

CAlfCompositionSourceData * iData

CAlfCompositionSourceData *iData[protected]