WARNING: USE THIS SOFTWARE AT YOUR OWN RISK! THIS IS EXPERIMENTAL SOFTWARE NOT INTENDED FOR PRODUCTION USE! Zuble is currently an early stage prototype. As such Zuble is minimally tested and inherently unstable. It is provided for experimental, development, and demonstration purposes only. Zuble QML Types   |  Zuble C++ Classes   |  Zuble Overview
Zuble  0.1
Zuble Framework C++/QML extension API
ZLogSearch.h
Go to the documentation of this file.
1 #ifndef ZLOGSEARCH_H
2 #define ZLOGSEARCH_H
3 
4 #include <QObject>
5 #include "ZblLogSearch.h"
6 
7 namespace Zbl
8 {
9 
10 //class ZblLogSearch;
11 
18 class ZLogSearch : public QObject
19 {
20  friend class ZLogViewport;
21 
22  Q_OBJECT
23 private:
24  Q_DISABLE_COPY(ZLogSearch)
25 
26 public:
27 
29  {
34  };
35  Q_ENUM(SearchState)
36 
38  {
41  };
42  Q_ENUM(SearchType)
43 
44  explicit ZLogSearch(QSharedPointer<ZblLogSearch> searchPtr, ZLogReader* reader);
45 
46  QSharedPointer<ZblLogSearch> getZSearch();
47 
48  // immutable properties
49 
50  //Q_PROPERTY(QString searchPhrase READ getPhrase NOTIFY notifySearchPhrase)
51 
52  Q_PROPERTY(QString searchPhrase READ getPhrase CONSTANT)
53 
54  Q_PROPERTY(int searchType READ getSearchType CONSTANT)
55 
56  Q_PROPERTY(QList<int> searchRoles READ getSearchRoles CONSTANT)
57 
58  // variable read-only properties
59 
60  Q_PROPERTY(int status READ getSearchState NOTIFY notifySearchState)
61  Q_PROPERTY(bool active READ getActive NOTIFY notifyActive)
62  Q_PROPERTY(bool saved READ getSaved NOTIFY notifySaved)
64 
65  // variable read-write properties
66 
69 
70  // constants
71 
72  Q_PROPERTY(int CaseSensitive READ getCaseSensitive CONSTANT)
73  Q_PROPERTY(int CaseInsensitive READ getCaseInsensitive CONSTANT)
74 
75 
76 
77 
78  QString getPhrase() const;
79  int getSearchType() const;
80  QList<int> getSearchRoles() const;
81  int getCaseSensitive() const;
82  int getCaseInsensitive() const;
83  int getSearchState() const;
84  bool getSearchForward() const;
85  void setSearchForward(bool forward);
86  bool getSearchBackward() const;
87  void setSearchBackward(bool backward);
88 
89  bool getActive() const;
90  bool getSaved() const;
91  qint64 getCompletionFileSize() const;
92 
93 
94 
100  Q_INVOKABLE QObject* getReader() const;
101 
116  Q_INVOKABLE QObject* resultModel();
117 
118 
125  Q_INVOKABLE bool isValid() const;
126 
127 
136  void onInvalidate();
137 
138 
139 signals:
140 
141  void notifySearchState(int newValue);
142  void notifySearchForward(bool newValue);
143  void notifySearchBackward(bool newValue);
144 
145  void notifyActive(bool newValue);
146  void notifySaved(bool newValue);
147  void notifyCompletionFileSize(qint64 newValue);
148 
149 
150 public slots:
151 
152  void search();
153 
154 protected:
155 
156  QSharedPointer<ZblLogSearch> m_search;
157 };
158 
159 } // Zbl
160 
161 #endif // ZLOGSEARCH_H
Q_INVOKABLE QObject * getReader() const
Returns the foreground log file reader object for this search.
Definition: ZLogSearch.cpp:17
bool searchBackward
Definition: ZLogSearch.h:68
void setSearchBackward(bool backward)
Definition: ZLogSearch.cpp:108
A QML type that manages reading JSON formatted Zuble log files. QML programs create using Zbl...
Definition: ZLogReader.h:62
qint64 completionFileSize
Definition: ZLogSearch.h:63
QString getPhrase() const
Definition: ZLogSearch.cpp:22
void notifySearchBackward(bool newValue)
bool searchForward
Definition: ZLogSearch.h:67
A wrapper for the explicitly shared ZblLogSearch object.
Definition: ZLogSearch.h:18
bool getSearchForward() const
Definition: ZLogSearch.cpp:82
bool getActive() const
Definition: ZLogSearch.cpp:65
void notifyCompletionFileSize(qint64 newValue)
int getCaseInsensitive() const
Definition: ZLogSearch.cpp:51
QList< int > searchRoles
Definition: ZLogSearch.h:56
A log viewport encapsulates a ZTableModel containing a contiguous subset of log records from a Zuble ...
Definition: ZLogViewport.h:95
Definition: ZAndGate.cpp:6
QList< int > getSearchRoles() const
Definition: ZLogSearch.cpp:38
void notifyActive(bool newValue)
int getSearchType() const
Definition: ZLogSearch.cpp:30
int getSearchState() const
Definition: ZLogSearch.cpp:56
void setSearchForward(bool forward)
Definition: ZLogSearch.cpp:90
void notifySearchState(int newValue)
void notifySearchForward(bool newValue)
bool getSearchBackward() const
Definition: ZLogSearch.cpp:100
Q_INVOKABLE QObject * resultModel()
Obtain a list model containing an item for each log record represented in the ZLogSearchMark&#39;s result...
Definition: ZLogSearch.cpp:118
QSharedPointer< ZblLogSearch > m_search
Definition: ZLogSearch.h:156
QSharedPointer< ZblLogSearch > getZSearch()
Definition: ZLogSearch.cpp:12
void onInvalidate()
Handler for the ZblLogSearch::invalidate signal.
Definition: ZLogSearch.cpp:131
bool getSaved() const
Definition: ZLogSearch.cpp:70
qint64 getCompletionFileSize() const
Definition: ZLogSearch.cpp:75
Q_INVOKABLE bool isValid() const
Determine if this wrapper object points to a valid search object.
Definition: ZLogSearch.cpp:126
void notifySaved(bool newValue)
This object encapsulates search operation parameters, results, and steady state.
Definition: ZblLogSearch.h:35
ZLogSearch(QSharedPointer< ZblLogSearch > searchPtr, ZLogReader *reader)
Definition: ZLogSearch.cpp:6
int getCaseSensitive() const
Definition: ZLogSearch.cpp:46
QString searchPhrase
Definition: ZLogSearch.h:52