Browser.h

Go to the documentation of this file.
00001 #ifndef __BROWSER_H__
00002 #define __BROWSER_H__
00003 
00004 /*
00005 
00006 $Header$
00007 
00008 */
00009 
00010 #include "Service.h"
00011 #include "Registry.h"
00012 #include "BrowserWindow.h"
00013 
00014 static const char *const NAME_BROWSER = "browser";
00015 static const char *const MAN_BROWSER  = "\
00016 Service <service>browser</service> represents a Mozilla Firefox-based web browser window.\
00017 ";
00018 
00019 static const char *const BROWSER_PROFILE_PATH = "/tmp/pylon";
00020 
00021 static const unsigned int BROWSER_LIMIT_INSTANCES_NUM = 32;
00022 
00023 // Registry manuals.
00024 
00025 static const char *const MAN_BROWSER_LIMITS_INSTANCES = "\
00026 <registry>unsigned int browser.limits.instances</registry>\n\n\
00027 Contains browser instances number limit.\
00028 ";
00029 
00030 using namespace std;
00031 
00032 class Browser : public Service<Browser>
00033 {
00034 
00035 friend class Service<Browser>;
00036 
00037   PYLON_OBJECT
00038 
00039 public:
00040 
00041   inline
00042   static String NAME();
00043 
00044   inline
00045   static String MANUAL();
00046 
00047   inline
00048   static unsigned int instancesNumberLimit();
00049 
00050   REGISTRY(String, profile__path, BROWSER_PROFILE_PATH, "", REG_PERSISTENCY_YES | REG_ACCESS_READ_ONLY | REG_VISIBILITY_PUBLISHED);
00051   REGISTRY(String, pref__name,    "");
00052   REGISTRY(String, pref__value,   "");
00053 
00054   REGISTRY_PRIVATE(String, url,         "");
00055   REGISTRY_PRIVATE(int,    go,          0);
00056   REGISTRY_PRIVATE(bool,   go__back,    false);
00057   REGISTRY_PRIVATE(bool,   go__forward, false);
00058 
00059 protected:
00060 
00061   Browser(const ValueList &params);
00062   virtual ~Browser();
00063 
00064 private:
00065 
00066   int start();
00067 
00068   SLOT(uiClose);
00069 
00070   // Registry getters and setters.
00071   int setUrl(const String &name, const String &url);
00072 
00073   BrowserWindow *_window;
00074 
00075 };
00076 
00077 inline
00078 String Browser::NAME()
00079 {
00080   return NAME_BROWSER;
00081 }
00082 
00083 inline
00084 String Browser::MANUAL()
00085 {
00086   return MAN_BROWSER;
00087 }
00088 
00089 inline
00090 unsigned int Browser::instancesNumberLimit()
00091 {
00092   return BROWSER_LIMIT_INSTANCES_NUM;
00093 }
00094 
00095 #endif

Generated on Thu Sep 6 20:11:25 2007 for Pylon Application Platform by  doxygen 1.5.1