os/graphics/windowing/windowserver/nonnga/SERVER/windowgroup.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/windowing/windowserver/nonnga/SERVER/windowgroup.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,226 @@
     1.4 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// CWsWindow and associated classes definitions
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#ifndef __WINDOWGROUP_H__
    1.22 +#define __WINDOWGROUP_H__
    1.23 +
    1.24 +#include "server.h"
    1.25 +#include "tcursor.h"
    1.26 +
    1.27 +class CWsWindowGroup : public CWsWindowBase
    1.28 +	{
    1.29 +private:
    1.30 +	enum {EMaxIdentifierCount=10000};	// Could go as high as the highest signed int, but this would be impractical to test
    1.31 +	enum TGroupWindowFlags {
    1.32 +		EGroupFlagDisableKeyClick=0x01,
    1.33 +		EGroupFlagReceivesFocus=  0x02,
    1.34 +		EGroupFlagAutoForeground= 0x04,
    1.35 +		EGroupFlagHandlesDeviceChange= 0x08,
    1.36 +		EGroupFlagScreenDeviceDeleted= 0x10,
    1.37 +		EGroupFlagMsgQueueActive= 0x20,
    1.38 +		EGroupFlagMsgQueueNew=	  0x40,
    1.39 +		EGroupFlagMessageSignalled= 0x80,
    1.40 +		};
    1.41 +public:
    1.42 +	static CWsWindowGroup* NewL(CWsClient* aOwner, CScreen* aScreen, 
    1.43 +		const TWsClCmdCreateWindowGroup& aCmd);
    1.44 +	~CWsWindowGroup();
    1.45 +private:
    1.46 +	CWsWindowGroup(CWsClient* aOwner,CScreen* aScreen);
    1.47 +	void ConstructL(const TWsClCmdCreateWindowGroup &aCmd);
    1.48 +public: // from CWsObject
    1.49 +	virtual void CommandL(TInt aOpcode, const TAny *aCmdData);
    1.50 +public: // from CWsWindowBase
    1.51 +	virtual TPoint Origin() const;
    1.52 +	virtual TRect AbsRect() const;
    1.53 +	virtual TSize Size() const;
    1.54 +public:
    1.55 +	CWsClientWindow *Child() const;
    1.56 +	inline CWsWindowGroup *PrevSibling() const;
    1.57 +	inline CWsWindowGroup *NextSibling() const;
    1.58 +	CWsRootWindow *Parent() const;
    1.59 +	void UpdateOrdinalPriority(TBool aDoAdjust);
    1.60 +	void LostFocus();
    1.61 +	void ReceivedFocus();
    1.62 +	inline RWsTextCursor *TextCursor();
    1.63 +	inline TBool ReceivesFocus() const;
    1.64 +	static TInt NumWindowGroups(TBool aAllPriorities, TInt aPriority);
    1.65 +	static TInt SendWindowGroupListAndChainL(TBool aAllPriorities, TInt aPriority, TInt aCount);
    1.66 +	static TBool SendEventToAllGroups(TBool aAllPriorities,TBool aOnePerClient,const TWsClCmdSendEventToWindowGroup& aData);
    1.67 +	static void SendMessageToAllGroupsL(CWsClient& aSender,TBool aAllPriorities,const TWsClCmdSendMessageToWindowGroup& aData);
    1.68 +	static void GetFocusWindowGroupL();
    1.69 +	virtual void SetOrdinalPosition(TInt pos);
    1.70 +	TBool SetOrdinalPosition(TInt pos,CWsWindowGroup *aClosingWindow);
    1.71 +	void SetOrdinalPriority(TInt aPos, TInt aPriority);
    1.72 +	void QueueMessageL(TUid aUid, TInt aDataLength, CWsClient& aSender);
    1.73 +	void AddPriorityKeyL(TUint aKeycode, TUint aModifierMask, TUint aModifiers);
    1.74 +	void RemovePriorityKey(TUint aKeycode, TUint aModifierMask, TUint aModifiers);
    1.75 +	void RemoveAllPriorityKeys();
    1.76 +	TBool CheckForPriorityKey(const TKeyData &aKey, TInt aScanCode);
    1.77 +	inline CWsPointerCursor *GroupPointerCursor() const;
    1.78 +	static CWsWindowGroup *WindowGroupFromIdentifier(TInt aIdentifier);
    1.79 +	static CWsWindowGroup *WindowGroupFromIdentifierL(TInt aIdentifier);
    1.80 +	static CWsWindowGroup *FindWindowGroupL(CWsClient* aClient,TInt aIdentifier,TInt aOffset,const TPtrC *aMatch,const TThreadId *aThreadId);
    1.81 +	inline TInt Identifier() const;
    1.82 +	inline HBufC *GroupName();
    1.83 +	inline TInt OrdinalPriority();
    1.84 +	inline void SetNextDefaultOwningWindow(CWsWindowGroup *aNext);
    1.85 +	inline CWsWindowGroup **NextDefaultOwningWindowPtr();
    1.86 +	void SetScreenDeviceValidState(const DWsScreenDevice *aDevice);
    1.87 +	void SetScreenChangeEventStateL(TBool aEnabled);
    1.88 +	TBool ScreenDeviceValid() const;
    1.89 +	TBool CanReceiveFocus() const;
    1.90 +	static void SetScreenDeviceValidStates(const DWsScreenDevice *aDevice);
    1.91 +	static TBool SetScreenDeviceValidStates(const TBool aScreenSizeChanged, const TBool aSwapWidthAndHeight, CScreen* aScreen);
    1.92 +	static void NewOrientation(TInt aMode,CFbsBitGc::TGraphicsOrientation aRotation, CWsRootWindow* aRootWindow);
    1.93 +	inline DWsScreenDevice *Device();
    1.94 +	void FetchMessageL();
    1.95 +	static inline void SetFocusGainPreprocessing(TBool aDo);
    1.96 +	TBool IsChained(TInt& aParentId);
    1.97 +	inline TInt NumWindowGroupsOnMyScreen(TInt aPriority);
    1.98 +	static TInt NumWindowGroupsOnScreen(const CWsWindowGroup* aGroupWin,TBool aAllPriorities,TInt aPriority);
    1.99 +	inline void SetScreenDeviceDeleted();
   1.100 +	inline TBool ScreenDeviceDeleted() const;
   1.101 +	static TInt SendWindowGroupListL(TInt aScreenNumber, TBool aAllPriorities, TInt aPriority, TInt aCount);
   1.102 +	static void GetFocusWindowGroupL(TInt aScreenNumber);
   1.103 +	void SetScreenDevice(DWsScreenDevice *aDevice);
   1.104 +	TBool HasVisibleTranslucentChild();
   1.105 +private:
   1.106 +	void SwitchToOwningWindow(CWsWindowGroup *aClosingWindow);
   1.107 +	void MoveChainedWindows(TDblQueIter<CWsWindowGroup>& aIter,TBool aForward,TInt aPos,CWsWindowGroup* aClosingWindow);
   1.108 +	TBool DoSetOrdinalPosition1(TInt aPos,CWsWindowGroup *aClosingWindow);
   1.109 +	void DoSetOrdinalPosition2(TInt aPos,CWsWindowGroup *aClosingWindow);
   1.110 +	void SignalMessageReady();
   1.111 +	static void AdvanceIdentifierCount();
   1.112 +	void StatusDump(TDes &aBuf);
   1.113 +	void PurgeCapturedKeys();
   1.114 +	inline void UpdateKeyClickState();
   1.115 +	void ResetFocus(CWsWindowGroup *aClosingWindow);
   1.116 +	static TInt GetWindowGroupListL(TInt aScreenNo,TBool aAllPriorities,TInt aPriority,TInt aCount,CArrayFixFlat<TInt>* aList);	
   1.117 +	inline CWsWindowGroup* BeforeInChain();
   1.118 +	static void GetWindowGroupListAndChainL(TInt aScreen,TBool aAllPriorities,TInt aPriority
   1.119 +																,RArray<RWsSession::TWindowGroupChainInfo>& list,TInt& aCountLeft);
   1.120 +	TBool CheckCapability(TInt& aOrdinalPriority);
   1.121 +	void DeleteQueue(TDblQue<CWsWindowGroup>* aQueue);
   1.122 +	TInt NumClientWindowGroups();
   1.123 +// data
   1.124 +private:
   1.125 +	RWsTextCursor iTextCursor;
   1.126 +	TInt iFlags;
   1.127 +	TInt iOrdinalPriorityBase;
   1.128 +	TInt iOrdinalPriorityAdjust;
   1.129 +	TPriorityKey *iPriorityKeys;
   1.130 +	TInt iOwningWindowGroup;
   1.131 +	HBufC *iGroupName;
   1.132 +	TInt iIdentifier;
   1.133 +	CWsWindowGroup *iNextDefaultOwningWindow;
   1.134 +	CArrayVarSeg<TWsMessage> *iMessageArray;
   1.135 +	static TInt iIdentifierCount;
   1.136 +	DWsScreenDevice *iScreenDevice;
   1.137 +	static RPointerArray< TDblQue<CWsWindowGroup> > iChains;
   1.138 +	TDblQue<CWsWindowGroup>* iQueue;
   1.139 +	TDblQueLink iChainLink;
   1.140 +	TUint32 iChildSID;
   1.141 +	static TBool iFocusGainPreProcess;		//'REMOVEFADINGONFOCUSGAIN' flag in INI file
   1.142 +	// used for eventqueue testing
   1.143 +#if defined(_DEBUG)
   1.144 +	static TInt iSkipCount;
   1.145 +#endif
   1.146 +	friend class WsPointer;
   1.147 +	};
   1.148 +
   1.149 +inline CWsClientWindow *CWsWindowGroup::Child() const
   1.150 +	{
   1.151 +	return (CWsClientWindow *)iChild;
   1.152 +	}
   1.153 +
   1.154 +inline CWsWindowGroup *CWsWindowGroup::NextSibling() const
   1.155 +	{
   1.156 +	return (CWsWindowGroup *)iSibling;
   1.157 +	}
   1.158 +
   1.159 +inline CWsWindowGroup *CWsWindowGroup::PrevSibling() const
   1.160 +	{
   1.161 +	return (CWsWindowGroup *)GetPrevSibling();
   1.162 +	}
   1.163 +
   1.164 +inline CWsRootWindow *CWsWindowGroup::Parent() const
   1.165 +	{
   1.166 +	return (CWsRootWindow *)iParent;
   1.167 +	}
   1.168 +
   1.169 +inline TBool CWsWindowGroup::ReceivesFocus() const
   1.170 +	{
   1.171 +	return(iFlags&EGroupFlagReceivesFocus);
   1.172 +	}
   1.173 +
   1.174 +inline RWsTextCursor *CWsWindowGroup::TextCursor()
   1.175 +	{
   1.176 +	return &iTextCursor;
   1.177 +	}
   1.178 +
   1.179 +inline TInt CWsWindowGroup::Identifier() const
   1.180 +	{
   1.181 +	return iIdentifier;
   1.182 +	}
   1.183 +
   1.184 +inline HBufC *CWsWindowGroup::GroupName()
   1.185 +	{
   1.186 +	return iGroupName;
   1.187 +	}
   1.188 +
   1.189 +inline TInt CWsWindowGroup::OrdinalPriority()
   1.190 +	{
   1.191 +	return iOrdinalPriorityBase;
   1.192 +	}
   1.193 +
   1.194 +inline void CWsWindowGroup::SetNextDefaultOwningWindow(CWsWindowGroup *aNext)
   1.195 +	{
   1.196 +	iNextDefaultOwningWindow=aNext;
   1.197 +	}
   1.198 +
   1.199 +inline CWsWindowGroup **CWsWindowGroup::NextDefaultOwningWindowPtr()
   1.200 +	{
   1.201 +	return &iNextDefaultOwningWindow;
   1.202 +	}
   1.203 +
   1.204 +/**
   1.205 +@return A pointer to the DWsScreenDevice used by this window-group, or 
   1.206 +		NULL when there is no DWsScreenDevice used by the window-group.
   1.207 +*/
   1.208 +inline DWsScreenDevice *CWsWindowGroup::Device()
   1.209 +	{
   1.210 +	return iScreenDevice;
   1.211 +	}
   1.212 +
   1.213 +inline void CWsWindowGroup::SetFocusGainPreprocessing(TBool aDo)
   1.214 +	{
   1.215 +	iFocusGainPreProcess=aDo;
   1.216 +	}
   1.217 +
   1.218 +inline void CWsWindowGroup::SetScreenDeviceDeleted()
   1.219 +	{
   1.220 +	iFlags|=EGroupFlagScreenDeviceDeleted;
   1.221 +	iScreenDevice = NULL; //  PDEF100409
   1.222 +	}
   1.223 +
   1.224 +inline TBool CWsWindowGroup::ScreenDeviceDeleted() const
   1.225 +	{
   1.226 +	return (iFlags&EGroupFlagScreenDeviceDeleted);
   1.227 +	}
   1.228 +
   1.229 +#endif