|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // The declaration of the TRPSOwnNumbersManager. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @internalTechnology |
|
20 */ |
|
21 #ifndef TOWNNUMBERSMANAGER_H |
|
22 #define TOWNNUMBERSMANAGER_H |
|
23 |
|
24 #include "cetelsessionmgr.h" |
|
25 #include "rpsownnumbers.h" |
|
26 #include "cctsyintegrationtestsuitepanics.h" |
|
27 |
|
28 //this holds the Own Numbers cache. It also holds state to say whether cache has been retrieved. |
|
29 //This object is passed to all CCTSYIntegrationTestSuiteStepBase derived classes. |
|
30 class TOwnNumbersManager |
|
31 { |
|
32 public: |
|
33 |
|
34 inline void SetEtelSessMgr(CEtelSessionMgr* aMgr) |
|
35 { |
|
36 iEtelSessMgr = aMgr; |
|
37 } |
|
38 |
|
39 inline TRPSOwnNumbers& OwnNumbers() |
|
40 { |
|
41 return iOwnNumbers; |
|
42 }; |
|
43 |
|
44 void CacheOwnNumbersL(); |
|
45 protected: |
|
46 void CacheOwnNumbersAO(); |
|
47 static TInt AsyncCallback(TAny* aTOwnNumbersManagerInstance); |
|
48 private: |
|
49 TBool iGotNumbers; |
|
50 TRPSOwnNumbers iOwnNumbers; |
|
51 CEtelSessionMgr* iEtelSessMgr; |
|
52 TInt iRetrieveError; |
|
53 }; |
|
54 |
|
55 //This a wrapper around TOwnNumbersManager that is used within TestStepL bodies. |
|
56 class TOwnNumbersCache |
|
57 { |
|
58 public: |
|
59 inline TRPSOwnNumbers& OwnNumbers() |
|
60 { |
|
61 __ASSERT_ALWAYS(iOwnNumbersManager, User::Panic(KPanic,KCTSYPanic_badhandle)); |
|
62 return iOwnNumbersManager->OwnNumbers(); |
|
63 }; |
|
64 |
|
65 inline void SetOwnNumbersManager(TOwnNumbersManager* aOwnNumbersManager) |
|
66 { |
|
67 iOwnNumbersManager = aOwnNumbersManager; |
|
68 } |
|
69 |
|
70 inline void CacheOwnNumbersL() |
|
71 { |
|
72 __ASSERT_ALWAYS(iOwnNumbersManager, User::Panic(KPanic,KCTSYPanic_badhandle)); |
|
73 return iOwnNumbersManager->CacheOwnNumbersL(); |
|
74 } |
|
75 |
|
76 private: |
|
77 TOwnNumbersManager* iOwnNumbersManager; |
|
78 }; |
|
79 |
|
80 #endif //TOWNNUMBERSMANAGER_H |