1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/embedding/components/commandhandler/src/nsBaseCommandController.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,58 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsBaseCommandController_h__ 1.10 +#define nsBaseCommandController_h__ 1.11 + 1.12 +#define NS_BASECOMMANDCONTROLLER_CID \ 1.13 +{ 0xbf88b48c, 0xfd8e, 0x40b4, { 0xba, 0x36, 0xc7, 0xc3, 0xad, 0x6d, 0x8a, 0xc9 } } 1.14 +#define NS_BASECOMMANDCONTROLLER_CONTRACTID \ 1.15 + "@mozilla.org/embedcomp/base-command-controller;1" 1.16 + 1.17 + 1.18 +#include "nsIController.h" 1.19 +#include "nsIControllerContext.h" 1.20 +#include "nsIControllerCommandTable.h" 1.21 +#include "nsIInterfaceRequestor.h" 1.22 +#include "nsIWeakReferenceUtils.h" 1.23 + 1.24 +// The base editor controller is used for both text widgets, 1.25 +// and all other text and html editing 1.26 +class nsBaseCommandController : public nsIController, 1.27 + public nsIControllerContext, 1.28 + public nsIInterfaceRequestor, 1.29 + public nsICommandController 1.30 +{ 1.31 +public: 1.32 + 1.33 + nsBaseCommandController(); 1.34 + virtual ~nsBaseCommandController(); 1.35 + 1.36 + // nsISupports 1.37 + NS_DECL_ISUPPORTS 1.38 + 1.39 + // nsIController 1.40 + NS_DECL_NSICONTROLLER 1.41 + 1.42 + // nsICommandController 1.43 + NS_DECL_NSICOMMANDCONTROLLER 1.44 + 1.45 + //nsIControllerContext 1.46 + NS_DECL_NSICONTROLLERCONTEXT 1.47 + 1.48 + // nsIInterfaceRequestor 1.49 + NS_DECL_NSIINTERFACEREQUESTOR 1.50 + 1.51 +private: 1.52 + 1.53 + nsWeakPtr mCommandContextWeakPtr; 1.54 + nsISupports* mCommandContextRawPtr; 1.55 + 1.56 + // Our reference to the command manager 1.57 + nsCOMPtr<nsIControllerCommandTable> mCommandTable; 1.58 +}; 1.59 + 1.60 +#endif /* nsBaseCommandController_h_ */ 1.61 +