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

Unified Diff: pdf/control.h

Issue 294793003: Add the pdf plugin's source in src\pdf. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: review comments and sync past DEPS roll to fix gyp Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pdf/chunk_stream.cc ('k') | pdf/control.cc » ('j') | pdf/pdf.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/control.h
===================================================================
--- pdf/control.h (revision 0)
+++ pdf/control.h (revision 0)
@@ -0,0 +1,77 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PDF_CONTROL_H_
+#define PDF_CONTROL_H_
+
+#include <list>
+
+#include "base/basictypes.h"
+#include "ppapi/c/dev/pp_cursor_type_dev.h"
+#include "ppapi/cpp/rect.h"
+
+namespace pp {
+class ImageData;
+class InputEvent;
+class Instance;
+}
+
+namespace chrome_pdf {
+
+const uint32 kInvalidControlId = 0;
+
+class Control {
+ public:
+ class Owner {
+ public:
+ virtual ~Owner() {}
+ virtual void OnEvent(uint32 control_id, uint32 event_id, void* data) = 0;
+ virtual void Invalidate(uint32 control_id, const pp::Rect& rc) = 0;
+ virtual uint32 ScheduleTimer(uint32 control_id, uint32 timeout_ms) = 0;
+ virtual void SetEventCapture(uint32 control_id, bool set_capture) = 0;
+ virtual void SetCursor(uint32 control_id,
+ PP_CursorType_Dev cursor_type) = 0;
+ virtual pp::Instance* GetInstance() = 0;
+ };
+
+ Control();
+ virtual ~Control();
+ virtual bool Create(uint32 id, const pp::Rect& rc,
+ bool visible, Owner* owner);
+
+ virtual void Paint(pp::ImageData* image_data, const pp::Rect& rc) {}
+ virtual bool HandleEvent(const pp::InputEvent& event);
+ virtual void OnTimerFired(uint32 timer_id) {}
+ virtual void EventCaptureReleased() {}
+
+ // Paint control into multiple destination rects.
+ virtual void PaintMultipleRects(pp::ImageData* image_data,
+ const std::list<pp::Rect>& rects);
+
+ virtual void Show(bool visible, bool invalidate);
+ virtual void AdjustTransparency(uint8 transparency, bool invalidate);
+ virtual void MoveBy(const pp::Point& offset, bool invalidate);
+ virtual void SetRect(const pp::Rect& rc, bool invalidate);
+
+ void MoveTo(const pp::Point& origin, bool invalidate);
+
+ uint32 id() const { return id_; }
+ const pp::Rect& rect() const { return rc_; }
+ bool visible() const { return visible_; }
+ Owner* owner() { return owner_; }
+ uint8 transparency() const { return transparency_; }
+
+ private:
+ uint32 id_;
+ pp::Rect rc_;
+ bool visible_;
+ Owner* owner_;
+ uint8 transparency_;
+};
+
+typedef Control::Owner ControlOwner;
+
+} // namespace chrome_pdf
+
+#endif // PDF_CONTROL_H_
Property changes on: pdf\control.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « pdf/chunk_stream.cc ('k') | pdf/control.cc » ('j') | pdf/pdf.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698