00001 #ifndef Fireworks_Core_FWViewContextMenuHandlerBase_h 00002 #define Fireworks_Core_FWViewContextMenuHandlerBase_h 00003 // -*- C++ -*- 00004 // 00005 // Package: Core 00006 // Class : FWViewContextMenuHandlerBase 00007 // 00016 // 00017 // Original Author: Chris Jones 00018 // Created: Mon Nov 2 13:46:26 CST 2009 00019 // $Id: FWViewContextMenuHandlerBase.h,v 1.5 2011/03/25 18:02:45 amraktad Exp $ 00020 // 00021 00022 // system include files 00023 00024 // user include files 00025 00026 // forward declarations 00027 class FWModelId; 00028 class FWModelContextMenuHandler; 00029 00030 00031 class FWViewContextMenuHandlerBase 00032 { 00033 00034 public: 00035 FWViewContextMenuHandlerBase(); 00036 virtual ~FWViewContextMenuHandlerBase(); 00037 00038 class MenuEntryAdder { 00039 friend class FWViewContextMenuHandlerBase; 00040 MenuEntryAdder(FWModelContextMenuHandler&); 00041 FWModelContextMenuHandler* m_handler; 00042 // int m_lastIndex; 00043 public: 00046 int addEntry(const char* iEntryName, int idx, bool enable = true); 00047 }; 00048 00049 // ---------- const member functions --------------------- 00050 00051 // ---------- static member functions -------------------- 00052 00053 // ---------- member functions --------------------------- 00054 void addTo(FWModelContextMenuHandler&, const FWModelId &id); 00055 00060 virtual void select(int iEntryIndex, const FWModelId &id, int iX, int iY) = 0; 00061 protected: 00062 00063 private: 00064 FWViewContextMenuHandlerBase(const FWViewContextMenuHandlerBase&); // stop default 00065 00066 const FWViewContextMenuHandlerBase& operator=(const FWViewContextMenuHandlerBase&); // stop default 00067 00069 virtual void init(MenuEntryAdder&, const FWModelId &id) = 0; 00070 00071 00072 }; 00073 00074 #endif