landmarksui/msgviewer/inc/CLmkMsgViewerAppUi.h
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2002 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:    LandmarksUi Content File -    Application UI class for Landmark message viewer.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef CLMKMSGVIEWERAPPUI_H
       
    26 #define CLMKMSGVIEWERAPPUI_H
       
    27 
       
    28 // INCLUDES
       
    29 #include "MLmkAOOperationObserver.h"
       
    30 #include <aknappui.h>
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class CLmkParser;
       
    34 class CPosLandmarkDatabase;
       
    35 class CAknWaitDialog;
       
    36 class CLmkSender;
       
    37 class CLmkMsgViewerAppView;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42 * Application UI class for Landmark message viewer.
       
    43 */
       
    44 class CLmkMsgViewerAppUi
       
    45 : public CAknAppUi,
       
    46   public MLmkAOOperationObserver
       
    47     {
       
    48     public: // Constructors and destructor
       
    49 
       
    50         /**
       
    51          * C++ default constructor.
       
    52          */
       
    53         void ConstructL();
       
    54 
       
    55         /**
       
    56          * Destructor.
       
    57          */
       
    58         ~CLmkMsgViewerAppUi();
       
    59 
       
    60     public: // from CCoeControl
       
    61       /*
       
    62        * Helper function to implement the dynamic resource changes
       
    63        */
       
    64       void HandleResourceChangeL(TInt aType);
       
    65 
       
    66     public: // New functions
       
    67         TBool ProcessCommandParametersL( TApaCommand aCommand,
       
    68 	                                     TFileName& aDocumentName,
       
    69 	                                     const TDesC8& aTail );
       
    70 
       
    71         /**
       
    72         * Opens a landmark package file and starts processing it.
       
    73         * @param aFilename full file name
       
    74         */
       
    75         void OpenL( const TDesC& aFilename );
       
    76 
       
    77         // Added for FILE_HANDLE change
       
    78         void OpenL(RFile& aFile);
       
    79 
       
    80         /**
       
    81         * Returns a reference to landmark sender.
       
    82         * @return landmark sender
       
    83         */
       
    84         CLmkSender& LmkSender() const;
       
    85 
       
    86     protected: // From MLmkAOOperationObserver
       
    87         void HandleOperationL( TOperationTypes aType,
       
    88                                TReal32 aProgress,
       
    89                                TInt aStatus );
       
    90 
       
    91     private: // From CEikAppUi
       
    92         void HandleCommandL( TInt aCommand );
       
    93 		void OpenFileL( const TDesC& aFileName );
       
    94 
       
    95         // Added for FILE_HANDLE change
       
    96         void OpenFileL( RFile& aFilHandle );
       
    97 
       
    98     private: // New functions
       
    99         /**
       
   100         * Helper function which performs the steps following
       
   101         * database initialization.
       
   102         * @param aStatus result of db initialization
       
   103         */
       
   104         void HandleDbInitFinishedL( TInt aStatus );
       
   105 
       
   106         /**
       
   107         * Helper function which performs the steps following
       
   108         * asynchronous parse operation.
       
   109         * @param aStatus result of parse operation
       
   110         */
       
   111         void HandleParseFinishedL( TInt aStatus );
       
   112 
       
   113         /**
       
   114         * Helper function which creates and executes a landmark viewer.
       
   115         */
       
   116         void ExecuteLmViewerL();
       
   117 
       
   118         /**
       
   119         * Helper function which creates and executes a lm package viewer.
       
   120         */
       
   121         void ExecutePkgViewerL();
       
   122 
       
   123         /**
       
   124         * Used to callback by the idle timer in order to launch the dialog
       
   125         * @since 3.0
       
   126         */
       
   127         static TInt CallBackFuncL(TAny *aPtr);
       
   128 
       
   129         /**
       
   130         * This function accesses the document and launches the content
       
   131         * using the UI Dialog.
       
   132         * return: ETrue When file handle is not valid
       
   133         *         EFalse When file handle is valid
       
   134         * @since 3.0
       
   135         */
       
   136         TBool LaunchDialogL();
       
   137 
       
   138         /**
       
   139         * This function closes wait note.
       
   140         * @since 3.0
       
   141         */
       
   142         void CloseWaitNoteL();
       
   143 
       
   144         /** Common part of both OpenL(...) */
       
   145         void DoOpenL();
       
   146 
       
   147     private: //Data
       
   148         /// Owns: parser
       
   149         CLmkParser* iParser;
       
   150         /// Owns: landmark database
       
   151         CPosLandmarkDatabase* iDb;
       
   152         /// Owns: wait dialog
       
   153         CAknWaitDialog* iWaitDialog;
       
   154         /// Owns: landmark sender
       
   155         CLmkSender* iLmkSender;
       
   156         /// Owns: empty view
       
   157         CLmkMsgViewerAppView* iAppView;
       
   158 
       
   159         CPeriodic* iIdleTimer;
       
   160         /// result of parsing
       
   161         TBool iDataReadyForView;
       
   162         //
       
   163         TBool iIsDbOpen;
       
   164     };
       
   165 
       
   166 #endif // CLMKMSGVIEWERAPPUI_H
       
   167 
       
   168 // End of File