Update contrib.
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // CWsWindowBase and associated classes definitions
23 class TWalkWindowTreeBase;
24 class TResumableWalkWindowTreeBase;
29 /** The base class that represents a node in the window tree.
31 Every window and window group is part of a window tree. The root of the tree is an instance of the
38 class CWsWindowBase : public CWsScreenObject, public MWsWindowTreeNode
41 CWsWindowBase(CWsClient *aOwner,WH_HANDLES aType, CScreen* aScreen);
42 void ConstructL(CWsWindowBase *aParent);
43 virtual void AreaCovered(TRegion &aRegion)=0;
44 virtual TPoint Origin() const = 0;
45 virtual TRect AbsRect() const = 0;
46 virtual TSize Size() const = 0;
47 CWsWindowGroup *WinGroup() const;
48 inline TUint32 ClientHandle() const;
49 inline CWsWindowBase *BaseParent() const;
50 inline CWsWindowBase *BaseChild() const;
51 inline CWsWindowBase *NextSibling() const;
52 CWsWindowBase *GetPrevSibling() const;
53 CWsWindowBase *LastSibling() const;
54 CWsWindowBase *PrevSiblingMultiParent() const;
55 CWsWindowBase *NextSiblingMultiParent() const;
56 inline TWinType WinType() const;
57 virtual void StatusDump(TDes &aBuf)=0;
58 TBool QueueEvent(TInt aEvent, TInt aIntVal = 0) const;
59 inline TBool AdvancedPointersEnabled() const;
60 inline CWsPointerCursor *PointerCursor() const;
61 TEventQueueWalkRet EventPurgeCheck(TWsEvent *aEvent);
62 virtual void SetOrdinalPosition(TInt aPos);
63 TBool TreeIsObscured() const;
64 CEventQueue *EventQueue() const;
66 void WalkWindowTree(TWalkWindowTreeBase &doIt,TWalkMode aMode);
67 void WalkWindowTree(TResumableWalkWindowTreeBase& aWalkClass, TWalkMode aMode, TBool aResume);
68 void WalkWindowTreeBackToFront(TWalkWindowTreeBase &doIt, TWalkModeBackToFront aMode);
70 inline TInt FadeCount() const;
71 void AddSprite(CWsSpriteBase * aSprite);
72 void RemoveSprite(CWsSpriteBase * aSprite);
73 inline TBool HasSprite() const;
74 virtual TBool IsDSAHost() const;
75 virtual void SendState(MWsWindowTreeObserver& aWindowTreeObserver) const;
77 public: // from CWsObject
78 TBool CommandL(TInt aOpcode, TWsWinCmdUnion &aCmd);
80 public: // from MWsWindowTreeNode
81 MWsWindowTreeNode::TType NodeType() const;
82 const MWsWindow* Window() const;
83 const MWsSprite* Sprite() const;
84 const MWsStandardTextCursor* StandardTextCursor() const;
85 const MWsWindowGroup* WindowGroup() const;
86 const MWsWindowTreeNode* ParentNode() const;
89 TInt OrdinalPosition(TBool aFull) const;
90 TBool CheckOrdinalPositionChange(TInt aPos);
91 virtual void Shutdown(); // Part of two phase destruction
92 void SetPointerCursor(CWsPointerCursor *aCursor);
93 void SetPointerCursorByIndex(TInt aIndex);
94 void ChangeWindowPosition(TInt aPos,CWsWindowBase* aNewParent);
97 void RemoveFromSiblingList();
98 virtual TBool IsActivated() const;
101 CWsSpriteBase *iSpriteList; // Start of linked list of sprites attached to the window
106 EBaseWinAdvancedPointersEnabled = 0x00000001,
107 EBaseWinNodeCreated = 0x00000002,
110 CWsWindowBase *iParent;
111 CWsWindowBase *iSibling;
112 CWsWindowBase *iChild;
113 /** The handle specified by the client when the object was created.
115 This is different from CWsObject::iWsOwner which is the handle assigned to the object by the server.
116 @see CWsObject::iWsOwner
118 TUint32 iClientHandle;
119 TInt iOrdinalPriority;
125 CWsPointerCursor *iPointerCursor;
130 TBool IsClientHandleInUse(TUint32 aHandle);
134 inline TWinType CWsWindowBase::WinType() const
139 inline CWsPointerCursor *CWsWindowBase::PointerCursor() const
141 return iPointerCursor;
144 inline CWsWindowBase *CWsWindowBase::NextSibling() const
149 inline CWsWindowBase *CWsWindowBase::BaseChild() const
154 inline CWsWindowBase *CWsWindowBase::BaseParent() const
159 inline TUint32 CWsWindowBase::ClientHandle() const
161 return iClientHandle;
164 inline TInt CWsWindowBase::FadeCount() const
169 inline TBool CWsWindowBase::AdvancedPointersEnabled() const
171 return iBaseWinFlags&EBaseWinAdvancedPointersEnabled;
174 inline TBool CWsWindowBase::HasSprite() const
176 return (NULL != iSpriteList);