messagingapp/msgui/inc/msgaudiofetcherdialog.h
changeset 56 f42d9a78f435
child 73 ecf6a73a9186
equal deleted inserted replaced
55:5b3b2fa8c3ec 56:f42d9a78f435
       
     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:
       
    15  *     The header file for messaging's audio fetcher view.
       
    16  *
       
    17  */
       
    18 
       
    19 #ifndef MSGAUDIOFETCHERDIALOG_H
       
    20 #define MSGAUDIOFETCHERDIALOG_H
       
    21 
       
    22 #ifdef BUILD_MSGAUDIOFETCHER_DLL
       
    23 #define MSGAUDIOFETCHER_DLL_EXPORT Q_DECL_EXPORT
       
    24 #else
       
    25 #define MSGAUDIOFETCHER_DLL_EXPORT Q_DECL_IMPORT
       
    26 #endif
       
    27 
       
    28 // SYSTEM INCLUDES
       
    29 #include <QObject>
       
    30 #include <hblistwidget.h>
       
    31 #include <HbDialog>
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 //class MsgAudioFetcherWidget;
       
    35 class HbAction;
       
    36 class HbListView;
       
    37 class MsgAudioFetcherModel;
       
    38 class MsgAudioPreview;
       
    39 
       
    40 /**
       
    41  * @class MsgAudioFetcherView
       
    42  * @brief This class is messaging's audio fetcher view
       
    43  */
       
    44 class MSGAUDIOFETCHER_DLL_EXPORT MsgAudioFetcherDialog : public HbDialog
       
    45 {
       
    46 Q_OBJECT
       
    47 
       
    48 public:
       
    49     /**
       
    50      * Constructor
       
    51      */
       
    52     explicit MsgAudioFetcherDialog(QGraphicsItem *parent = 0);
       
    53 
       
    54     /**
       
    55      * Destructor
       
    56      */
       
    57     ~MsgAudioFetcherDialog();  
       
    58         
       
    59 private:
       
    60     /**
       
    61      * Creates a widget and sets it to the view
       
    62      */
       
    63     void initMainWidget();
       
    64 
       
    65     /**
       
    66      * Initializes dialog actions
       
    67      */
       
    68     void initActions();   
       
    69     
       
    70     /**
       
    71      * Returns the selected audio path
       
    72      */
       
    73     QString getCurrentItemPath();
       
    74 
       
    75 signals:
       
    76 
       
    77     /**
       
    78      * Emits when audio selected from dialog
       
    79      */
       
    80     void audioSelected(QString& filePath);
       
    81     
       
    82 private slots:
       
    83 
       
    84     /**
       
    85      * On View Ready signal do some construction
       
    86      */
       
    87     void doDelayedConstruction();
       
    88     
       
    89     /**
       
    90      * Handles toolbar's leftaction (select)
       
    91      */
       
    92     void onSelectAction();
       
    93 
       
    94     /**
       
    95      * Handles toolbar's rightaction (cancel)
       
    96      */
       
    97     void onCancelAction();
       
    98 
       
    99     /**
       
   100      * On close of dialog this resets the item
       
   101      */
       
   102     void reset();
       
   103     
       
   104     /**
       
   105      * This gets called after list item gets 
       
   106      * activated
       
   107      */
       
   108     void on_list_activated(const QModelIndex &index);
       
   109 
       
   110 private:
       
   111     
       
   112     /**
       
   113      * List for displaying the audio list
       
   114      */
       
   115     HbListView* mListView;
       
   116     
       
   117     /**
       
   118      * Model for the List View
       
   119      */
       
   120     MsgAudioFetcherModel* mFetcherModel;
       
   121     
       
   122     /**
       
   123      * Audio preview instance
       
   124      */
       
   125     MsgAudioPreview* mAudioPreview;
       
   126     
       
   127     /**
       
   128      * Toolbar's left SELECT action
       
   129      */
       
   130     HbAction *mLeftAction;
       
   131     
       
   132     /**
       
   133      * last selected item
       
   134      */
       
   135     QModelIndex mSeletedItem;
       
   136     
       
   137     /**
       
   138      * This to enable the left action in dialog
       
   139      */
       
   140     bool mSelected;
       
   141 };
       
   142 
       
   143 #endif /* MSGAUDIOFETCHERVIEW_H */