|
1 // Copyright (c) 2005-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 // |
|
15 |
|
16 #ifndef __CNTPHONENUMBERPARSER_H__ |
|
17 #define __CNTPHONENUMBERPARSER_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <ecom/ecom.h> |
|
21 |
|
22 /** The UID of the phone number parser ECom plugin interface. |
|
23 @released |
|
24 @internalTechnology |
|
25 */ |
|
26 const TUid KUidEcomCntPhoneNumberParserInterface = {0x102035FA}; |
|
27 |
|
28 class CContactPhoneNumberParser : public CBase |
|
29 /** Provides functionality to extract the real phone number from a contact's phone number field. |
|
30 @publishedPartner |
|
31 @released |
|
32 */ |
|
33 { |
|
34 public: |
|
35 virtual void ExtractRawNumber(const TDesC& aTextualNumber, TDes& aRawNumber)=0; |
|
36 }; |
|
37 |
|
38 |
|
39 class CContactEcomPhoneNumberParser : public CContactPhoneNumberParser |
|
40 /** It provides Ecom Framework based facilities to resolve and load the appropriate implementations at run-time. |
|
41 The framework supplies a default resolver for selecting appropriate implementations. |
|
42 @publishedPartner |
|
43 @released |
|
44 */ |
|
45 { |
|
46 public: |
|
47 static CContactEcomPhoneNumberParser* NewL(TUid aImplementationUid); |
|
48 inline virtual ~CContactEcomPhoneNumberParser(); |
|
49 private: |
|
50 TUid iDtor_ID_Key; |
|
51 }; |
|
52 |
|
53 inline CContactEcomPhoneNumberParser* CContactEcomPhoneNumberParser::NewL(TUid aImplementationUid) |
|
54 /** Allocates and Instantiates an interface implementation to satisfy the specified interface. |
|
55 @param aImplementationUid denotes the type of implemetation that need to be loaded. |
|
56 @return A pointer to a newly allocated and initialised object of type CContactEcomPhoneNumberParser. */ |
|
57 { |
|
58 TAny* ptr = REComSession::CreateImplementationL(aImplementationUid, |
|
59 _FOFF(CContactEcomPhoneNumberParser, |
|
60 iDtor_ID_Key)); |
|
61 return reinterpret_cast<CContactEcomPhoneNumberParser*>(ptr); |
|
62 } |
|
63 |
|
64 inline CContactEcomPhoneNumberParser::~CContactEcomPhoneNumberParser() |
|
65 /** The destruction of the interface implementation referred to by iDtor_ID_Key */ |
|
66 { |
|
67 REComSession::DestroyedImplementation(iDtor_ID_Key); |
|
68 } |
|
69 |
|
70 #endif //__CNTPHONENUMBERPARSER_H__ |