diff options
Diffstat (limited to 'ui/wm/public/tooltip_client.h')
-rw-r--r-- | ui/wm/public/tooltip_client.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/ui/wm/public/tooltip_client.h b/ui/wm/public/tooltip_client.h new file mode 100644 index 0000000..f592b21 --- /dev/null +++ b/ui/wm/public/tooltip_client.h @@ -0,0 +1,45 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_WM_PUBLIC_TOOLTIP_CLIENT_H_ +#define UI_WM_PUBLIC_TOOLTIP_CLIENT_H_ + +#include "ui/aura/aura_export.h" +#include "ui/gfx/font.h" + +namespace aura { +class Window; +namespace client { + +class ScopedTooltipDisabler; + +class AURA_EXPORT TooltipClient { + public: + // Informs the shell tooltip manager of change in tooltip for window |target|. + virtual void UpdateTooltip(Window* target) = 0; + + // Sets the time after which the tooltip is hidden for Window |target|. If + // |timeout_in_ms| is <= 0, the tooltip is shown indefinitely. + virtual void SetTooltipShownTimeout(Window* target, int timeout_in_ms) = 0; + + protected: + // Enables/Disables tooltips. This is treated as a reference count. Consumers + // must use ScopedTooltipDisabler to enable/disabled tooltips. + virtual void SetTooltipsEnabled(bool enable) = 0; + + private: + friend class ScopedTooltipDisabler; +}; + +AURA_EXPORT void SetTooltipClient(Window* root_window, + TooltipClient* client); +AURA_EXPORT TooltipClient* GetTooltipClient(Window* root_window); + +AURA_EXPORT void SetTooltipText(Window* window, base::string16* tooltip_text); +AURA_EXPORT const base::string16 GetTooltipText(Window* window); + +} // namespace client +} // namespace aura + +#endif // UI_WM_PUBLIC_TOOLTIP_CLIENT_H_ |