]> git.saurik.com Git - wxWidgets.git/blame - contrib/utils/wxrcedit/nodehnd.h
Weekly catch-up
[wxWidgets.git] / contrib / utils / wxrcedit / nodehnd.h
CommitLineData
56d2f750
VS
1/////////////////////////////////////////////////////////////////////////////
2// Purpose: XML resources editor
3// Author: Vaclav Slavik
4// Created: 2000/05/05
5// RCS-ID: $Id$
6// Copyright: (c) 2000 Vaclav Slavik
7// Licence: wxWindows licence
8/////////////////////////////////////////////////////////////////////////////
9
ab7ce33c 10#if defined(__GNUG__) && !defined(__APPLE__)
56d2f750
VS
11 #pragma interface "nodehnd.h"
12#endif
13
14#ifndef _NODEHND_H_
15#define _NODEHND_H_
16
17
1ad83f6b
VS
18class WXDLLEXPORT wxXmlNode;
19class WXDLLEXPORT wxList;
20class WXDLLEXPORT wxListCtrl;
56d2f750
VS
21
22class EditorFrame;
23
24#include "wx/treectrl.h"
999d9a9f 25#include "wx/xrc/xml.h"
12d9e308 26#include "nodesdb.h"
56d2f750
VS
27
28
29
30
31class NodeHandler : public wxObject
32{
33 public:
12d9e308 34 static NodeHandler *Find(wxXmlNode *node);
56d2f750 35
12d9e308 36 NodeHandler(NodeInfo *ni);
56d2f750
VS
37 virtual ~NodeHandler();
38
39 virtual bool CanHandle(wxXmlNode *node);
40 virtual wxTreeItemId CreateTreeNode(wxTreeCtrl *treectrl, wxTreeItemId parent,
41 wxXmlNode *node);
12d9e308 42 virtual PropertyInfoArray& GetPropsList(wxXmlNode *node);
56d2f750
VS
43 virtual int GetTreeIcon(wxXmlNode * WXUNUSED(node)) {return m_NodeInfo->Icon;}
44 virtual wxString GetTreeString(wxXmlNode *node);
56d2f750
VS
45 wxArrayString& GetChildTypes();
46 virtual void InsertNode(wxXmlNode *parent, wxXmlNode *node, wxXmlNode *insert_before = NULL);
47 virtual wxXmlNode *GetRealNode(wxXmlNode *node) { return node; }
48
49 protected:
12d9e308 50
56d2f750
VS
51 NodeInfo *m_NodeInfo;
52 wxArrayString m_ChildTypes;
56d2f750 53
12d9e308
VS
54 static wxList ms_Handlers;
55 static bool ms_HandlersLoaded;
56d2f750
VS
56};
57
58// wxPanel handler
59class NodeHandlerPanel : public NodeHandler
60{
61 public:
12d9e308 62 NodeHandlerPanel(NodeInfo *ni) : NodeHandler(ni) {}
56d2f750
VS
63
64 virtual wxTreeItemId CreateTreeNode(wxTreeCtrl *treectrl, wxTreeItemId parent,
65 wxXmlNode *node);
66 virtual void InsertNode(wxXmlNode *parent, wxXmlNode *node, wxXmlNode *insert_before = NULL);
67};
68
69
70// wxSizers handler
71class NodeHandlerSizer : public NodeHandlerPanel
72{
73 public:
12d9e308 74 NodeHandlerSizer(NodeInfo *ni) : NodeHandlerPanel(ni) {}
56d2f750
VS
75
76 virtual void InsertNode(wxXmlNode *parent, wxXmlNode *node, wxXmlNode *insert_before = NULL);
77 virtual int GetTreeIcon(wxXmlNode *node);
78};
79
80
81// item of wxSizer handler
82class NodeHandlerSizerItem : public NodeHandler
83{
84 public:
12d9e308 85 NodeHandlerSizerItem(NodeInfo *ni) : NodeHandler(ni) {}
56d2f750
VS
86
87 virtual wxTreeItemId CreateTreeNode(wxTreeCtrl *treectrl, wxTreeItemId parent,
88 wxXmlNode *node);
12d9e308 89 virtual PropertyInfoArray& GetPropsList(wxXmlNode *node);
56d2f750
VS
90 virtual wxString GetTreeString(wxXmlNode *node);
91 virtual int GetTreeIcon(wxXmlNode *node);
92 virtual wxXmlNode *GetRealNode(wxXmlNode *node);
12d9e308
VS
93
94 private:
95 PropertyInfoArray m_dummy;
56d2f750
VS
96};
97
98
99
ab13d1c5
VS
100// wxNotebook handler
101class NodeHandlerNotebook : public NodeHandlerPanel
102{
103 public:
12d9e308 104 NodeHandlerNotebook(NodeInfo *ni) : NodeHandlerPanel(ni) {}
ab13d1c5
VS
105
106 virtual void InsertNode(wxXmlNode *parent, wxXmlNode *node, wxXmlNode *insert_before = NULL);
107};
108
109
110// notebook page handler
111class NodeHandlerNotebookPage : public NodeHandlerSizerItem
112{
113 public:
12d9e308
VS
114 NodeHandlerNotebookPage(NodeInfo *ni) :
115 NodeHandlerSizerItem(ni) {}
ab13d1c5
VS
116};
117
118
119
56d2f750
VS
120// Generic handler which handles everything
121class NodeHandlerUnknown : public NodeHandler
122{
123 public:
12d9e308 124 NodeHandlerUnknown() : NodeHandler(new NodeInfo) {}
56d2f750
VS
125
126 virtual bool CanHandle(wxXmlNode *node) { return TRUE; }
127};
128
129
130#endif