00001
00024 #ifndef INC_SOA_UISERVICETREE_H
00025 #define INC_SOA_UISERVICETREE_H
00026
00027 #ifndef INC_SOA_UISERVERLIST_H
00028 #include <soa/uiserverlist.h>
00029 #endif
00030
00031 #ifndef INC_MGUI_TREE_H
00032 #include <mgui/tree.h>
00033 #endif
00034
00035
00036
00037 namespace SOA {
00038
00039
00040 class CTRL_SERVICETREE : public MGUI::CTRL_TREE {
00041 public:
00042
00043 typedef fastdelegate::FastDelegate<void(ITEMHND,const LPOINT2D&)> DELEGATE_BUTTON;
00044 typedef fastdelegate::FastDelegate<void(SOA::SERVERLIST::ITEM&)> DELEGATE_SERVERLISTITEM;
00045
00046 enum IMAGEIDX {
00047 IMAGEIDX_Blank = 0,
00048 IMAGEIDX_Folder,
00049 IMAGEIDX_Catalog,
00050 IMAGEIDX_Layer,
00051 IMAGEIDX_ServiceWMS,
00052 IMAGEIDX_ServiceWFS,
00053 IMAGEIDX_ServiceArcIMS,
00054 };
00055
00056 CTRL_SERVICETREE (
00057 );
00058
00059 ~CTRL_SERVICETREE ();
00060
00061 ITEMHND AddItem (
00062 SERVERLIST::ITEM *pParentItem,
00063 const SERVERLIST::ITEM *pPreviousItem,
00064 const SERVERLIST::ITEM& Item,
00065 bool RemoveExisting,
00066 IMAGEIDX *img=0
00067 );
00068
00069 const SOA::SERVERLIST& GetServerList (
00070 ) const { return (m_ServerList); }
00071
00072 SOA::SERVERLIST& GetServerList (
00073 ) { return (m_ServerList); }
00074
00075 const FILEPATH& GetServerListPath (
00076 ) const { return (m_PathServerList); }
00077
00078 ERRVALUE LoadServerList (
00079 const char *filename
00080 );
00081
00082 void ClearServerList (
00083 );
00084
00085 void OnNotifyItemAdded (
00086 const SERVERLIST::ITEM *pParentItem,
00087 const SERVERLIST::ITEM *pItemAdded
00088 );
00089
00090 bool RemoveItem (
00091 ITEMHND hndItem
00092 );
00093
00094 ERRVALUE SaveServerList (
00095 );
00096
00097 void SetDelegateOnRightButtonDown (
00098 DELEGATE_BUTTON delegate
00099 ) { m_DelegateOnRightButtonDown = delegate; }
00100
00101 void SetDelegateOnSelectService (
00102 DELEGATE_SERVERLISTITEM delegate
00103 ) { m_DelegateOnSelectService = delegate; }
00104
00105 void SetDelegateOnDoubleClickService (
00106 DELEGATE_SERVERLISTITEM delegate
00107 ) { m_DelegateOnDoubleClickService = delegate; }
00108
00109 void SetLayerSelected(const SOA::SERVERLIST::ITEM& item);
00110
00111 #ifndef GENERATING_DOXYGEN_OUTPUT
00112 private:
00113
00114 UINT64 m_LastClickTime;
00115 FILEPATH m_PathServerList;
00116 SOA::SERVERLIST m_ServerList;
00117 DELEGATE_BUTTON m_DelegateOnRightButtonDown;
00118 DELEGATE_SERVERLISTITEM m_DelegateOnSelectService;
00119 DELEGATE_SERVERLISTITEM m_DelegateOnDoubleClickService;
00120
00121 ITEMHND AddItem (ITEMHND hndParent, ITEMHND hndInsertAfter, const SOA::SERVERLIST::ITEM& item, IMAGEIDX *img=0);
00122 void AddServerList (ITEMHND hndParent, const SOA::SERVERLIST::ITEMLIST& ItemList);
00123
00124
00125 virtual bool v_OnChildVisibilityChanging (ITEMHND hndItem, CHILDVISIBILITY visibility);
00126 virtual void v_OnLeftButtonDown (ITEMHND hndItem, HITRESULT HitResult, const LPOINT2D& point, MGUI::KEYSTATE keystate);
00127 virtual void v_OnRightButtonDown (ITEMHND hndItem, HITRESULT HitResult, const LPOINT2D& point, MGUI::KEYSTATE keystate);
00128 virtual bool v_OnToolTipRequest (ITEMHND hndItem, HITRESULT HitResult, const LPOINT2D& point, MGUI::CTRL_TOOLTIP& ToolTipCtrl);
00129
00130 CTRL_SERVICETREE (const CTRL_SERVICETREE&);
00131 CTRL_SERVICETREE& operator= (const CTRL_SERVICETREE&);
00132 #endif
00133 };
00134
00135 }
00136
00137 #endif // INC_SOA_UISERVICETREE_H