upnpsettings/upnpsharingui/inc/upnpappfilesharinglist.h
branchIOP_Improvements
changeset 40 08b5eae9f9ff
parent 39 6369bfd1b60d
child 41 b4d83ea1d6e2
equal deleted inserted replaced
39:6369bfd1b60d 40:08b5eae9f9ff
     1 /*
       
     2 * Copyright (c) 2005-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:      File sharing list class definition for Home Network
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef UPNPAPPFILESHARINGLIST_H
       
    24 #define UPNPAPPFILESHARINGLIST_H
       
    25 
       
    26 //  INCLUDES
       
    27 #include <aknsettingitemlist.h> // base class
       
    28 #include <AknWaitNoteWrapper.h> // base class MAknBackgroundProcess
       
    29 
       
    30 // FORWARD CLASS DECLARATION
       
    31 class CUPnPFileSharingEngine;
       
    32 class CUPnPAppWizard;
       
    33 
       
    34 // CONSTANTS
       
    35 const TInt KMaxTextSettingItemLenght = 128;
       
    36 
       
    37 /**
       
    38  *  Settings list class declaration
       
    39  *  @since S60 3.1
       
    40  */
       
    41 NONSHARABLE_CLASS( CUPnPAppFileSharingList )
       
    42     : public CAknSettingItemList
       
    43     , public MAknBackgroundProcess
       
    44     {
       
    45 private:
       
    46     /**
       
    47      * The internal phases of wait note when changing sharing state
       
    48      */
       
    49     enum TSharingStarting
       
    50         {
       
    51         EPhaseNotActive,
       
    52         EPhaseProcessing,
       
    53         EPhaseCompleted
       
    54         };
       
    55 public:  // Constructors and destructor
       
    56 
       
    57     /**
       
    58      * Two-phased constructor.
       
    59      */
       
    60     static CUPnPAppFileSharingList* NewL(
       
    61         CUPnPFileSharingEngine* aFileSharingEngine );
       
    62 
       
    63     /**
       
    64      * Destructor.
       
    65      */
       
    66     virtual ~CUPnPAppFileSharingList();
       
    67 
       
    68 public: // New functions
       
    69     /**
       
    70      * From CAknSettingItemList, this launches the setting page.
       
    71      * @since S60 3.1
       
    72      * @param aIndex, index of selected list item
       
    73      * @param aCalledFromMenu, indicates if editing is called
       
    74      *        trough menu or from keyboard
       
    75      */
       
    76     void  EditItemL (TInt aIndex, TBool aCalledFromMenu);
       
    77 
       
    78     /**
       
    79      * Reads data from storage to member variables
       
    80      * @since S60 3.1
       
    81      */
       
    82     void LoadDataFromEngineL();
       
    83 
       
    84 public: //From MUPnPFileSharingEngineObserver
       
    85 
       
    86     /**
       
    87      * Function informs when file sharing was enabled or disabled
       
    88      * @since S60 3.1
       
    89      * @param aEngine File sharing engine
       
    90      * @param aError, error code
       
    91      * @param aPhase ETrue if current phase is sharing activation,
       
    92      * otherwise EFalse
       
    93      */
       
    94     void HandleSharingStatus( 
       
    95         CUPnPFileSharingEngine& aEngine, 
       
    96         TInt aError, 
       
    97         TBool aPhase );
       
    98 
       
    99     /**
       
   100      * Callback to inform if connection has been lost
       
   101      * @since S60 3.1
       
   102      * @param aEngine File sharing engine
       
   103      */ 
       
   104     void HandleSharingConnectionLost( 
       
   105         CUPnPFileSharingEngine& aEngine );
       
   106 
       
   107 public:
       
   108 
       
   109     /**
       
   110      * Processes progress information and sets secondary texts according to
       
   111      * received progress
       
   112      * @since S60 3.1
       
   113      * @param aProgressInfo, Type containg the progress information
       
   114      */
       
   115     void SetFilesharingTextsL(
       
   116         const RArray<TUpnpProgressInfo>& aProgressInfo );
       
   117 
       
   118     /**
       
   119      * Sets the default secondary texts if no sharing is ongoing
       
   120      * @since S60 3.1
       
   121      * @param aMediaType, Type of the media
       
   122      * @param aState, State of the selection
       
   123      */
       
   124     void SetDefaultSecondaryTextsL(
       
   125         const TInt& aMediaType,
       
   126         const TInt& aState );
       
   127 
       
   128     /**
       
   129      * Sets the secondary texts id there is sharing ongoing
       
   130      * @since S60 3.1
       
   131      * @param aMediaType, Type of the media
       
   132      * @param aProgress, The value of progress in percents
       
   133      */
       
   134     void SetProgressSecondaryTextsL(
       
   135         const TInt& aMediaType,
       
   136         const TInt& aProgress );
       
   137 
       
   138     /**
       
   139      * Update the visibity of item ,when the list is switched foregroud.
       
   140      */
       
   141      void UpdateVisibitySettingItemL();
       
   142      
       
   143 protected:
       
   144 
       
   145     /**
       
   146      * From CAknSettingItemList
       
   147      */
       
   148     void HandleResourceChange( TInt aType );
       
   149 
       
   150     /**
       
   151      * From CoeControl
       
   152      */
       
   153     void FocusChanged(
       
   154         TDrawNow  aDrawNow );
       
   155 
       
   156 protected:
       
   157     /**
       
   158      * From MAknBackgroundProcess
       
   159      */
       
   160     void  StepL();
       
   161 
       
   162     /**
       
   163      * From MAknBackgroundProcess
       
   164      */
       
   165     TBool  IsProcessDone() const;
       
   166 
       
   167 
       
   168 private:
       
   169 
       
   170     /**
       
   171      * C++ default constructor.
       
   172      */
       
   173     CUPnPAppFileSharingList();
       
   174 
       
   175     /**
       
   176      * By default Symbian 2nd phase constructor is private.
       
   177      * @param aFileSharingEngine, engine pointer
       
   178      */
       
   179     void ConstructL( CUPnPFileSharingEngine* aFileSharingEngine );
       
   180 
       
   181     /**
       
   182      * From CAknSettingItemList, Framework method to create a setting item.
       
   183      * @since S60 3.1
       
   184      * @param aIdentifier,  list item id to be created
       
   185      * @return CAknSettingItem, pointer to list item
       
   186      */
       
   187     CAknSettingItem* CreateSettingItemL( TInt aIdentifier );
       
   188 
       
   189     /**
       
   190      * Create and show the wait note when starting sharing
       
   191      * @since S60 3.1
       
   192      */
       
   193     void ShowWaitNoteL();
       
   194 
       
   195 
       
   196 private: // Data
       
   197 
       
   198     /**
       
   199      * list item text for visual albums
       
   200      */
       
   201     TBuf<KMaxTextSettingItemLenght>  iVisualAlbums;
       
   202     /**
       
   203      * list item text for playlists
       
   204      */
       
   205     TBuf<KMaxTextSettingItemLenght>  iPlayLists;
       
   206     /**
       
   207      * visibility setting item value
       
   208      */
       
   209     TInt iVisibility;
       
   210     /**
       
   211      *access point id setting item value
       
   212      */
       
   213     TInt iIapId;
       
   214     /**
       
   215      * engine pointer
       
   216      */
       
   217     CUPnPFileSharingEngine* iFileSharingEngine;
       
   218     /**
       
   219      * Indicator if wizard is run to update UI
       
   220      */
       
   221     TBool iWizardRun;
       
   222     /**
       
   223      * The state of sharing activation for progress note
       
   224      */
       
   225     TInt iStartingSharing;
       
   226     /**
       
   227      * Pointer to wizard
       
   228      */
       
   229     CUPnPAppWizard* iWizard;
       
   230 
       
   231     };
       
   232 
       
   233 #endif      // UPNPAPPFILESHARINGLIST_H
       
   234 // End of File