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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
24 // Forward declarations.
28 class CVwsSessionEventHandler;
32 class MVwsSessionWrapperObserver
34 The MVwsSessionObserver specifies an interface through which server events to be handled by the owner of
35 a client session are notified
40 //@internalTechnology @released
46 * Handles the view event aEvent for a view added through the client session being observed.
47 * Handles events for all the views added by the client.
49 virtual void HandleViewEventL(const TVwsViewEvent& aEvent)=0;
52 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
54 class CVwsSessionWrapper : public CBase
56 The CVwsSessionWrapper class mediates access to the view server client session which it creates, and wraps in
57 support for notification of server events. A session observer will be called back with server events if
58 it maintains an outstanding request for asynchronous event notification.
63 //@internalTechnology @released
67 IMPORT_C static CVwsSessionWrapper* NewL();
68 IMPORT_C static CVwsSessionWrapper* NewLC();
69 IMPORT_C static CVwsSessionWrapper* NewL(MVwsSessionWrapperObserver& aObserver);
70 IMPORT_C static CVwsSessionWrapper* NewLC(MVwsSessionWrapperObserver& aObserver);
71 IMPORT_C ~CVwsSessionWrapper();
72 IMPORT_C static TInt StartViewServer(MVwsAppStarter& aAppStarter);
73 IMPORT_C TInt ShutdownViewServer();
74 IMPORT_C TInt AddView(const TVwsViewId& aViewId);
75 IMPORT_C TInt RemoveView(const TVwsViewId& aViewId) const;
76 IMPORT_C TInt SetSystemDefaultView(const TVwsViewId& aViewId,TInt aMode);
77 IMPORT_C TInt SetSystemDefaultView(const TVwsViewId& aViewId);
78 IMPORT_C TInt ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage);
79 IMPORT_C TInt ActivateViewViaViewEvent(const TVwsViewIdAndMessage& aViewIdAndMessage);
80 IMPORT_C TInt RequestCustomMessage(TDes8& aMessageBufPtr) const;
81 IMPORT_C void QueueAsyncRequest();
82 IMPORT_C TInt StartApp(TUid aAppToStart);
83 IMPORT_C TInt DeactivateActiveView();
84 IMPORT_C TInt DeactivateActiveViewIfOwnerMatch();
85 IMPORT_C TInt NotifyNextDeactivation(const TVwsViewId& aViewId);
86 IMPORT_C TInt NotifyNextDeactivation();
87 IMPORT_C TInt NotifyNextActivation(const TVwsViewId& aViewId);
88 IMPORT_C TInt NotifyNextActivation();
89 IMPORT_C TInt SetDefaultView(const TVwsViewId& aViewId,TInt aMode) const;
90 IMPORT_C TInt SetDefaultView(const TVwsViewId& aViewId) const;
91 IMPORT_C TInt GetSystemDefaultView(TVwsViewId& aViewId);
92 IMPORT_C TInt CreateActivateViewEvent(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage);
93 IMPORT_C TInt SetClientRequestTimeOut(TTimeIntervalMicroSeconds32 aDuration);
94 IMPORT_C TInt SetServerEventTimeOut(TTimeIntervalMicroSeconds32 aDuration);
95 IMPORT_C TInt EnableServerEventTimeOut(TBool aEnable);
96 IMPORT_C TInt CheckSourceOfViewSwitch(TBool& aResult,const TSecurityPolicy& aSecurityPolicy,const char* aDiagnostic);
97 IMPORT_C TInt EnableServerBlankScreen(TBool aEnable);
98 IMPORT_C TInt EnableExternalViewSwitches(TBool aEnable);
99 IMPORT_C void ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TRequestStatus& aStatus);
100 IMPORT_C TInt SetCrossCheckUid(const TUid& aCrossCheckUid);
101 IMPORT_C TInt SetWindowBackgroundColor(const TRgb& aBgColor);
107 IMPORT_C TInt ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TInt aCustomControl);
112 IMPORT_C void ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TRequestStatus& aStatus, TInt aCustomControl);
116 */IMPORT_C TInt CreateActivateViewEvent(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TInt aCustomControl);
121 IMPORT_C TInt GetCurrentActiveViewInSystem(TVwsViewId& aActiveViewId);
123 CVwsSessionWrapper();
124 CVwsSessionWrapper(MVwsSessionWrapperObserver& aObserver);
126 TInt CheckCreateViewServerSession();
127 TBool IsSchedulerRunning();
129 RVwsSession* iVwsSession;
130 CVwsSessionEventHandler* iViewEventHandler;
131 MVwsSessionWrapperObserver* iObserver;
142 EVwsCreateScheduler=1,
149 GLREF_C void Panic(TVwsPanic aPanic);
156 GLDEF_C TInt ViewServerThreadStart(TAny* aPtr);
161 struct SVwsCommandLine
163 MVwsAppStarter* iAppStarter;
166 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS