Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: pdf/control.h

Issue 1125103002: Remove the in-process PDF viewer from pdf/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-in-process-instance
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pdf/button.cc ('k') | pdf/control.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 PDF_CONTROL_H_
6 #define PDF_CONTROL_H_
7
8 #include <list>
9
10 #include "base/basictypes.h"
11 #include "ppapi/c/dev/pp_cursor_type_dev.h"
12 #include "ppapi/cpp/rect.h"
13
14 namespace pp {
15 class ImageData;
16 class InputEvent;
17 class Instance;
18 }
19
20 namespace chrome_pdf {
21
22 const uint32 kInvalidControlId = 0;
23
24 class Control {
25 public:
26 class Owner {
27 public:
28 virtual ~Owner() {}
29 virtual void OnEvent(uint32 control_id, uint32 event_id, void* data) = 0;
30 virtual void Invalidate(uint32 control_id, const pp::Rect& rc) = 0;
31 virtual uint32 ScheduleTimer(uint32 control_id, uint32 timeout_ms) = 0;
32 virtual void SetEventCapture(uint32 control_id, bool set_capture) = 0;
33 virtual void SetCursor(uint32 control_id,
34 PP_CursorType_Dev cursor_type) = 0;
35 virtual pp::Instance* GetInstance() = 0;
36 };
37
38 Control();
39 virtual ~Control();
40 virtual bool Create(uint32 id, const pp::Rect& rc,
41 bool visible, Owner* owner);
42
43 virtual void Paint(pp::ImageData* image_data, const pp::Rect& rc) {}
44 virtual bool HandleEvent(const pp::InputEvent& event);
45 virtual void OnTimerFired(uint32 timer_id) {}
46 virtual void EventCaptureReleased() {}
47
48 // Paint control into multiple destination rects.
49 virtual void PaintMultipleRects(pp::ImageData* image_data,
50 const std::list<pp::Rect>& rects);
51
52 virtual void Show(bool visible, bool invalidate);
53 virtual void AdjustTransparency(uint8 transparency, bool invalidate);
54 virtual void MoveBy(const pp::Point& offset, bool invalidate);
55 virtual void SetRect(const pp::Rect& rc, bool invalidate);
56
57 void MoveTo(const pp::Point& origin, bool invalidate);
58
59 uint32 id() const { return id_; }
60 const pp::Rect& rect() const { return rc_; }
61 bool visible() const { return visible_; }
62 Owner* owner() { return owner_; }
63 uint8 transparency() const { return transparency_; }
64
65 private:
66 uint32 id_;
67 pp::Rect rc_;
68 bool visible_;
69 Owner* owner_;
70 uint8 transparency_;
71 };
72
73 typedef Control::Owner ControlOwner;
74
75 } // namespace chrome_pdf
76
77 #endif // PDF_CONTROL_H_
OLDNEW
« no previous file with comments | « pdf/button.cc ('k') | pdf/control.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698