messagingapp/msgservices/msgserviceapp/inc/msgserviceviewmanager.h
changeset 27 e4592d119491
child 44 36f374c67aa8
equal deleted inserted replaced
25:84d9eb65b26f 27:e4592d119491
       
     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: Manages differnt messaging views.
       
    15  * 
       
    16  *
       
    17  */
       
    18 
       
    19 #ifndef MSGSERVICEVIEWMANAGER_H_
       
    20 #define MSGSERVICEVIEWMANAGER_H_
       
    21 
       
    22 #include <QObject>
       
    23 #include <QVariant>
       
    24 
       
    25 class HbMainWindow;
       
    26 class MsgUnifiedEditorView;
       
    27 class UnifiedViewer;
       
    28 class MsgBaseView;
       
    29 class MsgSettingsView;
       
    30 class HbAction;
       
    31 class MsgStoreHandler;
       
    32 
       
    33 class MsgServiceViewManager: public QObject
       
    34 {
       
    35 Q_OBJECT
       
    36 
       
    37 public:
       
    38     /**
       
    39      * Constructor
       
    40      */
       
    41     MsgServiceViewManager(MsgStoreHandler* storeHandler,
       
    42             HbMainWindow* mainWindow, QObject* parent = 0);
       
    43 
       
    44     /**
       
    45      * Destructor.
       
    46      */
       
    47     ~MsgServiceViewManager();
       
    48 
       
    49     /**
       
    50      * Send message.
       
    51      * @param phoneNumber phone number.
       
    52      * @param contactId contactId.
       
    53      * @param displayName displayname.
       
    54      */
       
    55     void send(const QString phoneNumber, 
       
    56               const qint32 contactId, 
       
    57               const QString displayName);
       
    58 
       
    59     /**
       
    60      * Send message.
       
    61      * @param phoneNumber phone number.
       
    62      * @param alias alias.
       
    63      * @param bodyText body text.
       
    64      */
       
    65     void send(const QString phoneNumber, 
       
    66               const QString alias, 
       
    67               const QString bodyText);
       
    68     
       
    69     /**
       
    70      * Send message.
       
    71      * @param data data to be sent.
       
    72      */
       
    73     void send(QVariant data);
       
    74 
       
    75     /**
       
    76      * Opens the viewer to view the message.
       
    77      * @param msgId message id of the message.
       
    78      */
       
    79     void view(int msgId);
       
    80 
       
    81 private:
       
    82     /*
       
    83      * Switch to unieditor.
       
    84      * @param editorData editor data.
       
    85      */
       
    86     void switchToUniEditor(const QVariantList& editorData);
       
    87 
       
    88     /*
       
    89      * Switch to settings view.
       
    90      */
       
    91     void switchToMsgSettings(const QVariantList& data);
       
    92 
       
    93     /**
       
    94      * Handle sms and mms messge
       
    95      * @param msgId message id
       
    96      */
       
    97     void handleSmsMmsMsg(int msgId);
       
    98 
       
    99     /**
       
   100      * Handle ringtone message
       
   101      * @param msgId message id
       
   102      */
       
   103     void handleRingtoneMsg(int msgId);
       
   104 
       
   105     /**
       
   106      * Handle provisioning message
       
   107      * @param msgId message id
       
   108      */
       
   109     void handleProvisoningMsg(int msgId);
       
   110 
       
   111     /**
       
   112      * Handle bluetooth message
       
   113      * @param msgId message id
       
   114      */
       
   115     void handleBTMessage(int msgId);
       
   116     
       
   117 private slots:
       
   118     /**
       
   119      * This slot is called on mainwindows back action.
       
   120      */
       
   121     void onBackAction();
       
   122 
       
   123     /**
       
   124      * This slot is called when switchView signal is emitted from a view.
       
   125      * @param data data required to switch the views.
       
   126      */
       
   127     void switchView(const QVariantList& data);
       
   128     
       
   129 	/**
       
   130      * This slot is called delete message dialog launched.
       
   131      * @param action selected action (yes or no).
       
   132      */
       
   133     void onDialogDeleteMsg(HbAction* action);
       
   134 
       
   135     /**
       
   136      * This slot is called save tone dialog launched.
       
   137      * @param action selected action (yes or no)
       
   138      */
       
   139     void onDialogSaveTone(HbAction* action);
       
   140 	
       
   141 private:
       
   142     /**
       
   143      * Main window pointer. 
       
   144      * Not owned.
       
   145      */
       
   146     HbMainWindow* mMainWindow;
       
   147 
       
   148     /**
       
   149      * Unified editor. 
       
   150      * Owned.
       
   151      */
       
   152     MsgUnifiedEditorView* mUniEditor;
       
   153     
       
   154     /**
       
   155      * Unified viewer. 
       
   156      * Owned.
       
   157      */
       
   158     UnifiedViewer* mUniViewer;
       
   159     
       
   160     /**
       
   161      * Settings view. 
       
   162      * Owned.
       
   163      */
       
   164     MsgSettingsView* mSettingsView;
       
   165     
       
   166     /**
       
   167      * Back action 
       
   168      * Owned.
       
   169      */
       
   170     HbAction* mBackAction;
       
   171 
       
   172     /**
       
   173      * Store handler.
       
   174      * Not Owned.
       
   175      */
       
   176     MsgStoreHandler* mStoreHandler;
       
   177     
       
   178     /**
       
   179      * Current view value.
       
   180      */
       
   181     int mCurrentView;
       
   182     
       
   183 	/**
       
   184 	 * message Id
       
   185 	 */
       
   186     int mMessageId;
       
   187   
       
   188 };
       
   189 
       
   190 #endif /* MSGSERVICEVIEWMANAGER_H_ */