blob: b40011f10874e72b97470da3c02d880ca7945499 (
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
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
|
/*
*
* $Id: sourceheader 380067 2005-01-19 13:03:46Z trueg $
* Copyright (C) 2005 Sebastian Trueg <trueg@k3b.org>
*
* This file is part of the K3b project.
* Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.org>
*
* 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.
* See the file "COPYING" for the exact licensing terms.
*/
#ifndef _K3B_MEDIA_SELECTION_COMBOBOX_H_
#define _K3B_MEDIA_SELECTION_COMBOBOX_H_
#include <kcombobox.h>
#include "k3bmedium.h"
namespace K3bDevice {
class Device;
class DeviceManager;
}
/**
* Combo box which allows to select a media (in comparison
* to the K3bDeviceComboBox which allows to select a device.
*
* This class uses the K3bMediaCache to update it's status.
*/
class K3bMediaSelectionComboBox : public KComboBox
{
Q_OBJECT
TQ_OBJECT
public:
K3bMediaSelectionComboBox( TQWidget* tqparent );
virtual ~K3bMediaSelectionComboBox();
/**
* Although the widget allows selection of media this
* results in a device being selected.
*/
K3bDevice::Device* selectedDevice() const;
TQValueList<K3bDevice::Device*> allDevices() const;
int wantedMediumType() const;
int wantedMediumState() const;
int wantedMediumContent() const;
signals:
/**
* Be aware that his signal will also be emitted in case
* no medium is available with a null pointer.
*/
void selectionChanged( K3bDevice::Device* );
/**
* This signal is emitted if the selection of media changed.
* This includes a change due to changing the wanted medium state.
*/
void newMedia();
void newMedium( K3bDevice::Device* dev );
public slots:
/**
* Only works in case the device actually contains a usable medium.
* Otherwise the currently selected medium stays selected.
*/
void setSelectedDevice( K3bDevice::Device* );
/**
* Set the wanted medium type. Defaults to writable CD.
*
* \param type a bitwise combination of the K3bDevice::MediaType enum
*/
void setWantedMediumType( int type );
/**
* Set the wanted medium state. Defaults to empty media.
*
* \param state a bitwise combination of the K3bDevice::State enum
*/
void setWantedMediumState( int state );
/**
* Set the wanted medium content type. The default is K3bMedium::CONTENT_ALL (i.e. ignore media
* content)
* Be aware that 0 maps to K3bMedium::CONTENT_NONE, i.e. empty media.
*
* \param content A bitwise or of K3bMedium::MediumContent
*/
void setWantedMediumContent( int content );
/**
* Set the device to ignore. This device will not be checked for
* wanted media. This is many useful for media copy.
*
* \param dev The device to ignore or 0 to not ignore any device.
*/
void setIgnoreDevice( K3bDevice::Device* dev );
private slots:
void slotMediumChanged( K3bDevice::Device* );
void slotDeviceManagerChanged( K3bDevice::DeviceManager* );
void slotActivated( int i );
void slotUpdateToolTip( K3bDevice::Device* );
protected:
void updateMedia();
virtual bool showMedium( const K3bMedium& ) const;
virtual TQString mediumString( const K3bMedium& ) const;
virtual TQString mediumToolTip( const K3bMedium& ) const;
virtual TQString noMediumMessage() const;
private:
void updateMedium( K3bDevice::Device* );
void addMedium( K3bDevice::Device* );
void showNoMediumMessage();
void clear();
// usedby the tooltip
K3bDevice::Device* deviceAt( unsigned int index );
class ToolTip;
friend class ToolTip;
class Private;
Private* d;
};
#endif
|