phonebookui/phonebookservices/inc/cntserviceprovideredit.h
changeset 50 77bc263e1626
child 53 e6aff7b69165
equal deleted inserted replaced
49:74b30151afd6 50:77bc263e1626
       
     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: This class offers contact editing UI services.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef CNTSERVICEPROVIDEREDIT_H
       
    19 #define CNTSERVICEPROVIDEREDIT_H
       
    20 
       
    21 #include <cntservicescontact.h>
       
    22 #include <xqserviceprovider.h>
       
    23 #include <cntviewparams.h>
       
    24 #include <qtcontacts.h>
       
    25 
       
    26 #include "cntabstractserviceprovider.h"
       
    27 
       
    28 class CntServices;
       
    29 
       
    30 QTM_USE_NAMESPACE
       
    31 
       
    32 /*!
       
    33   This class offers contact editing UI services.
       
    34 */
       
    35 class CntServiceProviderEdit : public XQServiceProvider, public CntAbstractServiceProvider
       
    36 {
       
    37     Q_OBJECT
       
    38 public:
       
    39     CntServiceProviderEdit(CntServices& aServices, QObject *parent = 0);
       
    40     ~CntServiceProviderEdit();
       
    41 
       
    42 public slots:  // operations offered to clients
       
    43 
       
    44     /**
       
    45      * Launch editor for creating a new contact with a given detail.
       
    46      * @param definitionName The field type
       
    47      * @param value The value for the field.
       
    48      */
       
    49     void editCreateNew(const QString& definitionName, const QString& value);
       
    50 
       
    51     /**
       
    52      * Launch editor for creating a new contact based on vCard file indicated in arg.
       
    53      * @param vCardFile The vCard file name and path.
       
    54      */
       
    55     void editCreateNewFromVCard(const QString &vCardFile);
       
    56     
       
    57     /**
       
    58      * Open the editor for an existing contact.'
       
    59      * @param contactId
       
    60      */
       
    61     void editExisting(int contactId);
       
    62     
       
    63     /**
       
    64      * User can first choose a contact, and then an editor is opened.
       
    65      * A new detail is provided by caller and it will be prefilled in the editor.
       
    66      * @param definitionName The field type
       
    67      * @param value The value for the field.
       
    68      */
       
    69     void editUpdateExisting(const QString &definitionName, const QString &value);
       
    70 
       
    71 private: // from CntAbstractServiceProvider
       
    72     void CompleteServiceAndCloseApp(const QVariant& retValue);
       
    73 
       
    74 private:
       
    75     CntServices& mServices;
       
    76     int mCurrentRequestIndex;
       
    77 };
       
    78 
       
    79 #endif /* CNTSERVICEPROVIDEREDIT_H */