| 
									
										
										
										
											2017-04-27 20:26:05 +02:00
										 |  |  | // SPDX-License-Identifier: GPL-2.0
 | 
					
						
							| 
									
										
										
										
											2014-02-11 19:14:46 +01:00
										 |  |  | #ifndef TAGWIDGET_H
 | 
					
						
							|  |  |  | #define TAGWIDGET_H
 | 
					
						
							| 
									
										
										
										
											2013-11-02 02:20:02 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "groupedlineedit.h"
 | 
					
						
							|  |  |  | #include <QPair>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-26 14:01:31 -03:00
										 |  |  | class QCompleter; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-27 20:09:57 -08:00
										 |  |  | class TagWidget : public GroupedLineEdit { | 
					
						
							|  |  |  | 	Q_OBJECT | 
					
						
							| 
									
										
										
										
											2013-11-02 02:20:02 +01:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2014-02-27 20:09:57 -08:00
										 |  |  | 	explicit TagWidget(QWidget *parent = 0); | 
					
						
							| 
									
										
										
										
											2013-11-02 02:20:02 +01:00
										 |  |  | 	void setCompleter(QCompleter *completer); | 
					
						
							|  |  |  | 	QPair<int, int> getCursorTagPosition(); | 
					
						
							|  |  |  | 	void highlight(); | 
					
						
							| 
									
										
										
										
											2014-05-22 11:40:22 -07:00
										 |  |  | 	void setText(const QString &text); | 
					
						
							| 
									
										
										
										
											2013-11-02 02:20:02 +01:00
										 |  |  | 	void clear(); | 
					
						
							|  |  |  | 	void setCursorPosition(int position); | 
					
						
							| 
									
										
										
										
											2014-01-19 17:33:24 +02:00
										 |  |  | 	void wheelEvent(QWheelEvent *event); | 
					
						
							| 
									
										
										
										
											2014-11-16 23:28:48 -02:00
										 |  |  | 	void fixPopupPosition(int delta); | 
					
						
							| 
									
										
										
										
											2014-02-27 20:09:57 -08:00
										 |  |  | public | 
					
						
							|  |  |  | slots: | 
					
						
							| 
									
										
										
										
											2014-02-09 18:35:23 +01:00
										 |  |  | 	void reparse(); | 
					
						
							| 
									
										
										
										
											2014-05-22 11:40:22 -07:00
										 |  |  | 	void completionSelected(const QString &text); | 
					
						
							|  |  |  | 	void completionHighlighted(const QString &text); | 
					
						
							| 
									
										
										
										
											2014-02-27 20:09:57 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-02 17:04:18 +01:00
										 |  |  | protected: | 
					
						
							|  |  |  | 	void keyPressEvent(QKeyEvent *e); | 
					
						
							| 
									
										
										
										
											2013-11-02 02:20:02 +01:00
										 |  |  | private: | 
					
						
							| 
									
										
										
										
											2019-02-07 19:59:34 +01:00
										 |  |  | 	void focusOutEvent(QFocusEvent *ev) override; | 
					
						
							| 
									
										
										
										
											2014-02-09 18:35:23 +01:00
										 |  |  | 	QCompleter *m_completer; | 
					
						
							| 
									
										
										
										
											2014-05-16 15:12:46 +09:00
										 |  |  | 	bool lastFinishedTag; | 
					
						
							| 
									
										
										
										
											2013-11-02 02:20:02 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-11 19:14:46 +01:00
										 |  |  | #endif // TAGWIDGET_H
 |