|
1 /* |
|
2 * Copyright (c) 2002 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: It is container for handlers. It can also be used as a handler. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPHONEGSMHANDLERCONTAINER_H |
|
20 #define CPHONEGSMHANDLERCONTAINER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "CPhoneGsmHandlerBase.h" |
|
25 |
|
26 // CLASS DECLARATION |
|
27 |
|
28 /** |
|
29 * It is container for handlers. It can also be used as a handler. |
|
30 * |
|
31 * @since 1.0 |
|
32 * @lib phoneparser.lib |
|
33 */ |
|
34 class CPhoneGsmHandlerContainer |
|
35 : public CPhoneGsmHandlerBase |
|
36 { |
|
37 public: // Constructors and destructor |
|
38 |
|
39 /** |
|
40 * Two-phased constructor. |
|
41 */ |
|
42 IMPORT_C static CPhoneGsmHandlerContainer* NewL(); |
|
43 |
|
44 /** |
|
45 * Destructor. |
|
46 */ |
|
47 IMPORT_C ~CPhoneGsmHandlerContainer(); |
|
48 |
|
49 public: // New functions |
|
50 |
|
51 /** |
|
52 * Add a new handler to the container. |
|
53 * |
|
54 * Note that ownership is transferred. The method panics if |
|
55 * you try to add same instance twice. |
|
56 */ |
|
57 IMPORT_C void AddHandlerL( CPhoneGsmHandlerBase& aHandler ); |
|
58 |
|
59 public: // Functions from base classes |
|
60 |
|
61 /** |
|
62 * From CPhoneGsmHandlerBase, process the results of parsing. |
|
63 * |
|
64 * Note that it will forward the request to each of the contained |
|
65 * handler. |
|
66 * |
|
67 * @param aResult It is results to be processed. |
|
68 */ |
|
69 void ProcessL( |
|
70 CPhoneGsmParserResult& aResult ); |
|
71 |
|
72 private: |
|
73 |
|
74 /** |
|
75 * C++ default constructor. |
|
76 */ |
|
77 CPhoneGsmHandlerContainer(); |
|
78 |
|
79 /** |
|
80 * Symbian OS constructor. |
|
81 */ |
|
82 void ConstructL(); |
|
83 |
|
84 // By default, prohibit copy constructor |
|
85 CPhoneGsmHandlerContainer( const CPhoneGsmHandlerContainer& ); |
|
86 // Prohibit assigment operator |
|
87 CPhoneGsmHandlerContainer& operator= ( const CPhoneGsmHandlerContainer& ); |
|
88 |
|
89 private: // Data |
|
90 |
|
91 typedef CArrayPtrFlat< CPhoneGsmHandlerBase > CHandlerArray; |
|
92 |
|
93 // Owned array of handlers. |
|
94 CHandlerArray* iHandlers; |
|
95 |
|
96 }; |
|
97 |
|
98 #endif // CPHONEGSMHANDLERCONTAINER_H |
|
99 |
|
100 // End of File |