25 #ifndef ZLOGVIEWPORT_H 26 #define ZLOGVIEWPORT_H 43 class ZblLogSearchParams;
129 bool background =
false);
247 Q_INVOKABLE
void move(
344 qint64 getCurrentLocation();
357 int getSelectionType();
361 int getBookmarkType();
363 int getInvalidType();
385 void loadComplete(
bool endOfData, QString errorMsg, QVariantMap context);
454 QList<int> modelRoles,
592 QString searchPhrase,
623 QList<int> modelRoles,
654 QVariant getCurrentSearchParams();
828 #endif // ZLOGVIEWPORT_H
qint64 getActiveLocation()
void onMarkupCompleted(ZLogViewport *viewport, ZblLogSearchList rowsFound)
Connected to the ZblLogBkSearch::markupUpdatred signal.
int bookmarksRole
Role number of the log record bookmarks in the viewport data model.
static int m_roleByteCount
Role number of the byte count value in the log record data model.
ZTableModel * m_model
The data model that receives the viewport's log records.
void putRecordSize(int size)
Set the average log record size ZLogViewport will use when calculating memory buffer sizes...
static const qint64 m_maximumRecordSize
The maximum record size ZLogViewport will use. Currently 65536 bytes.
Q_INVOKABLE void move(qint64 recordCount, bool forward)
Moves the viewport forward or backwards. This method is asynchronous.
static int m_roleSeekIndex
Role number of the seek index value in the log record data model.
bool m_motionLock
Flag prevents viewport from being moved or updated during background operations.
static int getByteCountRole()
Obtain the role number for the byte count of a log record in the viewport's log record data model...
ZblLogMark m_logMark
The viewport's active location indicates the log record from which search operations will start...
int assumeRecordSize
The log reader assumes this is the average number of bytes per log record for calculating buffer size...
bool searchDirectionBoth
Returns (SearchDirectionBackward || SearchDirectionForward)
#define ZBL_DECLARE_LOGGED_OBJECT
This class performs log file I/O operations and JSON parsing in a background thread on behalf of a ZL...
QObject * getCurrentSearch()
Obtains a javascript wrapper for the current search object for this viewport.
int getRecordSize()
Obtain the average log record size ZLogViewport will use when calculating memory buffer sizes...
A QML type that manages reading JSON formatted Zuble log files. QML programs create using Zbl...
void rowMatched(qint64 modelRow, QList< int > modelRoles, QList< QString > markupText)
Received when the ZblLogBkSearch has found a row matching the search criteria within the viewport's d...
Q_INVOKABLE void loadRecords(qint64 seekPosition, qint64 recordCount)
Loads a consecutive set of log records from the log file into the viewport.
zblLogReaderPtr m_reader
The background worker object that reads and parses the viewport's log file. This value must not be nu...
bool searchDirectionForward
Returns the flag for searching forward.
void onRowMatched(qint64 modelRow, QList< int > modelRoles, QList< QString > markupText)
Connected to the rowMatched signal to update encapsulated ZLogSearch and ZLogMapModel objects when se...
void onUpdateBookmarks()
Signal handler for ZLogReader::updateLogMarks signal.
qint64 getRecordModelRow(qint64 recordID)
Obtain the index position for the specified log record in the model.
ZLogReader * getZReader()
Obtains the ZLogReader object that is the parent of this ZLogViewport object.
void onSearchDeleteRequested(QObject *searchObject)
Handler for ZLogReader::searchDeleteRequested signal.
bool markupText()
Marks up text in the viewport's data model asynchronously using the current search parameters...
int activeLocation
Obtain the file seek position for the currently active log record in the viewport.
This class allows Zuble log file viewer text search operations to pass parameters between threads...
static int getBookmarksRole()
Obtain the role number for the bookmark data of a log record in the viewport's log record data model...
Maintains a list of log record links pertaining to a specific log file.
ZLogViewport * m_listener
Companion ZLogViewport object to receive forwarded signals. Value may be null.
qint64 m_assumeRecordSize
The viewport will assume log records average this number of bytes (including JSON formating character...
void searchComplete()
Sent when entire background search operation has completed.
int currentID
Obtain the log record ID for the first log record in the viewport.
ZTableModel * getZModel()
Returns the data model containing the viewport's log records.
bool setCurrentSearch(QObject *search)
Sets this viewport's current search object.
Defines the location of a single log record in a log file.
A log viewport encapsulates a ZTableModel containing a contiguous subset of log records from a Zuble ...
void setListener(ZLogViewport *listener)
ZLogViewport * getListener() const
int activeID
Obtain the log record ID for the currently active log record in the viewport.
static int m_roleBookmarks
Role number of the bookmarks value in the log record data model.
void markupUpdated()
Sent when search has completed marking up viewport model data.
int getSearchDirBackward()
qint64 getRecordSeekPos(qint64 recordID)
Obtain the file seek position for the specified log record ID from model data in the viewport...
ZLogViewport(ZblLogReader *reader, qint64 recordCount, QObject *parent=0, bool background=false)
Viewport constructor.
bool searchDirectionBackward
Returns the flag for searching backward.
ZLogMap * m_selectionMap
A log mark map that holds the current selection for this viewport.
This two dimensional table model is used to store and manipulate data.
qint64 getMaxRecordCount()
Returns the number of log records the viewport data model will attempt to hold.
void findComplete(qint64 recordID, qint64 seekPos, QList< int >columns)
Sent when a search operation started with findNext() function has located a target log record...
QSharedPointer< ZblLogSearch > zblLogSearchPtr
int byteCountRole
Role number of the log record byte count in the viewport data model.
ZBL_DECLARE_LOGGED_OBJECT ZblLogSearchParams getSearchParameters()
A Qt log category for this class.
QObject * getModel()
Obtains the log viewport's data model which contains a contiguous subset of rows from the log file...
qint64 getNextPageLocation()
void loadComplete(bool endOfData, QString errorMsg, QVariantMap context)
Signals that loading of the viewport requested by a call to loadRecordByIndex() has completed...
zblLogSearchPtr getZSearch()
Obtains the current search log map for this viewport.
void moveComplete(qint64 rowsFound, qint64 rowsStored, bool endOfData, QString errorMsg)
Signals that moving of the viewport requested by a call to move() has completed.
ZblLogSearchList m_searchLinks
A list of log record links for records in the viewport that satisfy the current search criteria...
qint64 currentLocation
Obtain the file seek position for the first log record in the viewport.
int m_timerID
ID for the viewport's event timer.
qint64 getCurrentLocation()
This class allows Zuble log file viewer text search operations to pass search results between threads...
int seekIndexRole
Role number of the log record seek index in the viewport data model.
static int getSeekIndexRole()
Obtain the role number for the file seek position of a log record in the viewport's log record data m...
QObject * getReader()
Obtains the ZLogReader object that is the parent of this ZLogViewport object.
QObject * getCurrentSearchlinks()
Obtain a data model containing the log record links for the current search.
void setLock(bool locked)
Sets or clears the viewport motion lock.
qint64 m_optimalCount
Identifies the first record in the viewport.
int getSearchDirForward()
static const qint64 m_minimumRecordSize
The minimum record size ZLogViewport will use. Currently 1024 bytes.
zblLogSearchPtr m_currentSearch
A log mark map that holds the current search results for this viewport.
static void registerType()
Registers ZLogViewport as a QML type.
QPointer< ZblLogReader > zblLogReaderPtr
QObject * getSelection()
Obtains the selection log mark map for this viewport. Each viewport has its own selection.
virtual void timerEvent(QTimerEvent *event)
Timer is used to flush excess log records from the log record buffer.
bool locked
True if the viewport is locked for scanning, false otherwise.
QObject * getCurrentBookmarklinks()
Obtain a data model containing the log record links for the current bookmark. [TBD: does this even ma...