23 #include "wxgis/catalog/gxobject.h"
24 #include "wxgis/catalog/gxobjectfactory.h"
25 #include "wxgis/core/pointer.h"
27 #include <wx/xml/xml.h>
29 #include <wx/fswatcher.h>
31 #if wxVERSION_NUMBER <= 2903// && !defined EVT_FSWATCHER(winid, func)
32 #define EVT_FSWATCHER(winid, func) \
33 wx__DECLARE_EVT1(wxEVT_FSWATCHER, winid, wxFileSystemWatcherEventHandler(func))
48 wxGxCatalog(
wxGxObject *oParent = NULL,
const wxString &soName = _(
"Catalog"),
const CPLString &soPath =
"");
50 virtual void ObjectAdded(
long nObjectID);
51 virtual void ObjectChanged(
long nObjectID);
52 virtual void ObjectDeleted(
long nObjectID);
53 virtual void ObjectRefreshed(
long nObjectID);
54 virtual bool CreateChildren(
wxGxObject* pParent,
char** &pFileNames, wxArrayLong & pChildrenIds);
55 virtual void EnableRootItem(
size_t nItemId,
bool bEnable);
56 virtual bool Destroy(
void);
57 virtual wxGxObject*
const GetRootItemByType(
const wxClassInfo * info)
const;
58 virtual wxGxObjectFactory*
const GetObjectFactoryByClassName(
const wxString &sClassName);
59 virtual wxGxObjectFactory*
const GetObjectFactoryByName(
const wxString &sFactoryName);
68 virtual wxVector<wxGxCatalog::ROOTITEM>*
const GetRootItems(
void);
69 virtual wxVector<wxGxObjectFactory*>*
const GetObjectFactories(
void);
71 virtual bool AddFSWatcherPath(
const wxFileName& path,
int events = wxFSW_EVENT_ALL);
72 virtual bool AddFSWatcherTree(
const wxFileName& path,
int events = wxFSW_EVENT_ALL,
const wxString& filespec = wxEmptyString);
73 virtual bool RemoveFSWatcherPath(
const wxFileName& path);
74 virtual bool RemoveFSWatcherTree(
const wxFileName& path);
75 virtual void StopFSWatcher();
76 virtual void StartFSWatcher();
78 virtual void OnFileSystemEvent(wxFileSystemWatcherEvent& event);
81 virtual void LoadObjectFactories(
const wxXmlNode* pNode);
82 virtual void LoadObjectFactories(
void);
83 virtual void LoadChildren(
void);
84 virtual void LoadChildren(wxXmlNode*
const pNode);
85 virtual void EmptyObjectFactories(
void);
86 virtual void SerializePlugins(wxXmlNode* pNode,
bool bStore =
false);
88 virtual wxString GetConfigName(
void)
const {
return wxString(wxT(
"wxCatalog"));};
89 virtual bool IsPathWatched(
const wxString& sPath);
91 wxArrayString m_CatalogRootItemArray;
92 wxVector<wxGxObjectFactory*> m_ObjectFactoriesArray;
93 wxVector<ROOTITEM> m_staRootitems;
95 wxFileSystemWatcher *m_pWatcher;
96 bool m_bFSWatcherEnable;
98 wxCriticalSection m_oCritFSSect;
100 DECLARE_EVENT_TABLE()
103 #define wxGIS_GXCATALOG_EVENT(x) { wxGxCatalogBase* pGxCatalog = GetGxCatalog(); \
104 if(pGxCatalog) pGxCatalog->x(GetId()); }
105 #define wxGIS_GXCATALOG_EVENT_ID(x, id) { wxGxCatalogBase* pGxCatalog = GetGxCatalog(); \
106 if(pGxCatalog) pGxCatalog->x(id); }
Definition: gxcatalog.h:42
Definition: gxobject.h:111
Definition: gxcatalog.h:61
A base class for GxObject factory.
Definition: gxobjectfactory.h:32
Definition: gxobject.h:37