File: sectionWidget.h

package info (click to toggle)
attal 0.9.2-1.2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,992 kB
  • ctags: 5,972
  • sloc: cpp: 44,510; sh: 160; makefile: 45
file content (152 lines) | stat: -rw-r--r-- 3,228 bytes parent folder | download | duplicates (2)
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/****************************************************************
**
** Attal : Lords of Doom
**
** sectionWidget.h
** widgets for building sections
**
** Version : $Id: sectionWidget.h,v 1.1.1.1 2003/06/15 19:01:58 audoux Exp $
**
** Author(s) : Pascal Audoux
**
** Date : 02/06/2001
**
** Licence :    
**	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, or (at your option)
**      any later version.
**
**	This program is distributed in the hope that it will be useful,
** 	but WITHOUT ANY WARRANTY; without even the implied warranty of
**	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
**	GNU General Public License for more details.
**
****************************************************************/

 
#ifndef SECTIONWIDGET_H
#define SECTIONWIDGET_H
 
 
// generic include files
// include files for QT
#include <qwidget.h>
#include <qlineedit.h>
#include <qspinbox.h>
#include <qcheckbox.h>
// application specific include files
#include "libClient/askWidget.h"

class QLabel;
class QComboBox;
class QPixmap;
class QPushButton;

/*              ------------------------------
 *                         SectionWidget
 *              ------------------------------ */



/** comment for the class */
class SelectionWidget : public QFrame
{
	Q_OBJECT
public:
	/** Constructor */
	SelectionWidget( QWidget * parent = 0, const char * name = 0 );
	
	void setTitle( QString title );
	
signals:
	void sig_first();
	void sig_previous();
	void sig_next();
	void sig_last();
	void sig_new();
	void sig_del();
	
private:
	QLabel * _labTitle;
};

/** Pure virtual class for sections */
class Section : public QWidget
{
public:
	Section( QWidget * parent = 0, const char * name = 0 );

	virtual void save() = 0;
};

/** Pure virtual class with usefull api for section */
class GenericSection : public Section
{
	Q_OBJECT
public:
	/** Constructor */
	GenericSection( QWidget * parent = 0, const char * name = 0 );

	/** Selects the first item */
	virtual void selectFirst() = 0;

	/** Selects the previous item */
	virtual void selectPrevious() = 0;

	/** Selects the next item */
	virtual void selectNext() = 0;

	/** Selects the last item */
	virtual void selectLast() = 0;

	/** Creates new item */
	virtual void selectNew() = 0;

	/** Deletes current item */
	virtual void selectDel() = 0;

	/** Saves the data */
	virtual void save() = 0;

	/** Sets title to the section */
	void setTitle( QString title ) { _select->setTitle( title ); }

public slots:

	/** Slot when 'First' button is clicked */
        void slot_first() {
		selectFirst();
	}

	/** Slot when 'Previous' button is clicked */
	void slot_previous() {
		selectPrevious();
	}

	/** Slot when 'Next' button is clicked */
	void slot_next() {
		selectNext();
	}

	/** Slot when 'Last' button is clicked */
	void slot_last() {
		selectLast();
	}

	/** Slot when 'New' button is clicked */
	void slot_new() {
		selectNew();
	}

	/** Slot when 'Del' button is clicked */
	void slot_del() {
		selectDel();
	}

protected:
	SelectionWidget * _select;
	QWidget * _mainWidget;
};

#endif // SECTIONWIDGET_H