00001 00002 // Name: wxGuiTest/CRWindowHierarchyHandler.h 00003 // Author: Reinhold Fuereder 00004 // Created: 2004 00005 // Copyright: (c) 2005 Reinhold Fuereder 00006 // Modifications: John Ralls, 2007-2008 00007 // Modifications Copyright: (c) 2008 John Ralls 00008 // Licence: wxWindows licence 00009 // 00010 // $Id$ 00012 00013 #ifndef CRWINDOWHIERARCHYHANDLER_H 00014 #define CRWINDOWHIERARCHYHANDLER_H 00015 00016 #ifdef __GNUG__ 00017 #pragma interface "CRWindowHierarchyHandler.h" 00018 #endif 00019 00020 #include <wxGuiTest/Common.h> 00021 00022 #include <map> 00023 #include <vector> 00024 00025 00026 00027 namespace wxTst { 00028 00033 class CRWindowHierarchyHandler 00034 { 00035 public: 00041 static CRWindowHierarchyHandler * GetInstance (); 00042 00043 00047 static void Destroy (); 00048 00049 00058 virtual wxString FindContainerName (wxWindow *window); 00059 00060 protected: 00064 CRWindowHierarchyHandler (); 00065 00066 00070 virtual ~CRWindowHierarchyHandler (); 00071 private: 00072 static CRWindowHierarchyHandler *ms_instance; 00073 struct WxStrSort { 00074 bool operator() (const wxString left, const wxString right) const { 00075 return (left.Cmp(right) < 0); 00076 } 00077 }; 00078 00079 typedef std::map< wxString, wxString, WxStrSort > ContainerMap; 00080 static ContainerMap m_contMap; 00081 00082 private: 00083 // No copy and assignment constructor: 00084 CRWindowHierarchyHandler (const CRWindowHierarchyHandler &rhs); 00085 CRWindowHierarchyHandler & operator= (const CRWindowHierarchyHandler &rhs); 00086 }; 00087 00088 } // End namespace wxTst 00089 00090 #endif // CRWINDOWHIERARCHYHANDLER_H 00091