creator/inc/enginewrapper.h
changeset 17 4f2773374eff
child 19 4b22a598b890
equal deleted inserted replaced
15:e11368ed4880 17:4f2773374eff
       
     1 /*
       
     2 * Copyright (c) 2010 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 
       
    19 #ifndef ENGINEWRAPPER_H
       
    20 #define ENGINEWRAPPER_H
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <e32base.h>
       
    24 #include <badesca.h>
       
    25 #include <engine.h>
       
    26 
       
    27  #include <QObject> // for iProgressNote signal connect
       
    28 
       
    29 
       
    30 class MainView;
       
    31 class MemoryDetails;
       
    32 class HbProgressDialog;
       
    33 class HbPopup;
       
    34 class HbCommonNote;
       
    35 
       
    36 
       
    37 /**
       
    38  * class that is used for communicating between Symbian and Qt code.
       
    39  */
       
    40 class EngineWrapper : public QObject
       
    41  { 
       
    42 	Q_OBJECT
       
    43 
       
    44 public:
       
    45     
       
    46     /**
       
    47      * Constructor
       
    48      */
       
    49     EngineWrapper();
       
    50     
       
    51     /**
       
    52      * Destructor
       
    53      */
       
    54     ~EngineWrapper();
       
    55     
       
    56     /**
       
    57      * Initializes Engine Wrapper
       
    58      * @return true if engine was started successfully
       
    59      */
       
    60     bool init();
       
    61 	
       
    62 	/**
       
    63 	* Get memory details
       
    64 	*/
       
    65 	MemoryDetails GetMemoryDetails();
       
    66 	
       
    67 public: 
       
    68     
       
    69     /* Functions that are called from UI */
       
    70 	bool ExecuteOptionsMenuCommand(int commandId);
       
    71 
       
    72     
       
    73 public:
       
    74 
       
    75     /* Functions that are called from engine: */
       
    76     
       
    77 	/** 
       
    78      * uses Notifications class to show error message 
       
    79      */
       
    80     void ShowErrorMessage(const TDesC& aErrorMessage);
       
    81 
       
    82     /**
       
    83      * uses Notifications class to show progressbar
       
    84      */
       
    85     void ShowProgressBar(const TDesC& aPrompt, int aMax);
       
    86 	
       
    87 	/**
       
    88 	* uses Notifications class to show user note
       
    89 	*/
       
    90 	void ShowNote(const TDesC& aNoteMessage, TInt aResourceId = 0);
       
    91     
       
    92     /**
       
    93      * increments shown progressbar's value
       
    94      */
       
    95     void IncrementProgressbarValue();
       
    96     
       
    97     /**
       
    98      * closes progressbar
       
    99      */
       
   100     void CloseProgressbar();	
       
   101 	
       
   102 	/**
       
   103 	* Create entries query dialog
       
   104 	*/
       
   105 	TBool EntriesQueryDialog(TInt& aNumberOfEntries, const TDesC& aPrompt, TBool aAcceptsZero = EFalse);
       
   106 
       
   107 	/**
       
   108 	* Create time query dialog
       
   109 	*/    
       
   110     TBool TimeQueryDialog(TTime aTime, const TDesC& aPrompt);
       
   111 
       
   112 	/**
       
   113 	* Create yes or no query dialog
       
   114 	*/    
       
   115     TBool YesNoQueryDialog(const TDesC& aPrompt);
       
   116 	
       
   117 	/**
       
   118 	* Popup list dialog for selecting item from dialog list
       
   119 	*/
       
   120 	bool PopupListDialog(const TDesC& aPrompt, CDesCArray* aFileNameArray, TInt& aIndex); 
       
   121 	
       
   122 	/**
       
   123 	* Directory query dialog
       
   124 	*/
       
   125 	bool DirectoryQueryDialog(const TDesC& aPrompt, TFileName& aDirectory);
       
   126 	
       
   127 	/**
       
   128 	* Create list query single-selection dialog
       
   129 	*/
       
   130 	bool ListQueryDialog(const TDesC& aPrompt, TListQueryId aId, TInt& aIndex);
       
   131 
       
   132 	/**
       
   133 	* Create list query multi-selection dialog
       
   134 	*/
       
   135 	bool ListQueryDialog(const TDesC& aPrompt, TListQueryId aId, CArrayFixFlat<TInt>* aIndexes);
       
   136 	
       
   137 	
       
   138 	/**
       
   139 	* Close application when started from command line for script run.
       
   140 	*/
       
   141 	void CloseCreatorApp();
       
   142 
       
   143 private slots:
       
   144 	
       
   145 	/**
       
   146 	* progress dialog cancelled
       
   147 	*/
       
   148 	void ProgressDialogCancelled();    
       
   149 	
       
   150 private:
       
   151     
       
   152     
       
   153     /* Creator engine */
       
   154     CCreatorEngine* iEngine;
       
   155     
       
   156     /* progress dialog that is shown */
       
   157     HbProgressDialog* iProgressDialog;
       
   158     
       
   159 };
       
   160 
       
   161 #endif //ENGINEWRAPPER_H