00001 /* 00002 * ============================================================================== 00003 * Name : flash_ui.h 00004 * Part of : FlashLite 00005 * Interface : 00006 * Description : Loads the UI library and creates the instance of the document class. 00007 * Version : 00008 * 00009 * Copyright © 2005 Nokia. All rights reserved. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia. All rights are reserved. Copying, including 00013 * reproducing, storing, adapting or translating, any 00014 * or all of this material requires the prior written consent of 00015 * Nokia. This material also contains confidential 00016 * information which may not be disclosed to others without the 00017 * prior written consent of Nokia. 00018 * ============================================================================== 00019 */ 00020 00021 #ifndef __FLASH_UI_H__ 00022 #define __FLASH_UI_H__ 00023 00024 #include <eikapp.h> 00025 #include <apparc.h> 00026 #include <apgcli.h> 00027 00028 00091 struct FlashUIConfig 00092 { 00096 TBool iIsMMI; 00097 00101 TBool iIsStubApp; 00102 00106 TFileName iContentFileName; 00107 00111 TUint32 iContentChecksum; 00112 00116 const TDesC8* iExtensions; 00117 00121 const TDesC8* iReserved1; 00122 00126 TUint32 iReserved2; 00127 }; 00128 00132 _LIT(KFlashUILibraryName, "flash2ui.dll"); 00133 00137 const TInt KFlashCreateDocumentOrdinal = 1; 00138 00142 typedef void* (*PFNC_CreateFlashDocumentL)(CEikApplication* aApp, const FlashUIConfig& aUIConfig); 00143 00144 class CEikApplication; 00159 inline CApaDocument* CreateFlashDocumentL(RLibrary& aLibrary, CEikApplication* aApp, const FlashUIConfig& aUIConfig) 00160 { 00161 CApaDocument* doc = NULL; 00162 User::LeaveIfError(aLibrary.Load(KFlashUILibraryName)); 00163 PFNC_CreateFlashDocumentL pFncCreateFlashDocumentL = (PFNC_CreateFlashDocumentL)aLibrary.Lookup(KFlashCreateDocumentOrdinal); 00164 if (pFncCreateFlashDocumentL == NULL) 00165 { 00166 User::Leave(KErrGeneral); 00167 } 00168 doc = (CApaDocument*)pFncCreateFlashDocumentL(aApp, aUIConfig); 00169 return doc; 00170 } 00171 00177 inline TBool FlashStubsSupported() 00178 { 00179 00180 RLibrary library; 00181 TInt err = library.Load(KFlashUILibraryName); 00182 if(err == KErrNone) 00183 { 00184 library.Close(); 00185 return ETrue; 00186 } 00187 else 00188 { 00189 return EFalse; 00190 } 00191 } 00192 // __FLASH_UI_H__ 00193 #endif