nsBaseCommandController.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef nsBaseCommandController_h__
  6. #define nsBaseCommandController_h__
  7. #define NS_BASECOMMANDCONTROLLER_CID \
  8. { 0xbf88b48c, 0xfd8e, 0x40b4, { 0xba, 0x36, 0xc7, 0xc3, 0xad, 0x6d, 0x8a, 0xc9 } }
  9. #define NS_BASECOMMANDCONTROLLER_CONTRACTID \
  10. "@mozilla.org/embedcomp/base-command-controller;1"
  11. #include "nsIController.h"
  12. #include "nsIControllerContext.h"
  13. #include "nsIControllerCommandTable.h"
  14. #include "nsIInterfaceRequestor.h"
  15. #include "nsIWeakReferenceUtils.h"
  16. // The base editor controller is used for both text widgets, and all other text
  17. // and html editing
  18. class nsBaseCommandController
  19. : public nsIController
  20. , public nsIControllerContext
  21. , public nsIInterfaceRequestor
  22. , public nsICommandController
  23. {
  24. public:
  25. nsBaseCommandController();
  26. NS_DECL_ISUPPORTS
  27. NS_DECL_NSICONTROLLER
  28. NS_DECL_NSICOMMANDCONTROLLER
  29. NS_DECL_NSICONTROLLERCONTEXT
  30. NS_DECL_NSIINTERFACEREQUESTOR
  31. protected:
  32. virtual ~nsBaseCommandController();
  33. private:
  34. nsWeakPtr mCommandContextWeakPtr;
  35. nsISupports* mCommandContextRawPtr;
  36. // Our reference to the command manager
  37. nsCOMPtr<nsIControllerCommandTable> mCommandTable;
  38. };
  39. #endif /* nsBaseCommandController_h_ */