伯乐共勉

讨论。NET专区
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

小糊涂学symbian日记(11)

Posted on 2007-02-10 08:38  伯乐共勉  阅读(553)  评论(0)    收藏  举报
[Application Engines Overview] 
Purpose 
---------- 
提供访问核心应用程序的数据的能力。 

这些API允许第三方应用程序和核心程序整和到一起,如提供一个读取通讯簿数据的连接。 

Description 
------------- 
1、Agenda Entry and Instance Overview 
The interface to individual entries and instances in an agenda file. 

2、Agenda File Overview 
The interface to the data stored in an agenda file 

3、Agenda Server Client Side Overview 
Client side interface to the agenda server. 

4、Agenda Model Utilities Overview 
Utilities uesed by the agenda model-related APIs, e.g for data and time conversion 

5、To-do List Overview 
Manages lists of to-do entries 

6、Cantacts Model Overview 
Stores, manipulates and retrieves contacts data 

(以上详细可以看SDK,:) 

[Application Framework Overview] 
Purpose 
------------- 
为应用程序提供核心的框架和库。这些包括为EPOC应用程序所准备的框架,它们定义了应用程序的结构和基本UI操作。 

Description 
------------ 
这里提供了一系列的API用来完成以上功能。 
*Print Framework Overview 
Handles set up of print jobs 

*Print Preview Overview 
Provides a framework for creating print previews 

*System Sounds Overview 
为应用程序中的一般事件如信息或错误提供一个简单的和统一的声音调用方法。 
这里的声音是指逻辑上的,可以是wav,铃声或一个fixed tone sequences 

*Text and Text Attributes Overview 
提 供一个可以使用可编辑文本框的框架, The API does not store the layout information needed to display the text. This is done by a separate API called Text Views. 

*Text Views Overview 
Provides access to the layout information needed to format text for display 
The text itself and its formatting are accessed separately, using the Text and Text Attributes API. Text views obtain text and formatting information via an abstract interface class (MLayDoc). 

*UI Control Framework Overview 
Provides a framework for creating user interface controls; a framework for application to handle user interface events; and environment utilities for control creation and access to windowing functionality. 

*UI Graphics Utilities Overview 
Provides miscellaneous user interface utility functions, relating to fonts, colours, and drawing. 

*Uikon Overview 
Provides the top-layer of the framework for application, and a set of core controls that are present on all device families. 

*View Server Overview 
Allows applications (including system applications such as shells) to make and receive requests to show a particular view of their data. 

Clock Overview 
---------------- 
提供了一个显示数字和模拟时钟的图面。 
时钟根据系统时间会有所改变的。 

Front End Processor Overview 
----------------------------- 
Provides a framework for components that enable the input of characters not supported directly by the keyboard (if present). This includes hand-writing and voice input. 

Message Window Overview 
--------------------------- 
提供一个窗口来给用户显示信息,然后就消失了。 

Open Font System overview 
--------------------------- 
提供一个框架以便在symbian平台上使用各种各样的字体。 

Recognizers Overview 
------------------------ 
Plug-in code that can examine data in a file, or sample data supplied in a buffer, and return, if recognized, the data type of that data. A data type is also commonly known as a MIME type. 

Uikon Core Overview 
---------------------- 
Provides the top-layer of the framework for application, plus various user interface utility classes. The framework is fundamental to all GUI applications. 

Uikon Core Controls Overview 
-------------------------------- 
Provides core controls that are common to every device family. Further controls are available through the device family UI APIs. 

[Application Serveices Overview] 
可以提供一系列的功能服务给我们应用程序,包括警铃、logging、系统信息和vCard以及vCalendar操作。 
Description 
------------- 
由下列一组函数提供这样的功能,分别是 
*Alarm Server Overview 
提供警铃服务功能,里面分Alarm Service和Alarm,仔细请看SDK:) 

*Calendar Conversion Overview 
在Gregorian和Chinese日历之间转换,TGregorianCalendar存储了一个Gregorian日期,而TChineseCalendar则存储了一个Chinese日期。 

这两个都是从TCalendar派生的。 

*Log Engine Overview 
记 录引擎,记录那些用户很感兴趣或很重要但暂时无暇顾及的事件,如来电记录。这些时间都可以被一个viewer程序捕捉,然后显示给用户看。它有五个重要因 素:log engine wrapper, log client, event, view and filter. 

*System Agent Overview 
Provides a central repository of information about the state, particularly relating to power and communications, of the EPOC machine.Applications can ask to be informed when certain conditions are true, and they can also retrieve the current state. 
这个System Agent使用client/server结构。这组API有两个重要组成方面:System agent client interface和system agent variable. 

*Versit Overview 
Reads and writes the vCard(electronic business cards) and vCalendar(calendaring and scheduling) standards. 
这组函数支持版本2.1的vCard和版本1.0的vCalendar,这些资料可以在http://www.imc.org里找到。 

Agenda Model API可以导入或导出vCalendar 
Contacts Model API可以导入或导出vCards 

这组API包含四个重要的组成方面:parser, property, property parameter和property value. 

*World Server Overview 
提供反问城市和国家的数据库的能力,这组函数包含三个重要组成部分:world server, city information和country information. 


<> 
[Application Utilities Overview] 
可以让我们很方便的使用文件系统的实用程序。 

这组函数主要完成了定义在File Server Client端的文件系统处理功能,调用者必须拥有一个file server session(RFs)。 
Functions include: 
1、checking whether a file, folder, or path exists 
2、copying, renaming, and deleting files 
3、parsing and manipulating file names 
4、comparing UIDs 

所有的函数都是BaflUtils的静态成员。 

[Arrays And Lists] 
提供了数组和链表的对象。 
下面的几组函数提供了这样或那样的功能,请看 
*Fixed Size Arrays Overview 
Provides a simple wrapper to c++ arrarys with additional automatic checking of index values. 

固定大小数组提供一个简易但很实用的编程方式(和一般的c++数组比起来),如果用越界的索引来访问数组会引起不必要的麻烦。 
固定大小数组(fixed sized array)由TFixedArray提供。 

*Dynamic Arrarys Overview 
提供一个基于堆的可动态扩展的数组家族:) 
有很多具体的类为不同环境的情况提供动态数组,和EPOC的固定大小数组以及标准C++数组不同,他们的元素数目在运行时是可以改变大小的。 

这类数组分成以下两个派别: 
1、在大多数情况下使用的简单动态数组 
2、允许带有额外属性的可扩展数组,如数组在内存中的存储组织等。 

这些数组类都是模板形式出现的。 

*Array Keys Overview 
Defines a property of array element by which a dynamic array can sorted and searched. 

Keys是由客户程序描述的,并且和在动态数组API中定义基于堆的数组类一起联合使用。 
它也可以用于由系统静态函数API提供的底层存储函数中。 

*Singly Linked Lists Overview 
处理单向链表:an ordered, non-indexed list of elements, that can be traversed only from start to end. 
The API has three key concepts: list header (TSglQue), link class (TSglQueLink), and iterator class (TSglQueIter). 
注意单向链表有下面两个重要属性: 
1、elements can be accessed through iterating through the list, and added to the start and end of a list, but not to the middle 

2、elements in a linked list need not be objects of the same type but ought to be derived from the same base class 

*Doubly Linked Lists Overview 
双向链表的处理:an ordered, non-indexed list of elements, that can be traversed in both directions. 
The API has three key concepts: list header (TDblQue), link class (TDblQueLink), and iterator class (TDblQueIter). 

注意双向链表有下面三个重要属性: 
1、 the list is circular: the last element points forward to the head element and the head element points back to the last element 

2、elements can be accessed through iterating through the list, and added to the start and end of a list, but not to the middle 

3、elements in a linked list need not be objects of the same type but ought to be derived from the same base class 

[Basic Types] 
Provides implementation-independent versions of the C++ built-in types, defines the EPOC standard base class for all heap-allocated classes, and provides some useful yet simple global functions. 

你不要直接使用C++内建类型,应用使用EPOC定义的类型。 

这 些API为integer、text、Boolean和floating point类型定义了类和typedef。此外, a utility class to help with reference arguments in variable argument functions is provided. 

*Heap-allocated classes base 
EPOC提供了所有从标准基类CBase派生来的类,它们拥有动态分配的资源,这样的类习惯上拥有一个C前缀,并被当做C类来看待,这个类的分配和清除都是EPOC定义的。 

*Integral types 
1、TInt is the natural mechine word integer ,并且应该在所有应该使用整数的地方出现。 

2、 TInt32, TInt16和TInt8 map onto C++ built- in types in most implementations. These types should only be used where the size of the integer is of first importance. sometimes, this is relevant for C++ arrays and struct/class members. Note that C++ passes all function arguments as TInt, so there is nothing to be gained by using narrower types in function interfaces. 

3、 TUint is an unsigned integer of the natural machine word size. It should be used for flag and handle words,  which are manipulated using bitwise and equality-comparison operations rather than arithmetic. TUint should also be used in exceptional circumstances where the full range of a machine word is required for arithmetic:  this use is exceptional and must always be carefully controlled. 注意经验表明 当要使用一个正数时,我们应该用TInt而不是这里的TUint。记住这点就可以了, 

详细原因在SDK里有解释。 

4、TUint32, TUint16 and TUint8 are available where the specific representation width is important. 

*Text types 
1、 TText represents a character in the natural character width for the EPOC build. For Unicode builds, this is 16 bits.For non-Unicode builds, this is 8 bits. 
2、 TText8 is available for build-independent 8-bit characters, and TText16 for build -independent 16-bit characters。 事实上,TText就是映射两者之一的,具体哪个看情况了。 
3、 The TChar class wraps a character value and provides a number of utility functions to operate upon it.such as converting the character to uppercase and testing whether it’s a control character. 

*Boolean type 
TBool represents a Boolean whose value may be true or false. It is implemented as a natural machine-word integer. 
C语言中有0代表假,1代表真以及0代表假,非0代表真的定义,这样的混乱在TBool也可能出现。它是有可能的,但决不提倡在一个TBool中定义个数字值。 
In general, a TBool should be tested using 

if (x) ... 
or 

if (!x) ... 
rather than 

if (x==ETrue) ... 
or 

if (x==EFalse) ... 
The TBool uses a whole machine word. When a class has a number of flags, they should be encoded in a flags byte, and suitable getter/setter functions, taking TBools, should be coded to access that flags byte. 


*Floating-point types 
1、 TReal is a 64-bit double-precision type, used as the argument type for all math functions, and the default type of floating-point literals. 
2、TReal64 and TReal32 are available when the precise size is important. 

*value reference type 
The value reference type is a utility that is provided to overcome problems with specifying a C++ reference argument before the ellipsis argument in variable argument functions.The value reference type is provided by TRefByvalue. 

*Global functions 
Max(), Min(), Rng()和Abs()在很多情况下都很很有用的全部函数。 


*Templated functions 
In e32std.h, there are also a variety of inline templated functions for performing simple operations: 

return lower of two values: Min() 

return higher of two values: Max() 

return absolute value: Abs() 

check if a value is between two other values: Rng() 

These can be called on any type that supports the required operators (<,>,<=,>=,-). 


<> 
[Buffers And String Overview] 
可以处理字符串和一般的数据缓冲区。 
在EPOC 中字符串和缓冲区的习惯称法是descriptors,在这里的API,如Literals, Lexical Analysis和 Package Buffers提供了很多descriptor的处理应用。在有些情况下,应用程序可能需要直接管理内存中的底层数据,基于这个原因, Dynamic Buffers和Raw Memory API提供了这方面的应用。 

[Circular Buffers Overview] 
Provides a fixed length first-in first-out queue of fixed size objects. 

注意它拥有如下的属性: 
1、只有简单的添加、删除和重置操作是被允许的。 
2、可以在序列的头添加元素在序列的尾巴那删除元素。 
3、在circular buffer中的所有元素必须是同样类型的对象。 

Circular 字符串是由CCirBuf提供的。A predefined circular buffer of unsigned integers is provided by CCirBuffer. 

[Desciptors Overview] 
处理字符串和数据缓冲。 

Descriptors是在EPOC中使用的一组类,主要用来处理字符串。它们是用来代替Null-terminated C strings. The same classes are used for general binary data. 

descriptors类的基本分类如下所示. 
*Basic classification 
Type——————Description——————Basic name 
抽象——基本的接口,允许不同类型的descriptors在不同的状态下使用——TDes 
buffer——基于堆栈的:其中包括数据,在编译时刻内有个最大长度确定——TBuf 
pointer——指向那些存放在他处的属于descriptor的数据——TPtr 
heap——指向那些存放在堆中的属于descriptor的数据,可以设置最大长度并且可以动态改变——HBufC 

*Width 
Descriptor types can store 8-bit or 16-bit data. These types are indicated by the convention of appending 8 or 16 on the basic name, e.g. TDes8. In Unicode EPOC builds, the basic names correspond to 16-bit types, for example TBuf is defined to be TBuf16. 

*Modifiable and non-modifiable 
可修改的Descriptor类型可以有个接口,它允许调用者改变他们的内容,如添加字符。 
不可修改的Descriptor类型可以将他们内容重置,但不可修改。一般习惯上我们为不可修改的类型加上C后缀,如TBufC 

Heap类型的Descriptors是一个很特殊的情况,他们只在不可修改的状态下有效,但仍然可以通过使用指针来修改内容,可见HBufC::Des() 

[Dynamic Buffers Overview] 
处理可变长度的数据缓冲。如果是固定长度的数据或是其长度在一个最大值范围内一般不变的情况,最好使用Descriptors 

这类函数有三个关键组成:dynamic buffer base, flat dynamic buffer, and segmented dynamic buffer. 

[Lexical Analysis Overview] 
提供字符串分析和字符串与数字的转换。 
The API has two key concepts: lexical analyser, and extraction mark. 

[Literals Overview] 
简单的生成喊有只读文本的Descriptors. 
Literal descriptors 严格意义上并不是Descriptor API的一部分,这是当他们没有从descriptor类基类TDes派生的时候,不管怎么说它们有转换操作,这 样他们能做为函数参数在const TDesC&或const TRefBuvalue出现的地方。 

The API has two key concepts: literal descriptor, and literal descriptor constructor macro. 

[Package Buffers Overview] 
允许任何值类型(T class)做为一个descriptor被封装,for the purpose of inter-thread parameter passing. 

The Client/Server API expects data that is to be passed between threads to be encapsulated in a descriptor. Package buffers provide a generic way for the thread providing the data to do this. The thread receiving the data extracts the original data from the package. 
APIs with client/server architectures, such as ETel and Messaging, define specialised package buffer types that encapsulate the particular data types that they require to pass between threads. 

The API has two key concepts: package buffer descriptor, and package pointer descriptor. 

[Raw Memory Overview] 
简单的处理内存中数据的操作。 

This API is mostly used by other system APIs. Client applications generally use a higher-level API, such as descriptors. 

The API supplies static functions to compare, copy, move, swap, and fill areas of memory, as defined by pointers and data length parameters. 

The raw memory interface is provided by Mem.