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 <apparc.h> 00025 #include <apgcli.h> 00026 00027 00090 struct FlashUIConfig 00091 { 00095 TBool iIsMMI; 00096 00100 TBool iIsStubApp; 00101 00105 TFileName iContentFileName; 00106 00110 TUint32 iContentChecksum; 00111 00115 const TDesC8* iExtensions; 00116 00120 const TDesC8* iReserved1; 00121 00125 TUint32 iReserved2; 00126 }; 00127 00131 _LIT(KFlashUILibraryName, "flash2ui.dll"); 00132 00136 const TInt KFlashCreateDocumentOrdinal = 1; 00137 00141 typedef void* (*PFNC_CreateFlashDocumentL)(CEikApplication* aApp, const FlashUIConfig& aUIConfig); 00142 00157 inline CApaDocument* CreateFlashDocumentL(RLibrary& aLibrary, CEikApplication* aApp, const FlashUIConfig& aUIConfig) 00158 { 00159 CApaDocument* doc = NULL; 00160 User::LeaveIfError(aLibrary.Load(KFlashUILibraryName)); 00161 PFNC_CreateFlashDocumentL pFncCreateFlashDocumentL = (PFNC_CreateFlashDocumentL)aLibrary.Lookup(KFlashCreateDocumentOrdinal); 00162 if (pFncCreateFlashDocumentL == NULL) 00163 { 00164 User::Leave(KErrGeneral); 00165 } 00166 doc = (CApaDocument*)pFncCreateFlashDocumentL(aApp, aUIConfig); 00167 return doc; 00168 } 00169 00175 inline TBool FlashStubsSupported() 00176 { 00177 00178 RLibrary library; 00179 TInt err = library.Load(KFlashUILibraryName); 00180 if(err == KErrNone) 00181 { 00182 library.Close(); 00183 return ETrue; 00184 } 00185 else 00186 { 00187 return EFalse; 00188 } 00189 } 00190 // __FLASH_UI_H__ 00191 #endif