videocollection/tsrc/stubs/src/videolistselectiondialog.cpp
branchRCL_3
changeset 56 839377eedc2b
equal deleted inserted replaced
54:315810614048 56:839377eedc2b
       
     1 /*
       
     2 * Copyright (c) 2010 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:   videolist selection dialog implementation
       
    15 * 
       
    16 */
       
    17 
       
    18 #include <hbaction.h>
       
    19 
       
    20 #include "videolistselectiondialog.h"
       
    21 #include "videolistselectiondialogdata.h"
       
    22 #include "videocollectionwrapper.h"
       
    23 #include "videosortfilterproxymodel.h"
       
    24 
       
    25 bool VideoListSelectionDialogData::mExecReturnPrimary = false;
       
    26 int VideoListSelectionDialogData::mSelectionCount = 0;
       
    27 int VideoListSelectionDialogData::mMultiSelectionLaunchCount = 0;    
       
    28 int VideoListSelectionDialogData::mMultiSelectionItemSelectionCount = 0;
       
    29 int VideoListSelectionDialogData::mSelectionType = -1;
       
    30 TMPXItemId VideoListSelectionDialogData::mSettedMpxId = TMPXItemId::InvalidId();
       
    31 
       
    32 VideoListSelectionDialog::VideoListSelectionDialog(
       
    33     VideoCollectionUiLoader *uiLoader,
       
    34     QGraphicsItem *parent) : 
       
    35     HbDialog(parent),
       
    36     mUiLoader(uiLoader),
       
    37     mHeading(0),
       
    38     mCheckboxContainer(0),
       
    39     mItemCount(0),
       
    40     mCheckBox(0),
       
    41     mListContainer(0),
       
    42     mForcedCheck(false),
       
    43     mModel(0),
       
    44     mModelReady(false),
       
    45     mAlbumListReady(false),
       
    46     mListWidget(0),
       
    47     mPrimaryAction(0),
       
    48     mSecondaryAction(0)
       
    49 {
       
    50     setDismissPolicy(HbDialog::NoDismiss);
       
    51     setTimeout(HbDialog::NoTimeout);
       
    52     
       
    53     // create primary action
       
    54     mPrimaryAction = new HbAction();
       
    55     
       
    56     // create secondary action
       
    57     mSecondaryAction = new HbAction();
       
    58 }
       
    59 
       
    60 VideoListSelectionDialog::~VideoListSelectionDialog() 
       
    61 {
       
    62     VideoListSelectionDialogData::reset();
       
    63 }
       
    64 
       
    65 void VideoListSelectionDialog::setupContent(int type, TMPXItemId activeItem)
       
    66 {
       
    67     VideoListSelectionDialogData::mSelectionType = type;
       
    68     VideoListSelectionDialogData::mSettedMpxId = activeItem;
       
    69 }
       
    70 
       
    71 bool VideoListSelectionDialog::initDialog()
       
    72 {
       
    73     // not stubbed
       
    74     return false;
       
    75 }
       
    76 
       
    77 void VideoListSelectionDialog::exec()
       
    78 {
       
    79     // fill selection
       
    80     VideoListSelectionDialogData::mMultiSelectionLaunchCount++;
       
    81     VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
       
    82     VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeGeneric);
       
    83     if (model)
       
    84     {
       
    85         for (int i = 0; i < VideoListSelectionDialogData::mSelectionCount; i++)
       
    86         {
       
    87             QModelIndex index = model->index(i, 0);
       
    88             if(index.isValid())
       
    89             {
       
    90                 mSelection.append(QItemSelectionRange(index));
       
    91             }
       
    92         }
       
    93     }
       
    94     VideoListSelectionDialogData::mMultiSelectionItemSelectionCount = mSelection.indexes().count();
       
    95     
       
    96 }
       
    97 
       
    98 void VideoListSelectionDialog::finishedSlot(HbAction *action)
       
    99 {
       
   100     Q_UNUSED(action);
       
   101 }
       
   102 
       
   103 void VideoListSelectionDialog::markAllStateChangedSlot(int state)
       
   104 {
       
   105     Q_UNUSED(state);
       
   106     // not stubbed
       
   107 }
       
   108 
       
   109 void VideoListSelectionDialog::selectionChangedSlot(
       
   110     const QItemSelection &selected,
       
   111     const QItemSelection &deselected)
       
   112 {  
       
   113     Q_UNUSED(selected);
       
   114     Q_UNUSED(deselected);
       
   115     // not stubbed
       
   116 }
       
   117 
       
   118 void VideoListSelectionDialog::singleItemSelectedSlot(const QModelIndex &index)
       
   119 {
       
   120     Q_UNUSED(index);
       
   121     // not stubbed
       
   122 }
       
   123 
       
   124 void VideoListSelectionDialog::modelReadySlot()
       
   125 {
       
   126     // not stubbed
       
   127 }
       
   128 
       
   129 void VideoListSelectionDialog::albumListReadySlot()
       
   130 {
       
   131     // not stubbed
       
   132 }
       
   133 
       
   134 void VideoListSelectionDialog::updateCounterSlot()
       
   135 {
       
   136     // not stubbed
       
   137 }
       
   138 
       
   139 void VideoListSelectionDialog::primaryActionTriggeredSlot()
       
   140 {
       
   141     // not stubbed
       
   142 }
       
   143 
       
   144 void VideoListSelectionDialog::connectSignals()
       
   145 {
       
   146     // not stubbed
       
   147 }
       
   148  
       
   149 void VideoListSelectionDialog::disconnectSignals()
       
   150 {
       
   151     // not stubbed
       
   152 }
       
   153 
       
   154 void VideoListSelectionDialog::newAlbumNameDialogFinished(HbAction *action)
       
   155 {
       
   156     Q_UNUSED(action);
       
   157     // not stubbed
       
   158 }
       
   159 
       
   160 void VideoListSelectionDialog::finalize(QString albumName)
       
   161 {
       
   162     Q_UNUSED(albumName);
       
   163     // not stubbed
       
   164 }
       
   165 
       
   166 // end of file