You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bibletime/bibletime/frontend/keychooser/ckeyreferencewidget.h

93 lines
2.1 KiB

/*********
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
* Copyright 1999-2006 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/
#ifndef CKEYREFERENCEWIDGET_H
#define CKEYREFERENCEWIDGET_H
#include "cscrollerwidgetset.h"
#include "backend/cswordbiblemoduleinfo.h"
#include <tqwidget.h>
#include <layout.h>
#include <klineedit.h>
#include <kcompletion.h>
class CLexiconKeyChooser;
class CSwordVerseKey;
class CKeyReferenceCompletion : public KCompletion {
Q_OBJECT
TQ_OBJECT
public:
CKeyReferenceCompletion(CSwordBibleModuleInfo*);
TQString makeCompletion(const TQString &);
TQStringList allMatches();
private:
CSwordVerseKey *m_key;
CSwordBibleModuleInfo *m_module;
};
class CKeyReferenceLineEdit : public KLineEdit {
Q_OBJECT
TQ_OBJECT
public:
CKeyReferenceLineEdit(TQWidget *parent=0, const char *name=0);
void makeCompletion(const TQString &);
};
class CKeyReferenceWidget : public TQWidget {
Q_OBJECT
TQ_OBJECT
public:
/**
* the constructor
*/
CKeyReferenceWidget(CSwordBibleModuleInfo *, CSwordVerseKey*, TQWidget *parent=0, const char *name=0);
bool setKey(CSwordVerseKey* key);
KLineEdit* textbox();
void setModule(CSwordBibleModuleInfo *m = 0);
signals:
void changed(CSwordVerseKey* key);
protected:
void updateText();
protected slots: // Protected slots
/**
* Is called when the return key was presed in the textbox.
*/
void slotReturnPressed();
void slotClearRef();
void slotUpdateLock();
void slotUpdateUnlock();
void slotBookChange(int);
void slotChapterChange(int);
void slotVerseChange(int);
private:
friend class CLexiconKeyChooser;
TQHBoxLayout *m_mainLayout;
CKeyReferenceLineEdit *m_textbox;
CSwordVerseKey *m_key;
CScrollerWidgetSet *m_bookScroller;
CScrollerWidgetSet *m_chapterScroller;
CScrollerWidgetSet *m_verseScroller;
bool updatelock;
TQString oldKey;
CSwordBibleModuleInfo *m_module;
};
#endif