Contents

###

How does Localizer work internally ?

Localizer's map file format

The file format of localizer is XML based, an excerpt of a sample map file:

`<Company name="foo" homepage="www.foo.bar" icon="localizer/congress/foo.png">
<Info>
foo buils ...
</Info>
<Area stand="2.101" rectangle="10,35;20,45" />
<Representative name="John Foo" email="jonh@foo.bar" position="Director" />
<Presentation title="A New Product" speaker="John Foo" icon="localizer/congress/foo_product.png" date="11717;61200" about="What's this about" location="onArea"/>
</Company>`

Most of this code is self explanatory. There's only some things that should be said:

The Area tag in the example contains a rectangle attribute, instead of rectangle (with format "topLeftPoint;bottomRightPoint" where a point coordinate is separated by commas), it's also possible to use ellipse (with format "centerPoint;width,height"), polyline (a list of points separated by ";") and spot (for single points). For polylines areas, there's also a fill attribute to specify if you just want to draw the lines, or also fill the inside.

Boolean values may use 1/0, yes/no, true/false, on/off, etc.

You can add as many representatives and presentations to a company as you like, and add as many companies as you like.

The date on the presentation tag (which represents the date in which the presentation will begin) is composed of two numbers separated by a ";", the first number is the number of days since 1st January 1970 and the second one is the number of seconds since 00:00 (this way, the first number specifies the date and the second one the time).

The location attribute on the presentation tag specifies where the presentation is held. if can be "onArea", which means it's in the same area of the company's stand, or a point, which tells the exact place where it's held. In a future release, it will be possible to specify also a roomName attribute that would specify a building structure room (conference room usually) where it would be, in the meantime, if the presentation is not in the same stand, you should use location="x,y" to specify the place.

`<Nutrition type="Buffet,Restaurant,Coffee" name="The Best Restaurant in Planet Earth"> <Area ellipse="56,166;8,12"/> <Nutrition>` In this code we see the definition of a restaurant which also has a buffet service and serves coffee. As can be seen, it's possible to specify multiple subtypes for a given "Nutrition" place.

The following table shows the possible tags and whole list of type values (which can be specified separated by commas as shown above):

Tag | Possible Types
--- | ---
Nutrition | Restaurant,Buffet,Coffee,Tea,Selfservice,Pizza,Burger
Organization | Police,Firemen,Security,School,University,Library,Hospital,Sport,Other
Communication | Phone,Internet,Meeting Room,Meeting Point,Fax,Post
Travel | Taxi,Metro,Bus Stop,Bus Station,Rent A Car,Gas Station,Train Stop,Train Station,Airport,Harbour,Hotel,Residence
BuildingStructure | Door,Lift,Stairs,Conference Room,Waiting Room,Dance Hall,Reading Room,Parking,Cash Dispenser,Emergency Exit,Cloak Room,First Aid,Registration,Hall,Wall
CityItem | Museum,Monument,Square,Street,Bridge,Fountain,Park,Church,Cinema,Theatre,Building,BaseMap

Additionally, the Toilet tag allows to specify a hasDisabledPersonsAccess boolean attribute. Note that the CityItem subtype BaseMap has a special meaning as it's used to say where aerial photographs (or pixmaps in general) should be painted. First, the Area inside must be of type rectangle and in this case it can contain a pixmap attribute which says the file that should be painted in the rectangle (it's resized if needed). Then the CityItem tag must contain two attributes maxZoomFactor and minZoomFactor, these are used to tell Localizer between which zoom factor it must draw that pixmap. Localizer supports multiple resolution pixmaps and it loads and unloads from memory pixmaps as needed to always paint the pixmaps with a minimum memory usage and maximum needed quality.

Note also that the first tag in the file should be 'TheLocalizer' and it should contain three attributes . Look at the examples for more information or send me a mail to larrosa@kde.org.

On the development of Localizer

I've tried to integrate Localizer within Qtopia by using its classes as often as possible. For example, I've used QPEApplication, QPEMenuBar and QPEToolBar as well as FileSelector, Config, Resource, AlarmServer, DocLnk, etc.

The dialogs and widgets have all been made using Qt/Designer. I've decided to set a margin of 3 for the dialogs' layout just in order to save valuable screen space for PDAs. The tr method has also been used in order to translate all the strings,

As can be seen in the example 4 (the Map of Málaga), Localizer supports aerial photographs with different resolutions and it loads and unloads them from memory as required by the current zoom factor, memory usage and visible area, to note it, just do zoom in bit by bit and you'll notice that suddenly everything looks more sharp, that's because at that point, localizer decides to use another set of photographs to better see the map.

I should note that I'd have liked to use Qtopia's HelpBrowser for Localizer's help, but given that it wasn't part of the SDK, I thought that it would be better to not rely on it being present on every machine. I'll use it in future versions once Localizer is not part of the contest. Also, my Zaurus arrived with ROM 1.12 installed so I haven't tried Localizer in ROM 1.11 .

Contents