email_plat/nmail_client_api/inc/nmapimessagetask.h
changeset 74 6c59112cfd31
parent 23 2dc6caa42ec3
equal deleted inserted replaced
69:4e54af54a4a1 74:6c59112cfd31
       
     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:
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef NMAPIMESSAGETASK_H_
       
    19 #define NMAPIMESSAGETASK_H_
       
    20 
       
    21 #include <QObject>
       
    22 
       
    23 #include <nmapidef.h>
       
    24 
       
    25 /*!
       
    26    base class for async tasks
       
    27  */
       
    28 class NMAPI_EXPORT NmApiMessageTask : public QObject
       
    29 {
       
    30     Q_OBJECT
       
    31 protected:
       
    32     NmApiMessageTask(QObject *parent);
       
    33 
       
    34 public:
       
    35     virtual ~NmApiMessageTask();
       
    36 
       
    37 public slots:
       
    38     /*!
       
    39        Starts task and returns true if starting succeeded.
       
    40      */
       
    41     virtual bool start() = 0;
       
    42 
       
    43     /*!
       
    44        Cancels started but not yet completed task. may not be applicable
       
    45        in all tasks.
       
    46      */
       
    47     virtual void cancel() = 0;
       
    48 
       
    49     signals:
       
    50     /*!
       
    51        task failed, error code is specific to concrete task
       
    52      */
       
    53     void failed (int error);
       
    54     /*!
       
    55        task canceled
       
    56      */
       
    57     void canceled();
       
    58 };
       
    59 
       
    60 #endif /*NMAPIMESSAGETASK_H_ */