include/ax_resource/ax_activator_resource.h

Go to the documentation of this file.
00001 
00002 // Name:        ax_activator_resource.h
00003 // Purpose:     Resource activator classes
00004 // Author:      Julian Smart
00005 // Modified by:
00006 // Created:     2009-03-20
00007 // RCS-ID:
00008 // Copyright:   (c) Julian Smart
00009 // Licence:     New BSD License
00011 
00012 #ifndef _AX_ACTIVATOR_RESOURCE_H_
00013 #define _AX_ACTIVATOR_RESOURCE_H_
00014 
00019 #include "ax/ax_activator.h" 
00020 
00029 class AxResourceLibrary;
00030 
00040 class AxResourceLibraryActivator: public AxActivator
00041 {
00042 public:
00043     
00048     typedef enum {
00049         Search_Fields,
00050         Search_All
00051     } AxResourceLibraryActivatorType;
00052 
00053     DECLARE_DYNAMIC_CLASS( AxResourceLibraryActivator )
00054 
00055 public:
00056 // Constructors
00057 
00058     AxResourceLibraryActivator() { Init(); }
00059     AxResourceLibraryActivator(const AxResourceLibraryActivator& activator) { Init(); Copy(activator); }
00060 
00061     AxResourceLibraryActivator(AxMenuItem* item, AxResourceLibrary* library, AxResourceLibraryActivatorType type);
00062     AxResourceLibraryActivator(AxMenuItem* item, AxResourceLibrary* library, const wxArrayString& fields, const wxArrayString& values);
00063     ~AxResourceLibraryActivator() {}
00064 
00065 // Operations
00066 
00067     void Init();
00068 
00069     void Copy(const AxResourceLibraryActivator& activator);
00070 
00071     virtual AxActivator* Clone() const { return new AxResourceLibraryActivator(*this); }
00072 
00073     virtual AxMenu* Activate(AxMenuController* controller, AxMenuItem* item);
00074 
00075     AxResourceLibraryActivatorType GetType() const { return m_type; }
00076     void SetType(AxResourceLibraryActivatorType type) { m_type = type; }
00077 
00078     AxResourceLibrary* GetLibrary() const { return m_library; }
00079     void SetLibrary(AxResourceLibrary* library) { m_library = library; }
00080 
00081 protected:
00082     wxArrayString                   m_fields;
00083     wxArrayString                   m_values;
00084 
00085     AxResourceLibrary*              m_library;
00086     AxResourceLibraryActivatorType  m_type;
00087 
00088 };
00089 
00103 class AxResourceActivator: public AxActivator
00104 {
00105 public:
00106     
00107     DECLARE_DYNAMIC_CLASS( AxResourceActivator )
00108 
00109 public:
00110 // Constructors
00111 
00112     AxResourceActivator() { Init(); }
00113     AxResourceActivator(const AxResourceActivator& activator) { Init(); Copy(activator); }
00114 
00115     AxResourceActivator(AxResourceLibrary* library, AxResource* resource);
00116     ~AxResourceActivator();
00117 
00118 // Operations
00119 
00120     void Init();
00121 
00122     void Copy(const AxResourceActivator& activator);
00123 
00124     virtual AxActivator* Clone() const { return new AxResourceActivator(*this); }
00125 
00126     virtual AxMenu* Activate(AxMenuController* controller, AxMenuItem* item);
00127 
00130     virtual bool Reactivate(AxMenuController* controller, AxMenuItem* item);
00131 
00133     virtual bool Select(AxMenuController* controller, AxMenuItem* item);
00134 
00135     AxResource* GetResource() const { return m_resource; }
00136     void SetResource(AxResource* resource) { m_resource = resource; }
00137 
00138     AxResourceLibrary* GetLibrary() const { return m_library; }
00139     void SetLibrary(AxResourceLibrary* library) { m_library = library; }
00140 
00141     AxActivator* GetSpecificActivator() const { return m_specificActivator; }
00142     void SetSpecificActivator(AxActivator* activator) { m_specificActivator = activator; }
00143 
00144 protected:
00145     AxResourceLibrary*  m_library;
00146     AxResource*         m_resource;
00147     AxActivator*        m_specificActivator;
00148 };
00149 
00150 #endif
00151     // _AX_ACTIVATOR_RESOURCE_H_

Generated on Wed May 6 19:20:18 2009 for AxTk by  doxygen 1.5.1