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 void AddCompositionObserverL ( MAlfCompositionObserver &, TInt )
IMPORT_C TInt CreatePermissionToken ( TInt , TInt )
IMPORT_C TInt EnableAlpha ( TBool )
IMPORT_C void EnableKeyboard ( TBool , TInt )
IMPORT_C CAlfCompositionSource * NewL ( RWindow &)
IMPORT_C void RemoveObserver ( MAlfCompositionObserver &)
IMPORT_C TInt SetExtent (const TRect &, TInt )
IMPORT_C void SetIsBackgroundAnim ( TBool )
IMPORT_C TInt SetOpacity ( TReal32 )
IMPORT_C TInt SetRotation ( TInt )
IMPORT_C TInt SetSourceRect (const TRect &)
IMPORT_C TInt SetZOrder (const CAlfCompositionClientBase &, TBool , TInt )
Protected Member Functions
void ConstructL ( TInt , TInt , TInt )
void ConstructL ( RWindow &)
TInt Handle ()
IMPORT_C void HandleEventL ( 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 void AddCompositionObserverL ( MAlfCompositionObserver & aObserver,
TInt aScreenNumber = 0
)

Adds composition observer for better synchronization

Parameters

MAlfCompositionObserver & aObserver
TInt aScreenNumber = 0

ConstructL(TInt, TInt, TInt)

void ConstructL ( TInt aHandle1,
TInt aHandle2,
TInt aScreenNumber
) [protected, virtual]

Parameters

TInt aHandle1
TInt aHandle2
TInt aScreenNumber

ConstructL(RWindow &)

void ConstructL ( RWindow & aClientWindow ) [protected, virtual]

Parameters

RWindow & aClientWindow

CreatePermissionToken(TInt, TInt)

IMPORT_C TInt CreatePermissionToken ( TInt aKey,
TInt aPermissionFlags
)

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 TInt EnableAlpha ( TBool aEnable = ETrue )

Enables / disables alpha on composition target

Parameters

TBool aEnable = ETrue

EnableKeyboard(TBool, TInt)

IMPORT_C void EnableKeyboard ( TBool aEnable,
TInt aScreen
)

Internal For testing applications on extrenal screen

Parameters

TBool aEnable
TInt aScreen

Handle()

TInt Handle ( ) [protected]

HandleEventL(TInt, TAny *)

IMPORT_C void HandleEventL ( TInt aEventType,
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 void RemoveObserver ( MAlfCompositionObserver & aObserver )

Removes composition observer

Parameters

MAlfCompositionObserver & aObserver

SetExtent(const TRect &, TInt)

IMPORT_C TInt SetExtent ( const TRect & aRect,
TInt aScreen
)

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 void SetIsBackgroundAnim ( TBool aIsBg )

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 TInt SetOpacity ( TReal32 aOpacity )

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 TInt SetRotation ( TInt aRotationInDegrees )

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 TInt SetSourceRect ( const TRect & aRect )

Defines extent of the composition source rectangle

Parameters

const TRect & aRect

SetZOrder(const CAlfCompositionClientBase &, TBool, TInt)

IMPORT_C TInt SetZOrder ( const CAlfCompositionClientBase & aNode,
TBool aAbove,
TInt aKey = -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]