|
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 __VIEWCLI_partner_H__ |
|
17 #define __VIEWCLI_partner_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <gdi.h> |
|
21 #include <vwsdef.h> |
|
22 |
|
23 |
|
24 //classes referenced |
|
25 class RVwsSession; |
|
26 class CVwsSessionEventHandler; |
|
27 class MVwsAppStarter; |
|
28 class MVwsSessionWrapperObserver; |
|
29 |
|
30 class CVwsSessionWrapper : public CBase |
|
31 /** |
|
32 The CVwsSessionWrapper class mediates access to the view server client session which it creates, and wraps in |
|
33 support for notification of server events. A session observer will be called back with server events if |
|
34 it maintains an outstanding request for asynchronous event notification. |
|
35 |
|
36 @publishedPartner |
|
37 @released |
|
38 */ |
|
39 |
|
40 { |
|
41 public: |
|
42 IMPORT_C static CVwsSessionWrapper* NewL(); |
|
43 IMPORT_C static CVwsSessionWrapper* NewLC(); |
|
44 IMPORT_C static CVwsSessionWrapper* NewL(MVwsSessionWrapperObserver& aObserver); |
|
45 IMPORT_C static CVwsSessionWrapper* NewLC(MVwsSessionWrapperObserver& aObserver); |
|
46 IMPORT_C ~CVwsSessionWrapper(); |
|
47 IMPORT_C static TInt StartViewServer(MVwsAppStarter& aAppStarter); |
|
48 IMPORT_C TInt ShutdownViewServer(); |
|
49 IMPORT_C TInt AddView(const TVwsViewId& aViewId); |
|
50 IMPORT_C TInt RemoveView(const TVwsViewId& aViewId) const; |
|
51 IMPORT_C TInt SetSystemDefaultView(const TVwsViewId& aViewId,TInt aMode); |
|
52 IMPORT_C TInt SetSystemDefaultView(const TVwsViewId& aViewId); |
|
53 IMPORT_C TInt ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage); |
|
54 IMPORT_C TInt ActivateViewViaViewEvent(const TVwsViewIdAndMessage& aViewIdAndMessage); |
|
55 IMPORT_C TInt RequestCustomMessage(TDes8& aMessageBufPtr) const; |
|
56 IMPORT_C void QueueAsyncRequest(); |
|
57 IMPORT_C TInt StartApp(TUid aAppToStart); |
|
58 IMPORT_C TInt DeactivateActiveView(); |
|
59 IMPORT_C TInt DeactivateActiveViewIfOwnerMatch(); |
|
60 IMPORT_C TInt NotifyNextDeactivation(const TVwsViewId& aViewId); |
|
61 IMPORT_C TInt NotifyNextDeactivation(); |
|
62 IMPORT_C TInt NotifyNextActivation(const TVwsViewId& aViewId); |
|
63 IMPORT_C TInt NotifyNextActivation(); |
|
64 IMPORT_C TInt SetDefaultView(const TVwsViewId& aViewId,TInt aMode) const; |
|
65 IMPORT_C TInt SetDefaultView(const TVwsViewId& aViewId) const; |
|
66 IMPORT_C TInt GetSystemDefaultView(TVwsViewId& aViewId); |
|
67 IMPORT_C TInt CreateActivateViewEvent(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage); |
|
68 IMPORT_C TInt SetClientRequestTimeOut(TTimeIntervalMicroSeconds32 aDuration); |
|
69 IMPORT_C TInt SetServerEventTimeOut(TTimeIntervalMicroSeconds32 aDuration); |
|
70 IMPORT_C TInt EnableServerEventTimeOut(TBool aEnable); |
|
71 IMPORT_C TInt CheckSourceOfViewSwitch(TBool& aResult,const TSecurityPolicy& aSecurityPolicy,const char* aDiagnostic); |
|
72 IMPORT_C TInt EnableServerBlankScreen(TBool aEnable); |
|
73 IMPORT_C TInt EnableExternalViewSwitches(TBool aEnable); |
|
74 IMPORT_C void ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TRequestStatus& aStatus); |
|
75 IMPORT_C TInt SetCrossCheckUid(const TUid& aCrossCheckUid); |
|
76 IMPORT_C TInt SetWindowBackgroundColor(const TRgb& aBgColor); |
|
77 public: |
|
78 |
|
79 IMPORT_C TInt ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TInt aCustomControl); |
|
80 |
|
81 IMPORT_C void ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TRequestStatus& aStatus, TInt aCustomControl); |
|
82 |
|
83 IMPORT_C TInt CreateActivateViewEvent(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TInt aCustomControl); |
|
84 |
|
85 IMPORT_C TInt GetCurrentActiveViewInSystem(TVwsViewId& aActiveViewId); |
|
86 private: |
|
87 CVwsSessionWrapper(); |
|
88 CVwsSessionWrapper(MVwsSessionWrapperObserver& aObserver); |
|
89 void ConstructL(); |
|
90 TInt CheckCreateViewServerSession(); |
|
91 TBool IsSchedulerRunning(); |
|
92 private: |
|
93 RVwsSession* iVwsSession; |
|
94 CVwsSessionEventHandler* iViewEventHandler; |
|
95 MVwsSessionWrapperObserver* iObserver; |
|
96 }; |
|
97 |
|
98 #endif |
|
99 |