navigation.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #ifndef NULLSOFT_WEBDEV_PLUGIN_NAVIGATION_HEADER
  2. #define NULLSOFT_WEBDEV_PLUGIN_NAVIGATION_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. #include <ifc_mlnavigationcallback.h>
  8. #include <vector>
  9. typedef LPVOID HNAVITEM;
  10. class ifc_omservice;
  11. class Navigation : public ifc_mlnavigationcallback
  12. {
  13. protected:
  14. Navigation();
  15. ~Navigation();
  16. public:
  17. static HRESULT CreateInstance(Navigation **instance);
  18. public:
  19. /* Dispatchable */
  20. size_t AddRef();
  21. size_t Release();
  22. int QueryInterface(GUID interface_guid, void **object);
  23. /* ifc_mlnavigationcallback */
  24. void ImageChanged(LPCWSTR pszName, INT index);
  25. public:
  26. HRESULT Finish();
  27. BOOL ProcessMessage(INT msg, INT_PTR param1, INT_PTR param2, INT_PTR param3, INT_PTR *result);
  28. HNAVITEM GetActive(ifc_omservice **serviceOut);
  29. HWND GetActiveView(ifc_omservice **serviceOut);
  30. HRESULT SelectItem(HNAVITEM hItem, LPCWSTR pszUrl);
  31. HRESULT DeleteItem(HNAVITEM hItem);
  32. HRESULT DeleteAll();
  33. HRESULT CreatePopup(HNAVITEM hItem, HWND *hwnd);
  34. HRESULT GetService(HNAVITEM hItem, ifc_omservice **service);
  35. HRESULT UpdateService(ifc_omservice *service, UINT modifiedFlags);
  36. HNAVITEM FindService(UINT serviceId, ifc_omservice **serviceOut);
  37. HRESULT ShowService(UINT serviceId, LPCWSTR pszUrl);
  38. HNAVITEM CreateItem(ifc_omservice *service);
  39. HRESULT CreateUserService(HNAVITEM *itemOut);
  40. protected:
  41. HRESULT Initialize();
  42. HRESULT SaveOrder();
  43. HRESULT Order(std::vector<ifc_omservice *>&list);
  44. HNAVITEM GetMessageItem(INT msg, INT_PTR param1);
  45. HNAVITEM CreateItemInt(HNAVITEM hParent, ifc_omservice *service);
  46. HRESULT SelectItemInt(HNAVITEM hItem, UINT serviceId, LPCWSTR pszUrl);
  47. HRESULT GenerateServiceName(LPWSTR pszBuffer, INT cchBufferMax);
  48. HRESULT OnCreateView(HNAVITEM hItem, HWND hParent, HWND *hView);
  49. HRESULT OnContextMenu(HNAVITEM hItem, HWND hHost, POINTS pts);
  50. HRESULT OnEndTitleEdit(HNAVITEM hItem, LPCWSTR pszNewTitle);
  51. HRESULT OnDeleteItem(HNAVITEM hItem);
  52. HRESULT OnKeyDown(HNAVITEM hItem, NMTVKEYDOWN *pnmkd);
  53. HRESULT OnControlDestroy();
  54. protected:
  55. size_t ref;
  56. HNAVITEM hRoot;
  57. HWND hLibrary;
  58. UINT cookie;
  59. protected:
  60. RECVS_DISPATCH;
  61. };
  62. #endif //NULLSOFT_WEBDEV_PLUGIN_NAVIGATION_HEADER