OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_LINUX_UI_LINUX_UI_H_ | |
6 #define UI_LINUX_UI_LINUX_UI_H_ | |
7 | |
8 #include "third_party/skia/include/core/SkColor.h" | |
9 #include "ui/linux_ui/linux_ui_export.h" | |
10 #include "ui/linux_ui/status_icon_linux.h" | |
11 #include "ui/shell_dialogs/linux_shell_dialog.h" | |
12 | |
13 // The main entrypoint into Linux toolkit specific code. GTK code should only | |
14 // be executed behind this interface. | |
15 | |
16 namespace gfx { | |
17 class Image; | |
18 } | |
19 | |
20 namespace ui { | |
21 class NativeTheme; | |
22 | |
23 // Adapter class with targets to render like different toolkits. Set by any | |
24 // project that wants to do linux desktop native rendering. | |
25 // | |
26 // TODO(erg): We're hardcoding GTK2, when we'll need to have backends for (at | |
27 // minimum) GTK2 and GTK3. LinuxUI::instance() should actually be a very | |
28 // complex method that pokes around with dlopen against a libuigtk2.so, a | |
29 // liuigtk3.so, etc. | |
30 // | |
31 // TODO(erg): This class should be folded into ui/views/ instead of living in | |
32 // its own component once we've deleted out the GTK+ port. | |
33 class LINUX_UI_EXPORT LinuxUI : public LinuxShellDialog { | |
34 public: | |
35 virtual ~LinuxUI() {} | |
36 | |
37 // Sets the dynamically loaded singleton that draws the desktop native UI. | |
38 static void SetInstance(LinuxUI* instance); | |
39 | |
40 // Returns a LinuxUI instance for the toolkit used in the user's desktop | |
41 // environment. | |
42 // | |
43 // Can return NULL, in case no toolkit has been set. (For example, if we're | |
44 // running with the "--ash" flag.) | |
45 static const LinuxUI* instance(); | |
46 | |
47 // Returns an themed image per theme_provider.h | |
48 virtual bool UseNativeTheme() const = 0; | |
49 virtual gfx::Image GetThemeImageNamed(int id) const = 0; | |
50 virtual bool GetColor(int id, SkColor* color) const = 0; | |
51 virtual bool HasCustomImage(int id) const = 0; | |
52 | |
53 // Returns a NativeTheme that will provide system colors and draw system | |
54 // style widgets. | |
55 virtual NativeTheme* GetNativeTheme() const = 0; | |
56 | |
57 // Returns whether we should be using the native theme provided by this | |
58 // object by default. | |
59 virtual bool GetDefaultUsesSystemTheme() const = 0; | |
60 | |
61 // Sets visual properties in the desktop environment related to download | |
62 // progress, if available. | |
63 virtual void SetDownloadCount(int count) const = 0; | |
64 virtual void SetProgressFraction(float percentage) const = 0; | |
65 | |
66 // Checks for platform support for status icons. | |
67 virtual bool IsStatusIconSupported() const = 0; | |
68 | |
69 // Create a native status icon. | |
70 virtual scoped_ptr<StatusIconLinux> CreateLinuxStatusIcon( | |
71 const gfx::ImageSkia& image, | |
72 const string16& tool_tip) const = 0; | |
73 }; | |
74 | |
75 } // namespace ui | |
76 | |
77 #endif // UI_LINUX_UI_LINUX_UI_H_ | |
OLD | NEW |