|
1 // Copyright (c) 1999-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 // |
|
15 |
|
16 #ifndef __VWSDEF_partner_H__ |
|
17 #define __VWSDEF_partner_H__ |
|
18 |
|
19 #ifndef __VWSDEF_H__ |
|
20 #include <vwsdef.h> |
|
21 #endif |
|
22 |
|
23 |
|
24 #include <e32std.h> |
|
25 |
|
26 //class defined |
|
27 class TVwsViewEvent; |
|
28 |
|
29 //class referenced |
|
30 class TVwsViewId; |
|
31 |
|
32 /** |
|
33 @internalTechnology |
|
34 @released |
|
35 */ |
|
36 #define KNullViewId TVwsViewId(KNullUid,KNullUid) |
|
37 |
|
38 /** |
|
39 @internalTechnology |
|
40 @released |
|
41 */ |
|
42 const TInt KErrViewWrongMode=1; // !!! Wrong error code - should be -ve & unique |
|
43 |
|
44 |
|
45 /** |
|
46 @publishedPartner |
|
47 @released |
|
48 */ |
|
49 #define KUidCustomCrossCheckValue 0x80282748 |
|
50 |
|
51 /** |
|
52 @publishedPartner |
|
53 @released |
|
54 */ |
|
55 const TUid KUidCustomCrossCheck={KUidCustomCrossCheckValue}; |
|
56 |
|
57 class TVwsViewEvent |
|
58 /** |
|
59 The TVwsViewEvent class encapsulates the attributes of a view server event. |
|
60 These are: |
|
61 - The event type |
|
62 - The view ids of the two views associated with the event |
|
63 - The attributes of any message which can go with the event. |
|
64 |
|
65 @publishedPartner |
|
66 @released |
|
67 */ |
|
68 { |
|
69 public: |
|
70 enum TVwsViewEventType |
|
71 { |
|
72 EVwsActivateView, |
|
73 EVwsDeactivateView, |
|
74 EVwsScreenDeviceChanged, |
|
75 EVwsDeactivationNotification, |
|
76 EVwsActivationNotification, |
|
77 EVwsDeactivateViewDifferentInstance |
|
78 }; |
|
79 public: |
|
80 inline TVwsViewEvent(); |
|
81 inline TVwsViewEvent(TVwsViewEventType aEventType); |
|
82 inline TVwsViewEvent(TVwsViewEventType aEventType,const TVwsViewId& aViewOneId); |
|
83 inline TVwsViewEvent(TVwsViewEventType aEventType,const TVwsViewId& aViewOneId,const TVwsViewId& aViewTwoId); |
|
84 inline TVwsViewEvent(TVwsViewEventType aEventType,const TVwsViewId& aViewOneId,const TVwsViewId& aViewTwoId,TUid aCustomMessageId,TInt aCustomMessageLength); |
|
85 public: |
|
86 /** |
|
87 The event type. |
|
88 */ |
|
89 TVwsViewEventType iEventType; |
|
90 /** |
|
91 The first view id associated with the event. This has a different meaning for each of the event types: |
|
92 - For ActivateView events, it is the view to activate |
|
93 - For DeactivateView events, it is the view to deactivate |
|
94 - For ScreenDeviceChange events, it is the id of the currently active view |
|
95 - For ActivationNotification events, it is the id of the activated view |
|
96 - For DeactivationNotification events, it is the id of the deactivated view |
|
97 */ |
|
98 TVwsViewId iViewOneId; |
|
99 /** |
|
100 The second view id associated with the event. This has a different meaning for each of the event types: |
|
101 - For ActivateView events, it is the view that will be deactivated |
|
102 - For DeactivateView events, it is the view that has been activated |
|
103 - For ScreenDeviceChange events, it is unused |
|
104 - For ActivationNotification events, it is the view that will be deactivated |
|
105 - For DeactivationNotification events, it is the id of the view that has been activated |
|
106 */ |
|
107 TVwsViewId iViewTwoId; |
|
108 /** |
|
109 The type of message being passed in the custom message buffer |
|
110 */ |
|
111 TUid iCustomMessageId; |
|
112 /** |
|
113 The length of the custom message being held by the server. |
|
114 To retrieve the message itself from the server, a buffer of this length must be allocated |
|
115 */ |
|
116 TInt iCustomMessageLength; |
|
117 }; |
|
118 |
|
119 inline TVwsViewEvent::TVwsViewEvent() {} |
|
120 |
|
121 inline TVwsViewEvent::TVwsViewEvent(TVwsViewEventType aEventType) |
|
122 : iEventType(aEventType),iViewOneId(),iViewTwoId(),iCustomMessageId(KNullUid),iCustomMessageLength(0) {} |
|
123 |
|
124 inline TVwsViewEvent::TVwsViewEvent(TVwsViewEventType aEventType,const TVwsViewId& aViewOneId) |
|
125 : iEventType(aEventType),iViewOneId(aViewOneId),iViewTwoId(),iCustomMessageId(KNullUid),iCustomMessageLength(0) {} |
|
126 |
|
127 inline TVwsViewEvent::TVwsViewEvent(TVwsViewEventType aEventType,const TVwsViewId& aViewOneId,const TVwsViewId& aViewTwoId) |
|
128 : iEventType(aEventType),iViewOneId(aViewOneId),iViewTwoId(aViewTwoId),iCustomMessageId(KNullUid),iCustomMessageLength(0) {} |
|
129 |
|
130 inline TVwsViewEvent::TVwsViewEvent(TVwsViewEventType aEventType,const TVwsViewId& aViewOneId,const TVwsViewId& aViewTwoId,TUid aCustomMessageId,TInt aCustomMessageLength) |
|
131 : iEventType(aEventType),iViewOneId(aViewOneId),iViewTwoId(aViewTwoId),iCustomMessageId(aCustomMessageId),iCustomMessageLength(aCustomMessageLength) {} |
|
132 |
|
133 |
|
134 #endif |