svgtviewer/SvgtViewerPlugin/AppInc/SVGTViewerAppDocument.h
branchRCL_3
changeset 20 5fd161fa28b6
parent 0 632761c941a7
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:  This header file enlists the Document class interface of
       
    15 *                the SVGT Viewer App
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __SVGTVIEWERAPPDOCUMENT_H__
       
    22 #define __SVGTVIEWERAPPDOCUMENT_H__
       
    23 
       
    24 // INCLUDES
       
    25 #include <AknDoc.h>
       
    26 #include <GenericParamConsumer.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CSVGTViewerAppAppUi;
       
    30 class CEikApplication;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 *  Document Class for SVGT Viewer
       
    36 *  An instance of class CSVGTViewerAppDocument is the Document part of the
       
    37 *  SVGT Viewer.
       
    38 *  @since 3.0
       
    39 */
       
    40 class CSVGTViewerAppDocument : public CAiwGenericParamConsumer
       
    41     {
       
    42     public:  // Constructors and destructor
       
    43         /**
       
    44         * Two-phased constructor.
       
    45         * @param aApp Reference to application object
       
    46         * @return CSVGTViewerAppDocument*.
       
    47         */
       
    48         static CSVGTViewerAppDocument* NewL( CEikApplication& aApp );
       
    49 
       
    50         /**
       
    51         * Two-phased constructor.
       
    52         * @param aApp Reference to application object
       
    53         * @return CSVGTViewerAppDocument*.        
       
    54         */
       
    55         static CSVGTViewerAppDocument* NewLC( CEikApplication& aApp );
       
    56 
       
    57         // Destructor
       
    58         virtual ~CSVGTViewerAppDocument();
       
    59     public: // New functions
       
    60         /**
       
    61         * GetSvgtContentFileHandle() This function is a get function to 
       
    62         * get the file-handle of the file content. This is used by AppUI
       
    63         * @since 3.0
       
    64         */
       
    65         RFile& GetSvgtContentFileHandle();
       
    66         
       
    67         /**
       
    68         * IsFileHandleValid() This function is a get function to 
       
    69         * get the flag whether File's handle is valid
       
    70         * AppUi uses this method.
       
    71         * @since 3.0
       
    72         */
       
    73         TBool IsFileHandleValid() const;
       
    74 
       
    75         /**
       
    76         * IsFileFullPathAvailable() This function is a get function to 
       
    77         * get the flag whether File's fullpath is available. I.e.
       
    78         * file is public. AppUi uses this method.
       
    79         * @since 3.0
       
    80         */
       
    81         TBool IsFileFullPathAvailable() const;
       
    82 
       
    83         /**
       
    84         * GetFileFullPath() This function is a get function to 
       
    85         * get the File's fullpath. AppUi uses this method.
       
    86         * @since 3.0
       
    87         */
       
    88         void GetFileFullPath(TFileName& filename); 
       
    89         
       
    90         /**
       
    91         * GetParentAppUid() This function is a get function to 
       
    92         * get the Parent Application's Uid. AppUi uses this method.
       
    93         * @since 3.0
       
    94         */
       
    95         TUid GetParentAppUid() const; 
       
    96         
       
    97 
       
    98     public:  // Functions from base classes
       
    99         /**
       
   100         * From CAknDocument This function is used by the Doc Handler to open
       
   101         *  SVGT content.
       
   102         * @since 3.0
       
   103         * @param aDoOpen Boolean indicates whether Document is to be
       
   104         *  opened/Created.
       
   105         * @param aFilename Descriptor indicates SVGT File path
       
   106         * @param aFs File Server Session handle
       
   107         * @return CFileStore *.
       
   108         */
       
   109         virtual CFileStore* OpenFileL( TBool aDoOpen, const TDesC& aFilename,
       
   110                                          RFs& aFs );
       
   111 
       
   112         /**
       
   113         * From CAknDocument This function is used by the Doc Handler to open
       
   114         *  the document passed by the framework as a file-handle.
       
   115         * @since 3.0
       
   116         * @see CAknDocument::OpenFileL
       
   117         *         */
       
   118         virtual void OpenFileL( CFileStore*& aFileStore, RFile& aFile);
       
   119         
       
   120         /**
       
   121         * From CAknDocument This function is called by the framework to
       
   122         *  create the AppUI for SVGT Viewer.
       
   123         * @since 3.0
       
   124         * @return A pointer to the created instance of the AppUi created
       
   125         */
       
   126         CEikAppUi* CreateAppUiL();
       
   127     private:
       
   128 
       
   129         /**
       
   130         * C++ default constructor.
       
   131         */
       
   132         CSVGTViewerAppDocument( CEikApplication& aApp );
       
   133 
       
   134         /**
       
   135         * Second phase construction of a CSVGTViewerAppDocument object.
       
   136         */
       
   137         void ConstructL();
       
   138      
       
   139      private:   
       
   140               
       
   141         // File handle to the SVGT content
       
   142         RFile iSvgtContentFileHandle;
       
   143 
       
   144         //File Path if the file launched with full filepath.
       
   145         HBufC* iFileFullPath;
       
   146 
       
   147         //Was file launched with full-path.
       
   148         TBool iIsFileFullPathValid;
       
   149         
       
   150         //OpenFileL updates this flag after getting the file handle.
       
   151         TBool iIsFileHandleValid;
       
   152         
       
   153         //Uid of the parent application
       
   154         TUid iParentUid;
       
   155 
       
   156     };
       
   157 
       
   158 
       
   159 #endif // __SVGTVIEWERAPPDOCUMENT_H__
       
   160 // End of File