filebrowser/engine/engine.h
branchGCC_SURGE
changeset 37 c20154ccf3c0
parent 35 98924d2efce9
child 48 da3ec8478e66
equal deleted inserted replaced
20:ba8a586c45f1 37:c20154ccf3c0
    20 
    20 
    21 // INCLUDES
    21 // INCLUDES
    22 #include <e32std.h>
    22 #include <e32std.h>
    23 #include <e32base.h>
    23 #include <e32base.h>
    24 #include <apgcli.h>
    24 #include <apgcli.h>
    25 #include <CAknMemorySelectionSettingPage.h>
    25 
    26 #include "FBFileUtils.h"
    26 #include "FBFileUtils.h"
    27 
    27 
    28 // setting keys (do not change uids of existing keys to maintain compatibility to older versions!)
    28 // setting keys (do not change uids of existing keys to maintain compatibility to older versions!)
    29 const TUid KFBSettingDisplayMode                   = { 0x00 };
    29 const TUid KFBSettingDisplayMode                   = { 0x00 };
    30 const TUid KFBSettingFileViewMode                  = { 0x01 };
    30 const TUid KFBSettingFileViewMode                  = { 0x01 };
    46 // FORWARD DECLARATIONS
    46 // FORWARD DECLARATIONS
    47 class CFileBrowserFileListContainer;
    47 class CFileBrowserFileListContainer;
    48 class CFileBrowserScreenCapture;
    48 class CFileBrowserScreenCapture;
    49 class CFileBrowserFileUtils;
    49 class CFileBrowserFileUtils;
    50 class CEikonEnv;
    50 class CEikonEnv;
    51 class CAknGlobalConfirmationQuery;
       
    52 class CDictionaryFileStore;
    51 class CDictionaryFileStore;
    53 class MFileBrowserUI;
    52 class MFileBrowserUI;
    54 
    53 
    55 // CLASS DECLARATIONS
    54 // CLASS DECLARATIONS
    56 
    55 
    76 // INFERFACE FOR COMMUNICATION WITH UI
    75 // INFERFACE FOR COMMUNICATION WITH UI
    77 
    76 
    78 class MFileBrowserUI
    77 class MFileBrowserUI
    79 {
    78 {
    80 public:
    79 public:
    81     /**
    80 //    /**
    82       * Method from getting current index
    81 //      * Method from getting current index
    83       * @return current index.
    82 //      * @return current index.
    84       */
    83 //      */
    85 //    virtual TInt QueryCurrentItemIndex() = 0;
    84 //    virtual TInt QueryCurrentItemIndex() = 0;
    86 
    85 
    87     /**
    86     /**
    88      * Shows info message with text
    87      * Shows info message with text
    89      * @param A aText text to be shown in message body.
    88      * @param A aText text to be shown in message body.
   104      * @param aText An text to be shown in message.
   103      * @param aText An text to be shown in message.
   105      * @return None.
   104      * @return None.
   106      */
   105      */
   107     virtual void ShowConfirmationNote(const TDesC& aText, TBool aNoTimeout = EFalse) = 0;
   106     virtual void ShowConfirmationNote(const TDesC& aText, TBool aNoTimeout = EFalse) = 0;
   108 
   107 
   109 //    /**
   108     /**
   110 //     * Shows progress bar with text
   109      * Shows progress bar with text
   111 //     * @param aText A text to be shown at top of the progress bar.
   110      * @param aText A text to be shown at top of the progress bar.
   112 //     * @param aMinimum A minimum progress bar value.
   111      * @param aMinimum A minimum progress bar value.
   113 //     * @param aMaximum A maximum progress bar value.
   112      * @param aMaximum A maximum progress bar value.
   114 //     * @return None.
   113      * @return None.
   115 //     */
   114      */
   116 //    virtual void ShowProgressBar(const TDesC& aText, TInt aMinimum, TInt aMaximum ) = 0;
   115     virtual void ShowProgressDialog(const TDesC& aDescText, TInt aMinimum, TInt aMaximum ) = 0;
       
   116 
       
   117     /**
       
   118      * Cancel progress dialog
       
   119      * @return None.
       
   120      */
       
   121     virtual void CancelProgressDialog() = 0;
       
   122 
       
   123     /**
       
   124       * Set progress dialog value
       
   125       * @param aValue A vaule to be shown at top of the progress dialog.
       
   126       */
       
   127     virtual void SetProgressValue(TInt aValue) = 0;
   117 //
   128 //
   118 //    /**
   129 //    /**
   119 //     * Sets progress bar value
   130 //     * Sets progress bar value
   120 //     * @param aValue A value between min and max value of the progress bar range
   131 //     * @param aValue A value between min and max value of the progress bar range
   121 //     * @return None.
   132 //     * @return None.
   126 //     * Hides progress bar
   137 //     * Hides progress bar
   127 //     * @return None.
   138 //     * @return None.
   128 //     */
   139 //     */
   129 //    virtual void HideProgressBar() = 0;
   140 //    virtual void HideProgressBar() = 0;
   130 //
   141 //
   131 //    /**
   142     /**
   132 //     * Shows wait dialog with text
   143      * Shows wait dialog with text
   133 //     * @param aText A text to be shown at top of the wait bar.
   144      * @param aText A text to be shown at top of the wait bar.
   134 //     * @return None.
   145      * @return None.
   135 //     */
   146      */
   136 //    virtual void ShowWaitDialog(const TDesC& aText) = 0;
   147     virtual void ShowWaitDialog(const TDesC& aText) = 0;
   137 //
   148 
   138 //    /**
   149     /**
   139 //     * Hides wait dialog
   150      * Cancel wait dialog
   140 //     * @return None.
   151      * @return None.
   141 //     */
   152      */
   142 //    virtual void HideWaitDialog() = 0;
   153     virtual void CancelWaitDialog() = 0;
       
   154 
       
   155     /**
       
   156      * Processes all pending events to allow wait/progresa dialog to update itself
       
   157      * @return None.
       
   158      */
       
   159     virtual void ProcessEvents() = 0;
   143 
   160 
   144     /**
   161     /**
   145      * Shows confirmation dialog
   162      * Shows confirmation dialog
   146      * @param aFileName String contaning file name and path
   163      * @param aFileName String contaning file name and path
   147      * @return ETrue if user pressed OK button, otherwise EFalse.
   164      * @return ETrue if user pressed OK button, otherwise EFalse.
   158 
   175 
   159 private:
   176 private:
   160     CEngine();
   177     CEngine();
   161     void ConstructL(MFileBrowserUI *aFileBrowserUI);
   178     void ConstructL(MFileBrowserUI *aFileBrowserUI);
   162     void LoadSettingsL();
   179     void LoadSettingsL();
   163     void GetHashKeySelectionStatus();
       
   164     void LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TInt& aValue);
   180     void LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TInt& aValue);
   165     void LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TDes& aValue);
   181     void LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TDes& aValue);
   166     void SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TInt& aValue);
   182     void SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TInt& aValue);
   167     void SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TDes& aValue);
   183     void SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TDes& aValue);
   168 
   184 
   169 public:
   185 public:
   170     void ActivateEngineL();
   186     void ActivateEngineL();
   171     void DeActivateEngineL();
   187     void DeActivateEngineL();
   172     void SaveSettingsL(TBool aNotifyModules=ETrue);
   188     void SaveSettingsL(TBool aNotifyModules=ETrue);
   173 //    void SetFileListContainer(CFileBrowserFileListContainer* aFileListContainer);
       
   174     TInt LaunchSettingsDialogL();
   189     TInt LaunchSettingsDialogL();
   175     inline TFileBrowserSettings& Settings() { return iSettings; }
   190     inline TFileBrowserSettings& Settings() { return iSettings; }
   176     inline CEikonEnv* EikonEnv() { return iEnv; }
   191     inline CEikonEnv* EikonEnv() { return iEnv; }
   177     inline RApaLsSession& LsSession() { return iLs; }
   192     inline RApaLsSession& LsSession() { return iLs; }
   178     inline CFileBrowserScreenCapture* ScreenCapture() { return iScreenCapture; }
   193     inline CFileBrowserScreenCapture* ScreenCapture() { return iScreenCapture; }
   179     inline CFileBrowserFileUtils* FileUtils() { return iFileUtils; }
   194     inline CFileBrowserFileUtils* FileUtils() { return iFileUtils; }
   180     inline MFileBrowserUI* FileBrowserUI() { return iFileBrowserUI; }
   195     inline MFileBrowserUI* FileBrowserUI() { return iFileBrowserUI; }
   181     inline CFileBrowserFileListContainer* FileListContainer() { return iFileListContainer; }
       
   182     inline TBool IsHashKeySelectionInUse() { return iIsHashKeySelectionInUse; }
       
   183 
   196 
   184     void OpenWithApparcL(TFileName aFileName);
   197     void OpenWithApparcL(TFileName aFileName);
   185     void OpenWithDocHandlerL(TFileName aFileName, TBool aEmbed);
   198     void OpenWithDocHandlerL(TFileName aFileName, TBool aEmbed);
   186 //    TInt QueryCurrentItemIndex();
   199 //    TInt QueryCurrentItemIndex();
   187 //    CArrayFix<TInt> *GetSelectedIndices();
       
   188     TSearchAttributes GetSearchAttributes();
   200     TSearchAttributes GetSearchAttributes();
   189     void ChangeAttributes(TSearchAttributes attributes);
   201     void ChangeAttributes(TSearchAttributes attributes);
   190     TSearchResults SearchResults();
   202     TSearchResults SearchResults();
   191     CFileEntryList* FoundFiles();	
   203     CFileEntryList* FoundFiles();	
   192     void SearchL();
   204     void SearchL();
   193 
   205 
   194 private:
   206 private:
   195     MFileBrowserUI                  *iFileBrowserUI;
   207     MFileBrowserUI                  *iFileBrowserUI;
   196     CFileBrowserFileListContainer   *iFileListContainer;
       
   197     CFileBrowserScreenCapture       *iScreenCapture;
   208     CFileBrowserScreenCapture       *iScreenCapture;
   198     CFileBrowserFileUtils           *iFileUtils;
   209     CFileBrowserFileUtils           *iFileUtils;
   199     CEikonEnv*                      iEnv;
   210     CEikonEnv*                      iEnv;
   200     TFileBrowserSettings            iSettings;
   211     TFileBrowserSettings            iSettings;
   201     RApaLsSession                   iLs;
   212     RApaLsSession                   iLs;