63
|
1 |
/*
|
|
2 |
* Copyright (c) 2007 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:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef CPCS_PLUGIN_INTERFACE_H
|
|
19 |
#define CPCS_PLUGIN_INTERFACE_H
|
|
20 |
|
|
21 |
// INCLUDE FILES
|
|
22 |
#include <s32mem.h>
|
|
23 |
#include <coemain.h>
|
|
24 |
|
|
25 |
#include <CPcsDefs.h>
|
|
26 |
#include "CPsClientData.h"
|
|
27 |
#include "CPsQuery.h"
|
|
28 |
#include "CPsSettings.h"
|
|
29 |
#include "CPsPattern.h"
|
|
30 |
|
|
31 |
// FORWARD DECLARATION
|
|
32 |
class CPcsPlugin;
|
|
33 |
|
|
34 |
/**
|
|
35 |
* Class is used to instantiate the required plugins when the search has been
|
|
36 |
* asked. Acts as interface to all Plugins.
|
|
37 |
*/
|
|
38 |
|
|
39 |
class CPcsPluginInterface: public CBase
|
|
40 |
{
|
|
41 |
public:
|
|
42 |
|
|
43 |
/**
|
|
44 |
* Symbian OS 2 phased constructor.
|
|
45 |
* @return A pointer to the created instance of CPcsPluginInterface.
|
|
46 |
*/
|
|
47 |
static CPcsPluginInterface* NewL();
|
|
48 |
|
|
49 |
/**
|
|
50 |
* Symbian OS 2 phased constructor.
|
|
51 |
* @return A pointer to the created instance of CPcsPluginInterface.
|
|
52 |
*/
|
|
53 |
static CPcsPluginInterface* NewLC();
|
|
54 |
|
|
55 |
/**
|
|
56 |
* Destructor.
|
|
57 |
*/
|
|
58 |
virtual ~CPcsPluginInterface();
|
|
59 |
|
|
60 |
/**
|
|
61 |
* Instantiates the required search plug-ins known by the ecom framework.
|
|
62 |
* basically this function first calls ListAllImplementationsL()
|
|
63 |
* and then checks them one by one to match the algorithm name
|
|
64 |
*/
|
|
65 |
void InstantiateAlgorithmL(TDes& aAlgorithm);
|
|
66 |
|
|
67 |
/**
|
|
68 |
* Unloads all plugins
|
|
69 |
* This should internally call REComSession::DestroyedImplementation( iDtor_ID_Key )
|
|
70 |
* and then REComSession::FinalClose()
|
|
71 |
*/
|
|
72 |
void UnloadPlugIns();
|
|
73 |
|
|
74 |
/**
|
|
75 |
* Lists all implementations which satisfy this ecom interface
|
|
76 |
*
|
|
77 |
* @param aImplInfoArray On return, contains the list of available implementations
|
|
78 |
*
|
|
79 |
*/
|
|
80 |
inline void ListAllImplementationsL( RImplInfoPtrArray& aImplInfoArray )
|
|
81 |
{
|
|
82 |
REComSession::ListImplementationsL( KPcsPluginInterfaceUid, aImplInfoArray );
|
|
83 |
}
|
|
84 |
|
|
85 |
/**
|
|
86 |
* Forwards the search request to the algorithm instance
|
|
87 |
*/
|
|
88 |
void PerformSearchL(CPsSettings& aSettings,
|
|
89 |
CPsQuery& aCondition,
|
|
90 |
RPointerArray<CPsClientData>& aPsData,
|
|
91 |
RPointerArray<CPsPattern>& aPattern);
|
|
92 |
/**
|
|
93 |
* Forwards the search request to the algorithm instance
|
|
94 |
*/
|
|
95 |
void SearchInputL(CPsQuery& aSearchQuery,
|
|
96 |
TDesC& aSearchData,
|
|
97 |
RPointerArray<TDesC>& aMatchSet,
|
|
98 |
RArray<TPsMatchLocation>& aMatchLocation);
|
|
99 |
|
|
100 |
/**
|
|
101 |
* Forwards the search request to the algorithm instance
|
|
102 |
*/
|
|
103 |
void SearchMatchStringL(CPsQuery& aSearchQuery,
|
|
104 |
TDesC& aSearchData,
|
|
105 |
TDes& aMatch );
|
|
106 |
|
|
107 |
/**
|
|
108 |
* Forwards the request to check if language is supported
|
|
109 |
* to the algorithm instance
|
|
110 |
*/
|
|
111 |
TBool IsLanguageSupportedL(const TUint32 aLanguage);
|
|
112 |
|
|
113 |
/**
|
|
114 |
* Forwards the request to recover data fields order for a URI
|
|
115 |
* to the algorithm instance
|
|
116 |
*/
|
|
117 |
void GetDataOrderL(TDesC& aURI, RArray<TInt>& aDataOrder);
|
|
118 |
|
|
119 |
/**
|
|
120 |
* Forwards the request to recover sort order for a URI
|
|
121 |
* to the algorithm instance
|
|
122 |
*/
|
|
123 |
void GetSortOrderL(TDesC& aURI, RArray<TInt>& aSortOrder);
|
|
124 |
|
|
125 |
/**
|
|
126 |
* Forwards the request to set sort order for a URI
|
|
127 |
* to the algorithm instance
|
|
128 |
*/
|
|
129 |
void ChangeSortOrderL(TDesC& aURI, RArray<TInt>& aSortOrder);
|
|
130 |
|
|
131 |
/**
|
|
132 |
* Forwards the request to get the Adaptive Grid for one or more URI
|
|
133 |
* to the algorithm instance
|
|
134 |
*/
|
|
135 |
void GetAdaptiveGridL( const MDesCArray& aURIs,
|
|
136 |
const TBool aCompanyName,
|
|
137 |
TDes& aAdaptiveGrid );
|
|
138 |
|
|
139 |
/**
|
|
140 |
* Returns the UID of the algorithm in use
|
|
141 |
*/
|
|
142 |
TUid AlgorithmInUse()
|
|
143 |
{
|
|
144 |
return iAlgorithmInUse;
|
|
145 |
}
|
|
146 |
|
|
147 |
private:
|
|
148 |
|
|
149 |
/**
|
|
150 |
* Performs the first phase of two phase construction.
|
|
151 |
*/
|
|
152 |
CPcsPluginInterface();
|
|
153 |
|
|
154 |
/**
|
|
155 |
* Symbian OS 2 phased constructor.
|
|
156 |
*/
|
|
157 |
void ConstructL();
|
|
158 |
|
|
159 |
/**
|
|
160 |
* Instantiates a PCS plug-in, knowing the implementation uid.
|
|
161 |
* @param aImpUid imp uID
|
|
162 |
*/
|
|
163 |
CPcsPlugin* InstantiatePlugInFromImpUidL( const TUid& aImpUid );
|
|
164 |
|
|
165 |
|
|
166 |
private:
|
|
167 |
|
|
168 |
TUid iDtor_ID_Key;
|
|
169 |
|
|
170 |
// List of plugins that this interface will interact with
|
|
171 |
RPointerArray<CPcsPlugin> iPcsPluginInstances;
|
|
172 |
|
|
173 |
// Uid of the algorithm in use
|
|
174 |
TUid iAlgorithmInUse;
|
|
175 |
};
|
|
176 |
|
|
177 |
#endif // CPCS_PLUGIN_INTERFACE_H
|
|
178 |
|
|
179 |
//End of File
|