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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
24 // Forward declarations.
28 class CVwsSessionEventHandler;
31 class MVwsSessionWrapperObserver
33 The MVwsSessionObserver specifies an interface through which server events to be handled by the owner of
34 a client session are notified
39 //@internalTechnology @released
45 * Handles the view event aEvent for a view added through the client session being observed.
46 * Handles events for all the views added by the client.
48 virtual void HandleViewEventL(const TVwsViewEvent& aEvent)=0;
52 class CVwsSessionWrapper : public CBase
54 The CVwsSessionWrapper class mediates access to the view server client session which it creates, and wraps in
55 support for notification of server events. A session observer will be called back with server events if
56 it maintains an outstanding request for asynchronous event notification.
61 //@internalTechnology @released
65 IMPORT_C static CVwsSessionWrapper* NewL();
66 IMPORT_C static CVwsSessionWrapper* NewLC();
67 IMPORT_C static CVwsSessionWrapper* NewL(MVwsSessionWrapperObserver& aObserver);
68 IMPORT_C static CVwsSessionWrapper* NewLC(MVwsSessionWrapperObserver& aObserver);
69 IMPORT_C ~CVwsSessionWrapper();
70 IMPORT_C static TInt StartViewServer(MVwsAppStarter& aAppStarter);
71 IMPORT_C TInt ShutdownViewServer();
72 IMPORT_C TInt AddView(const TVwsViewId& aViewId);
73 IMPORT_C TInt RemoveView(const TVwsViewId& aViewId) const;
74 IMPORT_C TInt SetSystemDefaultView(const TVwsViewId& aViewId,TInt aMode);
75 IMPORT_C TInt SetSystemDefaultView(const TVwsViewId& aViewId);
76 IMPORT_C TInt ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage);
77 IMPORT_C TInt ActivateViewViaViewEvent(const TVwsViewIdAndMessage& aViewIdAndMessage);
78 IMPORT_C TInt RequestCustomMessage(TDes8& aMessageBufPtr) const;
79 IMPORT_C void QueueAsyncRequest();
80 IMPORT_C TInt StartApp(TUid aAppToStart);
81 IMPORT_C TInt DeactivateActiveView();
82 IMPORT_C TInt DeactivateActiveViewIfOwnerMatch();
83 IMPORT_C TInt NotifyNextDeactivation(const TVwsViewId& aViewId);
84 IMPORT_C TInt NotifyNextDeactivation();
85 IMPORT_C TInt NotifyNextActivation(const TVwsViewId& aViewId);
86 IMPORT_C TInt NotifyNextActivation();
87 IMPORT_C TInt SetDefaultView(const TVwsViewId& aViewId,TInt aMode) const;
88 IMPORT_C TInt SetDefaultView(const TVwsViewId& aViewId) const;
89 IMPORT_C TInt GetSystemDefaultView(TVwsViewId& aViewId);
90 IMPORT_C TInt CreateActivateViewEvent(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage);
91 IMPORT_C TInt SetClientRequestTimeOut(TTimeIntervalMicroSeconds32 aDuration);
92 IMPORT_C TInt SetServerEventTimeOut(TTimeIntervalMicroSeconds32 aDuration);
93 IMPORT_C TInt EnableServerEventTimeOut(TBool aEnable);
94 IMPORT_C TInt CheckSourceOfViewSwitch(TBool& aResult,const TSecurityPolicy& aSecurityPolicy,const char* aDiagnostic);
95 IMPORT_C TInt EnableServerBlankScreen(TBool aEnable);
96 IMPORT_C TInt EnableExternalViewSwitches(TBool aEnable);
97 IMPORT_C void ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TRequestStatus& aStatus);
98 IMPORT_C TInt SetCrossCheckUid(const TUid& aCrossCheckUid);
99 IMPORT_C TInt SetWindowBackgroundColor(const TRgb& aBgColor);
105 IMPORT_C TInt ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TInt aCustomControl);
110 IMPORT_C void ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TRequestStatus& aStatus, TInt aCustomControl);
114 */IMPORT_C TInt CreateActivateViewEvent(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TInt aCustomControl);
119 IMPORT_C TInt GetCurrentActiveViewInSystem(TVwsViewId& aActiveViewId);
121 CVwsSessionWrapper();
122 CVwsSessionWrapper(MVwsSessionWrapperObserver& aObserver);
124 TInt CheckCreateViewServerSession();
125 TBool IsSchedulerRunning();
127 RVwsSession* iVwsSession;
128 CVwsSessionEventHandler* iViewEventHandler;
129 MVwsSessionWrapperObserver* iObserver;
141 EVwsCreateScheduler=1,
148 GLREF_C void Panic(TVwsPanic aPanic);
155 GLDEF_C TInt ViewServerThreadStart(TAny* aPtr);
160 struct SVwsCommandLine
162 MVwsAppStarter* iAppStarter;