Abstract:
A method for interacting with imagery on a cellular phone, including rendering an image on a display for a cellular phone, detecting that a user has selected an active area of the display using an input device for the cellular phone, and automatically activating a function of the cellular phone corresponding to the active area of the display. A system and a computer readable storage medium are also described and claimed.

Description:
FIELD OF THE INVENTION  
       [0001]     The present invention relates to cell phones that display images.  
       BACKGROUND OF THE INVENTION  
       [0002]     With the advent of color displays on cell phones, and operating systems for developing software applications, digital images are being used on cell phones in a variety of applications. Aside from the aesthetics of images, from the standpoint of information digital images convey a lot of information, much more than can be conveyed with text on the small cell phone displays. A picture&#39;s worth a thousand word. Consider, for example, a cell phone user who wishes to find directions to get from one location to another. An image of a map conveys much more information than a textual description.  
         [0003]     Many cell phones today interact with a user with menu-driven text selections. Such in interface is cumbersome, and often involves many stages of user selection, each stage involving pressing a key or tapping a light pen. Use of images has the advantage of simplifying and accelerating the interface.  
         [0004]     There is thus a need for an interactive imaging applications that enable a cell phone user to find the information he desires in a simple and rapid way, with an intuitive and aesthetic user interface.  
       SUMMARY OF THE DESCRIPTION  
       [0005]     The present invention provides a method and system for interactive imaging on cellular phones. Using the present invention, a cell phone may run software or hardware that enables a user to interactively view virtual tours of various sites, and jump from one tour to another by means of “hot spots”. Hot spots are active areas within a virtual tour that the user can activate in order to jump to a virtual tour specific to the active area. For example, the user can jump from a city map to virtual tours of sites of interest by activating hot spots for the sites that are located within the city map. Moreover, in accordance with a preferred embodiment of the present invention, hot spots can be used to automatically activate functions of the cell phone, such as a dial function. For example, a user viewing a virtual tour of a site can automatically call an office for the site by activating a hot spot within the virtual tour.  
         [0006]     The present invention preferably provides three views within virtual tours; namely, (i) a map view, (ii) an “eye view”, and (iii) a meta-view. Preferably, the map view shows an overall map for a virtual tour, enabling a user to see where the virtual tour is currently located. Preferably, the eye view shows a panoramic scene of a site located within the overall map. The eye view may also show a finer detail map of the site. Preferably, the meta view shows informational text describing the site being virtually toured. The user can toggle between these three views by pressing specific keys on the cell phone keyboard, or by tapping areas of the display with a light pen.  
         [0007]     It may thus be appreciated that the present invention provides the capability for automatically linking functions of a cell phone to hot spots within interactive virtual tours rendered on the cell phone&#39;s display.  
         [0008]     There is thus provided in accordance with a preferred embodiment of the present invention a method for interactive imaging on a cellular phone, including rendering an image on a display for a cellular phone, detecting that a user has selected an active area of the display using an input device for the cellular phone, and automatically activating a function of the cellular phone corresponding to the active area of the display.  
         [0009]     There is moreover provided in accordance with a preferred embodiment of the present invention a system for interactive imaging, including a cellular phone, including a display housed on the cellular phone for displaying an image, and a processor housed inside the cellular phone and coupled to the display for detecting that a user has selected an active area of the display using an input device for the cellular phone, and for automatically activating a function of the cellular phone corresponding to the active area of the display.  
         [0010]     There is further provided in accordance with a preferred embodiment of the present invention a computer-readable storage medium storing program code for causing a computer to perform the steps of rendering an image on a display for a cellular phone, detecting that a user has selected an active area of the display using an input device for the cellular phone, and automatically activating a function of the cellular phone corresponding to the active area of the display.  
         [0011]     There is yet further provided in accordance with a preferred embodiment of the present invention a method for interactive imaging on a cellular phone, including determining whether or not a cellular phone is currently connected to the Internet, if so, then requesting image data from a server computer, receiving the requested image data, rendering an image on a display for the cellular phone, based on local image data stored on the cellular phone and based on the requested image data, else rendering an image on the display for a cellular phone based on local image data stored on the cellular phone, detecting that a user has selected an active area of the display using an input device for the cellular phone, and automatically activating a function of the cellular phone corresponding to the active area of the display.  
         [0012]     There is additionally provided in accordance with a preferred embodiment of the present invention a system for interactive imaging on a cellular phone, including a cellular phone, including a connection detector housed within the cellular phone for determining whether or not the cellular phone is currently connected to the Internet, a transmitter housed within the cellular phone for requesting image data from a server computer, a receiver housed within the cellular phone for receiving the requested image data, a display on the cellular phone for displaying an image, using local image data stored on the cellular phone and using the requested image data, and a processor within said cellular phone coupled with said connection detector, said transmitter, said receiver and said display, for detecting that a user has selected an active area of the display using an input device for the cellular phone, and for automatically activating a function of the cellular phone corresponding to the active area of the display.  
         [0013]     A computer-readable storage medium storing program code for causing a computer to perform the steps of determining whether or not a cellular phone is currently connected to the Internet, if so, then requesting image data from a server computer, receiving the requested image data, rendering an image on a display for the cellular phone, based on local image data stored on the cellular phone and based on the requested image data, else rendering an image on the display for a cellular phone based on local image data stored on the cellular phone, detecting that a user has selected an active area of the display using an input device for the cellular phone, and automatically activating a function of the cellular phone corresponding to the active area of the display..  
     
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0014]     The present invention will be more fully understood and appreciated from the following detailed description, taken in conjunction with the drawings in which:  
         [0015]      FIGS. 1A and 1B  illustrate a Nokia smart cell phone running an interactive imaging application, in accordance with a preferred embodiment of the present invention;  
         [0016]      FIGS. 2A-2G  illustrate a virtual tour of Paddington Station displayed on a cell phone, in accordance with a preferred embodiment of the present invention;  
         [0017]      FIG. 3A-3H  illustrate illustrate a virtual tour of London displayed on a cell phone, in accordance with a preferred embodiment of the present invention; and  
         [0018]      FIGS. 4A-4D  are images used to generate the virtual tour of Paddington Station, in accordance with a preferred embodiment of the present invention. 
     
    
     LIST OF APPENDICES  
       [0019]     Appendices A1-A4 are source listings of XML files used to implement a system for interactive imaging, in accordance with a preferred embodiment of the present invention.  
       DETAILED DESCRIPTION  
       [0020]     The present invention concerns a method and system for interactive imaging on cellular phones.  
         [0021]     The present invention is preferably implemented within a cell phone that includes a central processing unit, memory units for storing programs and data, a keypad and a display. Preferably, the central processing unit, memory units, and device drivers for the keypad and display are coupled communicatively together using a conventional data bus. Preferably the central processing unit runs an operating system such as Symbian OS.  
         [0022]      FIGS. 1A-1G  illustrate operation of the present invention within a Nokia cell phone.  
         [0023]     Reference is now made to  FIG. 1A , which is an illustration of a Nokia Series  60  smart cell phone  100  that includes a keypad  110 , control buttons and a color display  120 . Keypad  110  includes conventional buttons for the ten digits 1-0, and buttons for “*” and “#”. The control buttons include four directional buttons  130 , an “OK” button  140 , and buttons  150  for activating the commands appearing at the bottom left and right of display  120 . It may be appreciated by those skilled in the art that other input devices may be used instead of or in conjunction with keyboard  110  and buttons  130 ,  140  and  150 , such as a light pen for tapping the screen. Such an input device is included, for example, with Sony-Ericsson cell phones.  
         [0024]     Upon startup of cell phone  100 , icons  160  for various applications loaded on the phone appear in display  130 . The currently selected application is identified by a box frame  170  surrounding it. A user can navigate through the various icons by pressing directional buttons  130 . The user can launch the selected application by pressing on the OK button  140 .  
         [0025]     One such icon  160  is for an interactive imaging application named “iSeeVU”, in accordance with a preferred embodiment of the present invention. When iSeeVU is launched, a list of maps appear in display  120 , as shown in  FIG. 1B . Each map is a virtual tour of one or more sites, as described hereinbelow. The currently selected map is indicated by shaded text. The user can navigate up and down through the list of maps by pressing the up and down directional buttons  130 , and can activate the currently selected map by pressing on the “OK” button.  
         [0026]     Reference is now made to  FIG. 2A , which illustrates cell phone  100  with a map for a virtual tour of Paddington appearing in display  120 . The Paddington map is larger than the display area of display  120 , and can be moved left, right, up and down by using the four directional buttons  130 .  
         [0027]     Within the Paddington map are active areas  205  indicated by square icons, referred to as “hot spots”. When a user activates a hot spot, the virtual tour jumps from one display to another, as described hereinbelow. The currently active hot spot  210  is designated by a double-lined thick border  215 . For the map shown in  FIG. 2A , the hot spot for Paddington Station is currently the active hot spot. This is also evidenced by the description  220  at the top of display  120 . Preferably, the user navigates from one hot spot to another by pressing on the “*” key, and the user activates the currently selected hot spot by pressing on the “OK” button.  
         [0028]     Reference is now made to  FIG. 2B , which shows a different currently selected hot spot  225 , described as “St. Mary&#39;s Hospital” at the top of display  120 . Hot spot  225  is located at the intersection of Praed Street and Norfolk in the Paddington map.  
         [0029]     When the user activates hot spot  225 , by pressing on the “OK” button, the virtual tour jumps to a panoramic scene of St. Mary&#39;s Hospital on Praed Street, as illustrated in  FIG. 2C . The changeover from a map view to a panoramic scene, referred to as an “Eye View” is also indicated by the tabs  230  and  235 . Preferably, the user can toggle between the map view and the panoramic scene by pressing the “1” key on keypad  110 . In fact, there is a third view, referred to as a “Meta View” that the user can select, as described below with reference to  FIG. 2F , and the user can toggle between all three views.  
         [0030]     The panoramic scene of St. Mary&#39;s Hospital is larger than can fit within display  120 . Preferably, the user can navigate through the panorama by pressing the directional buttons on the cell phone. Reference is made to  FIG. 2D , which shows a view of St. Mary&#39;s Hospital when the user presses the left directional arrow. The distance that the panorama moves between  FIG. 2C  and  FIG. 2D  is apparent from hot spot  240 . In  FIG. 2C  hot spot  240  is positioned near the center of display  120 , and in  FIG. 2D  hot spot  240  has moved to the right.  
         [0031]     Going back to Paddington Station in  FIG. 2A , when the user activates hot spot  210 , the virtual tour jumps to a panoramic image of Paddington Station, illustrated in  FIG. 2E . Shown in  FIG. 2E  is a hot spot  245  described as “META/General Information” at the top of display  120 . Hot spot  245  is an information hot spot. The user activates hot spot  245  and the view changes from Eye View to Meta View, as illustrated in  FIG. 2F , and as indicated by tabs  235  and  250 . Shown in  FIG. 2F  is informational text, referred to as meta-data, about Paddington Station. Below the information are telephone hot spots  255 , for calling various services related to Paddington Station. Preferably, the user navigates through the telephone hot spots by pressing the “*” key. The currently selected telephone hot spot  260  is indicated by a square frame 265 surrounding it. The user activates the selected telephone hot spot by pressing on the “OK” button.  
         [0032]     Reference is now made to  FIG. 2G , which appears after the user has activated the “Thames Trains” hot spot. The phone number for the Thames Trains appears in display  120 . Cell phone 100 dials the phone number automatically if the user selects “Yes”, by pressing on left button  150 .  
         [0033]     Reference is now made to  FIGS. 3A-3H , which illustrate a virtual tour of London. Such a virtual tour is activated when the user selects “London” from the list of maps shown in  FIG. 1B , and presses the “OK” button.  
         [0034]     Shown in  FIG. 3A  is a map of London with a currently selected hot spot  310  for Greater London, as indicated in the description  320  at the top of cell phone  100 . By pressing on right navigational directional button  130 , the map moves to the right. The movement of the map is evident by the position of hot spot  310  in  FIG. 3A  vis a vis its position in  FIG. 3B .  
         [0035]     The user activates hot spot  310  by pressing on “OK” button  140 , and the virtual tour jumps from a Map View of London to an Eye View of Greater London illustrated in  FIG. 3C . The map in  FIG. 3C  contains various hot spots  330 , the currently selected hotspot  340  for jumping to a map of Waterloo.  
         [0036]     The user activates-hot spot  340  by pressing on “OK” button  140 , and the virtual tour jumps from the Eye View of Greater London to an Eye View of Waterloo illustrated in  FIG. 3D . In turn, the map of Waterloo contains a hot spot  350  for jumping to the Golden Jubilee Bridge.  
         [0037]     The user activates hot spot  350  by pressing on “OK” button  140 , and the virtual tour jumps to a panoramic scene of the Golden Jubilee Bridge shown in  FIG. 3E . The panoramic scene includes a hot spot  360  for jumping back to the Waterloo map. The user navigates through the panoramic image by pressing on directional buttons  130 . The user can also move through hot spots by pressing on the “*” key.  FIG. 3F  shows a section of the panoramic scene that is rotated approximately 90° from the section shown in  FIG. 3E , including a meta-data hot spot  370 .  
         [0038]     The user activates hot spot  370  by pressing on “OK” button  140 , and the information text shown in  FIG. 3G  appears on the display. Shown in  FIG. 3G  is a telephone hot spot  380 , which the user can activate by pressing on “OK” button  140 . When the user activates hot spot  380 , the phone number is displayed as in  FIG. 3H , and the user selects the “Yes” command at the bottom left of the display by pressing on left button  150 . In response, cell phone 100 automatically dials the indicated phone number.  
         [0039]     The present invention is preferably implemented through XML documents that define areas for hot spots and actions to be taken when a hot spot is activated. Reference is now made to Appendix A1, which is a listing of an XML document used to implement the virtual tour of Paddington illustrated in  FIGS. 2A-2G , in accordance with a preferred embodiment of the present invention. As can be seen in the listing, an ImageFile tag references a JPEG image Paddington_map.jpg, which is shown in  FIG. 4A . It is noted that the image has icons for the hot spots embedded within-it.  
         [0040]     The listing in Appendix A also includes a plurality of hot spots. Whenever a user presses the “*” key of the cell phone, he advances through the hot spots. Each hot spot specifies: (i) a rectangular position for the hot spot within the display, based on normalized coordinates; (ii) an XML file for the hot spot; and (iii) a tip, which includes a brief description of the hot spot. Thus the hot spot for St. Mary&#39;s Hospital extends in width from 0.558 to 0.6, and extends in height from 0.620588 to 0.679412. These coordinates are normalized so that the entire display has a width and height of 1. The hot spot for St. Mary&#39;s Hospital references an XML file named st_marys_hospital.xml, and has a tip with text “St. Mary&#39;s Hospital”. Thus, when this hot spot is the currently selected hot spot, the text “St. Mary&#39;s Hospital” appears in the cell phone display, as illustrated in  FIG. 2B . When this hot spot is selected by the user, the virtual tour jumps to the XML file for St. Mary&#39;s Hospital.  
         [0041]     The XML file for St. Mary&#39;s Hospital is listed in Appendix A2, in accordance with a preferred embodiment of the present invention. The listing references a spherical panoramic image, st_marys_hospital.jpg, which is shown in  FIG. 4B . The tag for the panoramic image includes several viewing parameters, such as a vertical field of view and a pitch range. The listing also references two hot spots, one for “Praed South Wharf” and one for Praed London St“. It is noted that the panoramic image has icons for the two hot spots embedded within it.  
         [0042]     The XML file for Paddington Station is listed in Appendix A3, in accordance with a preferred embodiment of the present invention. This file is invoked from the hot spot for Paddington Station listed in Appendix A1. The listing references a spherical panoramic image, paddington_station_interior.jpg, which is shown in  FIG. 4C . The listing in Appendix A3 indicates two hot spots, one designated “Walkway to Praed St.” and one designated “META/General Information.txt”. The general information text file includes the text illustrated in  FIG. 2F . The graphic for the telephone hot spots is shown in  FIG. 4D .  
         [0043]     The automatic dialing of the cellular phone is preferably implemented through the Symbian operating system functions call.OpenNewCall(line, newCallName) and call.Dial(aPhoneNumber), where line is an instance of Symbian class RLine, and call is an instance of Symbian class RCall.  
         [0044]     In reading the above description, persons skilled in the art will realize that there are many apparent variations that can be applied to the methods and systems described. Thus, although the present specification describes interactive imaging for image content that is already stored in the cell phone, in an alternative embodiment the image content may be dynamically downloaded from a server computer. Specifically, when the cell phone user downloads the iSeeVU software application, illustrated in  FIG. 1A , from a server computer, the download may include all of the image content, part of the image content, or none of the image content. Furthermore, when the cell phone runs the iSeeVU application, it may or may not be connected to the Internet. If the cell phone is not connected to the Internet, then it runs the iSeeVU application using whatever local content is available. If the cell phone is connected to the Internet, then it downloads content from a server, either by the cell phone pulling content on demand or by the server pushing content to the cell phone.  
         [0045]     The ability to download content dynamically enables additional functionality, including inter alia the ability to make custom content available to users based on user profiles, and the ability to regularly change content.  
         [0046]     In the foregoing specification, the invention has been described with reference to specific exemplary embodiments thereof. It will, however, be evident that various modifications and changes may be made to the specific exemplary embodiments without departing from the broader spirit and scope of the invention as set forth in the appended claims. Accordingly, the specification and drawings are to be regarded in an illustrative rather than a restrictive sense.  
               APPENDIX A1                           &lt;?xml version=“1.0” ?&gt;       &lt;VirtualTourLocation&gt;        &lt;ImageNavigator&gt;         &lt;ImageFile&gt;PHOTOS/paddington_map.jpg&lt;/ImageFile&gt;         &lt;ViewerType&gt;J2D&lt;/ViewerType&gt;        &lt;/ImageNavigator&gt;        &lt;Hotspot&gt;         &lt;Position&gt;0.26 0.688235 0.302 0.750035&lt;/Position&gt;        &lt;XMLSource&gt;XML/paddington_station_interior.xml&lt;/XMLSource&gt;          &lt;Tip&gt;Paddington Station&lt;/Tip&gt;        &lt;/Hotspot&gt;        &lt;Hotspot&gt;         &lt;Position&gt;0.74 0.370588 0.78 0.432353&lt;/Position&gt;         &lt;XMLSource&gt;XML/sale_place.xml&lt;/XMLSource&gt;         &lt;Tip&gt;Sale Place&lt;/Tip&gt;        &lt;/Hotspot&gt;        &lt;Hotspot&gt;         &lt;Position&gt;0.67 0.461765 0.712 0.523529&lt;/Position&gt;         &lt;XMLSource&gt;XML/south_wharf_road.xml&lt;/XMLSource&gt;         &lt;Tip&gt;South Wharf&lt;/Tip&gt;        &lt;/Hotspot&gt;        &lt;Hotspot&gt;         &lt;Position&gt;0.558 0.620588 0.6 0.679412&lt;/Position&gt;         &lt;XMLSource&gt;XML/st_marys_hospital.xml&lt;/XMLSource&gt;         &lt;Tip&gt;St. Mary&#39;s Hospital&lt;/Tip&gt;        &lt;/Hotspot&gt;        &lt;Hotspot&gt;         &lt;Position&gt;0.346 0.752941 0.388 0.814706&lt;/Position&gt;         &lt;XMLSource&gt;XML/london_street.xml&lt;/XMLSource&gt;         &lt;Tip&gt;London St&lt;/Tip&gt;        &lt;/Hotspot&gt;        &lt;Hotspot&gt;         &lt;Position&gt;0.836 0.220588 0.878 0.282388&lt;/Position&gt;        &lt;XMLSource&gt;XML/hilton_london_metropole.xml&lt;/XMLSource&gt;         &lt;Tip&gt;Hilton London Metropole&lt;/Tip&gt;        &lt;/Hotspot&gt;       &lt;/VirtualTourLocation&gt;                  
 
         [0047]    
       
         
               
               
             
           
               
                   
                 APPENDIX A2 
               
               
                   
                   
               
               
                   
                   
               
             
             
               
                   
                 &lt;?xml version=“1.0” ?&gt; 
               
               
                   
                 &lt;VirtualTourLocation&gt; 
               
               
                   
                  &lt;ImageNavigator&gt; 
               
               
                   
                   &lt;ImageFile&gt;PHOTOS/st_marys_hospital.jpg&lt;/ImageFile&gt; 
               
               
                   
                   &lt;ViewerType&gt;Pano&lt;/ViewerType&gt; 
               
               
                   
                   &lt;panotype&gt;SPHERE&lt;/panotype&gt; 
               
               
                   
                   &lt;pitchRange&gt;−0.231 0.231&lt;/pitchRange&gt; 
               
               
                   
                   &lt;vFov&gt;−0.231 0.231&lt;/vFov&gt; 
               
               
                   
                   &lt;initialView&gt;0.00286517 84.7636 26.4649&lt;/initialView&gt; 
               
               
                   
                   &lt;Autospin&gt;0&lt;/Autospin&gt; 
               
               
                   
                  &lt;/ImageNavigator&gt; 
               
               
                   
                  &lt;Hotspot&gt; 
               
               
                   
                   &lt;XMLSource&gt;XML/south_wharf_road.xml&lt;/XMLSource&gt; 
               
               
                   
                   &lt;Position&gt;0.21572 0.730924 0.231289 0.904535&lt;/Position&gt; 
               
               
                   
                   &lt;Tip&gt;Praed South Wharf&lt;/Tip&gt; 
               
               
                   
                  &lt;/Hotspot&gt; 
               
               
                   
                  &lt;Hotspot&gt; 
               
               
                   
                   &lt;XMLSource&gt;XML/london_street.xml&lt;/XMLSource&gt; 
               
               
                   
                   &lt;Position&gt;0.752424 0.823293 0.767659 0.995984&lt;/Position&gt; 
               
               
                   
                   &lt;Tip&gt;Praed London St&lt;/Tip&gt; 
               
               
                   
                  &lt;/Hotspot&gt; 
               
               
                   
                 &lt;/VirtualTourLocation&gt; 
               
               
                   
                   
               
             
          
         
       
     
         [0048]    
       
         
               
             
           
               
                 APPENDIX A3 
               
               
                   
               
               
                   
               
             
             
               
                 &lt;?xml version=“1.0” ?&gt; 
               
               
                 &lt;VirtualTourLocation&gt; 
               
               
                  &lt;ImageNavigator&gt; 
               
               
                   &lt;ImageFile&gt;PHOTOS/paddington_station_interior.jpg&lt;/ImageFile&gt; 
               
               
                   &lt;ViewerType&gt;Pano&lt;/ViewerType&gt; 
               
               
                   &lt;panotype&gt;SPHERE&lt;/panotype&gt; 
               
               
                   &lt;pitchRange&gt;−0.236 0.236&lt;/pitchRange&gt; 
               
               
                   &lt;vFov&gt;−0.236 0.236&lt;/vFov&gt; 
               
               
                   &lt;initialView&gt;0.00286517 148.971 27.0379&lt;/initialView&gt; 
               
               
                   &lt;Autospin&gt;0&lt;/Autospin&gt; 
               
               
                  &lt;/ImageNavigator&gt; 
               
               
                  &lt;Hotspot&gt; 
               
               
                   &lt;XMLSource&gt;XML/london_street.xml&lt;/XMLSource&gt; 
               
               
                   &lt;Position&gt;0.380086 0.650602 0.395028 0.817046&lt;/Position&gt; 
               
               
                   &lt;Tip&gt;Walkway To Praed St.&lt;/Tip&gt; 
               
               
                  &lt;/Hotspot&gt; 
               
               
                  &lt;Hotspot&gt; 
               
               
                   &lt;XMLSource&gt;XML/paddington_GenInfo_meta.xml&lt;/XMLSource&gt; 
               
               
                   &lt;Position&gt;0.292291 0.666667 0.308291 0.847667&lt;/Position&gt; 
               
               
                   &lt;Tip&gt;META\General Information.txt&lt;/Tip&gt; 
               
               
                  &lt;/Hotspot&gt; 
               
               
                 &lt;/VirtualTourLocation&gt; 
               
               
                   
               
             
          
         
       
     
         [0049]    
       
         
               
             
           
               
                 APPENDIX A4 
               
               
                   
               
               
                   
               
             
             
               
                 &lt;?xml version=“1.0” ?&gt; 
               
               
                 &lt;VirtualTourLocation&gt; 
               
               
                  &lt;ImageNavigator&gt; 
               
               
                   &lt;ImageFile&gt;PHOTOS/paddington_GenInfo_meta.jpg&lt;/ImageFile&gt; 
               
               
                   &lt;ViewerType&gt;J2D&lt;/ViewerType&gt; 
               
               
                  &lt;/ImageNavigator&gt; 
               
               
                  &lt;Hotspot&gt; 
               
               
                   &lt;XMLSource&gt;XML/paddington_station_interior.xml&lt;/ 
               
               
                   XMLSource&gt; 
               
               
                   &lt;Position&gt;0.0148 0.111 0.0529 0.444&lt;/Position&gt; 
               
               
                   &lt;Tip&gt;Phone / +44 8457 484950&lt;/Tip&gt; 
               
               
                  &lt;/Hotspot&gt; 
               
               
                  &lt;Hotspot&gt; 
               
               
                   &lt;XMLSource&gt;XML/paddington_station_interior.xml&lt;/ 
               
               
                   XMLSource&gt; 
               
               
                   &lt;Position&gt;0.229 0.143 0.2682 0.461&lt;/Position&gt; 
               
               
                   &lt;Tip&gt;Phone / +44 8456 005604&lt;/Tip&gt; 
               
               
                  &lt;/Hotspot&gt; 
               
               
                  &lt;Hotspot&gt; 
               
               
                   &lt;XMLSource&gt;XML/paddington_station_interior.xml&lt;/ 
               
               
                   XMLSource&gt; 
               
               
                   &lt;Position&gt;0.403 0.127 0.4423 0.445&lt;/Position&gt; 
               
               
                   &lt;Tip&gt;Phone / +44 8456 001515&lt;/Tip&gt; 
               
               
                  &lt;/Hotspot&gt; 
               
               
                  &lt;Hotspot&gt; 
               
               
                   &lt;XMLSource&gt;XML/paddington_station_interior.xml&lt;/ 
               
               
                   XMLSource&gt; 
               
               
                   &lt;Position&gt;0.564 0.143 0.6032 0.461&lt;/Position&gt; 
               
               
                   &lt;Tip&gt;Phone / +44 8453 303728&lt;/Tip&gt; 
               
               
                  &lt;/Hotspot&gt; 
               
               
                  &lt;Hotspot&gt; 
               
               
                   &lt;XMLSource&gt;XML/paddington_station_interior.xml&lt;/ 
               
               
                   XMLSource&gt; 
               
               
                   &lt;Position&gt;0.71 0.111 0.7492 0.444&lt;/Position&gt; 
               
               
                   &lt;Tip&gt;Phone / +44 2072 620344&lt;/Tip&gt; 
               
               
                  &lt;/Hotspot&gt; 
               
               
                  &lt;Hotspot&gt; 
               
               
                   &lt;XMLSource&gt;XML/paddington_station_interior.xml&lt;/ 
               
               
                   XMLSource&gt; 
               
               
                   &lt;Position&gt;0.852 0.127 0.8914 0.445&lt;/Position&gt; 
               
               
                   &lt;Tip&gt;Phone / +44 2072 620344&lt;/Tip&gt; 
               
               
                  &lt;/Hotspot&gt; 
               
               
                 &lt;/VirtualTourLocation&gt; 
               
               
                   
               
             
          
         
       
     
         [0050]    
       
         
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
             
           
               
                 APPENDIX B1 
               
               
                   
               
               
                   
               
             
             
               
                 const TInt KMaxPhoneLength = 0x10; 
               
               
                 CHintController::CHintController( ): 
               
             
          
           
               
                   
                 ipProjectManager(NULL), 
               
               
                   
                 ipDrawEngine(NULL), 
               
               
                   
                 ipProjectSniffler(NULL) 
               
             
          
           
               
                 { 
               
               
                 } 
               
               
                 CHintController::˜CHintController( ) 
               
               
                 { 
               
             
          
           
               
                   
                 delete ipProjectManager; 
               
               
                   
                 delete ipProjectSniffler; 
               
               
                   
                 delete ipDrawEngine; 
               
               
                   
                 delete iScrollTimer; 
               
               
                   
                 delete iLogFile; 
               
             
          
           
               
                 } 
               
               
                 void CHintController::ConstructL( ) 
               
               
                 { 
               
             
          
           
               
                   
                 ipProjectSniffler = CHintProjectSniffler::NewL( ); 
               
               
                   
                 if(!ipProjectSniffler-&gt;Sniff(KDataDirectoryC)) 
               
             
          
           
               
                   
                 if(!ipProjectSniffler-&gt;Sniff(KDataDirectoryD)) 
               
               
                   
                 if(!ipProjectSniffler-&gt;Sniff(KDataDirectoryE)) 
               
             
          
           
               
                   
                 { 
               
             
          
           
               
                   
                 ShowErrorDialog(KNoContentErrorMsgLn1, 
               
             
          
           
               
                 KNoContentErrorMsgLn2); 
               
             
          
           
               
                   
                 ExitApplication( ); 
               
               
                   
                 return; 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                   
                 TFileName chosenProjDir; 
               
               
                   
                 if(!ChooseProjectL(chosenProjDir)) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ExitApplication( ); 
               
               
                   
                 return; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 ipProjectManager = CHintProjectManager::NewL(chosenProjDir); 
               
               
                   
                 ipProjectManager-&gt;LoadVTourL( ); 
               
               
                   
                 ipDrawEngine = CHintDrawEngine::NewL( ); 
               
               
                   
                 ipDrawEngine-&gt;SetProject(ipProjectManager); 
               
               
                   
                 ipDrawEngine-&gt;SetController(this); 
               
               
                   
                 iPenDown = false; 
               
               
                   
                 iPenDrag = false; 
               
               
                   
                 iPenUp = false; 
               
               
                   
                 iScrollTimer = CPeriodic::NewL(CActive::EPriorityStandard); 
               
               
                   
                 iPointerEventDown.iPosition.iX = 0; 
               
               
                   
                 iPointerEventDown.iPosition.iY = 0; 
               
               
                   
                 iPointerEventDrag.iPosition.iX = 0; 
               
               
                   
                 iPointerEventDrag.iPosition.iY = 0; 
               
               
                   
                 iPointerEventUp.iPosition.iX = 0; 
               
               
                   
                 iPointerEventUp.iPosition.iY = 0; 
               
             
          
           
               
                 } 
               
               
                 TBool CHintController::ChooseProjectL(TFileName&amp; chosenProjDir, TBool bAddCrtNb) 
               
               
                 { 
               
             
          
           
               
                   
                 TBool bOk = true; 
               
               
                   
                 RArray&lt;TName&gt; projects; 
               
               
                   
                 CleanupClosePushL(projects); 
               
               
                   
                 ipProjectSniffler-&gt;GetProjects(projects); 
               
               
                   
                 if(projects.Count( ) == 1) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ipProjectSniffler-&gt;GetProjectDir(projects[0], chosenProjDir); 
               
               
                   
                 CleanupStack::PopAndDestroy( ); 
               
               
                   
                 return bOk; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 CDesCArrayFlat* items = new(ELeave) CDesCArrayFlat(projects.Count( )); 
               
               
                   
                 CleanupStack::PushL(items); 
               
               
                   
                 for(int i = 0; i &lt; projects.Count( ); i++) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 TName name; 
               
               
                   
                 if(bAddCrtNb) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 name.AppendNum(i + 1); 
               
               
                   
                 name.Append(_L(“\t”)); 
               
             
          
           
               
                   
                 } 
               
               
                   
                 name.Append(projects[i]); 
               
               
                   
                 items-&gt;AppendL(name); 
               
             
          
           
               
                   
                 } 
               
               
                   
                 TInt nChosenProj = 0; 
               
               
                   
                 if(GetUserChosenProject(nChosenProj, items)) 
               
             
          
           
               
                   
                 ipProjectSniffler-&gt;GetProjectDir(projects[nChosenProj], chosenProjDir); 
               
             
          
           
               
                   
                 else 
               
             
          
           
               
                   
                 bOk = false; 
               
             
          
           
               
                   
                 items-&gt;Reset( ); 
               
               
                   
                 CleanupStack::PopAndDestroy( ); 
               
               
                   
                 CleanupStack::PopAndDestroy( ); 
               
               
                   
                 return bOk; 
               
             
          
           
               
                 } 
               
               
                 TKeyResponse CHintController::HandleKeyEventL(const TKeyEvent&amp; aKeyEvent, 
               
               
                 TEventCode aType) 
               
               
                 { 
               
             
          
           
               
                   
                 TKeyResponse keyResponse = EKeyWasConsumed; 
               
               
                   
                 TInt active = GetActiveViewIndex( ); 
               
               
                   
                 TInt count = GetViewCount( ); 
               
               
                   
                 if(aType != EEventKey) 
               
             
          
           
               
                   
                 return EKeyWasNotConsumed; 
               
             
          
           
               
                   
                 TFileName metaFileName; 
               
               
                   
                 ipProjectManager-&gt;GetProjectDirectory(metaFileName); 
               
               
                   
                 switch (aKeyEvent.iScanCode) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 case EStdKeyUpArrow: 
               
             
          
           
               
                   
                 ipDrawEngine-&gt;ScrollUp( ); 
               
               
                   
                 break; 
               
             
          
           
               
                   
                 case EStdKeyDownArrow: 
               
             
          
           
               
                   
                 ipDrawEngine-&gt;ScrollDown( ); 
               
               
                   
                 break; 
               
             
          
           
               
                   
                 case EStdKeyLeftArrow: 
               
             
          
           
               
                   
                 ipDrawEngine-&gt;ScrollLeft( ); 
               
               
                   
                 break; 
               
             
          
           
               
                   
                 case EStdKeyRightArrow: 
               
             
          
           
               
                   
                 ipDrawEngine-&gt;ScrollRight( ); 
               
               
                   
                 break; 
               
             
          
           
               
                   
                 case 49: 
               
               
                   
                 case 48: 
               
               
                   
                 case 51: 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ipDrawEngine-&gt;ClearCache( ); 
               
               
                   
                 if(aKeyEvent.iScanCode == 49) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 active−−; 
               
               
                   
                 active = active &lt; 0 ? count − 1 : active; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else 
               
               
                   
                 { 
               
             
          
           
               
                   
                 active++; 
               
               
                   
                 active = active % count; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 DisplayViewNameByIndex(active); 
               
               
                   
                 PrepareViewToActivate(active); 
               
               
                   
                 SetActiveViewByIndex(active); 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                   
                 break; 
               
             
          
           
               
                   
                 case EStdKeyNkpAsterisk: 
               
               
                   
                 case 42: 
               
               
                   
                 case EStdKeyHash: 
               
               
                   
                 case EStdKeyNkpMinus: 
               
             
          
           
               
                   
                 ipProjectManager-&gt;GetCrtGallery( )-&gt;inCrtHotSpot = 
               
             
          
           
               
                 ipProjectManager-&gt;GetCrtGallery( )-&gt;GetNextHotSpot(aKeyEvent.iScanCode == 42 ∥ 
               
               
                 aKeyEvent.iScanCode == EStdKeyNkpAsterisk); 
               
             
          
           
               
                   
                 ShowTooltip(ipProjectManager-&gt;GetCrtGallery( )- 
               
             
          
           
               
                 &gt;GetCrtHotSpot( )-&gt;iTip); 
               
             
          
           
               
                   
                 ipDrawEngine-&gt;Update( ); 
               
               
                   
                 break; 
               
             
          
           
               
                   
                 case EStdKeyDevice3: 
               
             
          
           
               
                   
                 if(active == 0) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ipDrawEngine-&gt;ClearCache( ); 
               
               
                   
                 CHintHotSpot* pCrtHotSpot = ipProjectManager- 
               
             
          
           
               
                 &gt;GetCrtGallery( )-&gt;GetCrtHotSpot( ); 
               
             
          
           
               
                   
                 bool bMetaSpot = false; 
               
               
                   
                 TFileName&amp; tip = pCrtHotSpot-&gt;iTip; 
               
               
                   
                 if(tip.Find(KMetaFileTag) != KErrNotFound) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 bMetaSpot = true; 
               
               
                   
                 metaFileName.Append(tip); 
               
               
                   
                 MetaViewSetFileNameL(metaFileName); 
               
             
          
           
               
                   
                 } 
               
               
                   
                 TFileName&amp; link = pCrtHotSpot-&gt;iLink; 
               
               
                   
                 if(!ipProjectManager-&gt;GalleryIsLoaded(link)) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ipProjectManager-&gt;LoadVTourLocationL(link); 
               
               
                   
                 ipProjectManager-&gt;SetCrtGallery(link); 
               
               
                   
                 ipDrawEngine-&gt;ibCenterToCrtHotSpot = true; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else 
               
               
                   
                 { 
               
               
                   
                 TFileName&amp; crtGalleryName = ipProjectManager- 
               
             
          
           
               
                 &gt;GetCrtGallery( )-&gt;iXMLFileName; 
               
             
          
           
               
                   
                 if(link != crtGalleryName) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ipProjectManager-&gt;SetCrtGallery(link); 
               
               
                   
                 ipDrawEngine-&gt;ibCenterToCrtHotSpot = true; 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                   
                 } 
               
               
                   
                 TInt active = 1; 
               
               
                   
                 if(bMetaSpot) 
               
             
          
           
               
                   
                 active = 2; 
               
             
          
           
               
                   
                 DisplayViewNameByIndex(active); 
               
               
                   
                 SetActiveViewByIndex(active); 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else if(active == 1) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ipDrawEngine-&gt;ClearCache( ); 
               
               
                   
                 CHintHotSpot* pCrtHotSpot = ipProjectManager- 
               
             
          
           
               
                 &gt;GetCrtGallery( )-&gt;GetCrtHotSpot( ); 
               
             
          
           
               
                   
                 bool bMetaSpot = false; 
               
               
                   
                 TFileName&amp; tip = pCrtHotSpot-&gt;iTip; 
               
               
                   
                 if(tip.Find(KMetaFileTag) != KErrNotFound) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 bMetaSpot = true; 
               
               
                   
                 metaFileName.Append(tip); 
               
               
                   
                 MetaViewSetFileNameL(metaFileName); 
               
             
          
           
               
                   
                 } 
               
               
                   
                 TFileName&amp; link = pCrtHotSpot-&gt;iLink; 
               
               
                   
                 if(!ipProjectManager-&gt;GalleryIsLoaded(link)) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ipProjectManager-&gt;LoadVTourLocationL(link); 
               
               
                   
                 ipProjectManager-&gt;SetCrtGallery(link); 
               
               
                   
                 ipDrawEngine-&gt;ibCenterToCrtHotSpot = true; 
               
               
                   
                 if(!bMetaSpot) 
               
             
          
           
               
                   
                 ipDrawEngine-&gt;Update( ); 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else 
               
               
                   
                 { 
               
             
          
           
               
                   
                 TFileName&amp; crtGalleryName = ipProjectManager- 
               
             
          
           
               
                 &gt;GetCrtGallery( )-&gt;iXMLFileName; 
               
             
          
           
               
                   
                 if(link != crtGalleryName) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ipProjectManager-&gt;SetCrtGallery(link); 
               
               
                   
                 ipDrawEngine-&gt;ibCenterToCrtHotSpot = true; 
               
               
                   
                 if(!bMetaSpot) 
               
               
                   
                 ipDrawEngine-&gt;Update( ); 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else 
               
               
                   
                 { 
               
             
          
           
               
                   
                 keyResponse = EKeyWasNotConsumed; 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                   
                 } 
               
               
                   
                 if(bMetaSpot) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 active = 2; 
               
               
                   
                 SetActiveViewByIndex(active); 
               
             
          
           
               
                   
                 } 
               
               
                   
                 } 
               
               
                   
                 else if( active == 2 ) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 CHintHotSpot* pCrtHotSpot = ipProjectManager- 
               
             
          
           
               
                 &gt;GetCrtGallery( )-&gt;GetCrtHotSpot( ); 
               
             
          
           
               
                   
                 TFileName&amp; tip = pCrtHotSpot-&gt;iTip; 
               
               
                   
                 TInt pos = tip.Find(KMetaPhoneTag); 
               
               
                   
                 if(pos != KErrNotFound) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 pos += KMetaPhoneTag( ).Length( ); 
               
               
                   
                 TInt phoneNbLength = tip.Length( ) − pos; 
               
               
                   
                 TBuf&lt;KMaxPhoneLength&gt; buf; 
               
               
                   
                 buf = tip.Right(phoneNbLength); 
               
               
                   
                 if(!ConfirmDialog(tip, KDialConfMsg)) 
               
             
          
           
               
                   
                 break; 
               
             
          
           
               
                   
                 TRAPD(err, DialNumberL(buf); ); 
               
               
                   
                 if (err) 
               
             
          
           
               
                   
                 User::InfoPrint(_L(“Error dialing”)); 
               
             
          
           
               
                   
                 break; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else if(tip.Find(KMetaEmailTag) != KErrNotFound) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 break; 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                   
                 default: 
               
             
          
           
               
                   
                 keyResponse = EKeyWasNotConsumed; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 return keyResponse; 
               
             
          
           
               
                 } 
               
               
                 void CHintController::PrepareViewToActivate(TInt active) 
               
               
                 { 
               
             
          
           
               
                   
                 if(active == 0) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 HBufC* locationName = HBufC::NewLC(ipProjectManager- 
               
             
          
           
               
                 &gt;GetCrtGallery( )-&gt;iXMLFileName.Length( )); 
               
             
          
           
               
                   
                 *locationName = ipProjectManager-&gt;GetCrtGallery( )-&gt;iXMLFileName; 
               
               
                   
                 TFileName map; 
               
               
                   
                 ipProjectManager-&gt;GetStartupLocation(map); 
               
               
                   
                 if(!ipProjectManager-&gt;GalleryIsLoaded(map)) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ipProjectManager-&gt;LoadVTourLocationL(map); 
               
               
                   
                 ipProjectManager-&gt;SetCrtGallery(map); 
               
               
                   
                 ipDrawEngine-&gt;ibCenterToCrtHotSpot = true; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ipProjectManager-&gt;SetCrtGallery(map); 
               
               
                   
                 ipDrawEngine-&gt;ibCenterToCrtHotSpot = true; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 ipProjectManager-&gt;GetCrtGallery( )- 
               
             
          
           
               
                 &gt;SetCurrentHotSpotByLink(*locationName); 
               
             
          
           
               
                   
                 CleanupStack::PopAndDestroy(locationName); 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else if(active == 1) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 CHintHotSpot* pCrtHotSpot = ipProjectManager-&gt;GetCrtGallery( )- 
               
             
          
           
               
                 &gt;GetCrtHotSpot( ); 
               
             
          
           
               
                   
                 TFileName&amp; link = pCrtHotSpot-&gt;iLink; 
               
               
                   
                 if(!ipProjectManager-&gt;GalleryIsLoaded(link)) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ipProjectManager-&gt;LoadVTourLocationL(link); 
               
               
                   
                 ipProjectManager-&gt;SetCrtGallery(link); 
               
               
                   
                 ipDrawEngine-&gt;ibCenterToCrtHotSpot = true; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ipProjectManager-&gt;SetCrtGallery(link); 
               
               
                   
                 ipDrawEngine-&gt;ibCenterToCrtHotSpot = true; 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else if(active == 2) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 CHintHotSpot* pCrtHotSpot = ipProjectManager-&gt;GetCrtGallery( )- 
               
             
          
           
               
                 &gt;GetCrtHotSpot( ); 
               
             
          
           
               
                   
                 TFileName&amp; tip = pCrtHotSpot-&gt;iTip; 
               
               
                   
                 TFileName&amp; link = pCrtHotSpot-&gt;iLink; 
               
               
                   
                 TFileName metaFileName; 
               
               
                   
                 ipProjectManager-&gt;GetProjectDirectory(metaFileName); 
               
               
                   
                 metaFileName.Append(tip); 
               
               
                   
                 MetaViewSetFileNameL(metaFileName); 
               
               
                   
                 MetaViewUseDrawEngine(tip.Find(KMetaFileTag) != KErrNotFound); 
               
               
                   
                 if(!ipProjectManager-&gt;GalleryIsLoaded(link)) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ipProjectManager-&gt;LoadVTourLocationL(link); 
               
               
                   
                 ipProjectManager-&gt;SetCrtGallery(link); 
               
               
                   
                 ipDrawEngine-&gt;ibCenterToCrtHotSpot = true; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ipProjectManager-&gt;SetCrtGallery(link); 
               
               
                   
                 ipDrawEngine-&gt;ibCenterToCrtHotSpot = true; 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                 } 
               
               
                 void CHintController::HandlePointerEventL(const TPointerEvent&amp; aPointerEvent) 
               
               
                 { 
               
             
          
           
               
                   
                 switch(aPointerEvent.iType) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 case TPointerEvent::EButton1Down: 
               
             
          
           
               
                   
                 iPenDown = true; 
               
               
                   
                 iPenDrag = false; 
               
               
                   
                 iPointerEventDown = aPointerEvent; 
               
               
                   
                 iPointerEventDrag = aPointerEvent; 
               
               
                   
                 break; 
               
             
          
           
               
                   
                 case TPointerEvent::EDrag: 
               
             
          
           
               
                   
                 if(!iPenDown) 
               
             
          
           
               
                   
                 return;. 
               
             
          
           
               
                   
                 iPenDrag = true; 
               
               
                   
                 { 
               
             
          
           
               
                   
                 TStdScanCode direction = 
               
             
          
           
               
                 CheckPenDragDirection(iPointerEventDrag, aPointerEvent); 
               
             
          
           
               
                   
                 switch (direction) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 case EStdKeyUpArrow: 
               
             
          
           
               
                   
                 ipDrawEngine-&gt;ScrollDown( ); 
               
               
                   
                 break; 
               
             
          
           
               
                   
                 case EStdKeyDownArrow: 
               
             
          
           
               
                   
                 ipDrawEngine-&gt;ScrollUp( ); 
               
               
                   
                 break; 
               
             
          
           
               
                   
                 case EStdKeyLeftArrow: 
               
             
          
           
               
                   
                 ipDrawEngine-&gt;ScrollRight( ); 
               
               
                   
                 break; 
               
             
          
           
               
                   
                 case EStdKeyRightArrow: 
               
             
          
           
               
                   
                 ipDrawEngine-&gt;ScrollLeft( ); 
               
               
                   
                 break; 
               
             
          
           
               
                   
                 default: 
               
             
          
           
               
                   
                 iPenDrag = false; 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                   
                 } 
               
               
                   
                 iPointerEventDrag = aPointerEvent; 
               
               
                   
                 break; 
               
             
          
           
               
                   
                 case TPointerEvent::EButton1Up: 
               
             
          
           
               
                   
                 if(iPenDrag &amp;&amp; iScrollTimer &amp;&amp; iScrollTimer-&gt;IsActive( )) 
               
             
          
           
               
                   
                 iScrollTimer-&gt;Cancel( ); 
               
             
          
           
               
                   
                 if(!iPenDrag) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 TPoint imagePos(0,0); 
               
               
                   
                 ipDrawEngine-&gt;ImagePosFromScreenPos(imagePos, 
               
             
          
           
               
                 aPointerEvent.iPosition); 
               
             
          
           
               
                   
                 TInt nTappedSpot = ipProjectManager-&gt;GetCrtGallery( )- 
               
             
          
           
               
                 &gt;GetHotSpotFromPos(imagePos); 
               
             
          
           
               
                   
                 if(nTappedSpot != −1) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ipProjectManager-&gt;GetCrtGallery( )-&gt;inCrtHotSpot = 
               
             
          
           
               
                 nTappedSpot; 
               
             
          
           
               
                   
                 ShowTooltip(ipProjectManager-&gt;GetCrtGallery( )- 
               
             
          
           
               
                 &gt;GetCrtHotSpot( )-&gt;iTip); 
               
             
          
           
               
                   
                 ipDrawEngine-&gt;ibCenterToCrtHotSpot = false; 
               
               
                   
                 ipDrawEngine-&gt;Update( ); 
               
               
                   
                 TKeyEvent aKeyEvent = {0}; 
               
               
                   
                 aKeyEvent.iScanCode = EStdKeyDevice3; 
               
               
                   
                 TEventCode aType; 
               
               
                   
                 aType = EEventKey; 
               
               
                   
                 HandleKeyEventL(aKeyEvent, aType); 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                   
                 } 
               
               
                   
                 iPenDown = false; 
               
               
                   
                 iPenDrag = false; 
               
               
                   
                 iPointerEventUp = aPointerEvent; 
               
               
                   
                 iPointerEventDrag.iPosition.iX = 0; 
               
               
                   
                 iPointerEventDrag.iPosition.iY = 0; 
               
               
                   
                 break; 
               
             
          
           
               
                   
                 default: 
               
             
          
           
               
                   
                 { 
               
             
          
           
               
                   
                 TInt dummy = 1; 
               
               
                   
                 dummy++; 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                 } 
               
               
                 void CHintController::HandleUserTabSwitchEventL( ) 
               
               
                 { 
               
             
          
           
               
                   
                 if(ipDrawEngine) 
               
             
          
           
               
                   
                 ipDrawEngine-&gt;ClearCache( ); 
               
             
          
           
               
                   
                 TInt index = GetActiveViewIndex( ); 
               
               
                   
                 PrepareViewToActivate(index); 
               
               
                   
                 SetActiveViewByIndex(index); 
               
             
          
           
               
                 } 
               
               
                 TInt CHintController::ScrollTimerCallBack(TAny*) 
               
               
                 { 
               
             
          
           
               
                   
                 return 0; 
               
             
          
           
               
                 } 
               
               
                 TStdScanCode CHintController::CheckPenDragDirection(const TPointerEvent&amp; 
               
               
                 aPointerEventDrag1, const TPointerEvent&amp; aPointerEventDrag2) 
               
               
                 { 
               
             
          
           
               
                   
                 TStdScanCode direction = EStdKeyNull; 
               
               
                   
                 TPoint delta = aPointerEventDrag2.iPosition − aPointerEventDrag1.iPosition; 
               
               
                   
                 if(delta.iX == 0 &amp;&amp; delta.iY == 0) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 direction = EStdKeyNull; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else if(delta.iX &gt;= 0 &amp;&amp; delta.iY &gt;= 0) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 if(delta.iX &gt; delta.iY) 
               
             
          
           
               
                   
                 direction = EStdKeyRightArrow; 
               
             
          
           
               
                   
                 else 
               
             
          
           
               
                   
                 direction = EStdKeyDownArrow; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else if(delta.iX &gt;= 0 &amp;&amp; delta.iY &lt;= 0) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 delta.iY = −delta.iY; 
               
               
                   
                 if(delta.iX &gt; delta.iY) 
               
             
          
           
               
                   
                 direction = EStdKeyRightArrow; 
               
             
          
           
               
                   
                 else 
               
             
          
           
               
                   
                 direction = EStdKeyUpArrow; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else if(delta.iX &lt;= 0 &amp;&amp; delta.iY &lt;= 0) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 delta.iX = −delta.iX; 
               
               
                   
                 delta.iY = −delta.iY; 
               
               
                   
                 if(delta.iX &gt; delta.iY) 
               
             
          
           
               
                   
                 direction = EStdKeyLeftArrow; 
               
             
          
           
               
                   
                 else 
               
             
          
           
               
                   
                 direction = EStdKeyUpArrow; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else if(delta.iX &lt;= 0 &amp;&amp; delta.iY &gt;= 0) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 delta.iX = −delta.iX; 
               
               
                   
                 if(delta.iX &gt; delta.iY) 
               
             
          
           
               
                   
                 direction = EStdKeyLeftArrow; 
               
             
          
           
               
                   
                 else 
               
             
          
           
               
                   
                 direction = EStdKeyDownArrow; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 return direction; 
               
             
          
           
               
                 } 
               
               
                 void CHintController::DialNumberL(const TDesC&amp; aPhoneNumber) 
               
               
                 { 
               
             
          
           
               
                   
                 RTelServer server; 
               
               
                   
                 CleanupClosePushL(server); 
               
               
                   
                 User::LeaveIfError(server.Connect( )); 
               
               
                   
                 TName tsy; 
               
               
                   
                 User::LeaveIfError(server.GetTsyName(0, tsy)); 
               
               
                   
                 User::LeaveIfError(server.LoadPhoneModule(tsy)); 
               
               
                   
                 TInt numberPhones; 
               
               
                   
                 User::LeaveIfError(server.EnumeratePhones(numberPhones)); 
               
               
                   
                 if (numberPhones &lt; 1) 
               
               
                   
                 User::Leave(KErrNotFound); 
               
               
                   
                 RTelServer::TPhoneInfo info; 
               
             
          
           
               
                   
                 User::LeaveIfError(server.GetPhoneInfo(0, info)); 
               
             
          
           
               
                   
                 RPhone phone; 
               
               
                   
                 CleanupClosePushL(phone); 
               
               
                   
                 User::LeaveIfError(phone.Open(server, info.iName)); 
               
               
                   
                 RPhone::TLineInfo lineInfo; 
               
               
                   
                 User::LeaveIfError(phone.GetLineInfo(0, lineInfo)); 
               
               
                   
                 RLine line; 
               
               
                   
                 CleanupClosePushL(line); 
               
               
                   
                 User::LeaveIfError(line.Open(phone, lineInfo.iName)); 
               
               
                   
                 TBuf &lt;100&gt; newCallName; 
               
               
                   
                 RCall call; 
               
               
                   
                 CleanupClosePushL(call); 
               
               
                   
                 User::LeaveIfError(call.OpenNewCall(line, newCallName)); 
               
               
                   
                 User::LeaveIfError(call.Dial(aPhoneNumber)); 
               
               
                   
                 CleanupStack::PopAndDestroy(3); 
               
               
                   
                 User::LeaveIfError(server.UnloadPhoneModule(tsy)); 
               
               
                   
                 CleanupStack::PopAndDestroy(&amp;server); 
               
             
          
           
               
                 } 
               
               
                   
               
             
          
         
       
     
         [0051]    
       
         
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
           
               
                 APPENDIX B2 
               
               
                   
               
               
                   
               
             
             
               
                 const TInt KScrollStep = 20; 
               
               
                 const TInt KScrollArrow = 5; 
               
               
                 CHintDrawEngine* CHintDrawEngine::NewL( ) 
               
               
                 { 
               
             
          
           
               
                   
                 CHintDrawEngine* self = CHintDrawEngine::NewLC( ); 
               
               
                   
                 CleanupStack::Pop( ); 
               
               
                   
                 return self; 
               
             
          
           
               
                 } 
               
               
                 CHintDrawEngine* CHintDrawEngine::NewLC( ) 
               
               
                 { 
               
             
          
           
               
                   
                 CHintDrawEngine* self = new (ELeave) CHintDrawEngine( ); 
               
               
                   
                 CleanupStack::PushL(self); 
               
               
                   
                 self-&gt;ConstructL( ); 
               
               
                   
                 return self; 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::ConstructL( ) 
               
               
                 { 
               
             
          
           
               
                   
                 ipProjectManager = NULL; 
               
               
                   
                 ipDisplayCallback = NULL; 
               
               
                   
                 ipController = NULL; 
               
               
                   
                 ipArrImages = new (ELeave) CArrayPtrFlat&lt;CHintImageAdapter&gt; (1); 
               
             
          
           
               
                 } 
               
               
                 CHintDrawEngine::CHintDrawEngine( ): 
               
             
          
           
               
                   
                 iClientRect(0,0,0,0) 
               
             
          
           
               
                 { 
               
             
          
           
               
                   
                 iCrtImage = −1; 
               
               
                   
                 iMaxCachedAdapters = 1; 
               
               
                   
                 iTopLeft.iX = 0; 
               
               
                   
                 iTopLeft.iY = 0; 
               
               
                   
                 ibMarkHotSpots = false; 
               
               
                   
                 ibCenterToCrtHotSpot = true; 
               
               
                   
                 ibScrollUpBtn = false; 
               
               
                   
                 ibScrollDownBtn = false; 
               
               
                   
                 ibScrollLeftBtn = false; 
               
               
                   
                 ibScrollRightBtn = false; 
               
             
          
           
               
                 } 
               
               
                 CHintDrawEngine::˜CHintDrawEngine( ) 
               
               
                 { 
               
             
          
           
               
                   
                 ipProjectManager = NULL; 
               
               
                   
                 ipDisplayCallback = NULL; 
               
               
                   
                 ipController = NULL; 
               
               
                   
                 if (ipArrImages) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 for(TInt idx = 0; idx &lt; ipArrImages-&gt;Count( ); ++idx) 
               
             
          
           
               
                   
                 ipArrImages-&gt;At(idx)-&gt;Cancel( ); 
               
             
          
           
               
                   
                 ipArrImages-&gt;ResetAndDestroy( ); 
               
               
                   
                 delete ipArrImages; 
               
               
                   
                 ipArrImages = NULL; 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::ClearCache( ) 
               
               
                 { 
               
             
          
           
               
                   
                 if (ipArrImages) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 for(TInt idx = 0; idx &lt; ipArrImages-&gt;Count( ); ++idx) 
               
             
          
           
               
                   
                 ipArrImages-&gt;At(idx)-&gt;Cancel( ); 
               
             
          
           
               
                   
                 ipArrImages-&gt;ResetAndDestroy( ); 
               
               
                   
                 delete ipArrImages; 
               
               
                   
                 ipArrImages = NULL; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 iCrtImage = −1; 
               
               
                   
                 ipArrImages = new (ELeave) CArrayPtrFlat&lt;CHintImageAdapter&gt; (1); 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::SetProject(CHintProjectManager* apHintProjectManager) 
               
               
                 { 
               
             
          
           
               
                   
                 ipProjectManager = apHintProjectManager; 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::SetController(MHintController* apController) 
               
               
                 { 
               
             
          
           
               
                   
                 ipController = apController; 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::Update( ) 
               
               
                 { 
               
             
          
           
               
                   
                 CHintImageNavigator* pCrtImageNav = ipProjectManager-&gt;GetCrtImgNav( ); 
               
               
                   
                 TFileName crtImageName = pCrtImageNav-&gt;iImageFileName; 
               
               
                   
                 TInt idx = 0; 
               
               
                   
                 for(idx = 0; idx &lt; ipArrImages-&gt;Count( ); ++idx) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 if(crtImageName == ipArrImages-&gt;At(idx)-&gt;GetImageFileName( )) 
               
             
          
           
               
                   
                 break; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 if(idx == ipArrImages-&gt;Count( )) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 CHintImageAdapter* pImageAdapter = NULL; 
               
               
                   
                 pImageAdapter = 
               
             
          
           
               
                 CHintImageAdapter::NewLC(NEikonEnvironment::EikEnv( ).DefaultDisplayMode( )); 
               
             
          
           
               
                   
                 pImageAdapter-&gt;SetImageFileName(crtImageName); 
               
               
                   
                 pImageAdapter-&gt;SetDispCallback(ipDisplayCallback); 
               
               
                   
                 pImageAdapter-&gt;SetEngCallback(this); 
               
               
                   
                 pImageAdapter-&gt;ExecuteCommandL(EDecodeImage); 
               
               
                   
                 ipArrImages-&gt;AppendL(pImageAdapter); 
               
               
                   
                 CleanupStack::Pop(pImageAdapter); 
               
               
                   
                 iCrtImage = idx; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else 
               
               
                   
                 { 
               
             
          
           
               
                   
                 iCrtImage = idx; 
               
               
                   
                 CheckScrollers( ); 
               
               
                   
                 if(ibCenterToCrtHotSpot) 
               
             
          
           
               
                   
                 CenterToCrtHotSpot( ); 
               
             
          
           
               
                   
                 if(ipDisplayCallback) 
               
             
          
           
               
                   
                 ipDisplayCallback-&gt;Redraw( ); 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::CenterToCrtHotSpot( ) 
               
               
                 { 
               
             
          
           
               
                   
                 CHintHotSpot* pSpot = NULL; 
               
               
                   
                 pSpot = ipProjectManager-&gt;GetCrtGallery( )-&gt;GetCrtHotSpot( ); 
               
               
                   
                 iTopLeft.iX = iClientRect.iTl.iX + iClientRect.Width( )/2 − (pSpot-&gt;iX + pSpot- 
               
             
          
           
               
                 &gt;iWidth / 2); 
               
             
          
           
               
                   
                 iTopLeft.iY = iClientRect.iTl.iY + iClientRect.Height( )/2 − (pSpot-&gt;iY + pSpot- 
               
             
          
           
               
                 &gt;iHeight / 2); 
               
             
          
           
               
                   
                 CFbsBitmap* bitmap = &amp;(ipArrImages-&gt;At(iCrtImage)-&gt;Image( )); 
               
               
                   
                 TInt nBitmapHeight = bitmap-&gt;SizeInPixels( ).iHeight; 
               
               
                   
                 if(iTopLeft.iY &lt;= iClientRect.iTl.iY + iClientRect.Height( ) − nBitmapHeight) 
               
             
          
           
               
                   
                 iTopLeft.iY = iClientRect.iTl.iY + iClientRect.Height( ) − nBitmapHeight; 
               
             
          
           
               
                   
                 if(iTopLeft.iY &gt;= iClientRect.iTl.iY) 
               
             
          
           
               
                   
                 iTopLeft.iY = iClientRect.iTl.iY; 
               
             
          
           
               
                   
                 TInt nBitmapWidth = bitmap-&gt;SizeInPixels( ).iWidth; 
               
               
                   
                 if(iTopLeft.iX &lt;= iClientRect.iTl.iX + iClientRect.Width( ) − nBitmapWidth) 
               
             
          
           
               
                   
                 iTopLeft.iX = iClientRect.iTl.iX + iClientRect.Width( ) − nBitmapWidth; 
               
             
          
           
               
                   
                 if(iTopLeft.iX &gt;= iClientRect.iTl.iX) 
               
             
          
           
               
                   
                 iTopLeft.iX = iClientRect.iTl.iX; 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::SystemRedraw( ) 
               
               
                 { 
               
             
          
           
               
                   
                 if(ipDisplayCallback) 
               
             
          
           
               
                   
                 ipDisplayCallback-&gt;Redraw( ); 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::ImageReady( ) 
               
               
                 { 
               
             
          
           
               
                   
                 NormalizeHotSpots(iCrtImage); 
               
               
                   
                 CenterToCrtHotSpot( ); 
               
               
                   
                 CheckScrollers( ); 
               
               
                   
                 ipController-&gt;ImageReady( ); 
               
               
                   
                 if(ipDisplayCallback) 
               
             
          
           
               
                   
                 ipDisplayCallback-&gt;Redraw( ); 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::SetDisplayReference(MDisplayCallback* apDisplayRef) 
               
               
                 { 
               
             
          
           
               
                   
                 ipDisplayCallback = apDisplayRef; 
               
               
                   
                 if(ipDisplayCallback) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ipDisplayCallback-&gt;GetWindowClientRect(iClientRect); 
               
               
                   
                 TopLeft = iClientRect.iTl; 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::Draw(CWindowGc&amp; gc, const TRect&amp;) const 
               
               
                 { 
               
             
          
           
               
                   
                 if(iCrtImage == −1) 
               
             
          
           
               
                   
                 return; 
               
             
          
           
               
                   
                 if(ipArrImages-&gt;At(iCrtImage)-&gt;GetErr( ) != KErrNone) 
               
             
          
           
               
                   
                 return; 
               
             
          
           
               
                   
                 if(!ipArrImages-&gt;At(iCrtImage)-&gt;ImageLoaded( )) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 return; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 CFbsBitmap* bitmap = &amp;(ipArrImages-&gt;At(iCrtImage)-&gt;Image( )); 
               
               
                   
                 TBool bUseVirtualTl = false; 
               
               
                   
                 if(ipProjectManager-&gt;GetCrtImgNav( )-&gt;iViewerType == 1) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 if(iTopLeft.iX &gt; iClientRect.iTl.iX) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 TPoint virtTopLeft(iTopLeft.iX − bitmap-&gt;SizeInPixels( ).iWidth, 
               
             
          
           
               
                 iTopLeft.iY); 
               
             
          
           
               
                   
                 gc.BitBlt(virtTopLeft, bitmap); 
               
               
                   
                 bUseVirtualTl = true; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 gc.BitBlt(iTopLeft, bitmap); 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else 
               
             
          
           
               
                   
                 gc.BitBlt(iTopLeft, bitmap); 
               
             
          
           
               
                   
                 CHintHotSpot* pSpot = NULL; 
               
               
                   
                 gc.SetPenColor(KRgbRed); 
               
               
                   
                 if(ibMarkHotSpots) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 for(TInt idx = 0; idx &lt; ipProjectManager-&gt;GetCrtGallery( )- 
               
             
          
           
               
                 &gt;ipArrHotSpots-&gt;Count( ); ++idx) 
               
             
          
           
               
                   
                 { 
               
             
          
           
               
                   
                 pSpot = ipProjectManager-&gt;GetCrtGallery( )-&gt;ipArrHotSpots- 
               
             
          
           
               
                 &gt;At(idx); 
               
             
          
           
               
                   
                 gc.DrawRect( TRect( iTopLeft + TPoint(pSpot-&gt;iX, pSpot-&gt;iY), 
               
             
          
           
               
                 TSize(pSpot-&gt;iWidth, pSpot-&gt;iHeight) ) ); 
               
             
          
           
               
                   
                 if(bUseVirtualTl) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 TPoint virtTopLeft(iTopLeft.iX − bitmap- 
               
             
          
           
               
                 &gt;SizeInPixels( ).iWidth, iTopLeft.iY); 
               
             
          
           
               
                   
                 gc.DrawRect( TRect( virtTopLeft + TPoint(pSpot-&gt;iX, pSpot- 
               
             
          
           
               
                 &gt;iY), TSize(pSpot-&gt;iWidth, pSpot-&gt;iHeight) ) ); 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                   
                 } 
               
               
                   
                 pSpot = ipProjectManager-&gt;GetCrtGallery( )-&gt;GetCrtHotSpot( ); 
               
               
                   
                 gc.DrawRect( TRect( iTopLeft + TPoint(pSpot-&gt;iX − 2, pSpot-&gt;iY − 2), 
               
             
          
           
               
                 TSize(pSpot-&gt;iWidth + 4, pSpot-&gt;iHeight + 4) ) ); 
               
             
          
           
               
                   
                 DrawScrollers(gc); 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::ScrollUp( ) 
               
               
                 { 
               
             
          
           
               
                   
                 if(iTopLeft.iY == iClientRect.iTl.iY) 
               
             
          
           
               
                   
                 return; 
               
             
          
           
               
                   
                 iTopLeft.iY += KScrollStep; 
               
               
                   
                 if(iTopLeft.iY &gt;= iClientRect.iTl.iY) 
               
             
          
           
               
                   
                 iTopLeft.iY = iClientRect.iTl.iY; 
               
             
          
           
               
                   
                 CheckScrollers( ); 
               
               
                   
                 SystemRedraw( ); 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::ScrollDown( ) 
               
               
                 { 
               
             
          
           
               
                   
                 CFbsBitmap* bitmap = &amp;(ipArrImages-&gt;At(iCrtImage)-&gt;Image( )); 
               
               
                   
                 TInt nBitmapHeight = bitmap-&gt;SizeInPixels( ).iHeight; 
               
               
                   
                 if(iTopLeft.iY == iClientRect.iTl.iY + iClientRect.Height( ) − nBitmapHeight) 
               
             
          
           
               
                   
                 return; 
               
             
          
           
               
                   
                 iTopLeft.iY −= KScrollStep; 
               
               
                   
                 if(iTopLeft.iY &lt;= iClientRect.iTl.iY + iClientRect.Height( ) − nBitmapHeight) 
               
             
          
           
               
                   
                 iTopLeft.iY = iClientRect.iTl.iY + iClientRect.Height( ) − nBitmapHeight; 
               
             
          
           
               
                   
                 CheckScrollers( ); 
               
               
                   
                 SystemRedraw( ); 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::ScrollLeft( ) 
               
               
                 { 
               
             
          
           
               
                   
                 if(ipProjectManager-&gt;GetCrtImgNav( )-&gt;iViewerType == 1) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 iTopLeft.iX += KScrollStep; 
               
               
                   
                 if(iTopLeft.iX &gt;= iClientRect.Width( )) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 CFbsBitmap* bitmap = &amp;(ipArrImages-&gt;At(iCrtImage)-&gt;Image( )); 
               
               
                   
                 TInt nBitmapWidth = bitmap-&gt;SizeInPixels( ).iWidth; 
               
               
                   
                 iTopLeft.iX = iClientRect.Width( ) − nBitmapWidth; 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else 
               
               
                   
                 { 
               
             
          
           
               
                   
                 if(iTopLeft.iX == iClientRect.iTl.iX) 
               
             
          
           
               
                   
                 return; 
               
             
          
           
               
                   
                 iTopLeft.iX += KScrollStep; 
               
               
                   
                 if(iTopLeft.iX &gt;= iClientRect.iTl.iX) 
               
             
          
           
               
                   
                 iTopLeft.iX = iClientRect.iTl.iX; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 CheckScrollers( ); 
               
               
                   
                 SystemRedraw( ); 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::ScrollRight( ) 
               
               
                 { 
               
             
          
           
               
                   
                 CFbsBitmap* bitmap = &amp;(ipArrImages-&gt;At(iCrtImage)-&gt;Image( )); 
               
               
                   
                 TInt nBitmapWidth = bitmap-&gt;SizeInPixels( ).iWidth; 
               
               
                   
                 if(ipProjectManager-&gt;GetCrtImgNav( )-&gt;iViewerType == 1) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 iTopLeft.iX −= KScrollStep; 
               
               
                   
                 if(iTopLeft.iX &lt;= iClientRect.Width( ) − nBitmapWidth) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 iTopLeft.iX = iClientRect.Width( ); 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                   
                 } 
               
               
                   
                 else 
               
               
                   
                 { 
               
             
          
           
               
                   
                 if(iTopLeft.iX == iClientRect.iTl.iX + iClientRect.Width( ) − nBitmapWidth) 
               
             
          
           
               
                   
                 return; 
               
             
          
           
               
                   
                 iTopLeft.iX −= KScrollStep; 
               
               
                   
                 if(iTopLeft.iX &lt;= iClientRect.iTl.iX + iClientRect.Width( ) − nBitmapWidth) 
               
             
          
           
               
                   
                 iTopLeft.iX = iClientRect.iTl.iX + iClientRect.Width( ) − 
               
             
          
           
               
                 nBitmapWidth; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 CheckScrollers( ); 
               
               
                   
                 SystemRedraw( ); 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::NormalizeHotSpots(TInt aCrtImage) 
               
               
                 { 
               
             
          
           
               
                   
                 CFbsBitmap* bitmap = &amp;(ipArrImages-&gt;At(aCrtImage)-&gt;Image( )); 
               
               
                   
                 TInt nBitmapWidth = bitmap-&gt;SizeInPixels( ).iWidth; 
               
               
                   
                 TInt nBitmapHeight = bitmap-&gt;SizeInPixels( ).iHeight; 
               
               
                   
                 if(!nBitmapWidth || !nBitmapHeight) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ASSERT(false); 
               
               
                   
                 return; 
               
             
          
           
               
                   
                 } 
               
               
                   
                 CHintHotSpot* pSpot = NULL; 
               
               
                   
                 for(TInt idx = 0; idx &lt; ipProjectManager-&gt;GetCrtGallery( )-&gt;ipArrHotSpots- 
               
             
          
           
               
                 &gt;Count( ); ++idx) 
               
             
          
           
               
                   
                 { 
               
             
          
           
               
                   
                 pSpot = ipProjectManager-&gt;GetCrtGallery( )-&gt;ipArrHotSpots-&gt;At(idx); 
               
               
                   
                 pSpot-&gt;iX = TInt(nBitmapWidth * pSpot-&gt;iXsReal); 
               
               
                   
                 pSpot-&gt;iY = TInt(nBitmapHeight * pSpot-&gt;iYsReal); 
               
               
                   
                 pSpot-&gt;iWidth = TInt(nBitmapWidth * (pSpot-&gt;iXeReal − pSpot- 
               
             
          
           
               
                 &gt;iXsReal)); 
               
             
          
           
               
                   
                 pSpot-&gt;iHeight = TInt(nBitmapHeight * (pSpot-&gt;iYeReal − pSpot- 
               
             
          
           
               
                 &gt;iYsReal)); 
               
             
          
           
               
                   
                 } 
               
               
                   
                 ipProjectManager-&gt;GetCrtGallery( )-&gt;SortTheSpots( ); 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::SetMarkHotSpots(TBool abMarkThem) 
               
               
                 { 
               
             
          
           
               
                   
                 ibMarkHotSpots = abMarkThem; 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::CheckScrollers( ) 
               
               
                 { 
               
             
          
           
               
                   
                 CFbsBitmap* pBitmap = &amp;(ipArrImages-&gt;At(iCrtImage)-&gt;Image( )); 
               
               
                   
                 if(!pBitmap) 
               
             
          
           
               
                   
                 return; 
               
             
          
           
               
                   
                 ibScrollUpBtn = (iTopLeft.iY &lt; iClientRect.iTl.iY); 
               
               
                   
                 ibScrollDownBtn = (iTopLeft.iY + pBitmap-&gt;SizeInPixels( ).iHeight &gt; 
               
             
          
           
               
                 iClientRect.iBr.iY); 
               
             
          
           
               
                   
                 ibScrollLeftBtn = (iTopLeft.iX &lt; iClientRect.iTl.iX); 
               
               
                   
                 ibScrollRightBtn = (iTopLeft.iX + pBitmap-&gt;SizeInPixels( ).iWidth &gt; 
               
             
          
           
               
                 iClientRect.iBr.iX); 
               
             
          
           
               
                   
                 if(ipProjectManager-&gt;GetCrtImgNav( )-&gt;iViewerType == 1) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 ibScrollLeftBtn = false; 
               
               
                   
                 ibScrollRightBtn = false; 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::DrawScrollers(CWindowGc&amp; gc) const 
               
               
                 { 
               
             
          
           
               
                   
                 TPoint ptOrig = TPoint(iClientRect.iTl.iX, iClientRect.iTl.iY); 
               
               
                   
                 TInt width = iClientRect.Width( ); 
               
               
                   
                 TInt height = iClientRect.Height( ); 
               
               
                   
                 TInt arrow = KScrollArrow; 
               
               
                   
                 if(ibScrollLeftBtn) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 gc.DrawLine(ptOrig + TPoint(0, height/2), ptOrig + TPoint(arrow, height/2 
               
             
          
           
               
                 − arrow)); 
               
             
          
           
               
                   
                 gc.DrawLine(ptOrig + TPoint(0, height/2), ptOrig + TPoint(arrow, height/2 
               
             
          
           
               
                 + arrow)); 
               
             
          
           
               
                   
                 gc.DrawLine(ptOrig + TPoint(arrow, height/2 − arrow), ptOrig + 
               
             
          
           
               
                 TPoint(arrow, height/2 + arrow)); 
               
             
          
           
               
                   
                 } 
               
               
                   
                 if(ibScrollRightBtn) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 gc.DrawLine(ptOrig + TPoint(width − arrow, height/2 − arrow), ptOrig + 
               
             
          
           
               
                 TPoint(width, height/2)); 
               
             
          
           
               
                   
                 gc.DrawLine(ptOrig + TPoint(width − arrow, height/2 + arrow), ptOrig + 
               
             
          
           
               
                 TPoint(width, height/2)); 
               
             
          
           
               
                   
                 gc.DrawLine(ptOrig + TPoint(width − arrow, height/2 − arrow), ptOrig + 
               
             
          
           
               
                 TPoint(width − arrow, height/2 + arrow)); 
               
             
          
           
               
                   
                 } 
               
               
                   
                 if(ibScrollUpBtn) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 gc.DrawLine(ptOrig + TPoint(width/2 − arrow, arrow), ptOrig + 
               
             
          
           
               
                 TPoint(width/2, 0)); 
               
             
          
           
               
                   
                 gc.DrawLine(ptOrig + TPoint(width/2, 0), ptOrig + TPoint(width/2 + 
               
             
          
           
               
                 arrow, arrow)); 
               
             
          
           
               
                   
                 gc.DrawLine(ptOrig + TPoint(width/2 − arrow, arrow), ptOrig + 
               
             
          
           
               
                 TPoint(width/2 + arrow, arrow)); 
               
             
          
           
               
                   
                 } 
               
               
                   
                 if(ibScrollDownBtn) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 gc.DrawLine(ptOrig + TPoint(width/2 − arrow, height − arrow), ptOrig + 
               
             
          
           
               
                 TPoint(width/2, height)); 
               
             
          
           
               
                   
                 gc.DrawLine(ptOrig + TPoint(width/2, height), ptOrig + TPoint(width/2 + 
               
             
          
           
               
                 arrow, height − arrow)); 
               
             
          
           
               
                   
                 gc.DrawLine(ptOrig + TPoint(width/2 − arrow, height − arrow), ptOrig + 
               
             
          
           
               
                 TPoint(width/2 + arrow, height − arrow)); 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                 } 
               
               
                 void CHintDrawEngine::ImagePosFromScreenPos(TPoint&amp; aImagePos, const TPoint&amp; 
               
               
                 aScreenPos) 
               
               
                 { 
               
             
          
           
               
                   
                 aImagePos = aScreenPos − iTopLeft; 
               
               
                   
                 if(iTopLeft.iX &gt; iClientRect.iTl.iX &amp;&amp; aScreenPos.iX &lt; iTopLeft.iX) 
               
               
                   
                 { 
               
             
          
           
               
                   
                 CFbsBitmap* bitmap = &amp;(ipArrImages-&gt;At(iCrtImage)-&gt;Image( )); 
               
               
                   
                 TPoint virtTopLeft(iTopLeft.iX − bitmap-&gt;SizeInPixels( ).iWidth, 
               
             
          
           
               
                 iTopLeft.iY); 
               
             
          
           
               
                   
                 aImagePos = aScreenPos − virtTopLeft; 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                 }