|
1 /* |
|
2 * Copyright (c) 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: Fetches the VAS tags from VAS DB |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef TAGGETTER_H |
|
21 #define TAGGETTER_H |
|
22 |
|
23 #include "asyncworker.h" |
|
24 #include <nssvasmgettagclient.h> |
|
25 #include <nssvasmgettagclient.h> |
|
26 #include <nssvasmcontext.h> |
|
27 #include <nssvasmtagmgr.h> |
|
28 |
|
29 /* |
|
30 * Fetches the context voice tags from VAS. Makes the asynchronous process |
|
31 * look like synchronous to the clients |
|
32 */ |
|
33 class CTagGetter : public CAsyncWorker, public MNssGetTagClient |
|
34 { |
|
35 public: |
|
36 static CTagGetter* NewL(); |
|
37 static CTagGetter* NewLC(); |
|
38 |
|
39 /** |
|
40 * Retrieves the list of tags for a given context. Synchronous. |
|
41 * Leaves two objects on the cleanup stack! |
|
42 * First PopAndDestroy will ResetAndDestroy content |
|
43 * Second one will destroy the MNssTagListArray itself |
|
44 */ |
|
45 MNssTagListArray* GetTagListLC2( MNssTagMgr& aTagManager, const MNssContext& aContext ); |
|
46 |
|
47 /** |
|
48 * Retrieves the list of tags for a given context and vcommand id. Synchronous. |
|
49 * Leaves two objects on the cleanup stack! |
|
50 * First PopAndDestroy will ResetAndDestroy content |
|
51 * Second one will destroy the MNssTagListArray itself |
|
52 */ |
|
53 MNssTagListArray* GetTagListLC2( MNssTagMgr& aTagManager, const MNssContext& aContext, |
|
54 TInt aCommandId ); |
|
55 |
|
56 // From MNssGetTagClient |
|
57 |
|
58 /** |
|
59 * Callback to indicate GetTag successed. |
|
60 * client has to delete the tag list |
|
61 * @param aTagList |
|
62 * @param aErrorCode KErrNone if getting of tag list was successfull |
|
63 * @return None |
|
64 */ |
|
65 virtual void GetTagListCompleted( MNssTagListArray* aTagList, |
|
66 TInt aErrorCode ); |
|
67 |
|
68 private: |
|
69 |
|
70 /** |
|
71 * After one of the GetTagListLC2 functions requested a list of |
|
72 * tags from VAS, they call this function to wait for the query |
|
73 * result and process it |
|
74 * Leaves two objects on the cleanup stack! |
|
75 * First PopAndDestroy will ResetAndDestroy content |
|
76 * Second one will destroy the MNssTagListArray itself |
|
77 * @param aNssErr Error code from the GetTagList request |
|
78 */ |
|
79 MNssTagListArray* WaitAndFormTagListLC2( TInt aNssErr ); |
|
80 |
|
81 private: |
|
82 // Temporary holder for the tag list. Is used with async callbacks |
|
83 MNssTagListArray* iTagList; |
|
84 |
|
85 }; |
|
86 |
|
87 #endif // TAGGETTER_H |