|
1 /* |
|
2 * Copyright (c) 2006-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: Contains MNcdNodeUpgrade interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef M_NCD_NODE_UPGRADE_H |
|
20 #define M_NCD_NODE_UPGRADE_H |
|
21 |
|
22 |
|
23 #include "catalogsbase.h" |
|
24 #include "ncdinterfaceids.h" |
|
25 #include "catalogsarray.h" |
|
26 |
|
27 |
|
28 class MNcdNode; |
|
29 |
|
30 |
|
31 /** |
|
32 * This interface is provided for the node if this node |
|
33 * contains an upgrade to the content of some other node. |
|
34 * UI may use this interface to check if the node contains |
|
35 * an upgrade. |
|
36 * |
|
37 * This interface is available: |
|
38 * |
|
39 * If the content of this node has been updated to server after the |
|
40 * node was bought or this node upgrades some installed application, |
|
41 * see EUpgradeContent |
|
42 * |
|
43 * If this node upgrades some other node, see EUpgradeNode |
|
44 * |
|
45 * This interface is NOT available if there is nothing to upgrade even if |
|
46 * the upgrades-dependency is defined in the protocol. |
|
47 * |
|
48 * |
|
49 */ |
|
50 class MNcdNodeUpgrade : public virtual MCatalogsBase |
|
51 { |
|
52 public: |
|
53 |
|
54 /** |
|
55 * Unique identifier for the interface, required for all MCatalogsBase interfaces. |
|
56 * |
|
57 * |
|
58 */ |
|
59 enum { KInterfaceUid = ENcdNodeUpgradeUid }; |
|
60 |
|
61 |
|
62 enum TUpgradeType |
|
63 { |
|
64 |
|
65 /** |
|
66 * Upgrades some other node |
|
67 * @see UpgradeableNodeL() |
|
68 */ |
|
69 EUpgradeNode, |
|
70 |
|
71 /** |
|
72 * The server contains an upgrade for the content of this |
|
73 * node |
|
74 * |
|
75 * This is used if the id in <downloadableContent> |
|
76 * matches some installed application and the application's version |
|
77 * number is lower than the one in <downloadableContent> or |
|
78 * if the protocol defines an upgrades-dependency to |
|
79 * some application and that application is installed on the device |
|
80 * |
|
81 * @see MNcdNodeContentInfo |
|
82 */ |
|
83 EUpgradeContent, |
|
84 |
|
85 /** |
|
86 * Upgrade type is set to EUpgradeNotAvailable when the upgrade |
|
87 * is installed. |
|
88 */ |
|
89 EUpgradeNotAvailable |
|
90 }; |
|
91 |
|
92 /** |
|
93 * Retrieves the name of the upgrade content in text format. |
|
94 * |
|
95 * |
|
96 * @return Name of the upgrade content. If the protocol has not defined any value |
|
97 * for name, an empty descriptor is returned. |
|
98 */ |
|
99 virtual const TDesC& Name() const = 0; |
|
100 |
|
101 /** |
|
102 * This function is the indicative Symbian application UID for the |
|
103 * upgrade content that is an application. This can be used e.g. for checking |
|
104 * if the application has already been installed to the phone. |
|
105 * |
|
106 * @return The UID of the upgrade application item. |
|
107 */ |
|
108 virtual TUid Uid() const = 0; |
|
109 |
|
110 /** |
|
111 * Different versions of the content items may exist. Thus, |
|
112 * a version identifier may be defined for the item. When installing |
|
113 * applications the version may be required. |
|
114 * |
|
115 * @return Version string of the upgrade application item. |
|
116 * If the protocol has not defined any value, an empty string is returned. |
|
117 */ |
|
118 virtual const TDesC& Version() const = 0; |
|
119 |
|
120 /** |
|
121 * Gives the target node that this node may upgrade. |
|
122 * |
|
123 * @note The reference count of the returned node object |
|
124 * is increased by one. So, Release function of the node |
|
125 * should be called when the node is not needed anymore. |
|
126 * |
|
127 * @note If the upgrade target has been directly gotten as a content |
|
128 * instead of as a node, then NULL pointer is returned here. Name, Uid and Version |
|
129 * information about the upgrade target content can still be requested by using |
|
130 * the other functions of this interface. |
|
131 * |
|
132 * @return Pointer to the target node that this node upgrades. |
|
133 * NULL if the upgrade target has been given as a content intead of as a node. |
|
134 * Counted, Release() must be called after use. |
|
135 * @exception Leave System wide error codes. |
|
136 */ |
|
137 virtual MNcdNode* UpgradeableNodeL() const = 0; |
|
138 |
|
139 |
|
140 /** |
|
141 * Upgrade type getter |
|
142 * |
|
143 * @return Type of the upgrade |
|
144 * @see TUpgradeType |
|
145 */ |
|
146 virtual TUpgradeType UpgradeType() const = 0; |
|
147 |
|
148 |
|
149 protected: |
|
150 |
|
151 /** |
|
152 * Destructor. |
|
153 * |
|
154 * @see MCatalogsBase::~MCatalogsBase |
|
155 */ |
|
156 virtual ~MNcdNodeUpgrade() {} |
|
157 |
|
158 }; |
|
159 |
|
160 |
|
161 #endif // M_NCD_NODE_UPGRADE_H |