upnpsettings/multiselectionui/inc/upnpappmultiselectionpopup.h
branchIOP_Improvements
changeset 40 08b5eae9f9ff
parent 39 6369bfd1b60d
child 41 b4d83ea1d6e2
equal deleted inserted replaced
39:6369bfd1b60d 40:08b5eae9f9ff
     1 /*
       
     2 * Copyright (c) 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:      CUPnPAppMultiselectionPopup class definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef UPNPAPPMULTISELECTIONPOPUP_H
       
    24 #define UPNPAPPMULTISELECTIONPOPUP_H
       
    25 
       
    26 // INCLUDES
       
    27 #include <AknDialog.h>
       
    28 #include <aknselectionlist.h>
       
    29 #include <aknsfld.h>
       
    30 #include <aknnavide.h>
       
    31 #include <akntitle.h> //for status pane
       
    32 #include <AknIconArray.h>
       
    33 #include <AknWaitNoteWrapper.h>
       
    34 #include <aknlistquerydialog.h> //caknlistquerydialog
       
    35 #include <aknsfld.h> //caknsearchfield
       
    36 
       
    37 #include "upnpfilesharingengine.h" // included to know THomeConnectMediaType
       
    38 #include "upnpmultiselectionutility.h"
       
    39 
       
    40 
       
    41 // FORWARD DECLARATIONS
       
    42 class CUPnPFileSharingEngine;
       
    43 
       
    44 // CLASS DECLARATION
       
    45 
       
    46 /**
       
    47  * CUPnPAppMultiselectionPopup dialog class
       
    48  * @since S60 3.1
       
    49  */
       
    50 NONSHARABLE_CLASS( CUPnPAppMultiselectionPopup ) : public CAknListQueryDialog,
       
    51                                     MAknBackgroundProcess
       
    52     {
       
    53 public: // Constructors and destructor
       
    54         /**
       
    55          * Two-phased constructor.
       
    56          * @since S60 3.1
       
    57          * @param aMediaType. Media type for UI. Either Images Or videos or \
       
    58 music.
       
    59          * @param aFileSharingEngine. Pointer to filesharingengine.
       
    60          * @param aSelectionIndexArray. Array for initial selection.
       
    61          */
       
    62     static CUPnPAppMultiselectionPopup* NewL(
       
    63         THomeConnectMediaType aMediaType,
       
    64         CUPnPFileSharingEngine* aFileSharingEngine,
       
    65         CListBoxView::CSelectionIndexArray* aSelectionIndexArray,
       
    66         const HBufC* aHeading);
       
    67 
       
    68     /**
       
    69      * stores marked items to iUiMarked
       
    70      * 
       
    71      * @param aMarkedItems
       
    72      */
       
    73     void SetMarkedItemsL(CArrayFix<TInt>& aMarkedItems);
       
    74     
       
    75     /**
       
    76      * Destructor.
       
    77      */
       
    78     virtual ~CUPnPAppMultiselectionPopup();
       
    79 
       
    80 
       
    81 protected:
       
    82 
       
    83     // New functions
       
    84     void ConstructL(THomeConnectMediaType aMediaType,
       
    85                     CUPnPFileSharingEngine* aFileSharingEngine,
       
    86                     CListBoxView::CSelectionIndexArray* aSelectionIndexArray);
       
    87 
       
    88 
       
    89 
       
    90 protected:  // Functions from base classes
       
    91     /**
       
    92      * From MAknBackgroundProcess, handles backround processing
       
    93      * @since S60 3.1
       
    94      */
       
    95     virtual void  StepL ();
       
    96 
       
    97     /**
       
    98      * From MAknBackgroundProcess, handles backround processing
       
    99      * @since S60 3.1
       
   100      * @return TBool, ETrue when the process is done
       
   101      */
       
   102     virtual TBool  IsProcessDone () const;
       
   103 
       
   104     /**
       
   105      * From CAknSelectionListDialog, handles layout initialization
       
   106      * @since S60 3.1
       
   107      */
       
   108     void PreLayoutDynInitL();
       
   109 
       
   110     /**
       
   111      * From CAknSelectionListDialog, handles initialization
       
   112      * that doesn't affect layout
       
   113      * @since S60 3.1
       
   114      */
       
   115     void  PostLayoutDynInitL ();
       
   116 
       
   117     /**
       
   118      * From CAknSelectionListDialog, handles key events.
       
   119      * @since S60 3.1
       
   120      * @param TKeyEvent, Event to handled.
       
   121      * @param TEventCode, Type of the key event.
       
   122      * @return TKeyResponse, response code
       
   123      * (EKeyWasConsumed, EKeyWasNotConsumed).
       
   124      */
       
   125     TKeyResponse  OfferKeyEventL (const TKeyEvent &aKeyEvent,
       
   126                                   TEventCode aType);
       
   127     /**
       
   128      * From CAknSelectionListDialog, handles focus changes of the dialog
       
   129      * @since S60 3.1
       
   130      * @param TInt, pressed button id
       
   131      * @return TBool, ETrue if ready to close dialog, EFalse otherwise
       
   132      */
       
   133     TBool OkToExitL( TInt aButtonId );
       
   134 
       
   135 
       
   136 private:
       
   137     /**
       
   138      * C++ default constructor.
       
   139      */
       
   140     CUPnPAppMultiselectionPopup(
       
   141         CListBoxView::CSelectionIndexArray* aSelectionIndexArray,
       
   142         const HBufC* aHeading );
       
   143 
       
   144 private: //data
       
   145     // dialog control item
       
   146 
       
   147     CEikListBox*              iListBox; //not owned
       
   148 
       
   149     CAknFilteredTextListBoxModel* iModel; //not owned
       
   150     
       
   151     
       
   152 
       
   153     // Mediatype selected from listbox
       
   154     THomeConnectMediaType           iMediaType;
       
   155     // File sharing engine member
       
   156     CUPnPFileSharingEngine*         iFileSharingEngine; //not owned
       
   157     // Share all selection
       
   158     TInt*                            iShareAllSelection;
       
   159     // selected album indexes
       
   160     CArrayFixFlat<TInt>*            iSelectedAlbums;
       
   161     // title pane
       
   162     CAknTitlePane*                  iTitlePane;
       
   163     // selected item - needed for creation of CAknSelectionListDialog
       
   164     TInt                            iSelectedItem;
       
   165     // array for playlists
       
   166     CDesCArrayFlat*                 iFileArray;
       
   167     // wait note
       
   168     CAknWaitNoteWrapper*            iWaitNoteWrapper;
       
   169     // array of marked (shared) items.
       
   170     CArrayFix<TInt>*           iMarkedItems;
       
   171     // If this is not NULL it is used instead of "normal" calculation of
       
   172     // selections
       
   173     CArrayFix<TInt>* iPreviousSelection;
       
   174     
       
   175     // get marked items from appwizard
       
   176     CArrayFix<TInt>* iUiMarked;
       
   177     
       
   178     // The pointer to multiselectiondialog
       
   179     CUpnpMultiselectionUtility* iUtility;
       
   180     
       
   181     CDesCArray* iSettingsTextArray; //not owned
       
   182 
       
   183     // Variable to transfer information about wait note end
       
   184     TBool iDone;
       
   185 
       
   186     /**
       
   187      * Msk's label. (Owned)
       
   188      */
       
   189     HBufC* iMskSelectText;
       
   190 
       
   191     /**
       
   192      * Msk's label. (Owned)
       
   193      */
       
   194     HBufC* iMskUnselectText;
       
   195 
       
   196     /**
       
   197      * Internal state
       
   198      */
       
   199     enum TState
       
   200         {
       
   201         ELoadNone = 0,
       
   202         ELoadContent,
       
   203         ELoadIndexes,
       
   204         ELoadDone
       
   205         };
       
   206     TState iState;
       
   207 
       
   208     // Heading text
       
   209     const HBufC*                             iHeading; //not owned
       
   210     };
       
   211 #endif
       
   212 
       
   213 // End of File