|
1 /* |
|
2 * Copyright (c) 2005-2006 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: Scans for matching jad files |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef JCFJADJARMATCHERSCANJADFILES_H |
|
20 #define JCFJADJARMATCHERSCANJADFILES_H |
|
21 |
|
22 #include <memory> |
|
23 |
|
24 #include "jcfjadjarmatcherstates.h" |
|
25 |
|
26 /** |
|
27 * Scanner class. |
|
28 * Search matching JAD files. |
|
29 * |
|
30 * @lib JcfJadJarMatcher.lib |
|
31 * @since S60 2.0 |
|
32 */ |
|
33 class CJcfJadJarMatcherScanJadFiles : public CJcfJadJarMatcherState |
|
34 { |
|
35 public: |
|
36 /** |
|
37 * To construct new CJcfJadJarMatcherScanJadFiles. |
|
38 * |
|
39 * Preconditions. The following conditions must be true prior to calling |
|
40 * this method; otherwise, its operation is undefined. |
|
41 * - None. |
|
42 * |
|
43 * Postconditions. The following condition is true immediately after |
|
44 * returning from this method. |
|
45 * - None. |
|
46 * |
|
47 * @param aObs - an observer of this object. |
|
48 * @param aFs - a reference to the file server session. |
|
49 */ |
|
50 CJcfJadJarMatcherScanJadFiles(MJcfJadJarMatcherObserver* aObs, RFs& aFs); |
|
51 |
|
52 /** |
|
53 * To destruct CJcfJadJarMatcherState. |
|
54 * |
|
55 * Preconditions. The following conditions must be true prior to calling |
|
56 * this method; otherwise, its operation is undefined. |
|
57 * - None. |
|
58 * |
|
59 * Postconditions. The following condition is true immediately after |
|
60 * returning from this method. |
|
61 * - No pending request. |
|
62 * |
|
63 */ |
|
64 virtual ~CJcfJadJarMatcherScanJadFiles(); |
|
65 |
|
66 /** |
|
67 * To execute this state. |
|
68 * |
|
69 * Preconditions. The following conditions must be true prior to calling |
|
70 * this method; otherwise, its operation is undefined. |
|
71 * - aJadNamePtr.Length() >= 256. |
|
72 * |
|
73 * Postconditions. The following condition is true immediately after |
|
74 * returning from this method. |
|
75 * - iState == EOpenJarFile. |
|
76 * |
|
77 * @param aJarName - a name of the JAR file. |
|
78 * @param aDirName - a name of the directory to be scanned. |
|
79 * @param aJadNamePtr - a pointer to the descriptor, where name of the JAD file |
|
80 * is stored. |
|
81 * @return None. |
|
82 * @leave Creation of the JAR file fails. |
|
83 * @leave Creation of iDir descriptor fails. |
|
84 */ |
|
85 virtual void ExecuteL(const TDesC& aJarName, const TDesC& aDirName, TDes* aJadNamePtr); |
|
86 |
|
87 protected: |
|
88 /** |
|
89 * To match JAR and JAD files from public folders. |
|
90 * |
|
91 * Preconditions. The following conditions must be true prior to calling |
|
92 * this method; otherwise, its operation is undefined. |
|
93 * - Successfull call of ExecuteL. |
|
94 * |
|
95 * Postconditions. The following condition is true immediately after |
|
96 * returning from this method. |
|
97 * - None. |
|
98 * |
|
99 * @leave If abnormal execution, e.g., allocation fails. |
|
100 */ |
|
101 virtual void RunL(); |
|
102 |
|
103 /** |
|
104 * To cancel this object activity. |
|
105 * |
|
106 * Preconditions. The following conditions must be true prior to calling |
|
107 * this method; otherwise, its operation is undefined. |
|
108 * - None. |
|
109 * |
|
110 * Postconditions. The following condition is true immediately after |
|
111 * returning from this method. |
|
112 * - No pending requests. |
|
113 * |
|
114 */ |
|
115 virtual void DoCancel(); |
|
116 |
|
117 private: |
|
118 /** |
|
119 * To do clean-up for next round. |
|
120 * |
|
121 * Preconditions. The following conditions must be true prior to calling |
|
122 * this method; otherwise, its operation is undefined. |
|
123 * - None. |
|
124 * |
|
125 * Postconditions. The following condition is true immediately after |
|
126 * returning from this method. |
|
127 * - iState == EBegin. |
|
128 * |
|
129 */ |
|
130 void Cleanup(); |
|
131 |
|
132 /** |
|
133 * To complete pending request and set this object active. |
|
134 * |
|
135 * Preconditions. The following conditions must be true prior to calling |
|
136 * this method; otherwise, its operation is undefined. |
|
137 * - None. |
|
138 * |
|
139 * Postconditions. The following condition is true immediately after |
|
140 * returning from this method. |
|
141 * - iActive == ETrue. |
|
142 * - iStatus == KErrNone. |
|
143 * |
|
144 */ |
|
145 void SetObjectActive(); |
|
146 |
|
147 private: |
|
148 TFindFile iFf; |
|
149 TBool iAdHocGuess; |
|
150 TBool iIsAbsolute; |
|
151 TMode iMode; |
|
152 TInt iIndex; |
|
153 TDes* iJadFileNamePtr; |
|
154 HBufC* iDir; |
|
155 CDir* iFl; |
|
156 RPointerArray<Java::MJavaAttribute>iAttributes; |
|
157 std::auto_ptr<HBufC> iFullJarName; |
|
158 RFs& iFs; |
|
159 }; |
|
160 |
|
161 #endif // JCFJADJARMATCHERSCANJADFILES_H |
|
162 |