Communicator UI: 2.1 ComplexMonikerClass: ComplexMoniker Instance Data

Up: GEOS SDK TechDocs | Up | Prev: 2 ComplexMonikerClass | Next: 2.2 ComplexMoniker Usage

ComplexMonikerClass contains the following instance data:

Code Display 2-3 ComplexMonikerClass Instance Data

ComplexMoniker			ClassName
@instance TextStyle			CMI_textStyle = (TS_BOLD);
@instance word 			CMI_topText;
@instance word 			CMI_iconBitmap;
@instance byte 			CMI_fontSize;

The ComplexMoniker Keyword

Because ComplexMonikerClass is a variant class, it needs to have its superclass assigned when it is built. The ComplexMoniker keyword represents the parent class of the complex moniker. By setting this keyword to a class name the parent class is changed from the default superclass GenClass to the specified class. Any child of GenClass may be a complex moniker superclass. The following are commonly used superclasses:

GenTriggerClass
GenInteractionClass
GenItemGroupClass
GenItemClass
GenBooleanGroupClass
GenDynamicListClass
ContactListClass

Each of these classes will behave quite differently, but all will exhibit the same characteristics in displaying their text and icon monikers that are gained through using ComplexMonikerClass. Note that using a ComplexMoniker object will cause the specific UI to ignore any moniker stored in the GI_ visMoniker instance data field in the above classes.

The ComplexMoniker Text

CMI _topText stores the "text" to display. This may be either a Chunkhandle to a text string, or a ComplexMonikerText identifier. If the value is a ComplexMonikerText identifier, the specific UI will determine what exact text is displayed.

As noted, the text may contain two lines. The top text is limited to COMPLEX_MONIKER_MAX_TOP_TEXT_LENGTH while the bottom is limited to COMPLEX_MONIKER_MAX_BOTTOM_TEXT_LENGTH.

Below is a complete list of types; in most cases the (English) text on the Nokia 9000i device is similar, if not identical, to the text alluded to by the identifier's name. Those cases where the actual text is noticeably different are noted. Using such an identifier is beneficial for localization purposes.

CMT_NULL
Never set a moniker to this value. It exists purely as a placeholder.
Basic strings:
CMT_OK
CMT_CLOSE
CMT_CANCEL
CMT_YES
CMT_NO
Command strings:
CMT_CLEAR
CMT_CLEAR_ALL
CMT_CHANGE
CMT_RENAME
CMT_COPY
CMT_SETTINGS
CMT_OPEN
CMT_CREATE_NEW "New"
CMT_DELETE
CMT_ROTATE
CMT_SELECT
CMT_START
CMT_GO
CMT_INSTALL
CMT_DEINSTALL "Remove"
CMT_NEXT
CMT_PREVIOUS
CMT_USER_DEFINED "User defined:"
CMT_ZOOM
CMT_ZOOM_IN
CMT_ZOOM_OUT
CMT_VIEWING_TOOLS
CMT_OPTIONS
Communication strings:
CMT_PHONE "On"
CMT_CALL
CMT_CALL_LOWERCASE "Call"
CMT_SEND
CMT_SEND_OPTIONS
CMT_CONNECT
CMT_CALLS
CMT_FAXES
CMT_DATA_CALLS
CMT_MESSAGES
CMT_RECENT_CALLS
CMT_RECENT_FAXES "Recent numbers"
CMT_RECENT_MESSAGES "Recent numbers"
CMT_RECEIVED_CALLS
CMT_RECEIVED_FAXES "Received fax numbers"
CMT_RECEIVED_MESSAGES "Received message numbers"
CMT_MISSED_CALLS
CMT_LAST_DIALED_CALLS "Dialed calls"
CMT_TO_COLON "To:"
CMT_FROM_COLON "From:"
CMT_TEXT_SEND "Send text"
CMT_TEXT_CAPTURE "Capture text"
CMT_CAPTURE
CMT_STOP_CAPTURE
CMT_FORWARD_FAX "Forward"
CMT_SELECT_RECEIVER "Recipient"
CMT_HANGUP
CMT_FORWARD
CMT_REPLY
Miscellaneous commands:
CMT_CLEAR_LIST
CMT_NO_CONTACT_INFORMATION "No log information"
CMT_CONTACT_CARD
CMT_NONE
CMT_CLEAR_ALL_COMMAND
CMT_ACCEPT
CMT_RESET
CMT_STOP
CMT_ACTIVATE
CMT_DISABLE
CMT_HELP
CMT_BACK
CMT_SPECIAL_KEYS_COMMAND "Keys"
CMT_SPECIAL_KEYS
CMT_TEXT
CMT_TEXTS
CMT_ZOOM_PLUS "Zoom in"
CMT_ZOOM_MINUS "Zoom out"
CMT_INSERT
CMT_OFF
CMT_ON
CMT_MENU /* Not available on build 4.8.8 or earlier versions of the Communicator */
CMT_SEARCH /* Not available on build 4.8.8 or earlier versions of the Communicator */

Code Display 2-4 Setting a Complex Moniker's Text

/* 
 * The text in a complex moniker is stored within the CMI_topText instance field. 
 * This text may either be referenced by a ChunkHandle ...
 */
@object ComplexMonikerClass MyMoniker = {
    ComplexMoniker = GenTriggerClass;
    CMI_topText = @MyText;
}
/* Use the TCHAR type to ensure the text is DBCS-compliant. */
@chunk TCHAR MyText[] = "Sample Text";
/* 
 * ... or CMI_topText can store a ComplexMonikerText type which indicates the text 
 * generically. 
 */
@object ComplexMonikerClass MyClearTrigger = {
    ComplexMoniker = GenTriggerClass;
    CMI_topText = CMT_CLEAR;
}

The ComplexMoniker Icon Bitmap

CMI_ iconBitmap stores the bitmap to display within this moniker. This may either be a ChunkHandle to a Bitmap structure or a member of the ComplexMonikerBitmap types. These types are enumerated below:

CMB_LEFT_FINGER
CMB_RIGHT_FINGER
CMB_CONTACT_CARD
CMB_CONTACT_LIST
CMB_SPEED_DIAL
CMB_SETTINGS_TITLE_ICON
CMB_SERVICES_VIEW
CMB_SERVICES_DEFINE
CMB_QUESTION_ICON
CMB_OPEN_FOLDER
CMB_DRAWER
CMB_RENAME_COPY
CMB_FOLDER
CMB_SECURITY_SUCCESS
CMB_SECURITY_ERROR
CMB_PC_ICON
CMB_INPUT_TITLE_ICON
CMB_WARNING_TITLE_ICON
CMB_SEARCH /* Not available on build 4.8.8 or earlier versions of the Communicator */
CMB_SMS_CARD_ICON /* Not available on build 4.8.8 or earlier versions of the Communicator */

Again, using a generic identifier eases localization.

You can create your own bitmaps by using the GEOS Icon Editor. To do so, perform the following steps:

@visMoniker Moniker ={
@chunk byte YourIconName[] = {
size = <...>;
style = <...>;
color = <...>;
aspectRatio = <...>;
cachedSize = <...,...>;
gstring { GSFillBitmapAtCP(<...>),
GSEndString()
}

Your resulting bitmap, ready for inclusion in your app, should look like this:

@chunk byte MyIconName[] = {
    Bitmap (32,20,BMC_PACKBITS,
            (BMT_MASK|BMF_4BIT)),
    0xfd, 0xff, 0x03, 0xbf, ...
};

Text Styles

CMI_ textStyle stores a GEOS TextStyle , defined in graphics.h . By default, text is shown as TS_BOLD. The full list of styles appears below:

TS_BOLD (default)
TS_OUTLINE
TS_ITALIC
TS_SUPERSCRIPT
TS_SUBSCRIPT
TS_STRIKE_THRU
TS_UNDERLINE

Font Sizes

CMI _fontSize stores a font size (in points). There are four pre-established font sizes that you should choose from:

#define FOAM_LARGE_FONT_SIZE					20
#define FOAM_NORMAL_FONT_SIZE					18
#define FOAM_LIGHT_FONT_SIZE					17
#define FOAM_SMALL_FONT_SIZE					16

The large font size is best reserved for commands and title bar monikers. In most other cases, use the normal font size.

The default font can be obtained by those routines or objects that demand a font name by using the VisTextDefaultFont value VTDF_RESPONDER.

ComplexMoniker Vardata

There are several vardata attributes that you may attach to the Complex Moniker. These are noted below:

Code Display 2-5 ComplexMoniker Vardata

@vardata		void	ATTR_COMPLEX_MONIKER_PLACE_BITMAP_AT_LEFT;
@vardata		void	HINT_COMPLEX_MONIKER_DRAW_SEPARATOR;
@vardata		void	HINT_COMPELX_MONIKER_DONT_DRAW_SEPARATOR;

ATTR_COMPLEX_MONIKER_PLACE_BITMAP_AT_LEFT will position the icon bitmap (if any) to the left of the text.

HINT_COMPLEX_MONIKER_DRAW_SEPARATOR draws a single-line separator below the complex moniker.

HINT_COMPLEX_MONIKER_DONT_DRAW_SEPARATOR prevents the drawing of a single-line separator below the complex moniker.


Up: GEOS SDK TechDocs | Up | Prev: 2 ComplexMonikerClass | Next: 2.2 ComplexMoniker Usage