emailuis/nmailui/src/nmattachmentpicker.cpp
changeset 47 f83bd4ae1fe3
parent 43 99bcbff212ad
child 56 15bc1d5d6267
equal deleted inserted replaced
45:780f926bc26c 47:f83bd4ae1fe3
    13 *
    13 *
    14 * Description: Utility class for launching different file pickers
    14 * Description: Utility class for launching different file pickers
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <fmfiledialog.h>
       
    19 #include <xqaiwdecl.h>
       
    20 #include "nmuiheaders.h"
    18 #include "nmuiheaders.h"
    21 const int NmAttachmentPickerStillMode = 0;
    19 
    22 const int NmAttachmentPickerVideoMode = 1;
    20 static const int NmAttachmentPickerStillMode = 0;
       
    21 static const int NmAttachmentPickerVideoMode = 1;
    23 
    22 
    24 /*!
    23 /*!
    25     \class NmAttachmentPicker
    24     \class NmAttachmentPicker
    26     \brief Attachment picker for mail editor
    25     \brief Attachment picker for mail editor
    27 */
    26 */
    28 
    27 
    29 /*!
    28 /*!
    30     Constructor
    29     Constructor
    31 */
    30 */
    32 NmAttachmentPicker::NmAttachmentPicker(QObject* parent):
    31 NmAttachmentPicker::NmAttachmentPicker(QObject *parent):
    33     QObject(parent),
    32     QObject(parent),
    34     mRequest(NULL)
    33     mRequest(NULL)
    35 {
    34 {
    36     NM_FUNCTION;
    35     NM_FUNCTION;
    37 }
    36 }
    83     NM_FUNCTION;
    82     NM_FUNCTION;
    84     
    83     
    85     QString path;
    84     QString path;
    86     path = FmFileDialog::getSaveFileName(0, hbTrId("txt_mail_dialog_select_file"));
    85     path = FmFileDialog::getSaveFileName(0, hbTrId("txt_mail_dialog_select_file"));
    87     
    86     
    88     if(!path.isEmpty()) {
    87     if (!path.isEmpty()) {
    89         QString temp = QDir::toNativeSeparators(path);
    88         QString temp = QDir::toNativeSeparators(path);
    90         emit attachmentsFetchOk(QVariant(temp));    
    89         emit attachmentsFetchOk(QVariant(temp));    
    91     }
    90     }
    92 }
    91 }
    93 
    92 
   114 */
   113 */
   115 void NmAttachmentPicker::fetchFromCamera(int mode)
   114 void NmAttachmentPicker::fetchFromCamera(int mode)
   116 {
   115 {
   117     NM_FUNCTION;
   116     NM_FUNCTION;
   118 
   117 
   119     int cameraIndex = 0;            //primary camera
   118     int cameraIndex(0);            //primary camera
   120     int quality = 0;                //default
   119     int quality(0);                //default
   121     bool allowModeSwitch = false;   //not allowed to change
   120     bool allowModeSwitch(false);   //not allowed to change
   122     bool allowCameraSwitch = true;  //allow changes
   121     bool allowCameraSwitch(true);  //allow changes
   123     bool allowQualityChange = true; //allow changes
   122     bool allowQualityChange(true); //allow changes
   124     
   123     
   125     QVariantMap parameters;
   124     QVariantMap parameters;
   126     parameters.insert(XQCAMERA_INDEX, cameraIndex);
   125     parameters.insert(XQCAMERA_INDEX, cameraIndex);
   127     parameters.insert(XQCAMERA_QUALITY, quality);
   126     parameters.insert(XQCAMERA_QUALITY, quality);
   128     parameters.insert(XQCAMERA_MODE_SWITCH, allowModeSwitch);
   127     parameters.insert(XQCAMERA_MODE_SWITCH, allowModeSwitch);
   139     Construct & send appmgr request to start appropriate picker   
   138     Construct & send appmgr request to start appropriate picker   
   140     param <interface> the interface to be connected to
   139     param <interface> the interface to be connected to
   141     param <operation> the operation of the interface
   140     param <operation> the operation of the interface
   142     param <args> the arguments that needed by the operation
   141     param <args> the arguments that needed by the operation
   143 */
   142 */
   144 void NmAttachmentPicker::fetch(const QString& interface, 
   143 void NmAttachmentPicker::fetch(const QString &interface, 
   145     const QString& operation, const QList<QVariant>* args)
   144     const QString &operation, const QList<QVariant> *args)
   146 {
   145 {
   147     NM_FUNCTION;
   146     NM_FUNCTION;
   148     
   147     
   149     delete mRequest;
   148     delete mRequest;
   150     mRequest = NULL;
   149     mRequest = NULL;