1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/ipc/ColorPickerParent.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,60 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * vim: set sw=4 ts=8 et tw=80 : 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef mozilla_dom_ColorPickerParent_h 1.11 +#define mozilla_dom_ColorPickerParent_h 1.12 + 1.13 +#include "mozilla/dom/PColorPickerParent.h" 1.14 +#include "nsIColorPicker.h" 1.15 + 1.16 +namespace mozilla { 1.17 +namespace dom { 1.18 + 1.19 +class ColorPickerParent : public PColorPickerParent 1.20 +{ 1.21 + public: 1.22 + ColorPickerParent(const nsString& aTitle, 1.23 + const nsString& aInitialColor) 1.24 + : mTitle(aTitle) 1.25 + , mInitialColor(aInitialColor) 1.26 + {} 1.27 + 1.28 + virtual ~ColorPickerParent() {} 1.29 + 1.30 + virtual bool RecvOpen() MOZ_OVERRIDE; 1.31 + virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE; 1.32 + 1.33 + class ColorPickerShownCallback MOZ_FINAL 1.34 + : public nsIColorPickerShownCallback 1.35 + { 1.36 + public: 1.37 + ColorPickerShownCallback(ColorPickerParent* aColorPickerParnet) 1.38 + : mColorPickerParent(aColorPickerParnet) 1.39 + {} 1.40 + 1.41 + NS_DECL_ISUPPORTS 1.42 + NS_DECL_NSICOLORPICKERSHOWNCALLBACK 1.43 + 1.44 + void Destroy(); 1.45 + 1.46 + private: 1.47 + ColorPickerParent* mColorPickerParent; 1.48 + }; 1.49 + 1.50 + private: 1.51 + bool CreateColorPicker(); 1.52 + 1.53 + nsRefPtr<ColorPickerShownCallback> mCallback; 1.54 + nsCOMPtr<nsIColorPicker> mPicker; 1.55 + 1.56 + nsString mTitle; 1.57 + nsString mInitialColor; 1.58 +}; 1.59 + 1.60 +} // namespace dom 1.61 +} // namespace mozilla 1.62 + 1.63 +#endif // mozilla_dom_ColorPickerParent_h 1.64 \ No newline at end of file