windowing/windowserver/nonnga/SERVER/winbase.h
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // CWsWindowBase and associated classes definitions
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __WINBASE_H__
       
    19 #define __WINBASE_H__
       
    20 
       
    21 #include "server.h"
       
    22 
       
    23 class TWalkWindowTreeBase;
       
    24 class TResumableWalkWindowTreeBase;
       
    25 class CWsAnim;
       
    26 class CWsSprite;
       
    27 class CWsBlankWindow;
       
    28 
       
    29 /** The base class that represents a node in the window tree.
       
    30 
       
    31 Every window and window group is part of a window tree. The root of the tree is an instance of the
       
    32 CWsRootWindow class.
       
    33 
       
    34 @see RWindowTreeNode
       
    35 @internalComponent
       
    36 @released
       
    37 */
       
    38 class CWsWindowBase : public CWsScreenObject
       
    39 	{
       
    40 public:
       
    41 	CWsWindowBase(CWsClient *aOwner,WH_HANDLES aType, CScreen* aScreen);
       
    42 	void ConstructL(CWsWindowBase *aParent);
       
    43 	virtual TPoint Origin() const = 0;
       
    44 	virtual TRect AbsRect() const = 0;
       
    45 	virtual TSize Size() const = 0;
       
    46 	CWsWindowGroup *WinGroup() const;
       
    47 	inline TUint32 ClientHandle() const;
       
    48 	inline CWsWindowBase *BaseParent() const;
       
    49 	inline CWsWindowBase *BaseChild() const;
       
    50 	inline CWsWindowBase *NextSibling() const;
       
    51 	CWsWindowBase *GetPrevSibling() const;
       
    52 	CWsWindowBase *LastSibling() const;
       
    53 	CWsWindowBase *PrevSiblingMultiParent() const;
       
    54 	CWsWindowBase *NextSiblingMultiParent() const;
       
    55 	inline TWinType WinType() const;
       
    56 	virtual void StatusDump(TDes &aBuf)=0;
       
    57 	TBool QueueEvent(TInt aEvent) const;
       
    58 	inline CWsPointerCursor *PointerCursor() const;
       
    59 	TEventQueueWalkRet EventPurgeCheck(TWsEvent *aEvent);
       
    60 	virtual void SetOrdinalPosition(TInt aPos);
       
    61 	TBool TreeIsObscured() const;
       
    62 	CEventQueue *EventQueue() const;
       
    63 	void WalkWindowTree(TWalkWindowTreeBase &doIt,TWalkMode aMode);
       
    64 	void WalkWindowTree(TResumableWalkWindowTreeBase& aWalkClass, TWalkMode aMode, TBool aResume);
       
    65 	void PurgeEvents();
       
    66 	inline TInt FadeCount() const;
       
    67 
       
    68 	virtual TBool IsDSAHost() const;
       
    69 public:	// from CWsObject
       
    70 	TBool CommandL(TInt aOpcode, TWsWinCmdUnion &aCmd);
       
    71 
       
    72 protected:
       
    73 	TInt OrdinalPosition(TBool aFull) const;
       
    74 	TBool CheckOrdinalPositionChange(TInt aPos);
       
    75 	virtual void Shutdown();	// Part of two phase destruction
       
    76 	void SetPointerCursor(CWsPointerCursor *aCursor);
       
    77 	void SetPointerCursorByIndex(TInt aIndex);
       
    78 	void ChangeWindowPosition(TInt aPos,CWsWindowBase* aNewParent);
       
    79 
       
    80 private:
       
    81 	void RemoveFromSiblingList();
       
    82 
       
    83 protected:
       
    84 	CWsWindowBase *iParent;
       
    85 	CWsWindowBase *iSibling;
       
    86 	CWsWindowBase *iChild;
       
    87 	/** The handle specified by the client when the object was created.
       
    88 	
       
    89 	This is different from CWsObject::iWsOwner which is the handle assigned to the object by the server.
       
    90 	@see CWsObject::iWsOwner
       
    91 	*/
       
    92 	TUint32 iClientHandle;
       
    93 	TInt iOrdinalPriority;
       
    94 	TWinType iWinType;
       
    95 	TInt iFadeCount;
       
    96 
       
    97 private:
       
    98 	CWsPointerCursor *iPointerCursor;
       
    99 	
       
   100 #if defined(_DEBUG)
       
   101 public:
       
   102 	void CheckTree();
       
   103 	TBool IsClientHandleInUse(TUint32 aHandle);
       
   104 #endif
       
   105 	};
       
   106 	
       
   107 inline TWinType CWsWindowBase::WinType() const
       
   108 	{
       
   109 	return iWinType;
       
   110 	}
       
   111 
       
   112 inline CWsPointerCursor *CWsWindowBase::PointerCursor() const
       
   113 	{
       
   114 	return iPointerCursor;
       
   115 	}
       
   116 
       
   117 inline CWsWindowBase *CWsWindowBase::NextSibling() const
       
   118 	{
       
   119 	return iSibling;
       
   120 	}
       
   121 
       
   122 inline CWsWindowBase *CWsWindowBase::BaseChild() const
       
   123 	{
       
   124 	return iChild;
       
   125 	}
       
   126 
       
   127 inline CWsWindowBase *CWsWindowBase::BaseParent() const
       
   128 	{
       
   129 	return iParent;
       
   130 	}
       
   131 
       
   132 inline TUint32 CWsWindowBase::ClientHandle() const
       
   133 	{
       
   134 	return iClientHandle;
       
   135 	}
       
   136 
       
   137 inline TInt CWsWindowBase::FadeCount() const
       
   138 	{
       
   139 	return iFadeCount;
       
   140 	}
       
   141 
       
   142 #endif