1 /* |
1 /* |
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
17 */ |
17 */ |
18 |
18 |
19 #ifndef IAUPDATEMAINVIEW_H_ |
19 #ifndef IAUPDATEMAINVIEW_H_ |
20 #define IAUPDATEMAINVIEW_H_ |
20 #define IAUPDATEMAINVIEW_H_ |
21 |
21 |
22 #include <HbView.h> |
22 #include <hbview.h> |
23 #include <QItemSelection> |
23 #include <QItemSelection> |
24 |
24 |
25 #include "iaupdatenode.h" |
25 #include "iaupdatenode.h" |
26 #include "iaupdatefwnode.h" |
26 #include "iaupdatefwnode.h" |
27 #include "iaupdatebasenode.h" |
27 #include "iaupdatebasenode.h" |
28 |
28 |
29 |
29 |
30 class HbListWidget; |
30 class HbListWidget; |
|
31 class HbAction; |
|
32 class HbAbstractViewItem; |
31 class IAUpdateEngine; |
33 class IAUpdateEngine; |
|
34 class IAUpdateDialogUtil; |
|
35 class TIAUpdateVersion; |
32 |
36 |
33 |
37 |
34 class IAUpdateMainView : public HbView |
38 class IAUpdateMainView : public HbView |
35 { |
39 { |
36 Q_OBJECT |
40 Q_OBJECT |
40 virtual ~IAUpdateMainView(); |
44 virtual ~IAUpdateMainView(); |
41 |
45 |
42 void refresh(const RPointerArray<MIAUpdateNode> &nodes, |
46 void refresh(const RPointerArray<MIAUpdateNode> &nodes, |
43 const RPointerArray<MIAUpdateFwNode> &fwNodes, |
47 const RPointerArray<MIAUpdateFwNode> &fwNodes, |
44 int error); |
48 int error); |
|
49 signals: |
|
50 void toSettingView(); |
|
51 |
45 public slots: |
52 public slots: |
46 void handleStartUpdate(); |
53 void handleStartUpdate(); |
47 |
54 |
48 void handleSettings(); |
55 void handleSettings(); |
49 |
56 |
50 void handleDisclaimer(); |
57 void handleDisclaimer(); |
51 |
58 |
52 void handleSelectionChanged(QItemSelection); |
59 void handleDetails( HbAbstractViewItem *, const QPointF & ); |
|
60 |
|
61 void handleSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); |
|
62 |
|
63 void dialogFinished(HbAction* action); |
53 |
64 |
54 private: |
65 private: |
55 |
66 |
56 void getSelectedNodes(RPointerArray<MIAUpdateAnyNode> &selectedNodes) const; |
67 void getSelectedNodes(RPointerArray<MIAUpdateAnyNode> &selectedNodes) const; |
57 void markListItem(bool mark, int index); |
68 void markListItem(bool mark, int index); |
58 bool getMandatoryNodes(RPointerArray<MIAUpdateAnyNode> &mandNodes) const; |
69 bool getMandatoryNodes(RPointerArray<MIAUpdateAnyNode> &mandNodes) const; |
59 void showUpdateCannotOmitDialog() const; |
70 void showUpdateCannotOmitDialog(); |
60 bool showDependenciesFoundDialog(QString &text) const; |
71 void showDependenciesFoundDialog(QString &text); |
|
72 void updateSelectionsToNodeArray(MIAUpdateNode &node, bool mark); |
61 void updateSelectionsToList(); |
73 void updateSelectionsToList(); |
|
74 MIAUpdateAnyNode* getNode(int index) const; |
|
75 void showDetails(MIAUpdateAnyNode& node); |
|
76 void constructDetailsText(MIAUpdateAnyNode &node, QString &text); |
|
77 void versionText(const TIAUpdateVersion &version, QString &versionText); |
|
78 void fileSizeText(int fileSize, QString &text); |
62 |
79 |
63 private: |
80 private: |
|
81 enum DialogState |
|
82 { |
|
83 NoDialog, |
|
84 Dependencies, |
|
85 CannotOmit, |
|
86 Details |
|
87 }; |
|
88 |
64 IAUpdateEngine *mEngine; |
89 IAUpdateEngine *mEngine; |
|
90 IAUpdateDialogUtil *mDialogUtil; |
65 HbListWidget *mListView; |
91 HbListWidget *mListView; |
66 RPointerArray<MIAUpdateAnyNode> mAllNodes; |
92 RPointerArray<MIAUpdateAnyNode> mAllNodes; |
|
93 DialogState mDialogState; |
|
94 HbAction *mPrimaryAction; |
|
95 MIAUpdateNode *mNode; |
|
96 bool mMark; |
|
97 bool mSelectionUpdate; |
67 |
98 |
68 }; |
99 }; |
69 |
100 |
70 #endif /* IAUPDATEMAINVIEW_H_ */ |
101 #endif /* IAUPDATEMAINVIEW_H_ */ |