controlpanelui/src/tonefetcher/src/tonefetcherwidget.h
changeset 19 36aa4756ee82
child 21 2883a5458389
equal deleted inserted replaced
12:624337f114fe 19:36aa4756ee82
       
     1 /*
       
     2  * Copyright (c) 2009 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:
       
    15  *     The header file for tone fetcher widget.
       
    16  *     
       
    17  */
       
    18 #ifndef TONEFETCHERWIDGET_H
       
    19 #define TONEFETCHERWIDGET_H
       
    20 
       
    21 #include <hbwidget.h>
       
    22 #include <QFileInfo>
       
    23 #include <QDir>
       
    24 #include <QString>
       
    25 #include "tonefetcherengine.h"
       
    26 
       
    27 class QDirModel;
       
    28 class HbListView;
       
    29 class QGraphicsLinearLayout;
       
    30 class QStandardItemModel;
       
    31 class HbAbstractViewItem;
       
    32 class ToneFetcherView;
       
    33 class ToneFetcherModel;
       
    34 class HbLabel;
       
    35 
       
    36 class ToneFetcherWidget : public HbWidget
       
    37 {
       
    38     Q_OBJECT
       
    39     
       
    40 public:
       
    41     explicit ToneFetcherWidget(ToneFetcherView *serviceView);
       
    42     ~ToneFetcherWidget();
       
    43     QString getCurrentItemPath();
       
    44     void playOrPause();
       
    45     
       
    46 signals:
       
    47     void itemClicked(const QString &item);
       
    48     void triggerToolBar(bool enable);
       
    49     
       
    50 private slots:
       
    51     void on_list_activated(const QModelIndex &index);    
       
    52     void mdeSessionOpened();
       
    53     void mdeSessionError(int error);
       
    54     void queryComplete(const QStringList &nameList, const QStringList &uriList);
       
    55     void queryError(int error );
       
    56     void previewEvent(ToneFetcherEngine::TPreviewEvent event, int errorId);
       
    57     void onObjectChanged();
       
    58     
       
    59 private:
       
    60     void init();
       
    61     void addRomFiles();
       
    62     
       
    63 private:
       
    64     HbLabel *mLabel;
       
    65     HbListView *mListView;
       
    66     QGraphicsLinearLayout *mLayout;
       
    67     ToneFetcherModel *mToneModel;   
       
    68     
       
    69     ToneFetcherView *mServiceView;
       
    70     ToneFetcherEngine *mServiceEngine;
       
    71     
       
    72     QFileInfoList mSimpleSoundList;
       
    73     QFileInfoList mDigitalSoundList;    
       
    74     bool mSelected;
       
    75     QModelIndex mOldSeletedItem;
       
    76 };
       
    77 #endif /* TONEFETCHERWIDGET_H_ */