phonebookui/pbkcommonui/inc/cnteditview.h
changeset 24 0ba2181d7c28
child 27 de1630741fbe
equal deleted inserted replaced
0:e686773b3f54 24:0ba2181d7c28
       
     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 CNTEDITVIEW__H
       
    19 #define CNTEDITVIEW__H
       
    20 
       
    21 #include <QObject>
       
    22 #include "cntbaseview.h"
       
    23 #include "cntviewparameters.h"
       
    24 #include "qtpbkglobal.h"
       
    25 
       
    26 class HbScrollArea;
       
    27 class QGraphicsLinearLayout;
       
    28 class HbGroupBox;
       
    29 class CntEditViewHeadingItem;
       
    30 class ThumbnailManager;
       
    31 
       
    32 class QTPBK_EXPORT CntEditView : public CntBaseView
       
    33 { 
       
    34     Q_OBJECT
       
    35 
       
    36 public slots:
       
    37 
       
    38     virtual void aboutToCloseView();
       
    39     virtual void discardAllChanges();
       
    40     virtual int handleExecutedCommand(QString aCommand, const QContact &aContact);
       
    41     void thumbnailReady( const QPixmap& pixmap, void *data, int id, int error );
       
    42 
       
    43     void addField();
       
    44     void deleteContact();
       
    45 
       
    46     void openNameEditor();
       
    47     void openImageEditor();
       
    48 
       
    49     void onLongPressed(const QPointF &point);
       
    50     void onItemActivated();
       
    51     void addDetail();
       
    52     void deleteDetail();
       
    53 
       
    54 public:
       
    55 
       
    56     CntEditView(CntViewManager *aViewManager, QGraphicsItem *aParent = 0);
       
    57     ~CntEditView();
       
    58 
       
    59     CntViewParameters::ViewId viewId() const { return CntViewParameters::editView; }
       
    60     void activateView(const CntViewParameters &aViewParameters);
       
    61     void addActionsToToolBar();
       
    62     void addMenuItems();
       
    63     CntViewParameters prepareToEditContact(const QString &aViewType, const QString &aAction);
       
    64 
       
    65     void prepareItems();
       
    66     
       
    67 #ifdef PBK_UNIT_TEST
       
    68 public:
       
    69 #else
       
    70 protected:
       
    71 #endif
       
    72     QContact *contact();
       
    73     void setContact(QContact* aContact);
       
    74     void resizeEvent(QGraphicsSceneResizeEvent *event);
       
    75 
       
    76 #ifdef PBK_UNIT_TEST
       
    77 public:
       
    78 #else
       
    79 private:
       
    80 #endif
       
    81     void createItem(const QContactDetail &detail, const QString &type = QString(), int position = -1);
       
    82         
       
    83 protected:
       
    84 
       
    85     HbScrollArea            *mScrollArea;
       
    86     QGraphicsWidget         *mContainerWidget;
       
    87     QGraphicsLinearLayout   *mContainerLayout;
       
    88     QContact                *mContact;
       
    89     HbGroupBox              *mDetailItem;
       
    90     ThumbnailManager        *mThumbnailManager;
       
    91     CntEditViewHeadingItem  *mHeadingItem;
       
    92     int                      mDetailItemIndex;
       
    93     int                      mAddressItemIndex;
       
    94     QStringList              mExcludeList;
       
    95 
       
    96 };
       
    97 #endif //CNTEDITVIEW__H
       
    98 // EOF