perfapps/memspyui/ui/avkon/inc/viewcli.h
changeset 51 b048e15729d6
parent 17 4f2773374eff
equal deleted inserted replaced
44:5db69f4c3d06 51:b048e15729d6
       
     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_H__
       
    17 #define __VIEWCLI_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <gdi.h>
       
    21 #include <vwsdef.h>
       
    22 
       
    23 //
       
    24 // Forward declarations.
       
    25 //
       
    26 
       
    27 class RVwsSession;
       
    28 class CVwsSessionEventHandler;
       
    29 class MVwsAppStarter;
       
    30 
       
    31 class MVwsSessionWrapperObserver
       
    32 /**
       
    33 The MVwsSessionObserver specifies an interface through which server events to be handled by the owner of
       
    34 a client session are notified
       
    35 
       
    36 @publishedAll 
       
    37 @deprecated
       
    38 */
       
    39 //@internalTechnology @released
       
    40 
       
    41 	{
       
    42 public:	
       
    43 
       
    44 	/**
       
    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.
       
    47 	 */
       
    48 	virtual void HandleViewEventL(const TVwsViewEvent& aEvent)=0;
       
    49 	};
       
    50 
       
    51 
       
    52 class CVwsSessionWrapper : public CBase
       
    53 /**
       
    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.
       
    57 
       
    58 @publishedPartner 
       
    59 @released 
       
    60 */
       
    61 //@internalTechnology @released
       
    62 
       
    63 	{
       
    64 public:	
       
    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);
       
   100 public:	
       
   101 	/**
       
   102 	@internalComponent
       
   103 	@released
       
   104 	*/
       
   105 	IMPORT_C TInt ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TInt aCustomControl);
       
   106 	/**
       
   107 	@internalComponent
       
   108 	@released
       
   109 	*/
       
   110 	IMPORT_C void ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TRequestStatus& aStatus, TInt aCustomControl);
       
   111 	/**
       
   112 	@internalComponent
       
   113 	@released
       
   114 	*/IMPORT_C TInt CreateActivateViewEvent(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TInt aCustomControl);
       
   115 	/**
       
   116 	@internalComponent
       
   117 	@released
       
   118 	*/
       
   119 	IMPORT_C TInt GetCurrentActiveViewInSystem(TVwsViewId& aActiveViewId);
       
   120 private:
       
   121 	CVwsSessionWrapper();
       
   122 	CVwsSessionWrapper(MVwsSessionWrapperObserver& aObserver);
       
   123 	void ConstructL();
       
   124 	TInt CheckCreateViewServerSession();
       
   125 	TBool IsSchedulerRunning();
       
   126 private:
       
   127 	RVwsSession* iVwsSession;
       
   128 	CVwsSessionEventHandler* iViewEventHandler;
       
   129 	MVwsSessionWrapperObserver* iObserver;
       
   130 	};
       
   131 
       
   132 
       
   133 //
       
   134 // Panic.
       
   135 //
       
   136 /**
       
   137 @internalComponent
       
   138 */
       
   139 enum TVwsPanic
       
   140 	{
       
   141 	EVwsCreateScheduler=1,
       
   142 	EVwsThreadRename
       
   143 	};
       
   144 
       
   145 /**
       
   146 @internalComponent
       
   147 */
       
   148 GLREF_C void Panic(TVwsPanic aPanic);
       
   149 
       
   150 /**
       
   151 Server thread start.
       
   152 
       
   153 @internalComponent
       
   154 */
       
   155 GLDEF_C TInt ViewServerThreadStart(TAny* aPtr);
       
   156 
       
   157 /**
       
   158 @internalComponent
       
   159 */
       
   160 struct SVwsCommandLine
       
   161 	{
       
   162 	MVwsAppStarter* iAppStarter;
       
   163 	};
       
   164 
       
   165 
       
   166 #endif