sl@0
|
1 |
// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// CWsWindow and associated classes definitions
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
#ifndef __WINDOWGROUP_H__
|
sl@0
|
19 |
#define __WINDOWGROUP_H__
|
sl@0
|
20 |
|
sl@0
|
21 |
#include "server.h"
|
sl@0
|
22 |
#include "tcursor.h"
|
sl@0
|
23 |
|
sl@0
|
24 |
class CWsWindowGroup : public CWsWindowBase, public MWsWindowGroup
|
sl@0
|
25 |
{
|
sl@0
|
26 |
private:
|
sl@0
|
27 |
enum {EMaxIdentifierCount=10000}; // Could go as high as the highest signed int, but this would be impractical to test
|
sl@0
|
28 |
enum TGroupWindowFlags {
|
sl@0
|
29 |
EGroupFlagDisableKeyClick=0x01,
|
sl@0
|
30 |
EGroupFlagReceivesFocus= 0x02,
|
sl@0
|
31 |
EGroupFlagAutoForeground= 0x04,
|
sl@0
|
32 |
EGroupFlagHandlesDeviceChange= 0x08,
|
sl@0
|
33 |
EGroupFlagScreenDeviceDeleted= 0x10,
|
sl@0
|
34 |
EGroupFlagMsgQueueActive= 0x20,
|
sl@0
|
35 |
EGroupFlagMsgQueueNew= 0x40,
|
sl@0
|
36 |
EGroupFlagMessageSignalled= 0x80,
|
sl@0
|
37 |
};
|
sl@0
|
38 |
public:
|
sl@0
|
39 |
static CWsWindowGroup* NewL(CWsClient* aOwner, CScreen* aScreen,
|
sl@0
|
40 |
const TWsClCmdCreateWindowGroup& aCmd);
|
sl@0
|
41 |
~CWsWindowGroup();
|
sl@0
|
42 |
private:
|
sl@0
|
43 |
CWsWindowGroup(CWsClient* aOwner,CScreen* aScreen);
|
sl@0
|
44 |
void ConstructL(const TWsClCmdCreateWindowGroup &aCmd);
|
sl@0
|
45 |
public: // virtual functions from CWsObject
|
sl@0
|
46 |
void CommandL(TInt aOpcode, const TAny *aCmdData);
|
sl@0
|
47 |
public: // virtual functions from CWsWindowBase
|
sl@0
|
48 |
TPoint Origin() const;
|
sl@0
|
49 |
TRect AbsRect() const;
|
sl@0
|
50 |
TSize Size() const;
|
sl@0
|
51 |
void SendState(MWsWindowTreeObserver& aWindowTreeObserver) const;
|
sl@0
|
52 |
void SendStateWindowGroupChain(MWsWindowTreeObserver& aWindowTreeObserver) const;
|
sl@0
|
53 |
|
sl@0
|
54 |
public: // virtual functions from MWsWindowGroup
|
sl@0
|
55 |
TInt Identifier() const;
|
sl@0
|
56 |
TPtrC Name() const;
|
sl@0
|
57 |
TBool IsFocusable() const;
|
sl@0
|
58 |
TInt OrdinalPriority() const;
|
sl@0
|
59 |
const MWsClient * Client() const;
|
sl@0
|
60 |
|
sl@0
|
61 |
public:
|
sl@0
|
62 |
CWsTopClientWindow *Child() const;
|
sl@0
|
63 |
inline CWsWindowGroup *PrevSibling() const;
|
sl@0
|
64 |
inline CWsWindowGroup *NextSibling() const;
|
sl@0
|
65 |
CWsRootWindow *Parent() const;
|
sl@0
|
66 |
virtual void AreaCovered(TRegion &aRegion);
|
sl@0
|
67 |
void UpdateOrdinalPriority(TBool aDoAdjust);
|
sl@0
|
68 |
void LostFocus();
|
sl@0
|
69 |
void ReceivedFocus();
|
sl@0
|
70 |
inline RWsTextCursor *TextCursor();
|
sl@0
|
71 |
inline TBool ReceivesFocus() const;
|
sl@0
|
72 |
static TInt NumWindowGroups(TBool aAllPriorities, TInt aPriority);
|
sl@0
|
73 |
static TInt SendWindowGroupListAndChainL(TBool aAllPriorities, TInt aPriority, TInt aCount);
|
sl@0
|
74 |
static TBool SendEventToAllGroups(TBool aAllPriorities,TBool aOnePerClient,const TWsClCmdSendEventToWindowGroup& aData);
|
sl@0
|
75 |
static void SendMessageToAllGroupsL(CWsClient& aSender,TBool aAllPriorities,const TWsClCmdSendMessageToWindowGroup& aData);
|
sl@0
|
76 |
static void GetFocusWindowGroupL();
|
sl@0
|
77 |
static void ReleasePendedMessagesToAllGroups(CWsClient * aClient);
|
sl@0
|
78 |
virtual void SetOrdinalPosition(TInt pos);
|
sl@0
|
79 |
TBool SetOrdinalPosition(TInt pos,CWsWindowGroup *aClosingWindow);
|
sl@0
|
80 |
void SetOrdinalPriority(TInt aPos, TInt aPriority);
|
sl@0
|
81 |
void QueueMessageL(TUid aUid, TInt aDataLength, CWsClient& aSender);
|
sl@0
|
82 |
void AddPriorityKeyL(TUint aKeycode, TUint aModifierMask, TUint aModifiers);
|
sl@0
|
83 |
void RemovePriorityKey(TUint aKeycode, TUint aModifierMask, TUint aModifiers);
|
sl@0
|
84 |
void RemoveAllPriorityKeys();
|
sl@0
|
85 |
TBool CheckForPriorityKey(const TKeyEvent &aKeyEvent);
|
sl@0
|
86 |
inline CWsPointerCursor *GroupPointerCursor() const;
|
sl@0
|
87 |
static CWsWindowGroup *WindowGroupFromIdentifier(TInt aIdentifier);
|
sl@0
|
88 |
static CWsWindowGroup *WindowGroupFromIdentifierL(TInt aIdentifier);
|
sl@0
|
89 |
static CWsWindowGroup *FindWindowGroupL(CWsClient* aClient,TInt aIdentifier,TInt aOffset,const TPtrC *aMatch,const TThreadId *aThreadId);
|
sl@0
|
90 |
inline HBufC *GroupName();
|
sl@0
|
91 |
inline void SetNextDefaultOwningWindow(CWsWindowGroup *aNext);
|
sl@0
|
92 |
inline CWsWindowGroup **NextDefaultOwningWindowPtr();
|
sl@0
|
93 |
void SetScreenDeviceValidState(const DWsScreenDevice *aDevice);
|
sl@0
|
94 |
void SetScreenChangeEventStateL(TBool aEnabled);
|
sl@0
|
95 |
TBool ScreenDeviceValid() const;
|
sl@0
|
96 |
TBool CanReceiveFocus() const;
|
sl@0
|
97 |
static void SetScreenDeviceValidStates(const DWsScreenDevice *aDevice);
|
sl@0
|
98 |
static void SetScreenDeviceValidStates(CScreen* aScreen);
|
sl@0
|
99 |
static void NewOrientation(TInt aMode,CFbsBitGc::TGraphicsOrientation aRotation, CWsRootWindow* aRootWindow);
|
sl@0
|
100 |
inline DWsScreenDevice *Device();
|
sl@0
|
101 |
void FetchMessageL();
|
sl@0
|
102 |
static inline void SetFocusGainPreprocessing(TBool aDo);
|
sl@0
|
103 |
TBool IsChained(TInt& aParentId);
|
sl@0
|
104 |
inline TInt NumWindowGroupsOnMyScreen(TInt aPriority);
|
sl@0
|
105 |
static TInt NumWindowGroupsOnScreen(const CWsWindowGroup* aGroupWin,TBool aAllPriorities,TInt aPriority);
|
sl@0
|
106 |
inline void SetScreenDeviceDeleted();
|
sl@0
|
107 |
inline TBool ScreenDeviceDeleted() const;
|
sl@0
|
108 |
static TInt SendWindowGroupListL(TInt aScreenNumber, TBool aAllPriorities, TInt aPriority, TInt aCount);
|
sl@0
|
109 |
static void GetFocusWindowGroupL(TInt aScreenNumber);
|
sl@0
|
110 |
void SetScreenDevice(DWsScreenDevice *aDevice);
|
sl@0
|
111 |
static void SetEventQueueTestState(TBool aEventQueState);
|
sl@0
|
112 |
TBool HasVisibleTranslucentChild();
|
sl@0
|
113 |
void ReleasePendedMessage();
|
sl@0
|
114 |
private:
|
sl@0
|
115 |
void SwitchToOwningWindow(CWsWindowGroup *aClosingWindow);
|
sl@0
|
116 |
void MoveChainedWindows(TDblQueIter<CWsWindowGroup>& aIter,TBool aForward,TInt aPos,CWsWindowGroup* aClosingWindow);
|
sl@0
|
117 |
TBool DoSetOrdinalPosition1(TInt aPos,CWsWindowGroup *aClosingWindow);
|
sl@0
|
118 |
void DoSetOrdinalPosition2(TInt aPos,CWsWindowGroup *aClosingWindow);
|
sl@0
|
119 |
TBool SignalMessageReady();
|
sl@0
|
120 |
static void AdvanceIdentifierCount();
|
sl@0
|
121 |
void StatusDump(TDes &aBuf);
|
sl@0
|
122 |
void PurgeCapturedKeys();
|
sl@0
|
123 |
inline void UpdateKeyClickState();
|
sl@0
|
124 |
void ResetFocus(CWsWindowGroup *aClosingWindow);
|
sl@0
|
125 |
static TInt GetWindowGroupListL(TInt aScreenNo,TBool aAllPriorities,TInt aPriority,TInt aCount,CArrayFixFlat<TInt>* aList);
|
sl@0
|
126 |
inline CWsWindowGroup* BeforeInChain();
|
sl@0
|
127 |
static void GetWindowGroupListAndChainL(TInt aScreen,TBool aAllPriorities,TInt aPriority
|
sl@0
|
128 |
,RArray<RWsSession::TWindowGroupChainInfo>& list,TInt& aCountLeft);
|
sl@0
|
129 |
TBool CheckCapability(TInt& aOrdinalPriority);
|
sl@0
|
130 |
void DeleteQueue(TDblQue<CWsWindowGroup>* aQueue);
|
sl@0
|
131 |
TInt NumClientWindowGroups();
|
sl@0
|
132 |
void DisconnectFloatingSprites();
|
sl@0
|
133 |
private:
|
sl@0
|
134 |
RWsTextCursor iTextCursor;
|
sl@0
|
135 |
TInt iFlags;
|
sl@0
|
136 |
TInt iOrdinalPriorityBase;
|
sl@0
|
137 |
TInt iOrdinalPriorityAdjust;
|
sl@0
|
138 |
TPriorityKey *iPriorityKeys;
|
sl@0
|
139 |
TInt iOwningWindowGroup;
|
sl@0
|
140 |
HBufC *iGroupName;
|
sl@0
|
141 |
TInt iIdentifier;
|
sl@0
|
142 |
CWsWindowGroup *iNextDefaultOwningWindow;
|
sl@0
|
143 |
CArrayVarSeg<TWsMessage> *iMessageArray;
|
sl@0
|
144 |
static TInt iIdentifierCount;
|
sl@0
|
145 |
DWsScreenDevice *iScreenDevice;
|
sl@0
|
146 |
static RPointerArray< TDblQue<CWsWindowGroup> > iChains;
|
sl@0
|
147 |
TDblQue<CWsWindowGroup>* iQueue;
|
sl@0
|
148 |
TDblQueLink iChainLink;
|
sl@0
|
149 |
TUint32 iChildSID;
|
sl@0
|
150 |
static TBool iFocusGainPreProcess; //'REMOVEFADINGONFOCUSGAIN' flag in INI file
|
sl@0
|
151 |
// used for eventqueue testing
|
sl@0
|
152 |
#if defined(_DEBUG)
|
sl@0
|
153 |
static TInt iSkipCount;
|
sl@0
|
154 |
#endif
|
sl@0
|
155 |
static TBool iEventQueueTest;
|
sl@0
|
156 |
friend class TWsPointer;
|
sl@0
|
157 |
};
|
sl@0
|
158 |
|
sl@0
|
159 |
inline CWsTopClientWindow *CWsWindowGroup::Child() const
|
sl@0
|
160 |
{
|
sl@0
|
161 |
return (CWsTopClientWindow *)iChild;
|
sl@0
|
162 |
}
|
sl@0
|
163 |
|
sl@0
|
164 |
inline CWsWindowGroup *CWsWindowGroup::NextSibling() const
|
sl@0
|
165 |
{
|
sl@0
|
166 |
return (CWsWindowGroup *)iSibling;
|
sl@0
|
167 |
}
|
sl@0
|
168 |
|
sl@0
|
169 |
inline CWsWindowGroup *CWsWindowGroup::PrevSibling() const
|
sl@0
|
170 |
{
|
sl@0
|
171 |
return (CWsWindowGroup *)GetPrevSibling();
|
sl@0
|
172 |
}
|
sl@0
|
173 |
|
sl@0
|
174 |
inline CWsRootWindow *CWsWindowGroup::Parent() const
|
sl@0
|
175 |
{
|
sl@0
|
176 |
return (CWsRootWindow *)iParent;
|
sl@0
|
177 |
}
|
sl@0
|
178 |
|
sl@0
|
179 |
inline TBool CWsWindowGroup::ReceivesFocus() const
|
sl@0
|
180 |
{
|
sl@0
|
181 |
return(iFlags&EGroupFlagReceivesFocus);
|
sl@0
|
182 |
}
|
sl@0
|
183 |
|
sl@0
|
184 |
inline RWsTextCursor *CWsWindowGroup::TextCursor()
|
sl@0
|
185 |
{
|
sl@0
|
186 |
return &iTextCursor;
|
sl@0
|
187 |
}
|
sl@0
|
188 |
|
sl@0
|
189 |
inline HBufC *CWsWindowGroup::GroupName()
|
sl@0
|
190 |
{
|
sl@0
|
191 |
return iGroupName;
|
sl@0
|
192 |
}
|
sl@0
|
193 |
|
sl@0
|
194 |
inline void CWsWindowGroup::SetNextDefaultOwningWindow(CWsWindowGroup *aNext)
|
sl@0
|
195 |
{
|
sl@0
|
196 |
iNextDefaultOwningWindow=aNext;
|
sl@0
|
197 |
}
|
sl@0
|
198 |
|
sl@0
|
199 |
inline CWsWindowGroup **CWsWindowGroup::NextDefaultOwningWindowPtr()
|
sl@0
|
200 |
{
|
sl@0
|
201 |
return &iNextDefaultOwningWindow;
|
sl@0
|
202 |
}
|
sl@0
|
203 |
|
sl@0
|
204 |
/**
|
sl@0
|
205 |
@return A pointer to the DWsScreenDevice used by this window-group, or
|
sl@0
|
206 |
NULL when there is no DWsScreenDevice used by the window-group.
|
sl@0
|
207 |
*/
|
sl@0
|
208 |
inline DWsScreenDevice *CWsWindowGroup::Device()
|
sl@0
|
209 |
{
|
sl@0
|
210 |
return iScreenDevice;
|
sl@0
|
211 |
}
|
sl@0
|
212 |
|
sl@0
|
213 |
inline void CWsWindowGroup::SetFocusGainPreprocessing(TBool aDo)
|
sl@0
|
214 |
{
|
sl@0
|
215 |
iFocusGainPreProcess=aDo;
|
sl@0
|
216 |
}
|
sl@0
|
217 |
|
sl@0
|
218 |
inline void CWsWindowGroup::SetScreenDeviceDeleted()
|
sl@0
|
219 |
{
|
sl@0
|
220 |
iFlags|=EGroupFlagScreenDeviceDeleted;
|
sl@0
|
221 |
iScreenDevice = NULL; // PDEF100409
|
sl@0
|
222 |
}
|
sl@0
|
223 |
|
sl@0
|
224 |
inline TBool CWsWindowGroup::ScreenDeviceDeleted() const
|
sl@0
|
225 |
{
|
sl@0
|
226 |
return (iFlags&EGroupFlagScreenDeviceDeleted);
|
sl@0
|
227 |
}
|
sl@0
|
228 |
|
sl@0
|
229 |
#endif
|