|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Control group sub session. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_ALFSRVCONTROLGROUPSUBSESSION_H |
|
21 #define C_ALFSRVCONTROLGROUPSUBSESSION_H |
|
22 |
|
23 #include "alfsrvsubsessionbase.h" |
|
24 |
|
25 class CAlfAppSrvSessionBase; |
|
26 class CHuiControlGroup; |
|
27 |
|
28 /** |
|
29 * Control group sub session. |
|
30 * |
|
31 * @lib alfappservercore.lib |
|
32 * @since S60 v3.2 |
|
33 */ |
|
34 NONSHARABLE_CLASS(CAlfSrvControlGroupSubSession): public CAlfSrvSubSessionBase |
|
35 { |
|
36 |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Two-phased constructor |
|
41 * |
|
42 * @param aSession Session in which this sub session belongs into. |
|
43 * @param aId Group ID. |
|
44 * @return New object. Ownership transferred. |
|
45 */ |
|
46 static CAlfSrvControlGroupSubSession* NewL( CAlfAppSrvSessionBase& aSession, |
|
47 TInt aId ); |
|
48 |
|
49 /** |
|
50 * Two-phased constructor. Leaves the objenct onto the cleanup stack. |
|
51 * |
|
52 * @param aSession Session in which this sub session belongs into. |
|
53 * @param aId Group ID. |
|
54 * @return New object on stack. Ownership transferred. |
|
55 */ |
|
56 static CAlfSrvControlGroupSubSession* NewLC( CAlfAppSrvSessionBase& aSession, |
|
57 TInt aId ); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 virtual ~CAlfSrvControlGroupSubSession(); |
|
63 |
|
64 /** |
|
65 * Returns the used control group. |
|
66 * |
|
67 * @return Used control group. |
|
68 */ |
|
69 CHuiControlGroup& ControlGroup(); |
|
70 |
|
71 /** |
|
72 * Returns if the control group is shown |
|
73 * |
|
74 * @return ETrue if shown |
|
75 */ |
|
76 TBool IsShown() const; |
|
77 |
|
78 /** |
|
79 * Set if the control group is shown |
|
80 * |
|
81 * @param aShown ETrue if shown. |
|
82 */ |
|
83 void SetIsShown( TBool aShown ); |
|
84 |
|
85 /** |
|
86 * Returns the host control. |
|
87 * |
|
88 * @return Host control. Always on the control group. |
|
89 */ |
|
90 CHuiControl& HostControl() const; |
|
91 |
|
92 // From CAlfSrvSubSessionBase |
|
93 |
|
94 /** |
|
95 * From CAlfSrvSubSessionBase |
|
96 * Can process the given message? |
|
97 * |
|
98 * @param aMessage The message. |
|
99 * @return ETrue if can process the message. |
|
100 */ |
|
101 TBool CanProcessMessage(const RMessage2& aMessage) const; |
|
102 |
|
103 /** |
|
104 * From CAlfSrvSubSessionBase |
|
105 * Processes the message. |
|
106 * |
|
107 * @param aMessage The message. |
|
108 */ |
|
109 void DoProcessMessageL(const RMessage2& aMessage); |
|
110 |
|
111 // defines whether group would like go to top or bottom of groups stack |
|
112 TInt& PreferredPos(); |
|
113 |
|
114 private: |
|
115 |
|
116 CAlfSrvControlGroupSubSession( CAlfAppSrvSessionBase& aSession, |
|
117 TInt aId ); |
|
118 |
|
119 void ConstructL(); |
|
120 |
|
121 void AppendL( const RMessage2& aMessage ); |
|
122 void RemoveL( const RMessage2& aMessage ); |
|
123 void EnableTransformationL( const RMessage2& aMessage ); |
|
124 |
|
125 // from subsessionbase |
|
126 CHuiControlGroup* AsHuiControlCroup(); |
|
127 |
|
128 private: // data |
|
129 |
|
130 CHuiControlGroup* iControlGroup; |
|
131 TInt iId; |
|
132 TBool iIsShown; |
|
133 CHuiControl* iHostControl; |
|
134 TInt iPrefrerredPos; |
|
135 }; |
|
136 |
|
137 #endif // C_ALFSRVCONTROLGROUPSUBSESSION_H |