|
1 /* |
|
2 * Copyright (c) 2009 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: OnlineSearchPlugin class definition |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef ONLINESEARCHPLUGIN_H |
|
19 #define ONLINESEARCHPLUGIN_H |
|
20 |
|
21 #include <QObject> |
|
22 |
|
23 /** |
|
24 * @ingroup group_onlinesearchpluginmodel |
|
25 * @brief Represents a plugin plugin in the framework. |
|
26 * |
|
27 * OnlineSearchPlugin is an interface through which setting plugin plugin can be |
|
28 * executed in the search handlers. |
|
29 * |
|
30 * @lib ?library |
|
31 * @since S60 ?S60_version |
|
32 */ |
|
33 |
|
34 class OnlineSearchPlugin : public QObject |
|
35 { |
|
36 Q_OBJECT |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Destructor. |
|
41 * @since S60 ?S60_version. |
|
42 */ |
|
43 virtual ~OnlineSearchPlugin() |
|
44 { |
|
45 } |
|
46 |
|
47 /** |
|
48 * Called by the search handlers during initialize cycle of the plugin, it is during |
|
49 * this phase the plugin widget |
|
50 * usually creates its initial view. |
|
51 * Once the initialization is done, pluginInitialized signal must be |
|
52 * emitted. |
|
53 * @since S60 ?S60_version. |
|
54 */ |
|
55 virtual void initializePlugin() = 0; |
|
56 |
|
57 /** |
|
58 * Called by the search handlers when the plugin becomes the current plugin. |
|
59 * @since S60 ?S60_version. |
|
60 */ |
|
61 virtual void activatePlugin() = 0; |
|
62 /** |
|
63 * Called by the search handlers when the plugin becomes the current plugin. |
|
64 * @since S60 ?S60_version. |
|
65 */ |
|
66 virtual void activatePlugin(const QString &searchQuery) = 0; |
|
67 |
|
68 /** |
|
69 * Called by the search handlers when the plugin is no longer being displayed. |
|
70 */ |
|
71 virtual void deactivatePlugin() = 0; |
|
72 |
|
73 /** |
|
74 * Called by the search handlers before the plugin destructor is called. |
|
75 * @param reason The reason why the search handlers is being killed. |
|
76 */ |
|
77 virtual void shutdownPlugin() = 0; |
|
78 |
|
79 protected: |
|
80 |
|
81 /** |
|
82 * Constructor. |
|
83 * @since S60 ?S60_version. |
|
84 */ |
|
85 OnlineSearchPlugin() |
|
86 { |
|
87 } |
|
88 |
|
89 signals: |
|
90 |
|
91 /** |
|
92 * Emit this signal when changing the view inside the plugin. |
|
93 * @param caller The calling plugin plugin instance. |
|
94 * @param viewWidget The new plugin view widget to be shown. |
|
95 */ |
|
96 void viewChanged(); |
|
97 |
|
98 /** |
|
99 * Emit this signal to indicate initialization is done. |
|
100 * @param caller The calling plugin plugin instance. |
|
101 * @param success True if succeeded, false otherwise. |
|
102 */ |
|
103 void pluginInitialized(bool success); |
|
104 |
|
105 /** |
|
106 * Emit this signal to indicate that the plugin plugin can be deleted. |
|
107 * Note that this signal does not need to be emitted if true is returned |
|
108 * from shutdownPlugin. |
|
109 * @param caller The calling plugin plugin instance. |
|
110 */ |
|
111 void shutdownCompleted(bool success); |
|
112 |
|
113 /** |
|
114 * Called by search handlers when back button is clicked in the plugin view. |
|
115 * In this method the plugin plugin can implement internally showing and |
|
116 * hiding GUI elements if the plugin has multiple 'views'. |
|
117 */ |
|
118 void handleBackEvent(); |
|
119 }; |
|
120 |
|
121 #endif // ONLINESEARCHPLUGIN_H |