emailuis/nmailui/src/nmuriserviceinterface.cpp
changeset 54 997a02608b3a
parent 30 759dc5235cdb
child 62 a8c646b56683
equal deleted inserted replaced
53:bf7eb7911fc5 54:997a02608b3a
    15 *              QT highway and other applications
    15 *              QT highway and other applications
    16 *
    16 *
    17 */
    17 */
    18 
    18 
    19 //  INCLUDES
    19 //  INCLUDES
    20 #include <xqaiwdecl.h>
       
    21 #include "nmuiheaders.h"
    20 #include "nmuiheaders.h"
    22 
    21 
    23 /*!
    22 /*!
    24     \class NmStartParamDataHelper
    23     \class NmStartParamDataHelper
    25     \brief A helper class for processing the data given to the actual service.
    24     \brief A helper class for processing the data given to the actual service.
    30 
    29 
    31     /*!
    30     /*!
    32         Class constructor.
    31         Class constructor.
    33     */
    32     */
    34     inline NmStartParamDataHelper()
    33     inline NmStartParamDataHelper()
    35     : mSubject(0),
    34     : mSubject(NULL),
    36       mToAddresses(0),
    35       mToAddresses(NULL),
    37       mCcAddresses(0),
    36       mCcAddresses(NULL),
    38       mBccAddresses(0)
    37       mBccAddresses(NULL)
    39     {
    38     {
    40         NM_FUNCTION;
    39         NM_FUNCTION;
    41     }
    40     }
    42 
    41 
    43     /*!
    42     /*!
    55     */
    54     */
    56     inline bool extractData(const QString &data)
    55     inline bool extractData(const QString &data)
    57     {
    56     {
    58         NM_FUNCTION;
    57         NM_FUNCTION;
    59         
    58         
    60         bool success = false;
    59         bool success(false);
    61         
    60         
    62         QUrl uri(data);
    61         QUrl uri(data);
    63         
    62         
    64         if (uri.isValid()) {
    63         if (uri.isValid()) {
    65             
    64             
   163     Class constructor.
   162     Class constructor.
   164 */
   163 */
   165 NmUriServiceInterface::NmUriServiceInterface(QObject *parent,
   164 NmUriServiceInterface::NmUriServiceInterface(QObject *parent,
   166                                                NmUiEngine &uiEngine,
   165                                                NmUiEngine &uiEngine,
   167                                                NmApplication *application)
   166                                                NmApplication *application)
   168 #ifndef NM_WINS_ENV
       
   169     : XQServiceProvider(emailServiceName+"."+XQI_URI_VIEW, parent),
   167     : XQServiceProvider(emailServiceName+"."+XQI_URI_VIEW, parent),
   170 #else
       
   171     : QObject(parent),
       
   172 #endif
       
   173       mApplication(application),
   168       mApplication(application),
   174       mUiEngine(uiEngine),
   169       mUiEngine(uiEngine),
   175       mAsyncReqId(0),
   170       mAsyncReqId(0),
   176       mStartParam(NULL),
   171       mStartParam(NULL),
   177       mSelectionDialog(NULL),
   172       mSelectionDialog(NULL),
   178       mCurrentView(NULL)
   173       mCurrentView(NULL)
   179 {
   174 {
   180 #ifndef NM_WINS_ENV
       
   181     publishAll();
   175     publishAll();
   182 #endif
       
   183 }
   176 }
   184 
   177 
   185 
   178 
   186 /*!
   179 /*!
   187     Class desctructor.
   180     Class desctructor.
   219     \param data <mailto:> uri
   212     \param data <mailto:> uri
   220 */
   213 */
   221 bool NmUriServiceInterface::view(const QString& uri)
   214 bool NmUriServiceInterface::view(const QString& uri)
   222 {
   215 {
   223     NM_FUNCTION;
   216     NM_FUNCTION;
   224     
   217       
   225 #ifndef NM_WINS_ENV
   218     HbMainWindow *mainWindow(NULL);
   226     
   219     if (mApplication) {
   227     // Make sure that nmail stays background if user presses back in editorview
   220         // Make sure that nmail stays background if user presses back in editorview
   228     mApplication->updateVisibilityState();
   221         mApplication->updateVisibilityState();
   229     
   222         
   230     HbMainWindow *mainWindow = mApplication->mainWindow();
   223         mainWindow = mApplication->mainWindow();
   231     mCurrentView = mainWindow->currentView();
   224         if (mainWindow) {
       
   225             mCurrentView = mainWindow->currentView();  
       
   226         } 
       
   227     }
   232 
   228 
   233     // Hide the current view.
   229     // Hide the current view.
   234     if (mCurrentView) {
   230     if (mCurrentView) {
   235         mCurrentView->hide();
   231         mCurrentView->hide();
   236     }
   232     }
   258         cancelService();
   254         cancelService();
   259     }
   255     }
   260     else { // count > 0
   256     else { // count > 0
   261         // Make sure the NMail application is in the foreground.
   257         // Make sure the NMail application is in the foreground.
   262         XQServiceUtil::toBackground(false);
   258         XQServiceUtil::toBackground(false);
   263         mainWindow->show();
   259         if (mainWindow) {
       
   260             mainWindow->show();        
       
   261         }
   264 
   262 
   265     	mStartParam = new NmUiStartParam(
   263     	mStartParam = new NmUiStartParam(
   266         	NmUiViewMessageEditor,
   264         	NmUiViewMessageEditor,
   267 	        0, // account id
   265 	        0, // account id
   268 	        0, // folder id
   266 	        0, // folder id
   351             mCurrentView = NULL;
   349             mCurrentView = NULL;
   352         }
   350         }
   353     }
   351     }
   354 }
   352 }
   355 
   353 
   356 #endif /* NM_WINS_ENV */
       
   357 
       
   358 
       
   359 
       
   360 // End of file.
   354 // End of file.