|
1 /* |
|
2 * Copyright (c) 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: Implementation of Asynchronous Operation of Add to Album |
|
15 * |
|
16 * |
|
17 * Copyright © 2007 Nokia. All rights reserved. |
|
18 * This material, including documentation and any related computer |
|
19 * programs, is protected by copyright controlled by Nokia. All |
|
20 * rights are reserved. Copying, including reproducing, storing, |
|
21 * adapting or translating, any or all of this material requires the |
|
22 * prior written consent of Nokia. This material also contains |
|
23 * confidential information which may not be disclosed to others |
|
24 * without the prior written consent of Nokia. |
|
25 |
|
26 * |
|
27 */ |
|
28 |
|
29 #ifndef __CAMCOLLECTIONMANAGERAO_H__ |
|
30 #define __CAMCOLLECTIONMANAGERAO_H__ |
|
31 |
|
32 #include <e32base.h> |
|
33 |
|
34 class CGlxCollectionInfo; |
|
35 class CGlxCollectionManager; |
|
36 class MCamAddToAlbumObserver; |
|
37 |
|
38 class CCamCollectionManagerAO : public CActive |
|
39 { |
|
40 public: // Constructors and destructor |
|
41 |
|
42 |
|
43 /** |
|
44 * Destructor. |
|
45 */ |
|
46 ~CCamCollectionManagerAO(); |
|
47 |
|
48 /** |
|
49 * Constructor |
|
50 * @aObserver Observer for compeleted/failed operations. |
|
51 */ |
|
52 CCamCollectionManagerAO( MCamAddToAlbumObserver& aObserver ); |
|
53 |
|
54 public: // New Method |
|
55 |
|
56 /** |
|
57 * Initiates Add To Album Operation |
|
58 * @param aSelectedAlbumIds Array of ids for albums where to add. |
|
59 * @param aUri Filename of the image / video to add. |
|
60 */ |
|
61 void StartCallBackAddToAlbumL( const RArray<TUint32>& aSelectedAlbumIds, |
|
62 const TDesC& aUri ); |
|
63 |
|
64 /** |
|
65 * Initiate Check for Album Operation |
|
66 * @param aDefaultAlbumId Album id. |
|
67 */ |
|
68 void CheckForAlbumExistenceL( const TUint32 aDefaultAlbumId ); |
|
69 |
|
70 public: // CActive |
|
71 |
|
72 /** |
|
73 * Perform the next scheduled task |
|
74 * @since 2.8 |
|
75 */ |
|
76 void RunL(); |
|
77 |
|
78 /** |
|
79 * Cancels the active object |
|
80 * @since 2.8 |
|
81 */ |
|
82 void DoCancel(); |
|
83 |
|
84 /** |
|
85 * Handles a leave occuring in the request completion event handler |
|
86 * @since 2.8 |
|
87 * @param aError Error (leave) code. |
|
88 */ |
|
89 TInt RunError( TInt aError ); |
|
90 |
|
91 private: |
|
92 |
|
93 /** |
|
94 * Performs the necessary add to album request |
|
95 * Using the collection manager. |
|
96 */ |
|
97 void DoAddToAlbumOperationL(); |
|
98 |
|
99 /** |
|
100 * We Perform the needed operation after we complete |
|
101 * Checking for album existence |
|
102 */ |
|
103 void DoCheckAlbumOperationCompleteL(); |
|
104 |
|
105 /** |
|
106 * Returns the Default Album Id from the CenRep key |
|
107 */ |
|
108 TUint32 DefaultAlbumIdFromCenRepL(); |
|
109 |
|
110 private: |
|
111 |
|
112 CGlxCollectionInfo* iCollectionInfo; |
|
113 CGlxCollectionManager* iCollectionManager; |
|
114 MCamAddToAlbumObserver& iObserver; |
|
115 TInt iCurrentAlbumIndex; |
|
116 RArray<TUint32> iSelectedAlbumIds; |
|
117 TFileName iUri; |
|
118 TBool iAddToAlbum; |
|
119 TBool iCheckForAlbum; |
|
120 }; |
|
121 |
|
122 |
|
123 #endif // __CAMCOLLECTIONMANAGERAO_H__ |