1 // Copyright 2013 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.
5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_FIRST_RUN_FIRST_RUN_ACTOR_H_
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_FIRST_RUN_FIRST_RUN_ACTOR_H_
10 #include "base/memory/scoped_ptr.h"
13 class DictionaryValue
;
22 virtual ~Delegate() {}
24 // Called after actor was initialized.
25 virtual void OnActorInitialized() = 0;
27 // Called when user clicked "Next" button in step with name |step_name|.
28 virtual void OnNextButtonClicked(const std::string
& step_name
) = 0;
30 // Called when user clicked "Keep exploring" button.
31 virtual void OnHelpButtonClicked() = 0;
33 // Called after step with |step_name| has been shown.
34 virtual void OnStepShown(const std::string
& step_name
) = 0;
36 // Called after step with |step_name| has been shown.
37 virtual void OnStepHidden(const std::string
& step_name
) = 0;
39 // Called in answer to Finalize() call.
40 virtual void OnActorFinalized() = 0;
42 // Notifies about about actor destruction.
43 virtual void OnActorDestroyed() = 0;
48 // Initializes fields in "non-set" state.
51 // Setters for properties. Return |*this|.
52 StepPosition
& SetTop(int top
);
53 StepPosition
& SetRight(int right
);
54 StepPosition
& SetBottom(int bottom
);
55 StepPosition
& SetLeft(int left
);
57 // Returns DictionaryValue containing set properties.
58 scoped_ptr
<base::DictionaryValue
> AsValue() const;
68 virtual ~FirstRunActor();
70 // Returns |true| if actor is initialized. Other public methods can be called
71 // only if |IsInitialized| returns |true|.
72 virtual bool IsInitialized() = 0;
74 // Changes background visibility.
75 virtual void SetBackgroundVisible(bool visible
) = 0;
77 // Adds rectangular hole to background with given position and dimensions.
78 virtual void AddRectangularHole(int x
, int y
, int width
, int height
) = 0;
80 // Adds round hole to background with given position and dimensions.
81 virtual void AddRoundHole(int x
, int y
, float radius
) = 0;
83 // Removes all holes from background.
84 virtual void RemoveBackgroundHoles() = 0;
86 // Shows step with given name and position.
87 virtual void ShowStepPositioned(const std::string
& name
,
88 const StepPosition
& position
) = 0;
90 // Shows step with given name that points to given point.
91 virtual void ShowStepPointingTo(const std::string
& name
,
96 // Hides currently shown step.
97 virtual void HideCurrentStep() = 0;
100 virtual void Finalize() = 0;
102 // Whether actor is finalizing now.
103 virtual bool IsFinalizing() = 0;
105 void set_delegate(Delegate
* delegate
) { delegate_
= delegate
; }
106 Delegate
* delegate() const { return delegate_
; }
112 } // namespace chromeos
114 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_FIRST_RUN_FIRST_RUN_ACTOR_H_