contacts_plat/contacts_ui_extensions_api/tsrc/contactcardplugin/contactcardextension.h
changeset 61 d30183af6ca6
equal deleted inserted replaced
56:d508aa856878 61:d30183af6ca6
       
     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: Example implementation of contact card extension.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef CONTACTCARDEXTENSION_H
       
    19 #define CONTACTCARDEXTENSION_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <QtGlobal>
       
    23 
       
    24 #include <cntuicontactcardextension.h>
       
    25 #include <qmobilityglobal.h>
       
    26 #include <qcontactmanager.h>
       
    27 //#include <qcontactaction.h>
       
    28 
       
    29 
       
    30 class QtMobility::QContactManager;
       
    31 
       
    32 
       
    33 /**
       
    34  * Example implementation of contact card extension.
       
    35  */
       
    36 class ContactCardExtension : public CntUiContactCardExtension, public CntUiContactCardExtAction
       
    37 {
       
    38     Q_OBJECT
       
    39 public:
       
    40     ContactCardExtension();
       
    41     ~ContactCardExtension();
       
    42 
       
    43 public: // from CntUiContactCardExtension
       
    44 
       
    45     void prepare( QContact& aContact, bool aMyCard );
       
    46 
       
    47     int actionCount() const;
       
    48 
       
    49     const CntUiContactCardExtAction& actionAt( int aIndex ) const;
       
    50 
       
    51     /// synchronous
       
    52     void handleShortPress( int aIndex );
       
    53 
       
    54 public: // from CntUiContactCardExtAction
       
    55         // Note that it can be a different class that is made to inherit from this interface.
       
    56 
       
    57     QString firstTextLine() const;
       
    58 
       
    59     /// Second line of text on the button.
       
    60     QString secondTextLine() const;
       
    61 
       
    62     const QIcon icon() const;
       
    63 
       
    64     /// Currently, the item must map to some detail. TODO Rethink this.
       
    65     const QContactDetail& detailUsedForChoosingPosition() const;
       
    66 
       
    67 
       
    68 signals: // from CntUiContactCardExtension
       
    69     void contactCardExtensionDataChanged();
       
    70 
       
    71 private: // data
       
    72     QContactDetail* mDetail;
       
    73 };
       
    74 
       
    75 #endif // CONTACTCARDEXTENSION_H