|
1 /* |
|
2 * Copyright (c) 2007-2008 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: CIAUpdateNormalContentOperation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef IA_UPDATE_NORMAL_CONTENT_OPERATION_H |
|
20 #define IA_UPDATE_NORMAL_CONTENT_OPERATION_H |
|
21 |
|
22 |
|
23 #include "iaupdatecontentoperation.h" |
|
24 |
|
25 class MNcdOperation; |
|
26 class TNcdProgress; |
|
27 class MNcdQuery; |
|
28 |
|
29 |
|
30 /** |
|
31 * CIAUpdateNormalContentOperation is an abstract base class |
|
32 * for normal node content operations. |
|
33 */ |
|
34 class CIAUpdateNormalContentOperation : public CIAUpdateContentOperation |
|
35 { |
|
36 |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Destructor |
|
41 */ |
|
42 virtual ~CIAUpdateNormalContentOperation(); |
|
43 |
|
44 |
|
45 protected: // CIAUpdateContentOperation |
|
46 |
|
47 /** |
|
48 * @see CIAUpdateContentOperation::StartOperationL |
|
49 */ |
|
50 virtual TBool StartOperationL(); |
|
51 |
|
52 /** |
|
53 * @see CIAUpdateContentOperation::CancelOperation |
|
54 */ |
|
55 virtual void CancelOperation(); |
|
56 |
|
57 |
|
58 protected: |
|
59 |
|
60 /** |
|
61 * @see CIAUpdateContentOperation::CIAUpdateContentOperation |
|
62 */ |
|
63 CIAUpdateNormalContentOperation( |
|
64 CIAUpdateBaseNode& aNode, |
|
65 MIAUpdateContentOperationObserver& aObserver ); |
|
66 |
|
67 /** |
|
68 * 2nd. phase constructor |
|
69 */ |
|
70 virtual void ConstructL(); |
|
71 |
|
72 |
|
73 /** |
|
74 * @return MNcdOperation* Pointer to the operation that was started. |
|
75 * NULL if operation was not needed for this node content. |
|
76 * @exception Leaves with system wide error code. |
|
77 */ |
|
78 virtual MNcdOperation* HandleContentL() = 0; |
|
79 |
|
80 |
|
81 /** |
|
82 * Query received related to the content operation. |
|
83 * |
|
84 * This is meant for the operation observing. |
|
85 * Child classes may use this function when their |
|
86 * callbacks are called. |
|
87 * |
|
88 * @param aOperation Operation that requests query. |
|
89 * @param aQuery Query that requires response. |
|
90 */ |
|
91 void ContentQueryReceived( MNcdOperation& aOperation, |
|
92 MNcdQuery* aQuery ); |
|
93 |
|
94 |
|
95 /** |
|
96 * This is meant for the operation observing. |
|
97 * Child classes may use this function when their |
|
98 * callbacks are called. |
|
99 * |
|
100 * @param aOperation Operation that completed. |
|
101 * @param aError Error code for the operation completion. |
|
102 */ |
|
103 void ContentOperationComplete( MNcdOperation& aOperation, |
|
104 TInt aError ); |
|
105 |
|
106 |
|
107 private: |
|
108 |
|
109 // Prevent these if not implemented |
|
110 CIAUpdateNormalContentOperation( |
|
111 const CIAUpdateNormalContentOperation& aObject ); |
|
112 CIAUpdateNormalContentOperation& operator =( |
|
113 const CIAUpdateNormalContentOperation& aObject ); |
|
114 |
|
115 |
|
116 // This will call Release to existing operation, if it exists, |
|
117 // Ownership of aOperation is transferred. |
|
118 void SetOperation( MNcdOperation* aOperation ); |
|
119 |
|
120 |
|
121 private: // data |
|
122 |
|
123 // This is released and set to NULL when a corresponding |
|
124 // operation finishes. |
|
125 MNcdOperation* iOperation; |
|
126 |
|
127 }; |
|
128 |
|
129 #endif // IA_UPDATE_NORMAL_CONTENT_OPERATION_H |
|
130 |