mpviewplugins/mpdetailsviewplugin/inc/mpdetailssharedialog.h
changeset 48 af3740e3753f
parent 42 79c49924ae23
child 54 c5b304f4d89b
equal deleted inserted replaced
42:79c49924ae23 48:af3740e3753f
     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: Header file for share player.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifdef SHARE_FUNC_ENABLED
       
    19 #ifndef MPDETAILSSHAREDIALOG_H
       
    20 #define MPDETAILSSHAREDIALOG_H
       
    21 
       
    22 #include <HbDialog>
       
    23 #include <QList>
       
    24 #include <QSslError>
       
    25 #include "mpsharedata.h"
       
    26 
       
    27 class QGraphicsWebView;
       
    28 class QNetworkAccessManager;
       
    29 class QNetworkReply;
       
    30 class MpShareWebView;
       
    31 class MpSongData;
       
    32 class HbProgressDialog;
       
    33 
       
    34 /*!
       
    35     Implements Share Player dialog for music player details view.
       
    36     First, construct an instance of the class, then call initialize method.
       
    37 */
       
    38 class MpDetailsShareDialog : public HbDialog
       
    39 {
       
    40     Q_OBJECT
       
    41 
       
    42 public:
       
    43     MpDetailsShareDialog();
       
    44 
       
    45     /*!
       
    46       Initializes an instance of the class with given MpSongData.
       
    47       Translation for "unknown" string is passed so that the share
       
    48       dialog can display "unknown" if artist or title are not set.
       
    49       MpSongData object ownership is not transferred,
       
    50       Music Player Engine retains the ownership.
       
    51     */
       
    52     void initialize( MpSongData* aSongData, const QString& aUnknownTr );
       
    53     virtual ~MpDetailsShareDialog();
       
    54     void cachePublishingPlayerFiles();
       
    55     void logoutPlayer();
       
    56     bool isInitialized() const;
       
    57 
       
    58 public slots:
       
    59     void addContext();
       
    60     void updateSharedData();
       
    61     void onIndexLoad( bool ok );
       
    62     void debugJs( QString s );
       
    63     void errorHandler( QString aError, QString aMessage );
       
    64     void clearCache();
       
    65     void showWindow();
       
    66     void showProgressDialog();
       
    67     void handleRequestSSLErrors( QNetworkReply* aReply, const QList< QSslError >& aErrors );
       
    68     void handleRequestFinished( QNetworkReply* aReply );
       
    69 
       
    70 signals:
       
    71     void closeShareDialog();
       
    72 
       
    73 private:
       
    74     void initShareData( MpSongData* aSongData, const QString& aUnknownTr );
       
    75     void initLanguage();
       
    76     void initNetworkAccessManager();
       
    77     void initWebView();
       
    78     void initSignalSlots();
       
    79     bool initUser();
       
    80 
       
    81 private:
       
    82     MpShareData            mShareData;
       
    83     MpShareWebView*        mShareWebView;   // Owned by HbDialog
       
    84     QNetworkAccessManager* mShareNetAccMan; // Owned
       
    85     HbProgressDialog*      mProgressbar; // Owned
       
    86     bool                   mIsInitialized;
       
    87 };
       
    88 
       
    89 #endif // MPDETAILSSHAREDIALOG_H
       
    90 #endif // SHARE_FUNC_ENABLED