kalarm/lib

lineedit.h
1/*
2 * lineedit.h - line edit widget with extra drag and drop options
3 * Program: kalarm
4 * Copyright (C) 2003 - 2005 by David Jarvie <software@astrojar.org.uk>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef LINEEDIT_H
22#define LINEEDIT_H
23
24#include <klineedit.h>
25
26
43class LineEdit : public KLineEdit
44{
45 TQ_OBJECT
46
47 public:
62 enum Type { Text, Url, Emails };
68 explicit LineEdit(Type type, TQWidget* parent = 0, const char* name = 0);
73 explicit LineEdit(TQWidget* parent = 0, const char* name = 0);
75 void setNoSelect() { mNoSelect = true; }
79 void setCursorAtEnd(bool end = true) { mSetCursorAtEnd = end; }
80 public slots:
82 virtual void setText(const TQString& str);
83 protected:
84 virtual void focusInEvent(TQFocusEvent*);
85 virtual void dragEnterEvent(TQDragEnterEvent*);
86 virtual void dropEvent(TQDropEvent*);
87 private:
88 void init();
89
90 Type mType;
91 bool mNoSelect;
92 bool mSetCursorAtEnd; // setText() should position cursor at end
93};
94
95#endif // LINEEDIT_H
Line edit widget with extra drag and drop options.
Definition: lineedit.h:44
Type
Types of drag and drop content which will be accepted.
Definition: lineedit.h:62
LineEdit(Type type, TQWidget *parent=0, const char *name=0)
Constructor.
Definition: lineedit.cpp:42
void setCursorAtEnd(bool end=true)
Sets whether the cursor should be set at the beginning or end of the text when setText() is called.
Definition: lineedit.h:79
void setNoSelect()
Prevents the line edit's contents being selected when the widget receives focus.
Definition: lineedit.h:75
virtual void setText(const TQString &str)
Sets the contents of the line edit to be str.
Definition: lineedit.cpp:90