diff -r 7333d7932ef7 -r 8b7f4e561641 iaupdate/IAD/ui/inc/iaupdatemainview.h --- a/iaupdate/IAD/ui/inc/iaupdatemainview.h Tue Aug 31 15:21:33 2010 +0300 +++ b/iaupdate/IAD/ui/inc/iaupdatemainview.h Wed Sep 01 12:22:02 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,115 +11,251 @@ * * Contributors: * -* Description: This file contains the header file of the IAUpdateMainView -* class +* Description: This file contains the header file of the CIAUpdateMainView class * */ -#ifndef IAUPDATEMAINVIEW_H_ -#define IAUPDATEMAINVIEW_H_ - -#include -#include - -#include "iaupdatenode.h" -#include "iaupdatefwnode.h" -#include "iaupdatebasenode.h" -class HbListWidget; -class HbAction; -class HbAbstractViewItem; -class HbGroupBox; -class HbDataForm; -class IAUpdateEngine; -class IAUpdateDialogUtil; -class TIAUpdateVersion; -class HbTranslator; +#ifndef IAUPDATEMAINVIEW_H +#define IAUPDATEMAINVIEW_H + +// INCLUDES +#include +#include +#include "iaupdatecontainerobserver.h" + +// FORWARD DECLARATIONS +class CAknNavigationControlContainer; +class CAknNavigationDecorator; +class CAknToolbar; +class CIAUpdateMainContainer; +class CIAUpdateFWUpdateHandler; + +class MIAUpdateAnyNode; +class MIAUpdateNode; +class MIAUpdateFwNode; + +// CLASS DECLARATION +/** +* This class represents the main view of IAUpdate +* +*/ +class CIAUpdateMainView : public CAknView, + public MAknToolbarObserver, + public MIAUpdateContainerObserver + { +public: + /** + * Symbian two phased constructor. + * @return Instance of the created server object. + */ + static CIAUpdateMainView* NewL(const TRect& aRect ); + + /** + * Symbian two phased constructor. + * @return Instance of the created server object. + */ + static CIAUpdateMainView* NewLC(const TRect& aRect ); + + /** + * Destructor + */ + ~CIAUpdateMainView(); + + /** + * Refresh the list + * @param aNodes Array of nodes + * @param aError Error code + */ + void RefreshL( const RPointerArray& aNodes, + const RPointerArray& aFwNodes, + TInt aError ); + + /** + * Returns node that's highlighted in a list + * @return Current (highlighted) node + */ + MIAUpdateAnyNode* GetCurrentNode(); + + /** + * Returns node that's selected (marked) in a list + * Can be used only when it's known that only one node is selected (marked) + * @return selected (marked) node + */ + MIAUpdateAnyNode* GetSelectedNode(); + + +private: // from CAknView + + /** + * Returns views id, intended for overriding by sub classes. + * @return id for this view. + */ + TUid Id() const; + + /** + * Command handling function intended for overriding by sub classes. + * Default implementation is empty. + * @param aCommand ID of the command to respond to. + */ + void HandleCommandL( TInt aCommand ); + + /** + * Dynamic menu initiation + * Called by framework before menu is shown. + * @param aResourceId Menu resource id. + * @param aMenuPane Pointer to the menu. + */ + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); -class IAUpdateMainView : public HbView -{ - Q_OBJECT + /** + * Handles a view activation and passes the message of type + * @c aCustomMessageId. This function is intended for overriding by + * sub classes. This function is called by @c AknViewActivatedL(). + * Views should not launch waiting or modal notes or dialogs in + * @c DoActivateL. + * @param aPrevViewId Specifies the view previously active. + * @param aCustomMessageId Specifies the message type. + * @param aCustomMessage The activation message. + */ + void DoActivateL ( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /** + * View deactivation function intended for overriding by sub classes. + * This function is called by @c AknViewDeactivated(). + */ + void DoDeactivate(); + +private: // from MAknToolbarObserver -public: - IAUpdateMainView(IAUpdateEngine *engine); - virtual ~IAUpdateMainView(); - - void refresh(const RPointerArray &nodes, - const RPointerArray &fwNodes, - int error); -signals: - void toSettingView(); + /** + * Should be used to set the properties of some toolbar components + * before it is drawn. + * @param aResourceId The resource ID for particular toolbar + * @param aToolbar The toolbar object pointer + */ + void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar ); + + /** + * Handles toolbar events for a certain toolbar item. + * @param aCommand The command ID of some toolbar item. + */ + void OfferToolbarEventL( TInt aCommand ); -public slots: - void handleStartUpdate(); +private: // from MIAUpdateContainerObserver - void handleSettings(); - - void handleDisclaimer(); - - void handleDetails(HbAbstractViewItem *, const QPointF &); + /** + * Mark list item + * @param aMark True if marking, False if unmarking + * @param aIndex Index of the item + * @return False value if marking/unmarking cancelled when dependencies/dependants not found + */ + TBool MarkListItemL( TBool aMark, TInt aIndex ); + + /** + * Set text label to middle soft key + * @param aVisible True value when MSK text is visible + * @param aSelected True value when list item is selected( marked) + */ + void SetMiddleSKTextL( TBool aVisible, TBool aSelected ); - void handleFotaDetails(HbAbstractViewItem *, const QPointF &); - - void handleSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); - - void handleFwSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); - - void dialogFinished(HbAction* action); - -private: +private: // constructors + + /** + * Constuctor + * @param aRect Rectangular of the view + */ + void ConstructL(const TRect& aRect); + + /** + * C++ constuctor + */ + CIAUpdateMainView(); + +private: // new methods + /** + * Get selected (marked) nodes in the list + * @param aSelectedNodes Array of nodes + */ + void GetSelectedNodesL( RPointerArray& aSelectedNodes ) const; - bool fotaSelected() const; - void markListItem(bool mark, int index); - void markFotaItem(bool mark); - bool getMandatoryNodes(RPointerArray &mandNodes) const; - void showUpdateCannotOmitDialog(); - void showDependenciesFoundDialog(QString &text); - void updateSelectionsToNodeArray(MIAUpdateNode &node, bool mark); - void updateSelectionsToList(); - MIAUpdateNode* getApplicationNode(int index) const; - void showDetails(MIAUpdateAnyNode& node); - void constructDetailsText(MIAUpdateAnyNode &node, QString &text); - void versionText(const TIAUpdateVersion &version, QString &versionText); - void fileSizeText(int fileSize, QString &text); - void setImportance(MIAUpdateAnyNode *node, QString &importanceDescription); - void removeCurrentContentLayout(); - void refreshFirmwareUpdates(const RPointerArray &fwNodes); - void refreshFotaUpdate(MIAUpdateFwNode& fwNode); - void refreshNsuUpdate(); - void refreshApplicationUpdates(const RPointerArray &nodes); - void updateSelectionInfoInDock(); + /** + * Get mandatory nodes in the list + * @param aMandNodes Array of nodes + */ + void GetMandatoryNodesL( RPointerArray& aMandNodes ) const; + /** + * Pass selected indices to the container + */ + void SetSelectedIndicesL(); + + /** + * Get index of a node + * + * @param aNode Node + * @return Index of the node + */ + TInt NodeIndex( const MIAUpdateAnyNode& aNode ) const; + + /** + * Updates the status pane text + */ + void UpdateStatusPaneL(); + + /** + * Updates selection information in navi pane + */ + void UpdateSelectionInfoInNaviPaneL(); + + /** + * Removes selection info in navi pane + */ + void RemoveSelectionInfoInNaviPane(); -private: - enum DialogState - { - NoDialog, - Dependencies, - CannotOmit, - Details - }; - - IAUpdateEngine *mEngine; - IAUpdateDialogUtil *mDialogUtil; - HbWidget *mContent; - HbListWidget *mListView; - HbListWidget *mFwListView; - HbGroupBox *mApplicationUpdatesGroupBox; - HbGroupBox *mFwNSUGroupBox; - HbDataForm *mContentDataForm; - HbGroupBox *mSelections; - RPointerArray mNodes; - RPointerArray mFwNodes; - DialogState mDialogState; - HbAction *mPrimaryAction; - MIAUpdateNode *mNode; - bool mMark; - bool mSelectionUpdate; - bool mSelectionConnect; - HbTranslator *mTranslator; + /** + * Shows dependencies found dialog + * + * @param aText Text shown in a dialog + * @return True value if marking/unmarking accepted + */ + TBool ShowDependenciesFoundDialogL( TDesC& aText ) const; + + /** + * Count of selected (marked) items + * + * @return Count of selected items + */ + TInt CountOfSelectedItems() const; + + void ShowUpdateCannotOmitDialogL() const; + +private: // Data -}; + CAknNavigationControlContainer* iNaviPane; //not owned + + CAknNavigationDecorator* iDecorator; + + CIAUpdateMainContainer* iContainer; + + RPointerArray iAllNodes; + + TBool iShowStatusDialogAgain; + + TInt iRefreshError; + + TInt iLastCommandId; + + CIAUpdateFWUpdateHandler* iFwUpdateHandler; + + TBool iIsDMSupported; + + }; -#endif /* IAUPDATEMAINVIEW_H_ */ + +#endif // IAUPDATEMAINVIEW_H + +// End of File