svgtviewer/SvgtViewerPlugin/AppInc/SVGTViewerAppAppUi.h
branchRCL_3
changeset 20 5fd161fa28b6
equal deleted inserted replaced
17:e52958d06c29 20:5fd161fa28b6
       
     1 /*
       
     2 * Copyright (c) 2004,2005 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:  AppUI class for the SVGT Viewer.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SVGTVIEWERAPPAPPUI_H
       
    20 #define SVGTVIEWERAPPAPPUI_H
       
    21 
       
    22 #include <SVGTAppObserver.h>
       
    23 #include <downloadmgrclient.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CAknAppUi;
       
    27 class CSVGTViewerAppAppView;
       
    28 class CSVGTUIDialog;
       
    29 class CDownloadMgrUiUserInteractions;       
       
    30 class CDownloadMgrUiDownloadsList;      
       
    31 class CDownloadMgrUiLibRegistry;
       
    32 class CSVGTViewerAppDownloads;
       
    33 class CSVGTAppObserverUtil;
       
    34 
       
    35         
       
    36 class CSvgtViewerAppView;
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40 *  CSVGTViewerAppAppUi is the AppUI class for the SVGT Viewer
       
    41 *  @since 3.0
       
    42 */
       
    43 class CSVGTViewerAppAppUi : public CAknAppUi
       
    44     {
       
    45     public: // Constructors and destructor
       
    46         /**
       
    47         * C++ default constructor.
       
    48         */
       
    49         CSVGTViewerAppAppUi();
       
    50 
       
    51         /**
       
    52         * Second Phase constructor.
       
    53         */
       
    54         void ConstructL();
       
    55 
       
    56         // Destructor
       
    57         virtual ~CSVGTViewerAppAppUi();
       
    58 
       
    59     public: // New functions
       
    60         /**
       
    61         * Handle open command from document class.
       
    62         * @since 3.0
       
    63         * @param  aFileHandle - File Fandle to the SVGT file.
       
    64         */
       
    65         virtual void OpenFileL( RFile& aFileHandle );
       
    66 
       
    67         /**
       
    68         * This function is used to set the move option, the
       
    69         * Move allowed or not decision is done by the document
       
    70         * class and it calls this function to inform the UI class
       
    71         * about the decision.
       
    72         * @param: aMoveAllowed, ETrue: Move allowed, EFalse: 
       
    73         *   Move Not allowed.
       
    74         * @since 3.0
       
    75         */
       
    76         void SetAllowMove(TInt32 aMoveAllowed);
       
    77 
       
    78     public: // Functions from base classes
       
    79         /**
       
    80         * From CAknAppUi
       
    81         * @see CAknAppUi::HandleCommandL
       
    82         */
       
    83         virtual void HandleCommandL( TInt aCommand );
       
    84         
       
    85         /**
       
    86         * From CAknAppUi
       
    87         * @see CAknAppUi::OpenFileL
       
    88         */
       
    89         virtual void OpenFileL( const TDesC& aFilename );
       
    90         
       
    91         /**
       
    92         * From CAknAppUi
       
    93         * @see CAknAppUi::ProcessCommandParametersL
       
    94         */
       
    95         virtual TBool ProcessCommandParametersL(TApaCommand aCommand,
       
    96             TFileName& aDocumentName, const TDesC8& aTail );
       
    97         
       
    98         /**
       
    99         * From CAknAppUi
       
   100         * @see CAknAppUi::HandleScreenDeviceChangedL
       
   101         */
       
   102         void HandleScreenDeviceChangedL();
       
   103         
       
   104         /**
       
   105         * From CAknAppUi
       
   106         * @see CAknAppUi::HandleResourceChangeL
       
   107         */
       
   108         void HandleResourceChangeL( TInt aType );
       
   109     private: 
       
   110         /**
       
   111         * From CEikAppUi, called when event occurs of type EEventFocusLost
       
   112         * or EEventFocusGained.
       
   113         * @param aForeground ETrue if the application is in the foreground,
       
   114         * otherwise EFalse
       
   115         */
       
   116         void HandleForegroundEventL(TBool aForeground);                           
       
   117     
       
   118         /**
       
   119         * Used to find out if video call is going on.
       
   120         * @since 3.0
       
   121         */   
       
   122         TBool IsVideoCall() const;
       
   123         /**
       
   124         * Used to check if the application has started any embedded app.
       
   125         * @since 3.0
       
   126         * return: ETrue: If there is an embedded app, EFalse otherwise.
       
   127         */ 
       
   128         TBool IsEmbeddedAppRunning() const;
       
   129         /**
       
   130         * Used to set internal state if the application has started 
       
   131         * any embedded app.
       
   132         * @since 3.0
       
   133         */
       
   134         void SetEmbeddedAppRunning();
       
   135         /**
       
   136         * Used to set internal state if the embedded app started 
       
   137         * previously gets closed.
       
   138         * @since 3.0
       
   139         */
       
   140         void ResetEmbeddedAppRunning();
       
   141         
       
   142         /**
       
   143         * Used to callback by the idle timer in order to launch the dialog
       
   144         * @since 3.0
       
   145         */
       
   146         static TInt CallBackFuncL(TAny *aPtr);
       
   147         
       
   148         /**
       
   149         * This function accesses the document and launches the content
       
   150         * using the UI Dialog.
       
   151         * return: ETrue When file handle is not valid
       
   152         *         EFalse When file handle is valid
       
   153         * @since 3.0
       
   154         */
       
   155         TBool LaunchDialogL();
       
   156 
       
   157         /**
       
   158         * This function is used to detect how we are launched. 
       
   159         * Embedded or Standalone.
       
   160         * return: ETrue: Embedded mode, EFalse: Standalone mode.
       
   161         * @since 3.0
       
   162         */
       
   163         TBool WeAreEmbedded() const;
       
   164 
       
   165         /**
       
   166         * This function is used to decide if the "save" option
       
   167         * should be shown in the UI. "Save" is shown if we
       
   168         * are launched from messaging/mms/mail/browser.
       
   169         * return: ETrue: Show save, EFalse: Do not show save.
       
   170         * @since 3.0
       
   171         */
       
   172         TBool CanShowSave() const;
       
   173 
       
   174         /**
       
   175         * This function is used to decide if the Save operation
       
   176         * should actually do a move. This is required if we
       
   177         * are launched from browser/downloadmgr and file
       
   178         * needs to be moved instead of copying to save disk
       
   179         * space. 
       
   180         * @since 3.0
       
   181         */
       
   182         TBool ShouldMoveContent() const;
       
   183 
       
   184         /**
       
   185         * This function checks whether the file is local or remote
       
   186         * @since 3.1
       
   187         */
       
   188         TBool IsLocalFile() const;
       
   189         
       
   190         /**
       
   191         * This function checks whether the filepath of the content 
       
   192         * opened is in the PHONE_MEMORY_IMAGES_PATH or 
       
   193         * MEMORYCARD_IMAGES_PATH
       
   194         * @param aFileHandle  Filehandle to check the path
       
   195         * @since 3.1
       
   196         */
       
   197         TBool IsLocalFileL( RFile& aFileHandle ) const;
       
   198 
       
   199     private:    // Data
       
   200 
       
   201         CSvgtViewerAppView* iContainer;
       
   202         
       
   203         // Pointer to the SVGT Dialog
       
   204         CSVGTUIDialog* iAppDialog;        
       
   205         
       
   206         // Pointer to Hyperlink Handler
       
   207         CSVGTAppObserverUtil*  iAppObserver;    
       
   208 
       
   209         TBool iEmbeddedAppRunning;
       
   210         CPeriodic* iIdleTimer;
       
   211         TBool iMoveAllowed;
       
   212     };
       
   213 
       
   214 
       
   215 #endif // __SVGTVIEWERAPPAPPUI_H__
       
   216 
       
   217 //End of File