1
0

skinembed.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef __SKIN_EMBEDDER_H
  2. #define __SKIN_EMBEDDER_H
  3. #include <bfc/nsguid.h>
  4. #include <bfc/string/bfcstring.h>
  5. #include <bfc/string/StringW.h>
  6. #include <bfc/ptrlist.h>
  7. #include <bfc/depend.h>
  8. #include <api/timer/timerclient.h>
  9. #define CB_DESTROYCONTAINER 0x887
  10. class ifc_window;
  11. class WindowHolder;
  12. class Container;
  13. class Layout;
  14. class SkinEmbedEntry {
  15. public:
  16. SkinEmbedEntry(api_dependent *d, ifc_window *w, GUID g, const wchar_t *gid, const wchar_t *prefered_container, int container_flag, Container *c, WindowHolder *wh) : groupid(gid), guid(g), dep(d), wnd(w), required(container_flag), layout(prefered_container), container(c), wndholder(wh) { }
  17. virtual ~SkinEmbedEntry() { }
  18. StringW groupid;
  19. GUID guid;
  20. api_dependent *dep;
  21. ifc_window *wnd;
  22. int required;
  23. StringW layout;
  24. Container *container;
  25. WindowHolder *wndholder;
  26. };
  27. class SkinEmbedder : public DependentViewerI, public TimerClientDI {
  28. public:
  29. SkinEmbedder();
  30. virtual ~SkinEmbedder();
  31. int toggle(GUID g, const wchar_t *prefered_container=NULL, int container_flag=0, RECT *r=NULL, int transcient=0);
  32. int toggle(const wchar_t *groupid, const wchar_t *prefered_container=NULL, int container_flag=0, RECT *r=NULL, int transcient=0);
  33. ifc_window *create(GUID g, const wchar_t *prefered_container=NULL, int container_flag=0, RECT *r=NULL, int transcient=0, int starthidden=0, int *isnew=NULL);
  34. ifc_window *create(const wchar_t *groupid, const wchar_t *prefered_container=NULL, int container_flag=0, RECT *r=NULL, int transcient=0, int starthidden=0, int *isnew=NULL);
  35. void destroy(ifc_window *w, RECT *r=NULL);
  36. int getNumItems(GUID g);
  37. int getNumItems(const wchar_t *groupid);
  38. ifc_window *enumItem(GUID g, int n);
  39. ifc_window *enumItem(const wchar_t *groupid, int n);
  40. WindowHolder *getSuitableWindowHolder(GUID g, const wchar_t *group_id, Container *cont, Layout *lay, int visible, int dynamic, int empty, int has_self, int autoavail);
  41. void registerWindowHolder(WindowHolder *w);
  42. void unregisterWindowHolder(WindowHolder *w);
  43. void destroyContainer(Container *o);
  44. virtual int timerclient_onDeferredCallback(intptr_t param1, intptr_t param2);
  45. virtual void timerclient_timerCallback(int id);
  46. #ifdef WASABI_COMPILE_CONFIG
  47. void restoreSavedState();
  48. void saveState();
  49. #endif
  50. void attachToSkin(ifc_window *w, int side, int size);
  51. virtual int viewer_onItemDeleted(api_dependent *item);
  52. static void cancelDestroyContainer(Container *c);
  53. private:
  54. ifc_window *create(GUID g, const wchar_t *groupid, const wchar_t *prefered_container=NULL, int container_flag=0, RECT *r=NULL, int transcient=0, int starthidden=0, int *isnew=NULL);
  55. PtrList<WindowHolder> wndholders;
  56. PtrList<SkinEmbedEntry> inserted;
  57. PtrList<SkinEmbedEntry> allofthem;
  58. static PtrList<SkinEmbedEntry> in_deferred_callback;
  59. static PtrList<Container> cancel_deferred_destroy;
  60. static PtrList<Container> deferred_destroy;
  61. };
  62. extern SkinEmbedder *skinEmbedder;
  63. #endif