dom/ipc/ColorPickerParent.h

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

michael@0 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
michael@0 2 * vim: set sw=4 ts=8 et tw=80 :
michael@0 3 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #ifndef mozilla_dom_ColorPickerParent_h
michael@0 8 #define mozilla_dom_ColorPickerParent_h
michael@0 9
michael@0 10 #include "mozilla/dom/PColorPickerParent.h"
michael@0 11 #include "nsIColorPicker.h"
michael@0 12
michael@0 13 namespace mozilla {
michael@0 14 namespace dom {
michael@0 15
michael@0 16 class ColorPickerParent : public PColorPickerParent
michael@0 17 {
michael@0 18 public:
michael@0 19 ColorPickerParent(const nsString& aTitle,
michael@0 20 const nsString& aInitialColor)
michael@0 21 : mTitle(aTitle)
michael@0 22 , mInitialColor(aInitialColor)
michael@0 23 {}
michael@0 24
michael@0 25 virtual ~ColorPickerParent() {}
michael@0 26
michael@0 27 virtual bool RecvOpen() MOZ_OVERRIDE;
michael@0 28 virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
michael@0 29
michael@0 30 class ColorPickerShownCallback MOZ_FINAL
michael@0 31 : public nsIColorPickerShownCallback
michael@0 32 {
michael@0 33 public:
michael@0 34 ColorPickerShownCallback(ColorPickerParent* aColorPickerParnet)
michael@0 35 : mColorPickerParent(aColorPickerParnet)
michael@0 36 {}
michael@0 37
michael@0 38 NS_DECL_ISUPPORTS
michael@0 39 NS_DECL_NSICOLORPICKERSHOWNCALLBACK
michael@0 40
michael@0 41 void Destroy();
michael@0 42
michael@0 43 private:
michael@0 44 ColorPickerParent* mColorPickerParent;
michael@0 45 };
michael@0 46
michael@0 47 private:
michael@0 48 bool CreateColorPicker();
michael@0 49
michael@0 50 nsRefPtr<ColorPickerShownCallback> mCallback;
michael@0 51 nsCOMPtr<nsIColorPicker> mPicker;
michael@0 52
michael@0 53 nsString mTitle;
michael@0 54 nsString mInitialColor;
michael@0 55 };
michael@0 56
michael@0 57 } // namespace dom
michael@0 58 } // namespace mozilla
michael@0 59
michael@0 60 #endif // mozilla_dom_ColorPickerParent_h

mercurial