NaviLibrary::NaviManager Class Reference

#include <NaviManager.h>

List of all members.

Public Member Functions

 NaviManager (Ogre::RenderWindow *_renderWindow, const std::string &localNaviDirectory="NaviLocal", const std::string &geckoRuntimeDirectory="GeckoRuntime")
 ~NaviManager ()
void Update ()
NavicreateNavi (const std::string &naviName, const std::string &homepage, const NaviPosition &naviPosition, unsigned short width, unsigned short height, unsigned short zOrder=0)
NavicreateNaviMaterial (const std::string &naviName, const std::string &homepage, unsigned short width, unsigned short height, Ogre::FilterOptions texFiltering=Ogre::FO_ANISOTROPIC)
NavigetNavi (const std::string &naviName)
void destroyNavi (const std::string &naviName)
void destroyNavi (Navi *naviToDestroy)
void resetAllPositions ()
void setProxy (bool isEnabled, const std::string &host, int port)
void setBooleanPref (const std::string &prefName, bool value)
void setIntegerPref (const std::string &prefName, int value)
void setStringPref (const std::string &prefName, const std::string &value)
bool isAnyNaviFocused ()
NavigetFocusedNavi ()
bool injectMouseMove (int xPos, int yPos)
bool injectMouseWheel (int relScroll)
bool injectMouseDown (int buttonID)
bool injectMouseUp (int buttonID)
void deFocusAllNavis ()

Static Public Member Functions

static NaviManagerGet ()
static NaviManagerGetPointer ()


Detailed Description

Supreme dictator and Singleton: NaviManager

The class you will need to go to for all your Navi-related needs.


Constructor & Destructor Documentation

NaviManager::NaviManager ( Ogre::RenderWindow *  _renderWindow,
const std::string &  localNaviDirectory = "NaviLocal",
const std::string &  geckoRuntimeDirectory = "GeckoRuntime" 
)

Creates the NaviManager and loads the internal LLMozLib library.

Parameters:
renderWindow The Ogre::RenderWindow to render Navis to
localNaviDirectory The directory that will be referred to when using the "local://" specifier. Default is "NaviLocal".
geckoRuntimeDirectory The directory that contains the Gecko runtime folders: chrome, components, greprefs, plugins, and res. Default is "GeckoRuntime".
Note:
Both directories should be specified as relative to the executable's working directory. For example:
"..\\..\\SomeFolder" 
Exceptions:
Ogre::Exception::ERR_INTERNAL_ERROR Throws this when LLMozLib fails initialization

NaviManager::~NaviManager (  ) 

Destroys any active Navis, the NaviMouse singleton (if instantiated), and shuts down LLMozLib.


Member Function Documentation

NaviManager & NaviManager::Get (  )  [static]

Gets the NaviManager Singleton.

Returns:
A reference to the NaviManager Singleton.
Exceptions:
Ogre::Exception::ERR_RT_ASSERTION_FAILED Throws this if NaviManager has not been instantiated yet.

NaviManager * NaviManager::GetPointer (  )  [static]

Gets the NaviManager Singleton as a pointer.

Returns:
If the NaviManager has been instantiated, returns a pointer to the NaviManager Singleton, otherwise this returns 0.

void NaviManager::Update (  ) 

Gives each active Navi a chance to update, each may or may not update their internal textures based on various conditions.

Navi * NaviManager::createNavi ( const std::string &  naviName,
const std::string &  homepage,
const NaviPosition naviPosition,
unsigned short  width,
unsigned short  height,
unsigned short  zOrder = 0 
)

Creates a Navi.

Parameters:
naviName The name of the Navi, used to refer to a specific Navi in subsequent calls.
homepage The default starting page for a Navi. You may use local:// here to refer to the local Navi directory (See NaviManager::Startup)
naviPosition The unified position (either relative or absolute) of a Navi. See NaviManager::NaviPosition for more information.
width The width of the Navi.
height The height of the Navi.
zOrder Sets the starting Z-Order for this Navi; Navis with higher Z-Orders will be on top of other Navis. To auto-increment this value for every successive Navi, leave this parameter as '0'.
Exceptions:
Ogre::Exception::ERR_RT_ASSERTION_FAILED Throws this if a Navi by the same name already exists.

Navi * NaviManager::createNaviMaterial ( const std::string &  naviName,
const std::string &  homepage,
unsigned short  width,
unsigned short  height,
Ogre::FilterOptions  texFiltering = Ogre::FO_ANISOTROPIC 
)

Creates a NaviMaterial. NaviMaterials are just like Navis except that they lack a movable overlay element. Instead, you handle the material and apply it to anything you like. Mouse input for NaviMaterials should be injected via the Navi::injectMouse_____ API calls instead of the global NaviManager::injectMouse_____ calls.

Parameters:
naviName The name of the NaviMaterial, used to refer to this specific Navi in subsequent calls.
homepage The default starting page for a Navi. You may use local:// here to refer to the local Navi directory (See NaviManager::Startup)
width The width of the NaviMaterial.
height The height of the NaviMaterial.
texFiltering The texture filtering to use for this material. (see Ogre::FilterOptions) If the NaviMaterial is applied to a 3D object, FO_ANISOTROPIC is the best (and default) choice, otherwise set this to FO_NONE for use in other overlays/GUI elements.
Exceptions:
Ogre::Exception::ERR_RT_ASSERTION_FAILED Throws this if a Navi by the same name already exists.

Navi * NaviManager::getNavi ( const std::string &  naviName  ) 

Retrieve a pointer to a Navi by name.

Parameters:
naviName The name of the Navi to retrieve.
Returns:
If the Navi is found, returns a pointer to the Navi, otherwise returns 0.

void NaviManager::destroyNavi ( const std::string &  naviName  ) 

Destroys a Navi.

Parameters:
naviName The name of the Navi to destroy.

void NaviManager::destroyNavi ( Navi naviToDestroy  ) 

Destroys a Navi.

Parameters:
naviName A pointer to the Navi to destroy.

void NaviManager::resetAllPositions (  ) 

Resets the positions of all Navis to their default positions. (not applicable to NaviMaterials)

void NaviManager::setProxy ( bool  isEnabled,
const std::string &  host,
int  port 
)

Configures the network proxy settings for all Navis.

Parameters:
isEnabled Whether or not the network proxy should be enabled.
host The hostname or IP address of the proxy server.
port The port of the proxy server.

void NaviManager::setBooleanPref ( const std::string &  prefName,
bool  value 
)

Sets a global Mozilla preference with a boolean value. For more info: http://preferential.mozdev.org/preferences.html

Parameters:
prefName the name of the preference
value the value of the preference

void NaviManager::setIntegerPref ( const std::string &  prefName,
int  value 
)

Sets a global Mozilla preference with an integer value. For more info: http://preferential.mozdev.org/preferences.html

Parameters:
prefName the name of the preference
value the value of the preference

void NaviManager::setStringPref ( const std::string &  prefName,
const std::string &  value 
)

Sets a global Mozilla preference with a string value. For more info: http://preferential.mozdev.org/preferences.html

Parameters:
prefName the name of the preference
value the value of the preference

bool NaviManager::isAnyNaviFocused (  ) 

Checks whether or not a Navi is focused/selected. (not applicable to NaviMaterials)

Returns:
True if a Navi is focused, False otherwise.

Navi * NaviManager::getFocusedNavi (  ) 

Gets the currently focused/selected Navi. (not applicable to NaviMaterials)

Returns:
A pointer to the Navi that is currently focused, returns 0 if none are focused.

bool NaviManager::injectMouseMove ( int  xPos,
int  yPos 
)

Injects the mouse's current position into NaviManager. Used to generally keep track of where the mouse is for things like moving Navis around, telling the internal pages of each Navi where the mouse is and where the user has clicked, etc. (not applicable to NaviMaterials)

Parameters:
xPos The current X-coordinate of the mouse.
yPos The current Y-coordinate of the mouse.
Returns:
Returns True if the injected coordinate is over a Navi, False otherwise.

bool NaviManager::injectMouseWheel ( int  relScroll  ) 

Injects mouse wheel events into NaviManager. Used to scroll the focused Navi. (not applicable to NaviMaterials)

Parameters:
relScroll The relative Scroll-Value of the mouse.
Note:
To inject this using OIS: on a OIS::MouseListener::MouseMoved event, simply inject "arg.state.Z.rel" of the "MouseEvent".
Returns:
Returns True if the mouse wheel was scrolled while a Navi was focused, False otherwise.

bool NaviManager::injectMouseDown ( int  buttonID  ) 

Injects mouse down events into NaviManager. Used to know when the user has pressed a mouse button and which button they used. (not applicable to NaviMaterials)

Parameters:
buttonID The ID of the button that was pressed. Left = 0, Right = 1, Middle = 2.
Returns:
Returns True if the mouse went down over a Navi, False otherwise.

bool NaviManager::injectMouseUp ( int  buttonID  ) 

Injects mouse up events into NaviManager. Used to know when the user has released a mouse button and which button they used. (not applicable to NaviMaterials)

Parameters:
buttonID The ID of the button that was released. Left = 0, Right = 1, Middle = 2.
Returns:
Returns True if the mouse went up while a Navi was focused, False otherwise.

void NaviManager::deFocusAllNavis (  ) 

De-Focuses any currently-focused Navis. This would be useful if you need to disable any auto-key-injection (and subsequent display in a focused textbox of a focused Navi) done internally by Gecko.


The documentation for this class was generated from the following files:
Generated on Tue Jun 10 22:33:20 2008 for NaviLibrary by  doxygen 1.5.3