summaryrefslogtreecommitdiffstats
path: root/src/kile/configcodecompletion.h
blob: 14f6e8529cb10d572791cb1fe4902a6d61ae57e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/***************************************************************************
    date                 : Mar 30 2007
    version              : 0.24
    copyright            : (C) 2004-2007 by Holger Danielsson
    email                : holger.danielsson@versanet.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef CONFIGCODECOMPLETION_H
#define CONFIGCODECOMPLETION_H

#include <tqwidget.h>
#include <tqtabwidget.h>
#include <tqcheckbox.h>
#include <tqlabel.h>
#include <tqspinbox.h>
#include <tqstring.h>

#include <tdeversion.h>
#include <tdelistview.h>
#include <kpushbutton.h>
#include <tdeconfig.h>

/**
  *@author Holger Danielsson
  */

namespace KileWidget { class LogMsg; }

class ConfigCodeCompletion : public TQWidget
{
    Q_OBJECT
  
public: 
   ConfigCodeCompletion(TDEConfig *config, KileWidget::LogMsg *logwidget, TQWidget *parent=0, const char *name=0);
   ~ConfigCodeCompletion();

   void readConfig(void);
   void writeConfig(void);

private:
	enum CompletionPage { TexPage=0, DictionaryPage=1, AbbreviationPage=2, NumPages=3 };

	TDEConfig *m_config;
	KileWidget::LogMsg *m_logwidget;
 
	// tabs, views, pages, wordlists
	TQTabWidget *tab;
	TDEListView *m_listview[NumPages];
	TQWidget *m_page[NumPages];
	TQStringList m_wordlist[NumPages];
	TQStringList m_dirname;

	// button
	KPushButton *add,*remove;

    // Checkboxes/Spinboxes
    TQCheckBox *cb_usecomplete, *cb_autocomplete;
    TQCheckBox *cb_setcursor, *cb_setbullets;
    TQCheckBox *cb_closeenv;
    TQSpinBox *sp_latexthreshold;
    TQLabel *lb_latexthreshold;
	TQCheckBox *cb_autocompletetext;
	TQSpinBox *sp_textthreshold;
	TQLabel *lb_textthreshold;
	TQCheckBox *cb_autocompleteabbrev;
	TQCheckBox *cb_showabbrevview;
	TQCheckBox *cb_citeoutofbraces;

	bool kateCompletionPlugin();

	TDEListView *getListview(TQWidget *page);
	TQString getListname(TQWidget *page);
	void addPage(TQTabWidget *tab, CompletionPage page, const TQString &title, const TQString &dirname);

	void setListviewEntries(CompletionPage page);
	bool getListviewEntries(CompletionPage page);
	bool isListviewEntry(TDEListView *listview, const TQString &filename);
	void updateColumnWidth(TDEListView *listview);

	TQString m_localCwlDir, m_globalCwlDir;
	void getCwlFiles(TQMap<TQString,TQString> &map, TQStringList &list, const TQString &dir);
	void getCwlDirs();

private slots:
   void showPage(TQWidget *page);
   void addClicked();
   void removeClicked();
	void slotListviewClicked(TQListViewItem *);
};

#endif