michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * vim: set sw=4 ts=8 et tw=80 : michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_ColorPickerParent_h michael@0: #define mozilla_dom_ColorPickerParent_h michael@0: michael@0: #include "mozilla/dom/PColorPickerParent.h" michael@0: #include "nsIColorPicker.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: class ColorPickerParent : public PColorPickerParent michael@0: { michael@0: public: michael@0: ColorPickerParent(const nsString& aTitle, michael@0: const nsString& aInitialColor) michael@0: : mTitle(aTitle) michael@0: , mInitialColor(aInitialColor) michael@0: {} michael@0: michael@0: virtual ~ColorPickerParent() {} michael@0: michael@0: virtual bool RecvOpen() MOZ_OVERRIDE; michael@0: virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE; michael@0: michael@0: class ColorPickerShownCallback MOZ_FINAL michael@0: : public nsIColorPickerShownCallback michael@0: { michael@0: public: michael@0: ColorPickerShownCallback(ColorPickerParent* aColorPickerParnet) michael@0: : mColorPickerParent(aColorPickerParnet) michael@0: {} michael@0: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSICOLORPICKERSHOWNCALLBACK michael@0: michael@0: void Destroy(); michael@0: michael@0: private: michael@0: ColorPickerParent* mColorPickerParent; michael@0: }; michael@0: michael@0: private: michael@0: bool CreateColorPicker(); michael@0: michael@0: nsRefPtr mCallback; michael@0: nsCOMPtr mPicker; michael@0: michael@0: nsString mTitle; michael@0: nsString mInitialColor; michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: #endif // mozilla_dom_ColorPickerParent_h