- add sources.
[platform/framework/web/crosswalk.git] / src / ash / system / date / tray_date.h
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 ASH_SYSTEM_DATE_TRAY_DATE_H_
6 #define ASH_SYSTEM_DATE_TRAY_DATE_H_
7
8 #include "ash/system/date/clock_observer.h"
9 #include "ash/system/tray/system_tray_item.h"
10 #include "base/memory/scoped_ptr.h"
11
12 namespace views {
13 class Label;
14 }
15
16 namespace ash {
17 namespace internal {
18
19 #if defined(OS_CHROMEOS)
20 class SystemClockObserver;
21 #endif
22
23 namespace tray {
24 class TimeView;
25 }
26
27 class TrayDate : public SystemTrayItem,
28                  public ClockObserver {
29  public:
30   enum ClockLayout {
31    HORIZONTAL_CLOCK,
32    VERTICAL_CLOCK,
33   };
34   explicit TrayDate(SystemTray* system_tray);
35   virtual ~TrayDate();
36
37   // Returns view for help button if it is exists. Returns NULL otherwise.
38   views::View* GetHelpButtonView() const;
39
40  private:
41   // Overridden from SystemTrayItem.
42   virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE;
43   virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE;
44   virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE;
45   virtual void DestroyTrayView() OVERRIDE;
46   virtual void DestroyDefaultView() OVERRIDE;
47   virtual void DestroyDetailedView() OVERRIDE;
48   virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE;
49   virtual void UpdateAfterShelfAlignmentChange(
50       ShelfAlignment alignment) OVERRIDE;
51
52   // Overridden from ClockObserver.
53   virtual void OnDateFormatChanged() OVERRIDE;
54   virtual void OnSystemClockTimeUpdated() OVERRIDE;
55   virtual void Refresh() OVERRIDE;
56
57   void SetupLabelForTimeTray(views::Label* label);
58
59   tray::TimeView* time_tray_;
60   views::View* default_view_;
61
62 #if defined(OS_CHROMEOS)
63   scoped_ptr<SystemClockObserver> system_clock_observer_;
64 #endif
65
66   DISALLOW_COPY_AND_ASSIGN(TrayDate);
67 };
68
69 }  // namespace internal
70 }  // namespace ash
71
72 #endif  // ASH_SYSTEM_DATE_TRAY_DATE_H_