Back to index

im-sdk  12.3.91
IMDesktop.hh
Go to the documentation of this file.
00001 #ifndef IMDESKTOP_HH_
00002 #define IMDESKTOP_HH_
00003 #include <SunIM.h>
00004 #include <string>
00005 #include <vector>
00006 #include <map>
00007 #include "basictype.hh"
00008 
00009 class IMUser;
00010 class LEBase;
00011 class LEContext;
00012 class IMDesktop
00013 {
00014   public:
00015     enum IMDESKTOP_ATTRS {
00016            CLIENT_HOST,
00017            CLIENT_NAME,
00018            OS_NAME,
00019            OS_ARCH,
00020            OS_VERSION,
00021            X_DISPLAY_NAME,
00022            X_SERVER_VENDOR
00023     };
00024     typedef map<int, u16string> IMDesktopAttr;
00025 
00026     enum CLIENT_TYPE {
00027            IIIMXCF,
00028            IIIMJCF,
00029            IIIMECF,
00030            IIIMGCF,
00031            UNKNOWN_CLIENT
00032     };
00033 
00034   private:
00035     IMUser *puser;
00036     IMDesktopAttr attrs;
00037     bool iiim_xbe;
00038     string desktop_display_name;
00039 
00040     enum CLIENT_TYPE client_type;
00041 
00042     void initialize();
00043 
00044     typedef map<LEBase*, iml_desktop_t*> IMLDesktopMap;
00045     IMLDesktopMap iml_desktop_map;
00046 
00047     iml_desktop_t* create_iml_desktop(
00048        LEContext &lec
00049     );
00050 
00051   public:
00052     iml_desktop_t* request_iml_desktop(
00053        LEContext &lec
00054     );
00055     void release_iml_desktop(
00056        LEContext &lec,
00057        iml_desktop_t *iml_desktop
00058     );
00059     bool match(
00060        IMDesktopAttr &attrs
00061     );
00062     const u16string* get_attr(
00063        enum IMDESKTOP_ATTRS attr
00064     );
00065     const string& get_desktop_display_name() const
00066     { return desktop_display_name; }
00067     enum CLIENT_TYPE get_client_type() const
00068     { return client_type; }
00069     bool iiim_xbe_p() const
00070     { return iiim_xbe; }
00071     void get_iml_desktop_args(
00072        vector<IMArg> &args
00073     );
00074     void get_lecontext_args(
00075        vector<IMArg> &args
00076     );
00077     IMDesktop(
00078        IMUser *pu
00079     );
00080     IMDesktop(
00081        IMUser *pu,
00082        IMDesktopAttr& attrs
00083     );
00084     virtual ~IMDesktop();
00085 };
00086 
00087 #endif /* not IMDESKTOP_HH_ */
00088 
00089 /* Local Variables: */
00090 /* c-file-style: "iiim-project" */
00091 /* End: */