1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7 
8 #ifndef Slide_DEFINED
9 #define Slide_DEFINED
10 
11 #include "SkRefCnt.h"
12 #include "SkSize.h"
13 #include "SkString.h"
14 #include "sk_app/Window.h"
15 
16 class SkCanvas;
17 class SkAnimTimer;
18 class SkMetaData;
19 
20 class Slide : public SkRefCnt {
21 public:
~Slide()22     virtual ~Slide() {}
23 
24     virtual SkISize getDimensions() const = 0;
25 
26     virtual void draw(SkCanvas* canvas) = 0;
animate(const SkAnimTimer &)27     virtual bool animate(const SkAnimTimer&) { return false;  }
load(SkScalar winWidth,SkScalar winHeight)28     virtual void load(SkScalar winWidth, SkScalar winHeight) {}
resize(SkScalar winWidth,SkScalar winHeight)29     virtual void resize(SkScalar winWidth, SkScalar winHeight) {}
unload()30     virtual void unload() {}
31 
onChar(SkUnichar c)32     virtual bool onChar(SkUnichar c) { return false; }
onMouse(SkScalar x,SkScalar y,sk_app::Window::InputState state,uint32_t modifiers)33     virtual bool onMouse(SkScalar x, SkScalar y, sk_app::Window::InputState state,
34                          uint32_t modifiers) { return false; }
35 
onGetControls(SkMetaData *)36     virtual bool onGetControls(SkMetaData*) { return false; }
onSetControls(const SkMetaData &)37     virtual void onSetControls(const SkMetaData&) {}
38 
getName()39     SkString getName() { return fName; }
40 
41 
42 protected:
43     SkString    fName;
44 };
45 
46 
47 #endif
48