|
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: Declares main application class. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __SERVER_H |
|
19 #define __SERVER_H |
|
20 #include <e32std.h> |
|
21 #include <e32base.h> |
|
22 #include "genericserver.h" |
|
23 #define RMESSAGE RMessage2 |
|
24 // ---------------------------------------------------------------------- |
|
25 // Panics: |
|
26 // Category: |
|
27 _LIT(KLayoutServerPanic, "LayoutServer"); |
|
28 |
|
29 // Codes: |
|
30 enum TLayoutServPanic |
|
31 { |
|
32 EBadRequest = 1, EBadDescriptor = 2, ENegativeSessionCount = 3 |
|
33 }; |
|
34 |
|
35 // ---------------------------------------------------------------------- |
|
36 |
|
37 class CLayoutMgrShutdown; |
|
38 class CLayoutLibrary; |
|
39 |
|
40 class CLayoutServer : public CGenericServer |
|
41 { |
|
42 public: |
|
43 static CLayoutServer* NewL(); |
|
44 static CLayoutServer* NewLC(); |
|
45 virtual ~CLayoutServer(); |
|
46 |
|
47 static TInt ThreadFunction(TAny* aThreadArg); |
|
48 |
|
49 void SessionAdded(); |
|
50 void SessionClosed(); |
|
51 |
|
52 TInt Layout() const; |
|
53 TInt SetLayout(TInt aLayoutId); |
|
54 |
|
55 TInt InitialLayout() const; |
|
56 void SetInitialLayoutL(TInt aCountry, TInt aVendor, TInt aProduct); |
|
57 |
|
58 TBool FoundLayout() const; |
|
59 TBool IsNokiaSu8() const; |
|
60 static void PanicClient(const RMessage2& aMessage, TInt aReason); |
|
61 static void PanicServer(TInt aPanic); |
|
62 |
|
63 private: |
|
64 CLayoutServer(); |
|
65 void ConstructL(); |
|
66 |
|
67 static void ThreadFunctionL(TStartupRequest* startup); |
|
68 |
|
69 // from CServer: |
|
70 virtual CSession2* NewSessionL(const TVersion& aVersion, |
|
71 const RMessage2& aMessage) const; |
|
72 |
|
73 protected: |
|
74 // from CActive: |
|
75 virtual TInt RunError(TInt aErr); |
|
76 |
|
77 private: |
|
78 TInt iSessionCount; |
|
79 |
|
80 CLayoutLibrary* iLayoutLibrary; |
|
81 CLayoutMgrShutdown* iShutdown; |
|
82 |
|
83 TInt iInitialLayout; |
|
84 |
|
85 TBool iIsNokiaSu8; |
|
86 TBool iFoundLayout; |
|
87 }; |
|
88 |
|
89 // ---------------------------------------------------------------------- |
|
90 |
|
91 #endif |