|
1 /* |
|
2 * Copyright (c) 2005-2007 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: Phonebook 2 assign service field validator. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef PBK2ASSIGNVALIDATEFIELD_H |
|
20 #define PBK2ASSIGNVALIDATEFIELD_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <f32file.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CPbk2PresentationContact; |
|
28 class MVPbkFieldType; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * Phonebook 2 assign service field validator. |
|
34 * Responsible for: |
|
35 * - inspecting the given contact for its support capabilities |
|
36 * for the given field type |
|
37 */ |
|
38 class Pbk2AssignValidateField |
|
39 { |
|
40 public: // Interface |
|
41 |
|
42 /** |
|
43 * Checks how the given field is used in the given contact. |
|
44 * |
|
45 * @param aContact The contact to inspect. |
|
46 * @param aFieldType The field type to inspect. |
|
47 * @param aFsSession File server session. |
|
48 * @param aFieldIndex Store index of the matching field if the |
|
49 * contact contains field(s) of the given type. |
|
50 * @return - KErrNone if contact contains field of given type but |
|
51 * there are no restrictions to usage of that field type. |
|
52 * - KErrNotFound if the contact does not contain |
|
53 * any fields of the given type. |
|
54 * - KErrAlreadyExists if the contact contains one |
|
55 * field of the given field type and the maximum |
|
56 * number of fields of that type is one. |
|
57 * - KErrNotSupported if the contact contains maximum |
|
58 * amount of fields of the given field type and the |
|
59 * maximum number of fields of that type is greater |
|
60 * than one. |
|
61 */ |
|
62 static TInt ValidateFieldTypeUsageInContactL( |
|
63 CPbk2PresentationContact& aContact, |
|
64 const MVPbkFieldType& aFieldType, |
|
65 RFs& aFsSession, |
|
66 TInt& aFieldIndex ); |
|
67 }; |
|
68 |
|
69 #endif // PBK2ASSIGNVALIDATEFIELD_H |
|
70 |
|
71 // End of File |