This page was last modified 10:13, 6 June 2008.
Symbian C++でFlashランチャーを作成する方法
From Forum Nokia Wiki
原文(英語): How to make Flash launcher with Symbian C++
通常のメニューにアイコンを表示するためには、Symbianアプリケーションを作成する必要があります。そしてまた、アプリケーションのフレームワーク等を定義する必要があります。これらについては、アプリケーションウィザードを使用して行えます。アプリケーションアイコンを変更する方法は、アプリケーションアイコンを定義する方法にて示しています。アプリケーションユーザインタフェースクラスに、コードを追加することだけです。
Contents |
Symbian S60 3rd Edition端末
S60 3rd Edition プラットフォームでは次のように、DocumentハンドラとしてRFileを使用できます(Run_Flash.cpp ファイル中で示しています)。
iHandler = CDocumentHandler::NewL( NULL ); iHandler->SetExitObserver(this); TFindFile AufFolder(CCoeEnv::Static()->FsSession()); if(KErrNone == AufFolder.FindByDir(KTxtFlashFileName, KNullDesC)) { RFile Runfile; User::LeaveIfError(Runfile.Open(CCoeEnv::Static()->FsSession(), aFlashAppName, EFileShareReadersOnly)); CleanupClosePushL(Runfile); TDataType Dummy; User::LeaveIfError(iHandler->OpenFileEmbeddedL(Runfile, Dummy)); CleanupStack::PopAndDestroy(); // sharedfile }
また、アプリケーションUIクラスとして、MAknServerAppExitObserverを実行することに注意する必要があります。
Symbian S60 3rd Edition FP1端末
... 専用のAPIがあります ...
Symbian S60 3rd Edition以前の端末
2nd Editionでは次のように、直接RApaLsSessionを利用できます(Run_Flash2.cpp ファイル中で示しています)。
RApaLsSession session; session.Connect(); CleanupClosePushL(session); TFindFile AppFile(CCoeEnv::Static()->FsSession()); if(KErrNone == AppFile.FindByDir(KTxtFlashFileName, KNullDesC)) { TThreadId id; User::LeaveIfError(session.StartDocument(AppFile.File(), id)); } CleanupStack::PopAndDestroy();//session.Close();
Run_Flash2.cpp
#include <apgcli.h> _LIT(KTxtFlashFileName, ":\\others\\MyFlashFile.swf" ); //_LIT(KTxtFlashFileName, ":\\private\\<My-SID>\\MyFlashFile.swf" ); void CFlashStubAppUi::ConstructL() { BaseConstructL(CAknAppUi::EAknEnableSkin); RApaLsSession session; session.Connect(); CleanupClosePushL(session); TFindFile AppFile(CCoeEnv::Static()->FsSession()); if(KErrNone == AppFile.FindByDir(KTxtFlashFileName, KNullDesC)) { TThreadId id; User::LeaveIfError(session.StartDocument(AppFile.File(), id)); } CleanupStack::PopAndDestroy();//session.Close(); User::Exit(0); } CFlashStubAppUi::CFlashStubAppUi() { // No implementation required } CFlashStubAppUi::~CFlashStubAppUi() { } void CFlashStubAppUi::HandleCommandL( TInt aCommand ) { switch( aCommand ) { case EEikCmdExit: case EAknSoftkeyExit: Exit(); break; default: break; } }
Run_Flash.cpp
#include <documenthandler.h> #include <apgcli.h> _LIT(KTxtFlashFileName, ":\\others\\MyFlashFile.swf" ); //_LIT(KTxtFlashFileName, ":\\private\\<My-SID>\\MyFlashFile.swf" ); void CFlashStubAppUi::ConstructL() { BaseConstructL(CAknAppUi::EAknEnableSkin); iHandler = CDocumentHandler::NewL( NULL ); iHandler->SetExitObserver(this); TFindFile AufFolder(CCoeEnv::Static()->FsSession()); if(KErrNone == AufFolder.FindByDir(KTxtFlashFileName, KNullDesC)) { RFile Runfile; User::LeaveIfError(Runfile.Open(CCoeEnv::Static()->FsSession(), aFlashAppName, EFileShareReadersOnly)); CleanupClosePushL(Runfile); TDataType Dummy; User::LeaveIfError(iHandler->OpenFileEmbeddedL(Runfile, Dummy)); CleanupStack::PopAndDestroy(); // sharedfile } } CFlashStubAppUi::CFlashStubAppUi() { // No implementation required } CFlashStubAppUi::~CFlashStubAppUi() { delete iHandler; } void CFlashStubAppUi::HandleCommandL( TInt aCommand ) { switch( aCommand ) { case EEikCmdExit: case EAknSoftkeyExit: Exit(); break; default: break; } } void CFlashStubAppUi::HandleServerAppExit (TInt /* aReason */) { Exit(); }
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Symbian C++ books | kayem | General Symbian C++ | 2 | 2007-11-19 16:34 |
| 紧急求救,环境配置问题 | jackyxue | Symbian | 6 | 2006-08-10 09:48 |
| help required for symbian programing.. | adv999 | General Symbian C++ | 9 | 2006-11-02 07:23 |
| New to Symbian world, needs some answers.... | ayman09 | General Symbian C++ | 5 | 2007-10-30 13:04 |
| I want to know something.... | sagars | General Symbian C++ | 6 | 2006-11-22 11:13 |
