2015-05-12 09:30:00 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2002-11-13 02:03:27 +03:00
|
|
|
|
|
|
|
#ifndef nsBaseCommandController_h__
|
|
|
|
#define nsBaseCommandController_h__
|
|
|
|
|
|
|
|
#include "nsIController.h"
|
|
|
|
#include "nsIControllerContext.h"
|
|
|
|
#include "nsIInterfaceRequestor.h"
|
2006-04-25 04:44:30 +04:00
|
|
|
#include "nsIWeakReferenceUtils.h"
|
2019-04-03 15:52:56 +03:00
|
|
|
#include "nsControllerCommandTable.h"
|
2019-04-03 15:52:14 +03:00
|
|
|
|
2015-05-11 22:35:14 +03:00
|
|
|
// The base editor controller is used for both text widgets, and all other text
|
|
|
|
// and html editing
|
2019-04-03 15:52:56 +03:00
|
|
|
class nsBaseCommandController final : public nsIController,
|
|
|
|
public nsIControllerContext,
|
|
|
|
public nsIInterfaceRequestor,
|
|
|
|
public nsICommandController {
|
2002-11-13 02:03:27 +03:00
|
|
|
public:
|
2019-04-03 15:52:56 +03:00
|
|
|
/**
|
|
|
|
* The default constructor initializes the instance with new
|
|
|
|
* nsControllerCommandTable. The other constructor does it with
|
|
|
|
* the given aControllerCommandTable.
|
|
|
|
*/
|
|
|
|
explicit nsBaseCommandController(
|
|
|
|
nsControllerCommandTable* aControllerCommandTable =
|
|
|
|
new nsControllerCommandTable());
|
2002-11-13 02:03:27 +03:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSICONTROLLER
|
|
|
|
NS_DECL_NSICOMMANDCONTROLLER
|
|
|
|
NS_DECL_NSICONTROLLERCONTEXT
|
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
2014-07-01 02:11:52 +04:00
|
|
|
|
2019-04-03 15:52:14 +03:00
|
|
|
static already_AddRefed<nsBaseCommandController> CreateWindowController();
|
|
|
|
static already_AddRefed<nsBaseCommandController> CreateEditorController();
|
|
|
|
static already_AddRefed<nsBaseCommandController> CreateEditingController();
|
|
|
|
static already_AddRefed<nsBaseCommandController> CreateHTMLEditorController();
|
|
|
|
static already_AddRefed<nsBaseCommandController>
|
|
|
|
CreateHTMLEditorDocStateController();
|
2018-09-07 06:59:23 +03:00
|
|
|
|
2014-07-01 02:11:52 +04:00
|
|
|
protected:
|
|
|
|
virtual ~nsBaseCommandController();
|
|
|
|
|
2002-11-13 02:03:27 +03:00
|
|
|
private:
|
2015-05-11 22:35:14 +03:00
|
|
|
nsWeakPtr mCommandContextWeakPtr;
|
|
|
|
nsISupports* mCommandContextRawPtr;
|
2002-11-13 02:03:27 +03:00
|
|
|
|
2015-05-11 22:35:14 +03:00
|
|
|
// Our reference to the command manager
|
2019-04-03 15:52:14 +03:00
|
|
|
RefPtr<nsControllerCommandTable> mCommandTable;
|
2002-11-13 02:03:27 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsBaseCommandController_h_ */
|