|
1 /* |
|
2 * Copyright (c) 2002-2005 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: Header file for game data handler. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CDOCGAMEHANDLER_H |
|
20 #define CDOCGAMEHANDLER_H |
|
21 |
|
22 // INCLUDES |
|
23 |
|
24 #include "DocDefaultHandler.h" |
|
25 |
|
26 const TInt32 KMaxGameEngineDataID( 1000 ); |
|
27 const TInt KGameEngineUID( 0x101F5EDA ); |
|
28 |
|
29 _LIT( KGDCount, "GDCount"); |
|
30 |
|
31 /** |
|
32 * Game data handler for Nokia games. |
|
33 * Never launch any applications, just save the file/buffer |
|
34 * to game specific directory under c:\data\games\. |
|
35 */ |
|
36 NONSHARABLE_CLASS(CDocGameHandler) :public CDocDefaultHandler |
|
37 { |
|
38 public: // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * C++ default constructor. |
|
42 */ |
|
43 CDocGameHandler( |
|
44 const TDataType& aDataType, |
|
45 const TUid& aUid, |
|
46 CDocumentHandler* aDocDispatcher, |
|
47 TDocServiceMode aServiceMode ); |
|
48 |
|
49 /** |
|
50 * Two-phased constructor. |
|
51 */ |
|
52 static CDocGameHandler* NewL( |
|
53 const TDataType& aDataType, |
|
54 const TUid& aUid, |
|
55 CDocumentHandler* aDocDispatcher, |
|
56 TDocServiceMode aServiceMode ); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 virtual ~CDocGameHandler(); |
|
62 |
|
63 public: // New functions |
|
64 public: // Functions from base classes |
|
65 |
|
66 TInt CopyOrMoveL( const TUint aAttr ); |
|
67 |
|
68 TInt CopyHandleL( const RFile& aSourceFile, const TUint aAttr ); |
|
69 |
|
70 void PopulateAppInfo(); |
|
71 |
|
72 void ParseGameInfoFromFileL( const RFile& aFile ); |
|
73 void ParseGameInfoFromFileL( const TDesC& aFilename ); |
|
74 void ParseGameInfoFromBufL( const TDesC8& aBuffer ); |
|
75 TInt CheckGameDataTypeL( TInt32 aGameId ); |
|
76 |
|
77 protected: // New functions |
|
78 |
|
79 protected: // Functions from base classes |
|
80 |
|
81 /** |
|
82 * Get the data directory for the mime type. |
|
83 * |
|
84 * @param aDataType Data type |
|
85 * @param aUid App Uid |
|
86 * @param aPath absolute path to return |
|
87 * |
|
88 * @return KErrNone if success. If fail an error code. |
|
89 */ |
|
90 TInt GetDataDirL( |
|
91 const TDataType& aDataType, |
|
92 const TUid& aUid, |
|
93 TDes& aPath, |
|
94 TInt aDataSize); |
|
95 |
|
96 /** |
|
97 * Never a viewer operations, because we don't launch |
|
98 * games at all. |
|
99 * @return EFalse |
|
100 */ |
|
101 TBool IsViewerOperation( TDocOperation aOperation ); |
|
102 |
|
103 TInt NotifyGameEngine( const TUid& aUid ); |
|
104 |
|
105 private: |
|
106 |
|
107 /** |
|
108 * By default EPOC constructor is private. |
|
109 */ |
|
110 void ConstructL(); |
|
111 |
|
112 // By default, prohibit copy constructor |
|
113 CDocGameHandler( const CDocGameHandler& ); |
|
114 |
|
115 // Prohibit assigment operator |
|
116 CDocGameHandler& operator= ( const CDocGameHandler& ); |
|
117 |
|
118 public: // Data |
|
119 |
|
120 protected: // Data |
|
121 TInt32 iGameId; |
|
122 |
|
123 private: // Data |
|
124 |
|
125 public: // Friend classes |
|
126 |
|
127 protected: // Friend classes |
|
128 |
|
129 private: // Friend classes |
|
130 |
|
131 }; |
|
132 |
|
133 #endif // CDOCGAMEHANDLER_H |
|
134 |
|
135 // End of File |