Warning, /maui/shelf/src/views/Viewer/Viewer_EPUB.qml is written in an unsupported language. File is not indexed.
0001 import QtQuick 2.0 0002 import QtQuick.Controls 2.2 0003 import org.mauikit.controls 1.0 as Maui 0004 import org.kde.kirigami 2.1 as Kirigami 0005 //import org.kde.okular 2.0 as Okular 0006 //import EPUB 1.0 as EPUB 0007 0008 Maui.Page 0009 { 0010 id: root 0011 0012 property string file; 0013 property int currentPage; 0014 property int pageCount; 0015 property var pagesModel; 0016 0017 title: documentItem.windowTitleForDocument; 0018 onFileChanged: documentItem.url = "file://"+file; 0019 // Okular.DocumentItem 0020 // { 0021 // id: documentItem 0022 // // onWindowTitleForDocumentChanged: { 0023 // // fileBrowserRoot.title = windowTitleForDocument 0024 // // } 0025 // onOpenedChanged: { 0026 // if(opened === true) { 0027 //// root.loadingCompleted(true); 0028 //// initialPageChange.start(); 0029 // } 0030 // } 0031 // onCurrentPageChanged: { 0032 // if(root.currentPage !== currentPage) { 0033 // root.currentPage = currentPage; 0034 // } 0035 // } 0036 // } 0037 0038 // ListView 0039 // { 0040 // id: imageBrowser 0041 // anchors.fill: parent; 0042 // model: documentItem.matchingPages; 0043 0044 // property int imageWidth: root.width + Maui.Style.units.largeSpacing; 0045 // property int imageHeight: root.height; 0046 0047 // orientation: ListView.Horizontal 0048 // snapMode: ListView.SnapOneItem 0049 0050 // // This ensures that the current index is always up to date, which we need to ensure we can track the current page 0051 // // as required by the thumbnail navigator, and the resume-reading-from functionality 0052 // onMovementEnded: { 0053 // var indexHere = indexAt(contentX + width / 2, contentY + height / 2); 0054 // if(currentIndex !== indexHere) { 0055 // currentIndex = indexHere; 0056 // } 0057 // } 0058 0059 // delegate: Flickable 0060 // { 0061 // id: flick 0062 // width: imageBrowser.imageWidth 0063 // height: imageBrowser.imageHeight 0064 // contentWidth: imageBrowser.imageWidth 0065 // contentHeight: imageBrowser.imageHeight 0066 // interactive: contentWidth > width || contentHeight > height 0067 // onInteractiveChanged: imageBrowser.interactive = !interactive; 0068 // z: interactive ? 1000 : 0 0069 // PinchArea { 0070 // width: Math.max(flick.contentWidth, flick.width) 0071 // height: Math.max(flick.contentHeight, flick.height) 0072 0073 // property real initialWidth 0074 // property real initialHeight 0075 0076 // onPinchStarted: { 0077 // initialWidth = flick.contentWidth 0078 // initialHeight = flick.contentHeight 0079 // } 0080 0081 // onPinchUpdated: { 0082 // // adjust content pos due to drag 0083 // flick.contentX += pinch.previousCenter.x - pinch.center.x 0084 // flick.contentY += pinch.previousCenter.y - pinch.center.y 0085 0086 // // resize content 0087 // flick.resizeContent(Math.max(imageBrowser.imageWidth, initialWidth * pinch.scale), Math.max(imageBrowser.imageHeight, initialHeight * pinch.scale), pinch.center) 0088 // } 0089 0090 // onPinchFinished: { 0091 // // Move its content within bounds. 0092 // flick.returnToBounds(); 0093 // } 0094 0095 // Item { 0096 // Okular.PageItem { 0097 // id: page; 0098 // document: documentItem; 0099 // pageNumber: index; 0100 // anchors.centerIn: parent; 0101 // property real pageRatio: implicitWidth / implicitHeight 0102 // property bool sameOrientation: root.width / root.height > pageRatio 0103 // width: sameOrientation ? parent.height * pageRatio : parent.width 0104 // height: !sameOrientation ? parent.width / pageRatio : parent.height 0105 // } 0106 // implicitWidth: page.implicitWidth 0107 // implicitHeight: page.implicitHeight 0108 // width: flick.contentWidth 0109 // height: flick.contentHeight 0110 // MouseArea { 0111 // anchors.fill: parent 0112 // onClicked: startToggleControls(); 0113 // onDoubleClicked: { 0114 // abortToggleControls(); 0115 // if (flick.interactive) { 0116 // flick.resizeContent(imageBrowser.imageWidth, imageBrowser.imageHeight, {x: imageBrowser.imageWidth/2, y: imageBrowser.imageHeight/2}); 0117 // } else { 0118 // flick.resizeContent(imageBrowser.imageWidth * 2, imageBrowser.imageHeight * 2, {x: mouse.x, y: mouse.y}); 0119 // } 0120 // } 0121 // } 0122 // } 0123 // } 0124 // } 0125 // } 0126 0127 function open(filePath) 0128 { 0129 root.file = filePath 0130 } 0131 }