|
1 /* |
|
2 * Copyright (c) 2004 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 applications framework: Open file service implementation |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef AKNOPENFILESERVICEIMPL_H |
|
21 #define AKNOPENFILESERVICEIMPL_H |
|
22 |
|
23 #include "AknOpenFileService.h" |
|
24 #include <f32file.h> |
|
25 |
|
26 class CAiwGenericParamList; |
|
27 class CBufStore; |
|
28 class CStreamDictionary; |
|
29 class CEikDocument; |
|
30 |
|
31 // dummy UID |
|
32 const TUid KAknOpenFileServiceUid = { 0x101F8826 }; |
|
33 |
|
34 // --------------------------------------------------------- |
|
35 // |
|
36 // --------------------------------------------------------- |
|
37 // |
|
38 enum TAknOpenFileServiceCmds |
|
39 { |
|
40 EAknOpenFileServiceCmdOpenFilename = RApaAppServiceBase::KServiceCmdBase, |
|
41 EAknOpenFileServiceCmdOpenHandle, |
|
42 EAknOpenFileServiceCmdOpenFilenameWithParams, |
|
43 EAknOpenFileServiceCmdOpenHandleWithParams |
|
44 }; |
|
45 |
|
46 |
|
47 // --------------------------------------------------------- |
|
48 // |
|
49 // --------------------------------------------------------- |
|
50 // |
|
51 NONSHARABLE_CLASS(RAknOpenFileService) : public RAknAppServiceBase |
|
52 { |
|
53 public: |
|
54 void OpenFileNameL(const TDesC& aFileName); |
|
55 void OpenFileNameL(const TDesC& aFileName, CAiwGenericParamList* aParam); |
|
56 void OpenHandleL(const RFile& aFile, CAiwGenericParamList* aParam); |
|
57 private: |
|
58 TUid ServiceUid() const; |
|
59 }; |
|
60 |
|
61 |
|
62 // --------------------------------------------------------- |
|
63 // |
|
64 // --------------------------------------------------------- |
|
65 // |
|
66 NONSHARABLE_CLASS(CAknOpenFileServiceImpl) : public CAknOpenFileService |
|
67 { |
|
68 public: |
|
69 ~CAknOpenFileServiceImpl(); |
|
70 CAknOpenFileServiceImpl(); |
|
71 |
|
72 void ConstructL( |
|
73 const TDesC& aFileName, MAknServerAppExitObserver* aObserver, CAiwGenericParamList* aParam); |
|
74 |
|
75 void ConstructL( |
|
76 const TUid& aAppUid, const RFile& aFileHandle, MAknServerAppExitObserver* aObserver, CAiwGenericParamList* aParam); |
|
77 private: |
|
78 TUid FindAppForFileL(const TDesC& aFileName); |
|
79 |
|
80 private: |
|
81 RAknOpenFileService iService; |
|
82 CApaServerAppExitMonitor* iMonitor; |
|
83 }; |
|
84 |
|
85 |
|
86 // --------------------------------------------------------- |
|
87 // |
|
88 // --------------------------------------------------------- |
|
89 // |
|
90 NONSHARABLE_CLASS(CAknOpenFileServiceSession) : public CAknAppServiceBase |
|
91 { |
|
92 public: |
|
93 CAknOpenFileServiceSession(); |
|
94 ~CAknOpenFileServiceSession(); |
|
95 |
|
96 protected: // from CSession2 |
|
97 void CreateL(); |
|
98 void ServiceL(const RMessage2& aMessage); |
|
99 void ServiceError(const RMessage2& aMessage,TInt aError); |
|
100 |
|
101 private: |
|
102 void OpenFileNameL(const RMessage2& aMessage); |
|
103 void OpenFileNameWithParamsL(const RMessage2& aMessage); |
|
104 void OpenHandleWithParamsL(const RMessage2& aMessage); |
|
105 void ExternalizeParamsL(CAiwGenericParamList* aParamList); |
|
106 |
|
107 private: |
|
108 |
|
109 /** |
|
110 * In memory store for parameter passing |
|
111 */ |
|
112 CBufStore* iStore; |
|
113 |
|
114 /** |
|
115 * Store dictionary for parameter passing |
|
116 */ |
|
117 CStreamDictionary* iDictionary; |
|
118 |
|
119 /** |
|
120 * Stream id for parameter passing |
|
121 */ |
|
122 TStreamId iStreamId; |
|
123 |
|
124 CEikDocument* iDoc; |
|
125 |
|
126 }; |
|
127 |
|
128 #endif |
|
129 |
|
130 // End of file. |