|
1 /* |
|
2 * Copyright (c) 2006-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: |
|
15 * Focus helper class |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CPBK2FIELDFOCUSHELPER_H |
|
21 #define CPBK2FIELDFOCUSHELPER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class MVPbkStoreContact; |
|
28 class MPbk2ContactUiControl; |
|
29 class MPbk2FieldPropertyArray; |
|
30 class MVPbkStoreContactField; |
|
31 |
|
32 // CLASS DECLARATIONS |
|
33 class CPbk2FieldFocusHelper : public CBase |
|
34 { |
|
35 public: |
|
36 /** |
|
37 * Static constructor |
|
38 * |
|
39 * @param aUiControl Ui control |
|
40 * @param aPropertyArray Field property array |
|
41 * @return New instance of this class |
|
42 */ |
|
43 IMPORT_C static CPbk2FieldFocusHelper* NewL( |
|
44 MPbk2ContactUiControl& aUiControl, |
|
45 MPbk2FieldPropertyArray& aPropertyArray ); |
|
46 ~CPbk2FieldFocusHelper(); |
|
47 |
|
48 public: |
|
49 /** |
|
50 * Save initially focused field at this contact from ui control's |
|
51 * focused field index. |
|
52 * @see usage from CPbk2ImageCmdBase. |
|
53 * @param aStoreContact A contact that has been locked. |
|
54 */ |
|
55 IMPORT_C void SaveInitiallyFocusedFieldL( MVPbkStoreContact& |
|
56 aStoreContact ); |
|
57 |
|
58 /** |
|
59 * Restores the initially focused field by calling first SetFocusedContact() |
|
60 * and then SetFocusedFieldIndex(). The reference to store contact given with |
|
61 * SaveInitiallyFocusedFieldL() should be still valid. |
|
62 * @return Index of field focused or KErrNotFound. |
|
63 */ |
|
64 IMPORT_C TInt RestoreSavedFieldL(); |
|
65 |
|
66 /** |
|
67 * Set the iUiControl is valid or not |
|
68 * @param aUiControlValid, if ETrue then the iUiControl is valid otherwise invalid. |
|
69 */ |
|
70 IMPORT_C void SetUiControlValid( TBool aUiControlValid ); |
|
71 |
|
72 private: // implementation |
|
73 CPbk2FieldFocusHelper( |
|
74 MPbk2ContactUiControl& aUiControl, |
|
75 MPbk2FieldPropertyArray& aPropertyArray ); |
|
76 |
|
77 private: // Data |
|
78 /// Ref: ui control |
|
79 MPbk2ContactUiControl& iUiControl; |
|
80 /// Ref: reference to the focused contact |
|
81 MVPbkStoreContact* iStoreContact; |
|
82 /// Ref: field property array |
|
83 MPbk2FieldPropertyArray& iFieldProperties; |
|
84 /// Own: initially focused field |
|
85 MVPbkStoreContactField* iFocusedStoreCntField; |
|
86 /// Own: field index |
|
87 TInt iUiFieldIndex; |
|
88 /// Own: flag for iUiControl |
|
89 TBool iUiControlValid; |
|
90 }; |
|
91 |
|
92 #endif // CPBK2FIELDFOCUSHELPER_H |
|
93 |
|
94 // End of file |