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

Unified Diff: fpdfsdk/cpdfsdk_annot.cpp

Issue 2236743002: Move CPDFSDK_Annot, CPDFSDK_BAAnnot and CPDFSDK_DateTime to their own files. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Move CPDFSDK_Annot, CPDFSDK_BAAnnot and CPDFSDK_DateTime to their own files. Created 4 years, 4 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 | « BUILD.gn ('k') | fpdfsdk/cpdfsdk_baannot.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/cpdfsdk_annot.cpp
diff --git a/fpdfsdk/cpdfsdk_annot.cpp b/fpdfsdk/cpdfsdk_annot.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e0abe6f54e289b9a7ee54b3d55b972078fea444e
--- /dev/null
+++ b/fpdfsdk/cpdfsdk_annot.cpp
@@ -0,0 +1,105 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#include "fpdfsdk/include/cpdfsdk_annot.h"
+
+#include <algorithm>
+
+#include "fpdfsdk/include/fsdk_mgr.h"
+
+#ifdef PDF_ENABLE_XFA
+#include "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h"
+#endif // PDF_ENABLE_XFA
+
+namespace {
+
+const float kMinWidth = 1.0f;
+const float kMinHeight = 1.0f;
+
+} // namespace
+
+CPDFSDK_Annot::CPDFSDK_Annot(CPDFSDK_PageView* pPageView)
+ : m_pPageView(pPageView), m_bSelected(FALSE), m_nTabOrder(-1) {}
+
+CPDFSDK_Annot::~CPDFSDK_Annot() {}
+
+#ifdef PDF_ENABLE_XFA
+
+FX_BOOL CPDFSDK_Annot::IsXFAField() {
+ return FALSE;
+}
+
+CXFA_FFWidget* CPDFSDK_Annot::GetXFAWidget() const {
+ return nullptr;
+}
+
+CPDFXFA_Page* CPDFSDK_Annot::GetPDFXFAPage() {
+ return m_pPageView ? m_pPageView->GetPDFXFAPage() : nullptr;
+}
+
+#endif // PDF_ENABLE_XFA
+
+FX_FLOAT CPDFSDK_Annot::GetMinWidth() const {
+ return kMinWidth;
+}
+
+FX_FLOAT CPDFSDK_Annot::GetMinHeight() const {
+ return kMinHeight;
+}
+
+int CPDFSDK_Annot::GetLayoutOrder() const {
+ return 5;
+}
+
+CPDF_Annot* CPDFSDK_Annot::GetPDFAnnot() const {
+ return nullptr;
+}
+
+CFX_ByteString CPDFSDK_Annot::GetType() const {
+ return "";
+}
+
+CFX_ByteString CPDFSDK_Annot::GetSubType() const {
+ return "";
+}
+
+void CPDFSDK_Annot::SetRect(const CFX_FloatRect& rect) {}
+
+CFX_FloatRect CPDFSDK_Annot::GetRect() const {
+ return CFX_FloatRect();
+}
+
+void CPDFSDK_Annot::Annot_OnDraw(CFX_RenderDevice* pDevice,
+ CFX_Matrix* pUser2Device,
+ CPDF_RenderOptions* pOptions) {}
+
+FX_BOOL CPDFSDK_Annot::IsSelected() {
+ return m_bSelected;
+}
+
+void CPDFSDK_Annot::SetSelected(FX_BOOL bSelected) {
+ m_bSelected = bSelected;
+}
+
+int CPDFSDK_Annot::GetTabOrder() {
+ return m_nTabOrder;
+}
+
+void CPDFSDK_Annot::SetTabOrder(int iTabOrder) {
+ m_nTabOrder = iTabOrder;
+}
+
+UnderlyingPageType* CPDFSDK_Annot::GetUnderlyingPage() {
+#ifdef PDF_ENABLE_XFA
+ return GetPDFXFAPage();
+#else // PDF_ENABLE_XFA
+ return GetPDFPage();
+#endif // PDF_ENABLE_XFA
+}
+
+CPDF_Page* CPDFSDK_Annot::GetPDFPage() {
+ return m_pPageView ? m_pPageView->GetPDFPage() : nullptr;
+}
« no previous file with comments | « BUILD.gn ('k') | fpdfsdk/cpdfsdk_baannot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698