]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/BulletsModule.h
make bullet configuration functional in the document settings dialog
[lyx.git] / src / frontends / qt4 / BulletsModule.h
1 // -*- C++ -*-
2 /**
3  * \file BulletsModule.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Edwin Leuven
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef QBULLETSMODULE_H
13 #define QBULLETSMODULE_H
14
15
16 #include "ui/BulletsUi.h"
17 #include "Bullet.h"
18 #include <boost/array.hpp>
19
20 #include <QWidget>
21
22 class BulletsModule : public QWidget, public Ui::BulletsUi {
23         Q_OBJECT
24 public:
25
26         BulletsModule(QWidget * parent = 0, const char * name = 0, Qt::WFlags fl = 0);
27
28         ~BulletsModule();
29
30         /// set a bullet
31         void setBullet(int level, Bullet const & bullet);
32         /// get bullet setting
33         Bullet const & getBullet(int level) const;
34         /// update 1st level
35         void init();
36
37 Q_SIGNALS:
38         void changed();
39
40 protected Q_SLOTS:
41
42         void on_bulletsizeCO_activated(int level);
43         void on_customCB_toggled(bool);
44         void on_customLE_textEdited(const QString &);
45         void bulletSelected(QListWidgetItem *, QListWidgetItem*);
46         void showLevel(int);
47
48 private:
49         void unselectPreviousItem();
50         void setupPanel(QListWidget * lw, QString panelname, std::string fname);
51         void selectBullet(int level);
52
53         /// store results
54         boost::array<Bullet, 4> bullets_;
55         int current_font_;
56         QListWidgetItem * current_item_;
57 };
58
59 #endif // BULLETSMODULE_H