summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/linux/opcmciasystem.h
Unidiff
Diffstat (limited to 'libopie2/opiecore/linux/opcmciasystem.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/linux/opcmciasystem.h129
1 files changed, 129 insertions, 0 deletions
diff --git a/libopie2/opiecore/linux/opcmciasystem.h b/libopie2/opiecore/linux/opcmciasystem.h
new file mode 100644
index 0000000..694bf16
--- a/dev/null
+++ b/libopie2/opiecore/linux/opcmciasystem.h
@@ -0,0 +1,129 @@
1/*
2                 This file is part of the Opie Project
3 =. (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de>
4 .=l.
5           .>+-=
6 _;:,     .>    :=|. This program is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; version 2 of the License.
11     ._= =}       :
12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This program is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
18..}^=.=       =       ; Library General Public License for more
19++=   -.     .`     .: details.
20 :     =  ...= . :.=-
21 -.   .:....=;==+<; You should have received a copy of the GNU
22  -_. . .   )=.  = Library General Public License along with
23    --        :-=` this library; see the file COPYING.LIB.
24 If not, write to the Free Software Foundation,
25 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
29
30#ifndef OPCMCIASYSTEM_H
31#define OPCMCIASYSTEM_H
32
33#include <qobject.h>
34#include <qdict.h>
35#include <qmap.h>
36
37namespace Opie {
38namespace Core {
39
40class OPcmciaCard;
41
42/*======================================================================================
43 * OPcmciaSystem
44 *======================================================================================*/
45
46/**
47 * @brief A container class for the linux pcmcia subsystem
48 *
49 * This class provides access to all available pcmcia/cf cards on your device.
50 *
51 * @author Michael 'Mickey' Lauer <mickey@Vanille.de>
52 */
53class OPcmciaSystem : public QObject
54{
55 Q_OBJECT
56
57 public:
58 typedef QDict<OPcmciaCard> CardMap;
59 typedef QDictIterator<OPcmciaCard> CardIterator;
60
61 public:
62 /**
63 * @returns the number of available interfaces
64 */
65 int count() const;
66 /**
67 * @returns a pointer to the (one and only) @ref OSystem instance.
68 */
69 static OPcmciaSystem* instance();
70 /**
71 * @returns an iterator usable for iterating through all sound cards.
72 */
73 CardIterator iterator() const;
74 /**
75 * @returns a pointer to the @ref OAudioInterface object for the specified @a interface or 0, if not found
76 * @see OAudioInterface
77 */
78 OPcmciaCard* card( const QString& interface ) const;
79 /**
80 * @internal Rebuild the internal interface database
81 * @note Sometimes it might be useful to call this from client code,
82 * e.g. after issuing a cardctl insert
83 */
84 void synchronize();
85
86 protected:
87 OPcmciaSystem();
88
89 private:
90 static OPcmciaSystem* _instance;
91 CardMap _interfaces;
92 class Private;
93 Private *d;
94};
95
96
97/*======================================================================================
98 * OPcmciaCard
99 *======================================================================================*/
100
101class OPcmciaCard : public QObject
102{
103 Q_OBJECT
104
105 public:
106 /**
107 * Constructor. Normally you don't create @ref OPcmciaCard objects yourself,
108 * but access them via @ref OPcmciaSystem::card().
109 */
110 OPcmciaCard( QObject* parent, const char* name );
111 /**
112 * Destructor.
113 */
114 virtual ~OPcmciaCard();
115
116 protected:
117
118 private:
119 void init();
120 private:
121 class Private;
122 Private *d;
123};
124
125
126}
127}
128
129#endif // OPCMCIASYSTEM_H