|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: server class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef TSFSWSERVER_H |
|
20 #define TSFSWSERVER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include "tsfswcommon.h" |
|
24 #include "tsfswobservers.h" |
|
25 |
|
26 /** |
|
27 * Possible panic reasons. |
|
28 */ |
|
29 enum TTsFswPanic |
|
30 { |
|
31 EPanicBadDescriptor, |
|
32 EPanicIllegalFunction, |
|
33 EPanicAccessDenied |
|
34 }; |
|
35 |
|
36 /** |
|
37 * Panic name. |
|
38 */ |
|
39 _LIT( KTsFswPanicName, "tsfsw" ); |
|
40 |
|
41 class CTsFswEngine; |
|
42 class CTsFswAppUi; |
|
43 |
|
44 /** |
|
45 * Ts FastSwap Server. |
|
46 */ |
|
47 class CTsFswServer : public CServer2, public MTsFswEngineObserver |
|
48 { |
|
49 public: |
|
50 static CTsFswServer* NewLC( CTsFswAppUi& aAppUi ); |
|
51 ~CTsFswServer(); |
|
52 void AddSession(); |
|
53 void DropSession(); |
|
54 |
|
55 void SerializeAndGetBufferSizeL( const RMessage2& aMessage ); |
|
56 void GetBufferL( const RMessage2& aMessage ); |
|
57 void CloseAppL( TInt aWgId ); |
|
58 void SwitchToAppL( TInt aWgId ); |
|
59 void ForegroundAppUidL( const RMessage2& aMessage ); |
|
60 |
|
61 private: |
|
62 CTsFswServer( TInt aPriority, CTsFswAppUi& aAppUi ); |
|
63 void ConstructL(); |
|
64 CSession2* NewSessionL( const TVersion& aVersion, |
|
65 const RMessage2& aMessage ) const; |
|
66 |
|
67 // from MTsFswEngineObserver |
|
68 void FswDataChanged(); |
|
69 TInt FswDataListenerCount(); |
|
70 |
|
71 private: |
|
72 TInt iSessionCount; |
|
73 CTsFswEngine* iEngine; |
|
74 CBufFlat* iBuffer; |
|
75 CTsFswAppUi& iAppUi; |
|
76 }; |
|
77 |
|
78 #endif |