symbian 生成help帮助文档
来源:互联网 发布:linux怎么配置dns 编辑:程序博客网 时间:2024/06/15 10:23
完成上下文相关的帮助文档
CS000809
- 开发伙伴平台:
S60 3rd Edition
S60 3rd Edition, FP1
S60 3rd Edition, FP2
S60 5th Edition
- 详细描述
下面的示例代码演示了如何完成一个程序的上下文相关的帮助文档。
注意,为了使用上下文相关的帮助,你需要从Symbian申请一个被保护的UID给帮助文件(如果你使用一个未被保护的UID,那么程序的帮助文件无法从程序中被启动调用),实际程序的UID3并不需要是受保护号,但是帮助文件的UID确实需要是。
这段示例代码可以通过自签名执行(保护号下的帮助文件不会阻止自签名)
- 步骤
1、生成一个目录,以供帮助文件使用,如help目录
2、使用cshelp2000.dot文件作为模板,写入相关帮助文件(.rtf),这个文件可以在SDK的目录下(C:/Symbian/9.2/S60_3rd_FP1/Epoc32/cshlpcmp_template/cshelp2000.dot)找到。
3、在文本编辑器中打开rtf文件,并删除Word生成的格式化指令。
{/*/wgrffmtfilter XXXX} in Word version 11.8134.8132, 或
{/*/generator Microsoft Word 10.0.6612;} in Word version 10.0.6612.
4、写出如下XML文件(help/help.xml)
<?xml version="1.0" encoding="UTF-8"?>
<?xml:stylesheet href="/epoc32/tools/cshlpcmp/xsl/CSHproj.xsl"
title="CS Help project" type="text/xsl"?>
<!DOCTYPE cshproj SYSTEM "/epoc32/tools/cshlpcmp/dtd/CSHproj.dtd">
<cshproj>
<helpfileUID>0x2000E190</helpfileUID> <!-- From help file -->
<directories>
<input></input>
<output></output>
<working></working>
</directories>
<files>
<source>
<file>help.rtf</file>
</source>
<destination>help.hlp</destination>
<customization>custom.xml</customization>
</files>
</cshproj>
5、写出格式描述用的XML文件(help/custom.xml)
<?xml version="1.0"?>
<!DOCTYPE cshcust SYSTEM "/epoc32/tools/cshlpcmp/dtd/CSHcust.dtd">
<?xml:stylesheet href="/epoc32/tools/cshlpcmp/xsl/cshcust.xsl"
title="CS Help customization" type="text/xsl"?>
<cshcust>
<parastyle name="body" font="sansserif" size="10"/>
<parastyle name="note" font="sansserif" size="10" left="20">
<b>Note:</b>
</parastyle>
<body style="body"/>
<titlestyle fontstyle="sansserif" size="10"/>
<listbullet1style bulletchar="8226"/>
<listbullet2style bulletchar="8226"/>
<lists leftindent="20"/>
</cshcust>
6、生成makefile(group/help.mk)文件用来编译帮助文件
makmake :
cshlpcmp ../help/help.xml
ifeq (WINS, $(findstring WINS, $(PLATFORM)))
copy ../help/help.hlp $(EPOCROOT)/epoc32/$(PLATFORM)/c/resource/help
endif
clean :
del ../help/help.hlp
del ../help/help.hlp.hrh
bld :
cshlpcmp ../help/help.xml
ifeq (WINS, $(findstring WINS, $(PLATFORM)))
copy ../help/help.hlp $(EPOCROOT)/epoc32/$(PLATFORM)/c/resource/help
endif
freeze lib cleanlib final resource savespace releasables :
注意:当编辑makefile文件时,要使用制表符替代空格,否则你会收到“HELP.MK:27: *** missing separator. Stop”错误信息
7、编辑group/bld.inf用来管理makefile文件
#ifdef EKA2 //3rd edition
gnumakefile help.mk
Application_S60_3rd_ed.mmp
#else //1st and 2nd edition
Application_S60_2nd_ed.mmp
#endif
注意:记住编辑完后执行bldmake bldfiles命令
8、增加帮助文件,以及相关库到mmp文件中(group/[app].mmp)
USERINCLUDE ../help
SOURCEPATH ../help
DOCUMENT help.rtf
DOCUMENT help.xml
DOCUMENT custom.xml
LIBRARY hlplch.lib // help
9、增加.hlp文件到pkg文件中(sis/[app].pkg)
"../help/help.hlp" - "!:/resource/help/help.hlp"
10、增加帮助命令(EClientHelp)的常量定义到inc/[app].hrh文件中
// Client enumerate command codes
enum TClientIds
{
EClientHelp = 1 // start value must not be 0
};
11、增加UID到inc/[app]Application.h文件中
const TUid KUidHelpFile = {0x2000E190}; // From the help file
12、增加本地化字符串到本地化数据文件(如data/[app]_loc.l01文件):
#define STRING_r_app_options_help "Help"
13、增加菜单项到程序资源文件(data/[app].rss)的RESOURCE MENU_PANE段中
MENU_ITEM
{
command = EClientHelp;
txt = STRING_r_app_options_help;
}
14、增加与帮助命令到AppUI(src/[app]AppUi.cpp文件)的HandleCommandL函数中:
#include <hlplch.h> // HlpLauncher
case EClientHelp:
{
CArrayFix <TCoeHelpContext>* buf = CCoeAppUi::AppHelpContextL();
HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), buf);
break;
}
15、重载HelpContextL函数
(inc/[app]AppUi.h文件)
private: // from CAknAppUi
/*
* HelpContextL()
*
* Returns the help context for this application
*
* Returns:
* A pointer to the help context
*
*/
CArrayFix<TCoeHelpContext>* HelpContextL() const;
(inc/[app]AppUi.cpp文件)
#include "[app]Application.h"
#include "help.hlp.hrh"
// ----------------------------------------------------------------------------
// CClientAppUi::HelpContextL()
//
// Return the help context for this application.
// ----------------------------------------------------------------------------
CArrayFix <TCoeHelpContext>* CClientAppUi::HelpContextL() const
{
CArrayFixFlat <TCoeHelpContext>* array =
new (ELeave) CArrayFixFlat <TCoeHelpContext>(1);
CleanupStack::PushL(array);
// KContextApplication below should refer to the context declared in
// help.rtf
array->AppendL(TCoeHelpContext(KUidHelpFile, KContextApplication));
CleanupStack::Pop(array);
return array;
}
16、重载GetHelpContext函数
(inc/[app]AppView.h文件中)
public:
/**
* From CoeControl
* Identify the help context so that the framework can look up
* the corresponding help topic
*
* @param aContext The help context
*/
void GetHelpContext(TCoeHelpContext& aContext) const;
(src/[app]AppView.cpp文件)
#include "[app]Application.h"
#include "help.hlp.hrh"
// -----------------------------------------------------------------------------
// CClientAppView::GetHelpContext()
// Gets the control's help context.
// -----------------------------------------------------------------------------
void CClientAppView::GetHelpContext(TCoeHelpContext& aContext) const
{
// Get the help context for the application
aContext.iMajor = KUidHelpFile;
// KContextApplication below should refer to the context declared in
// help.rtf
aContext.iContext = KContextApplication;
}
- symbian 生成help帮助文档
- Help document--帮助文档
- 在Vs.net中集成 NDoc生成的 Html Help 2帮助文档
- help和man查看命令帮助文档
- help和man查看命令帮助文档
- Python 查看帮助文档 dir(),help()
- python文档帮助help()和dir()
- 帮助文档生成批处理
- 帮助文档生成工具
- Java 生成帮助文档
- Sandcastle生成帮助文档
- Sandcastle生成帮助文档
- 生成javadoc帮助文档
- 帮助文档生成
- OSG帮助文档生成
- Android生成帮助文档
- Sandcastle生成CHM帮助文档
- MyEclipse生成Javadoc帮助文档
- jdk1.6中对scripting的支持
- 【转】 明明白白Unsupported major.minor version 49.0的错误
- Java精典面试题推荐二
- 马云:未来的创新要靠80后、90后
- symbian 用doxygen生成交叉引用文档
- symbian 生成help帮助文档
- flex 国际化
- Java Persistence API、Hibernate、Toplink、Entity Enterprise Java bean之间的优缺点
- 对过去的22年说bye bye.
- C++多态技术
- oracle查询链接数---sql命令
- tomcat简介
- ShellExecute 命令行参数最长2068
- vb.net里使用trackbar控件控制图形