emailuis/nmailui/inc/nmapplication.h
branchRCL_3
changeset 63 d189ee25cf9d
equal deleted inserted replaced
61:dcf0eedfc1a3 63:d189ee25cf9d
       
     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 NMAPPLICATION_H
       
    19 #define NMAPPLICATION_H
       
    20 
       
    21 #include <QStack>
       
    22 #include <QObject>
       
    23 
       
    24 #include "nmuiviewids.h"
       
    25 
       
    26 class HbMainWindow;
       
    27 class NmBaseView;
       
    28 class NmUiEngine;
       
    29 class NmMailboxListModel;
       
    30 class HbAction;
       
    31 class NmUiExtensionManager;
       
    32 class NmSendServiceInterface;
       
    33 class NmUriServiceInterface;
       
    34 class NmMailboxServiceInterface;
       
    35 class NmViewerServiceInterface;
       
    36 class NmViewerViewNetManager;
       
    37 class NmUtilities;
       
    38 class NmAttachmentManager;
       
    39 class NmSettingsViewLauncher;
       
    40 class NmUiEffects;
       
    41 class HbMessageBox;
       
    42 
       
    43 class NmApplication : public QObject
       
    44 {
       
    45     Q_OBJECT
       
    46 public:
       
    47     NmApplication(QObject *parent, quint64 accountId=0);
       
    48     ~NmApplication();
       
    49     void enterNmUiView(NmUiStartParam *startParam);
       
    50     HbMainWindow* mainWindow();
       
    51     NmUiExtensionManager &extManager();
       
    52     NmViewerViewNetManager &networkAccessManager();
       
    53     QSize screenSize();
       
    54     bool eventFilter(QObject *obj, QEvent *event);
       
    55     bool updateVisibilityState();
       
    56     bool isForeground() const;
       
    57 
       
    58 public slots:
       
    59     void prepareForPopView();
       
    60     void popView();
       
    61     void exitApplication();
       
    62     void delayedExitApplication();
       
    63     void handleOperationCompleted(const NmOperationCompletionEvent &event);
       
    64     void viewReady();
       
    65     void launchSettings(HbAction *action);
       
    66     
       
    67 private:
       
    68     void createMainWindow();
       
    69     void pushView(NmBaseView *view);
       
    70     void resetViewStack();
       
    71     void hideApplication();
       
    72     void updateActivity();
       
    73     
       
    74 private slots:
       
    75     void activityActivated();
       
    76 
       
    77 signals:
       
    78 	void applicationReady();
       
    79     
       
    80 private:
       
    81     HbMainWindow *mMainWindow;              // Owned
       
    82     QStack<NmBaseView*> *mViewStack;        // Owned
       
    83     NmUiViewId mActiveViewId;
       
    84     NmUiEngine *mUiEngine;                  // Not owned, singleton instance
       
    85     HbAction *mBackAction;                  // Owned
       
    86     NmUiExtensionManager *mExtensionManager;// Owned
       
    87     NmSendServiceInterface *mSendServiceInterface;       // Owned
       
    88     NmSendServiceInterface *mSendServiceInterface2;      // Owned
       
    89     NmUriServiceInterface *mUriServiceInterface;         // Owned
       
    90     NmMailboxServiceInterface *mMailboxServiceInterface; // Owned
       
    91     NmViewerServiceInterface *mViewerServiceInterface;   // Owned
       
    92     NmMailboxListModel *mMbListModel;       // Not owned
       
    93     NmUiViewId mServiceViewId;
       
    94     NmViewerViewNetManager *mNetManager;    // Owned
       
    95     bool mForegroundService;
       
    96     NmUiEffects *mEffects;                  // Owned
       
    97     NmAttachmentManager *mAttaManager;      // Owned
       
    98     NmSettingsViewLauncher* mSettingsViewLauncher; // Owned
       
    99     bool mViewReady;
       
   100     NmId mLastOperationMailbox;
       
   101     HbMessageBox *mQueryDialog;             // Owned
       
   102     bool mBackButtonPressed;
       
   103     NmId mCurrentMailboxId;
       
   104     bool mApplicationHidden;
       
   105 };
       
   106 
       
   107 #endif // NMAPPLICATION_H