michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * 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 nsColorPicker_h__ michael@0: #define nsColorPicker_h__ michael@0: michael@0: #include michael@0: #include michael@0: michael@0: #include "nsCOMPtr.h" michael@0: #include "nsIColorPicker.h" michael@0: #include "nsString.h" michael@0: #include "nsThreadUtils.h" michael@0: michael@0: class nsIWidget; michael@0: michael@0: class AsyncColorChooser : michael@0: public nsRunnable michael@0: { michael@0: public: michael@0: AsyncColorChooser(const nsAString& aInitialColor, michael@0: nsIWidget* aParentWidget, michael@0: nsIColorPickerShownCallback* aCallback); michael@0: NS_IMETHOD Run() MOZ_OVERRIDE; michael@0: michael@0: private: michael@0: nsString mInitialColor; michael@0: nsCOMPtr mParentWidget; michael@0: nsCOMPtr mCallback; michael@0: nsString mColor; michael@0: }; michael@0: michael@0: class nsColorPicker : michael@0: public nsIColorPicker michael@0: { michael@0: public: michael@0: nsColorPicker(); michael@0: virtual ~nsColorPicker(); michael@0: michael@0: NS_DECL_ISUPPORTS michael@0: michael@0: NS_IMETHOD Init(nsIDOMWindow* parent, const nsAString& title, michael@0: const nsAString& aInitialColor); michael@0: NS_IMETHOD Open(nsIColorPickerShownCallback* aCallback); michael@0: michael@0: protected: michael@0: nsString mInitialColor; michael@0: nsCOMPtr mParentWidget; michael@0: }; michael@0: michael@0: #endif // nsColorPicker_h__