Go to the documentation of this file.
25 #ifndef KLFSEARCHBAR_H
26 #define KLFSEARCHBAR_H
150 Pos(
const Pos& other) : posdata(other.posdata)
157 posdata.setAutoDelete(posdata->wantAutoDelete());
170 klfDbg(
"posdata="<<posdata) ;
171 return (posdata != NULL) ;
181 if (valid() && other.
valid())
184 return (valid() == other.
valid());
215 KLF_ASSERT_NOT_NULL(ptr,
"accessing a posdata that is NULL or of incompatible type!",
return NULL;) ;
232 virtual Pos searchStartFrom(
bool forward);
263 { Q_UNUSED(queryString); Q_UNUSED(found); Q_UNUSED(pos); }
288 virtual void setSearchInterruptRequested(
bool on);
292 bool pInterruptRequested;
305 virtual Pos
searchFind(
const QString& queryString,
const Pos& fromPos,
bool forward);
400 { Q_UNUSED(queryString); Q_UNUSED(found); Q_UNUSED(pos); }
432 struct KLFSearchBarPrivate;
468 Q_PROPERTY(
QString currentSearchText READ currentSearchText) ;
469 Q_PROPERTY(
bool autoHide READ autoHide WRITE setAutoHide) ;
470 Q_PROPERTY(
bool showOverlayMode READ showOverlayMode WRITE setShowOverlayMode) ;
471 Q_PROPERTY(
QRect showOverlayRelativeGeometry READ showOverlayRelativeGeometry
472 WRITE setShowOverlayRelativeGeometry ) ;
473 Q_PROPERTY(
QString focusOutText READ focusOutText WRITE setFocusOutText) ;
474 Q_PROPERTY(
QColor colorFound READ colorFound WRITE setColorFound) ;
475 Q_PROPERTY(
QColor colorNotFound READ colorNotFound WRITE setColorNotFound) ;
476 Q_PROPERTY(
bool showHideButton READ hideButtonShown WRITE setShowHideButton) ;
477 Q_PROPERTY(
bool showSearchLabel READ showSearchLabel WRITE setShowSearchLabel) ;
478 Q_PROPERTY(
bool emacsStyleBackspace READ emacsStyleBackspace WRITE setEmacsStyleBackspace) ;
479 Q_PROPERTY(
int resetTimeout READ resetTimeout WRITE setResetTimeout) ;
488 virtual void registerShortcuts(QWidget *parent);
495 QString currentSearchText()
const;
496 bool autoHide()
const;
497 bool showOverlayMode()
const;
498 QRect showOverlayRelativeGeometry()
const;
501 QColor colorFound()
const;
503 QColor colorNotFound()
const;
504 bool hideButtonShown()
const;
505 bool showSearchLabel()
const;
506 bool emacsStyleBackspace()
const;
507 int resetTimeout()
const;
513 SearchState currentState()
const;
517 void setAutoHide(
bool autohide);
524 void setShowOverlayMode(
bool showOverlayMode);
525 void setShowOverlayRelativeGeometry(
const QRect& relativeGeometryPercent);
526 void setShowOverlayRelativeGeometry(
int widthPercent,
int heightPercent,
527 int positionXPercent,
int positionYPercent);
528 void setColorFound(
const QColor& color);
529 void setColorNotFound(
const QColor& color);
530 void setShowHideButton(
bool showHideButton);
531 void setShowSearchLabel(
bool show);
532 void setEmacsStyleBackspace(
bool on);
537 void setResetTimeout(
int ms);
541 QLineEdit * editor();
570 void focusOrNext(
bool forward =
true);
574 void find(
const QString&
string);
575 void find(
const QString&
string,
bool forward);
576 void findNext(
bool forward =
true);
582 virtual void setSearchText(
const QString& text);
583 void setFocusOutText(
const QString& focusOutText);
589 bool searchBarHasFocus();
591 virtual bool event(
QEvent *event);
595 friend class KLFSearchBarDesPlugin;
599 virtual void slotSearchFocusIn();
600 virtual void slotSearchFocusOut();
601 virtual void slotSearchReset();
602 virtual void updateSearchFound(
bool found);
604 void promptEmptySearch();
616 void showSearchBarText(
const QString& text);
622 KLFSearchBarPrivate *d;
624 void adjustOverlayGeometry();
626 QString palettePropName(SearchState state)
const;
627 QString statePropValue(SearchState state)
const;
633 void performFind(
bool forward,
bool isFindNext =
false);
void hasMatch(bool hasmatch)
Reflects whether the search is currently pointing on a valid result.
An Search Bar for Incremental Search.
A Base class for storing abstract position data.
void didNotFind(const QString &queryString, bool forward)
virtual KLFSearchable * target()
void setSearchTarget(KLFPosSearchable *target)
virtual const KLFPosSearchable * target() const
virtual void setSearchTarget(KLFPosSearchable *t)
virtual void searchMoveToPos(const Pos &pos)
void found(const QString &queryString, bool forward, const KLFPosSearchable::Pos &pos)
KLF_EXPORT QDebug & operator<<(QDebug &str, const KLFPosSearchable::Pos &pos)
void searchPerformed(const QString &queryString, bool found)
Stores a pointer to an object with refcount.
Pos & operator=(const Pos &other)
virtual KLFPosSearchable * target()
void visibilityChanged(bool isShown)
#define klfDbg(streamableItems)
print debug stream items
virtual void searchReinitialized()
TT * data() const
A shorthand for retrieving the posdata cast into the custom type.
virtual void searchAborted()=0
virtual Pos searchFind(const QString &queryString, const Pos &fromPos, bool forward)=0
void searchReinitialized()
virtual void searchMoveToPos(const Pos &pos)
virtual void searchAborted()
#define KLF_DEBUG_BLOCK(msg)
Utility to debug the execution of a block.
void found(const QString &queryString, bool forward)
virtual bool equals(PosData *other) const =0
bool equals(const Pos &other) const
virtual void setSearchTarget(KLFPosSearchable *target)
virtual void searchPerformed(const QString &queryString, bool found, const Pos &pos)
virtual void setSearchInterruptRequested(bool on)
#define KLF_DEBUG_DECLARE_ASSIGNABLE_REF_INSTANCE()
Declare that this class has an assignable debugging ref-instance.
A proxy class that relays search queries to another searchable object (OBSOLETE)
virtual void searchPerformed(const QString &queryString, bool found, const Pos &pos)
virtual Pos searchStartFrom(bool forward)
virtual bool wantAutoDelete()
KLFRefPtr< PosData > posdata
Stores the actual position data, see PosData.
void searchPerformed(bool found)
virtual QString searchQueryString() const
The current query string.
virtual bool searchFind(const QString &queryString, bool forward)=0
Find the first occurence of a query string.
virtual void setSearchQueryString(const QString &s)
An abstract position in a searchable object.
bool searchFind(const QString &queryString)
Find the first occurence of a query string.
virtual QString toDebug()
#define KLF_ASSERT_NOT_NULL(ptr, msg, failaction)
Asserting Non-NULL pointers (NON-FATAL)
virtual void setTarget(KLFTarget *target)
virtual bool searchFindNext(bool forward)=0
Find next or previous occurence of query string.
Base declarations for klatexformula and some utilities.
virtual bool searchHasInterruptRequested()
An object that can be searched with a KLFSearchBar.
virtual void searchAbort()=0
Abort I-Search.
An interface for objects that can be I-searched with a KLFSearchBar (OBSOLETE)
void stateChanged(SearchState state)
Generated by doxygen 1.8.20