|
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 ringing commands. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef PBK2IMAGECOMMANDS_H |
|
20 #define PBK2IMAGECOMMANDS_H |
|
21 |
|
22 // FORWARD DECLARATIONS |
|
23 class MPbk2BaseCommand; |
|
24 class MVPbkStoreContact; |
|
25 class MVPbkStoreContactField; |
|
26 class MVPbkFieldType; |
|
27 class MPbk2ImageFieldObserver; |
|
28 |
|
29 /** |
|
30 * Phonebook 2 image commands are used to change contact image and thumbnail |
|
31 * fields and operate on a locked store contact. |
|
32 * Usually image field contains the filename of an original image and thumbnail field |
|
33 * contains its scaled down binary version. It's possible that a contact has |
|
34 * only thumbnail field, e.g. when it was imported as vCard. |
|
35 * |
|
36 * All commands that return a MPbk2BaseCommand* handle may run asynchronously. |
|
37 * The handle should be deleted to cancel the running command. |
|
38 * |
|
39 * NOTE: Some command functions may return NULL, it is a valid value and means |
|
40 * that command run synchronously. |
|
41 */ |
|
42 class Pbk2ImageCommands |
|
43 { |
|
44 public: |
|
45 |
|
46 /** |
|
47 * Assigns an image to a contact. |
|
48 * |
|
49 * Runs select image dialog and assign it to the contact. |
|
50 * |
|
51 * @param aContact Locked store contact. |
|
52 |
|
53 * @return A command handle. |
|
54 */ |
|
55 static MPbk2BaseCommand* SetImageL(MVPbkStoreContact* aContact,MPbk2ImageFieldObserver* aObserver); |
|
56 |
|
57 /** |
|
58 * Displays image via external image viewer. |
|
59 * |
|
60 * @param aContact Locked store contact. |
|
61 |
|
62 * @return A command handle. |
|
63 */ |
|
64 static MPbk2BaseCommand* ViewImageL(MVPbkStoreContact* aContact); |
|
65 |
|
66 /** |
|
67 * Removes an image. |
|
68 * |
|
69 * @param aContact Locked store contact. |
|
70 * |
|
71 * @return A command handle. |
|
72 */ |
|
73 static MPbk2BaseCommand* RemoveImageL(MVPbkStoreContact* aContact); |
|
74 |
|
75 /** |
|
76 * Returns ETrue if aField is image field. |
|
77 * |
|
78 * @param aField Store contact field. |
|
79 * |
|
80 * @return ETrue if aField is image field, EFalse otherwise |
|
81 */ |
|
82 static TBool IsImageFieldL(const MVPbkStoreContactField& aField); |
|
83 |
|
84 /** |
|
85 * Returns ETrue if aField is thumbnail field. |
|
86 * |
|
87 * @param aField Store contact field. |
|
88 * |
|
89 * @return ETrue if aField is thumbnail field, EFalse otherwise |
|
90 */ |
|
91 static TBool IsThumbnailFieldL(const MVPbkStoreContactField& aField); |
|
92 |
|
93 /** |
|
94 * Returns ETrue image field points to a valid ringtone file. |
|
95 * |
|
96 * @param aField Store contact field. |
|
97 * |
|
98 * @return ETrue if aField contains a valid ringtone filed, EFalse otherwise |
|
99 */ |
|
100 static TBool IsImageFieldValidL(const MVPbkStoreContactField& aField); |
|
101 }; |
|
102 |
|
103 #endif // PBK2IMAGECOMMANDS_H |
|
104 |
|
105 // End of File |