1 /* |
|
2 * Copyright (c) 2008 - 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 the License "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: Class declaration for Search |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 #ifndef DBUS_API_SUBJECT_TO_CHANGE |
|
23 #define DBUS_API_SUBJECT_TO_CHANGE |
|
24 #endif |
|
25 |
|
26 |
|
27 //Include files |
|
28 #include <e32err.h> |
|
29 #include <e32const.h> |
|
30 #include <e32base.h> |
|
31 |
|
32 #include <stdio.h> |
|
33 #include <stdlib.h> |
|
34 #include <string.h> |
|
35 #include <signal.h> |
|
36 |
|
37 #include <dbus/dbus-glib.h> |
|
38 #include <glib.h> |
|
39 |
|
40 #include <unistd.h> |
|
41 |
|
42 #include "tp-conn.h" |
|
43 #include "tp-connmgr.h" |
|
44 #include "tp-chan.h" |
|
45 #include "tp-chan-gen.h" |
|
46 #include "tp-ch-gen.h" |
|
47 #include "tp-chan-iface-group-gen.h" |
|
48 #include "tp-chan-type-text-gen.h" |
|
49 #include "tp-chan-type-search-gen.h" |
|
50 #include "tp-chan-type-streamed-media-gen.h" |
|
51 #include "tp-props-iface.h" |
|
52 #include "tp-constants.h" |
|
53 #include "tp-interfaces.h" |
|
54 #include <pthread.h> |
|
55 |
|
56 |
|
57 // FORWARD DECLARATION |
|
58 class CTestData; |
|
59 |
|
60 |
|
61 #define VERBOSE |
|
62 |
|
63 |
|
64 // CLASS DECLARATION |
|
65 NONSHARABLE_CLASS(CTelepathyGabbleSearch) : public CBase |
|
66 { |
|
67 public: |
|
68 |
|
69 struct Search_UserData |
|
70 { |
|
71 GHashTable* data_to_search; |
|
72 CTestData* testData; |
|
73 }; |
|
74 |
|
75 private: |
|
76 /** |
|
77 * C++ default constructor. |
|
78 */ |
|
79 |
|
80 CTelepathyGabbleSearch(); |
|
81 |
|
82 /** |
|
83 * By default Symbian 2nd phase constructor is private. |
|
84 */ |
|
85 void ConstructL(); |
|
86 |
|
87 public: // Constructors and destructor |
|
88 /** |
|
89 * Two-phased constructor. |
|
90 */ |
|
91 static CTelepathyGabbleSearch* NewL(); |
|
92 |
|
93 /** |
|
94 * Destructor. |
|
95 */ |
|
96 ~CTelepathyGabbleSearch(); |
|
97 |
|
98 |
|
99 |
|
100 public: // Member functions |
|
101 |
|
102 |
|
103 TInt SearchL( GHashTable *aDataToSearch, CTestData* aTestData ); |
|
104 |
|
105 TInt GetSearchKeysL( CTestData* aTestData ); |
|
106 |
|
107 void SearchAgainL( GHashTable *aDataToSearch, CTestData* aTestData ); |
|
108 |
|
109 CTestData* GetTestData(); |
|
110 |
|
111 void DoSearchL(GHashTable *aDataToSearch,CTestData *testData); |
|
112 |
|
113 void CloseChannel( CTestData* aTestdata ); |
|
114 |
|
115 public : //Callback functions |
|
116 |
|
117 static void search_chan_closed_cb ( DBusGProxy *proxy, |
|
118 GError *error, |
|
119 gpointer user_data |
|
120 ); |
|
121 static void search_result_received_cb ( DBusGProxy *proxy, |
|
122 guint contact_handle, |
|
123 GHashTable *values, |
|
124 gpointer user_data |
|
125 ); |
|
126 static void search_state_changed_cb ( DBusGProxy *proxy, |
|
127 guint search_state, |
|
128 gpointer user_data |
|
129 ); |
|
130 |
|
131 |
|
132 static void searchreply_cb( DBusGProxy *proxy, GError *error, gpointer user_data ); |
|
133 |
|
134 //static void setfield_foreach (gpointer key, gpointer value, gpointer user_data); |
|
135 |
|
136 static void do_search_reply( DBusGProxy *proxy, char *chan_object_path, |
|
137 GError *error, gpointer user_data ); |
|
138 static void getsearchkeys_cb( DBusGProxy *proxy, gchar * instr, |
|
139 gchar ** keys, GError *error, gpointer user_data ); |
|
140 private: |
|
141 |
|
142 CTestData *iTestData; |
|
143 }; |
|
144 |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 |
|