OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ | 5 #ifndef ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ |
6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ | 6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | |
10 #include <vector> | |
11 | |
12 #include "ash/system/user/login_status.h" | 9 #include "ash/system/user/login_status.h" |
13 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
14 #include "base/string16.h" | 11 #include "base/string16.h" |
15 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
16 | 13 |
17 class SkBitmap; | 14 class SkBitmap; |
18 | 15 |
19 namespace ash { | 16 namespace ash { |
20 | 17 |
21 struct NetworkIconInfo { | 18 struct NetworkIconInfo { |
22 SkBitmap image; | 19 SkBitmap image; |
23 string16 name; | 20 string16 name; |
24 string16 description; | 21 string16 description; |
25 std::string unique_id; | |
26 }; | 22 }; |
27 | 23 |
28 class SystemTrayDelegate { | 24 class SystemTrayDelegate { |
29 public: | 25 public: |
30 virtual ~SystemTrayDelegate() {} | 26 virtual ~SystemTrayDelegate() {} |
31 | 27 |
32 // Gets information about the logged in user. | 28 // Gets information about the logged in user. |
33 virtual const std::string GetUserDisplayName() const = 0; | 29 virtual const std::string GetUserDisplayName() const = 0; |
34 virtual const std::string GetUserEmail() const = 0; | 30 virtual const std::string GetUserEmail() const = 0; |
35 virtual const SkBitmap& GetUserImage() const = 0; | 31 virtual const SkBitmap& GetUserImage() const = 0; |
36 virtual user::LoginStatus GetUserLoginStatus() const = 0; | 32 virtual user::LoginStatus GetUserLoginStatus() const = 0; |
37 | 33 |
38 // Returns whether a system upgrade is available. | 34 // Returns whether a system upgrade is available. |
39 virtual bool SystemShouldUpgrade() const = 0; | 35 virtual bool SystemShouldUpgrade() const = 0; |
40 | 36 |
41 // Returns the resource id for the icon to show for the update notification. | 37 // Returns the resource id for the icon to show for the update notification. |
42 virtual int GetSystemUpdateIconResource() const = 0; | 38 virtual int GetSystemUpdateIconResource() const = 0; |
43 | 39 |
44 // Returns the desired hour clock type. | 40 // Returns the desired hour clock type. |
45 virtual base::HourClockType GetHourClockType() const = 0; | 41 virtual base::HourClockType GetHourClockType() const = 0; |
46 | 42 |
47 // Shows settings. | 43 // Shows settings. |
48 virtual void ShowSettings() = 0; | 44 virtual void ShowSettings() = 0; |
49 | 45 |
50 // Shows the settings related to date, timezone etc. | 46 // Shows the settings related to date, timezone etc. |
51 virtual void ShowDateSettings() = 0; | 47 virtual void ShowDateSettings() = 0; |
52 | 48 |
53 // Show the settings related to network. | |
54 virtual void ShowNetworkSettings() = 0; | |
55 | |
56 // Shows help. | 49 // Shows help. |
57 virtual void ShowHelp() = 0; | 50 virtual void ShowHelp() = 0; |
58 | 51 |
59 // Is the system audio muted? | 52 // Is the system audio muted? |
60 virtual bool IsAudioMuted() const = 0; | 53 virtual bool IsAudioMuted() const = 0; |
61 | 54 |
62 // Mutes/Unmutes the audio system. | 55 // Mutes/Unmutes the audio system. |
63 virtual void SetAudioMuted(bool muted) = 0; | 56 virtual void SetAudioMuted(bool muted) = 0; |
64 | 57 |
65 // Gets the volume level. | 58 // Gets the volume level. |
66 virtual float GetVolumeLevel() const = 0; | 59 virtual float GetVolumeLevel() const = 0; |
67 | 60 |
68 // Sets the volume level. | 61 // Sets the volume level. |
69 virtual void SetVolumeLevel(float level) = 0; | 62 virtual void SetVolumeLevel(float level) = 0; |
70 | 63 |
71 // Attempts to shut down the system. | 64 // Attempts to shut down the system. |
72 virtual void ShutDown() = 0; | 65 virtual void ShutDown() = 0; |
73 | 66 |
74 // Attempts to sign out the user. | 67 // Attempts to sign out the user. |
75 virtual void SignOut() = 0; | 68 virtual void SignOut() = 0; |
76 | 69 |
77 // Attempts to lock the screen. | 70 // Attempts to lock the screen. |
78 virtual void RequestLockScreen() = 0; | 71 virtual void RequestLockScreen() = 0; |
79 | 72 |
80 // Returns information about the most relevant network. Relevance is | 73 // Returns information about the most relevant network. Relevance is |
81 // determined by the implementor (e.g. a connecting network may be more | 74 // determined by the implementor (e.g. a connecting network may be more |
82 // relevant over a connected network etc.) | 75 // relevant over a connected network etc.) |
83 virtual NetworkIconInfo GetMostRelevantNetworkIcon(bool large) = 0; | 76 virtual NetworkIconInfo GetMostRelevantNetworkIcon() = 0; |
84 | |
85 // Returns information about the available networks. | |
86 virtual void GetAvailableNetworks(std::vector<NetworkIconInfo>* list) = 0; | |
87 | |
88 // Connects to the network specified by the unique id. | |
89 virtual void ConnectToNetwork(const std::string& network_id) = 0; | |
90 | |
91 // Toggles airplane mode. | |
92 virtual void ToggleAirplaneMode() = 0; | |
93 | |
94 // Shows UI for changing proxy settings. | |
95 virtual void ChangeProxySettings() = 0; | |
96 }; | 77 }; |
97 | 78 |
98 } // namespace ash | 79 } // namespace ash |
99 | 80 |
100 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ | 81 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ |
OLD | NEW |