|
1 /* |
|
2 * Copyright (c) 2007-2008 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: Provides information about ongoing calls. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CALLINFORMATION_H |
|
20 #define C_CALLINFORMATION_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 #include "mcall.h" |
|
25 |
|
26 |
|
27 // forward declarations |
|
28 class MCallInformationObserver; |
|
29 class CCallInformationImpl; |
|
30 class CCallInfoIter; |
|
31 |
|
32 |
|
33 /** |
|
34 * Class to be used for receiving information about ongoing calls. |
|
35 * |
|
36 * @code |
|
37 * // create the CCallInformation instance e.g. when the client component is created |
|
38 * iCallInfo = CCallInformation::NewL(); |
|
39 * iCallInfo->NotifyCallInformationChanges(*iObserver); |
|
40 * |
|
41 * // and use it when needed. |
|
42 * CCallInfoIter& iter = iCallInfo->GetCallsL(); |
|
43 * @endcode |
|
44 * |
|
45 * @lib telephonyservice.lib |
|
46 * @since S60 v5.1 |
|
47 */ |
|
48 NONSHARABLE_CLASS( CCallInformation ) : public CBase |
|
49 { |
|
50 |
|
51 public: |
|
52 |
|
53 /** |
|
54 * Two-phased constructor. |
|
55 */ |
|
56 IMPORT_C static CCallInformation* NewL(); |
|
57 |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 virtual ~CCallInformation(); |
|
63 |
|
64 /** |
|
65 * Allows a client to be notified when there are changes in current calls. |
|
66 * There can be only one observer per CCallInformation instance. |
|
67 * |
|
68 * @since S60 v5.1 |
|
69 * @param aObserver Observer for notifications. |
|
70 */ |
|
71 IMPORT_C void NotifyCallInformationChanges( MCallInformationObserver& aObserver ); |
|
72 |
|
73 /** |
|
74 * Used to cancel previously placed NotifyCallInformationChanges call. |
|
75 * |
|
76 * @since S60 v5.1 |
|
77 */ |
|
78 IMPORT_C void CancelNotification(); |
|
79 |
|
80 /** |
|
81 * Gets the snapshot of ongoing calls. |
|
82 * The returned reference should not be stored as member variable |
|
83 * as it goes out of scope when there are changes in call information. |
|
84 * |
|
85 * @since S60 v5.1 |
|
86 * @return Ongoing calls. |
|
87 */ |
|
88 IMPORT_C CCallInfoIter& GetCallsL( ); |
|
89 |
|
90 /** |
|
91 * Returns information whether call in given state exist. |
|
92 * |
|
93 * @since S60 v5.2 |
|
94 * @param aState Specifies a call state that is used as a search key. |
|
95 * @return ETrue if call in given state exist. |
|
96 */ |
|
97 IMPORT_C TBool IsCallInState( CCPCall::TCallState aState ) const; |
|
98 |
|
99 |
|
100 private: |
|
101 |
|
102 CCallInformation(); |
|
103 |
|
104 void ConstructL(); |
|
105 |
|
106 |
|
107 private: // data |
|
108 |
|
109 CCallInformationImpl* iImpl; |
|
110 |
|
111 }; |
|
112 |
|
113 |
|
114 #endif // C_CALLINFORMATION_H |