messagingapp/msgui/unifiedviewer/inc/univiewerutils.h
changeset 73 ecf6a73a9186
parent 68 e8a69c93c830
child 76 60a8a215b0ec
equal deleted inserted replaced
68:e8a69c93c830 73:ecf6a73a9186
     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:  Utility class for univiewer.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef UNI_VIEWER_UTILS_H
       
    19 #define UNI_VIEWER_UTILS_H
       
    20 
       
    21 // SYSTEM INCLUDES
       
    22 #include <QObject>
       
    23 
       
    24 // FORWARD DECLARATIONS
       
    25 
       
    26 /**
       
    27  * @class UniViewerUtils
       
    28  * @brief Utility class for univiewer. Contains common functionality required
       
    29  * for widgets.
       
    30  */
       
    31 
       
    32 class UniViewerUtils: public QObject
       
    33 {
       
    34 Q_OBJECT
       
    35 
       
    36 public:
       
    37 
       
    38     /**
       
    39      * Constructor
       
    40      */
       
    41     explicit UniViewerUtils(QObject *parent = 0);
       
    42 
       
    43     /**
       
    44      * Destructor
       
    45      */
       
    46     virtual ~UniViewerUtils();
       
    47 
       
    48     /**
       
    49      * Utility function to launch different content viewers.
       
    50      * @param mimeType Mime type of the content.
       
    51      * @param filePath Absolute file path of content.
       
    52      */
       
    53     void launchContentViewer(const QString &mimeType, const QString &filePath);
       
    54 
       
    55 signals:
       
    56 
       
    57     /**
       
    58      * Service launch complete.
       
    59      */
       
    60     void requestOk(const QVariant& result);
       
    61 
       
    62     /**
       
    63      * Service launch errors.
       
    64      */
       
    65     void requestError(int errorCode, const QString& errorMessage);
       
    66 
       
    67 private slots:
       
    68 
       
    69     /**
       
    70      * Service launch complete.
       
    71      */
       
    72     void handleOk(const QVariant& result);
       
    73 
       
    74     /**
       
    75      * Service launch errors.
       
    76      */
       
    77     void handleError(int errorCode, const QString& errorMessage);
       
    78 
       
    79 private:
       
    80 
       
    81     /**
       
    82      * Launch content viewer using XQSharableFile.
       
    83      * @param filePath Absolute path of content.
       
    84      */
       
    85     void launchViaSharableFile(const QString &filePath);
       
    86 
       
    87 };
       
    88 
       
    89 #endif // UNI_VIEWER_UTILS_H
       
    90 //eof