Diffstat (limited to 'libopie2/opiecore/linux/opcmciasystem.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/linux/opcmciasystem.h | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/libopie2/opiecore/linux/opcmciasystem.h b/libopie2/opiecore/linux/opcmciasystem.h index ef34964..ac6c1de 100644 --- a/libopie2/opiecore/linux/opcmciasystem.h +++ b/libopie2/opiecore/linux/opcmciasystem.h | |||
@@ -88,115 +88,136 @@ class OPcmciaSystem : public QObject | |||
88 | */ | 88 | */ |
89 | void synchronize(); | 89 | void synchronize(); |
90 | 90 | ||
91 | protected: | 91 | protected: |
92 | OPcmciaSystem(); | 92 | OPcmciaSystem(); |
93 | 93 | ||
94 | private: | 94 | private: |
95 | static OPcmciaSystem* _instance; | 95 | static OPcmciaSystem* _instance; |
96 | CardList _interfaces; | 96 | CardList _interfaces; |
97 | int _major; | 97 | int _major; |
98 | 98 | ||
99 | private: | 99 | private: |
100 | class Private; | 100 | class Private; |
101 | Private *d; | 101 | Private *d; |
102 | }; | 102 | }; |
103 | 103 | ||
104 | 104 | ||
105 | /*====================================================================================== | 105 | /*====================================================================================== |
106 | * OPcmciaSocket | 106 | * OPcmciaSocket |
107 | *======================================================================================*/ | 107 | *======================================================================================*/ |
108 | 108 | ||
109 | class OPcmciaSocket : public QObject | 109 | class OPcmciaSocket : public QObject |
110 | { | 110 | { |
111 | Q_OBJECT | 111 | Q_OBJECT |
112 | public: | ||
113 | |||
114 | enum OPcmciaSocketCardStatus | ||
115 | { | ||
116 | Unknown = 0, | ||
117 | Occupied = CS_EVENT_CARD_DETECT, | ||
118 | OccupiedCardBus = CS_EVENT_CB_DETECT, | ||
119 | WriteProtected = CS_EVENT_WRITE_PROTECT, | ||
120 | BatteryLow = CS_EVENT_BATTERY_LOW, | ||
121 | BatteryDead = CS_EVENT_BATTERY_DEAD, | ||
122 | Ready = CS_EVENT_READY_CHANGE, | ||
123 | Suspended = CS_EVENT_PM_SUSPEND, | ||
124 | Attention = CS_EVENT_REQUEST_ATTENTION, | ||
125 | InsertionInProgress = CS_EVENT_CARD_INSERTION, | ||
126 | RemovalInProgress = CS_EVENT_CARD_REMOVAL, | ||
127 | ThreeVolts = CS_EVENT_3VCARD, | ||
128 | SupportsVoltage = CS_EVENT_XVCARD, | ||
129 | }; | ||
112 | 130 | ||
113 | public: | 131 | public: |
114 | /** | 132 | /** |
115 | * Constructor. Normally you don't create @ref OPcmciaSocket objects yourself, | 133 | * Constructor. Normally you don't create @ref OPcmciaSocket objects yourself, |
116 | * but access them via @ref OPcmciaSystem::socket(). | 134 | * but access them via @ref OPcmciaSystem::socket(). |
117 | */ | 135 | */ |
118 | OPcmciaSocket( int major, int socket, QObject* parent, const char* name ); | 136 | OPcmciaSocket( int major, int socket, QObject* parent, const char* name ); |
119 | /** | 137 | /** |
120 | * Destructor. | 138 | * Destructor. |
121 | */ | 139 | */ |
122 | virtual ~OPcmciaSocket(); | 140 | virtual ~OPcmciaSocket(); |
123 | /** | 141 | /** |
124 | * @returns the corresponding socket number | 142 | * @returns the corresponding socket number |
125 | */ | 143 | */ |
126 | int number() const; | 144 | int number() const; |
127 | /** | 145 | /** |
128 | * @returns the identification string of the card in this socket, or "<Empty Socket>" | 146 | * @returns the card managers idea of the cards' identy, or "<Empty Socket>" |
129 | */ | 147 | */ |
130 | QString identity() const; | 148 | QString identity() const; |
131 | /** | 149 | /** |
150 | * @returns the socket status | ||
151 | */ | ||
152 | const OPcmciaSocketCardStatus status() const; | ||
153 | /** | ||
132 | * @returns true, if the card is unsupported by the cardmgr | 154 | * @returns true, if the card is unsupported by the cardmgr |
133 | */ | 155 | */ |
134 | bool isUnsupported() const; | 156 | bool isUnsupported() const; |
135 | /** | 157 | /** |
136 | * @returns true, if the socket is empty | 158 | * @returns true, if the socket is empty |
137 | */ | 159 | */ |
138 | bool isEmpty() const; | 160 | bool isEmpty() const; |
139 | /** | 161 | /** |
140 | * @returns true, if the socket is suspended | 162 | * @returns true, if the socket is suspended |
141 | */ | 163 | */ |
142 | bool isSuspended() const; | 164 | bool isSuspended() const; |
143 | /** | 165 | /** |
144 | * Eject card. @returns true, if operation succeeded | 166 | * Eject card. @returns true, if operation succeeded |
145 | * @note: This operation needs root privileges | 167 | * @note: This operation needs root privileges |
146 | */ | 168 | */ |
147 | bool eject(); | 169 | bool eject(); |
148 | /** | 170 | /** |
149 | * Insert card. @returns true, if operation succeeded | 171 | * Insert card. @returns true, if operation succeeded |
150 | * @note: This operation needs root privileges | 172 | * @note: This operation needs root privileges |
151 | */ | 173 | */ |
152 | bool insert(); | 174 | bool insert(); |
153 | /** | 175 | /** |
154 | * Suspend card. @returns true, if operation succeeded | 176 | * Suspend card. @returns true, if operation succeeded |
155 | * @note: This operation needs root privileges | 177 | * @note: This operation needs root privileges |
156 | */ | 178 | */ |
157 | bool suspend(); | 179 | bool suspend(); |
158 | /** | 180 | /** |
159 | * Resume card. @returns true, if operation succeeded | 181 | * Resume card. @returns true, if operation succeeded |
160 | * @note: This operation needs root privileges | 182 | * @note: This operation needs root privileges |
161 | */ | 183 | */ |
162 | bool resume(); | 184 | bool resume(); |
163 | /** | 185 | /** |
164 | * Reset card. @returns true, if operation succeeded | 186 | * Reset card. @returns true, if operation succeeded |
165 | * @note: This operation needs root privileges | 187 | * @note: This operation needs root privileges |
166 | */ | 188 | */ |
167 | bool reset(); | 189 | bool reset(); |
168 | /** | 190 | /** |
169 | * @returns a list of product IDs | 191 | * @returns a list of product IDs |
170 | */ | 192 | */ |
171 | const QStringList& productIdentity() const; | 193 | QStringList productIdentity() const; |
172 | /** | 194 | /** |
173 | * @returns the manufacturer ID pair | 195 | * @returns the manufacturer ID pair |
174 | */ | 196 | */ |
175 | #if 0 | 197 | #if 0 |
176 | const QPair& manufacturerIdentity() const; | 198 | const QPair& manufacturerIdentity() const; |
177 | #endif | 199 | #endif |
178 | 200 | /** | |
179 | private: | 201 | * @returns the function string |
180 | QStringList _productId; | 202 | */ |
203 | QString function() const; | ||
181 | 204 | ||
182 | private: | 205 | private: |
183 | void init(); | 206 | void init(); |
184 | void buildInformation(); | ||
185 | void cleanup(); | 207 | void cleanup(); |
186 | bool command( const QString& cmd ); | 208 | bool getTuple( cisdata_t tuple ) const; |
187 | bool getTuple( cisdata_t tuple ); | ||
188 | int _major; | 209 | int _major; |
189 | int _socket; | 210 | int _socket; |
190 | int _fd; | 211 | int _fd; |
191 | ds_ioctl_arg_t _ioctlarg; | 212 | mutable ds_ioctl_arg_t _ioctlarg; |
192 | 213 | ||
193 | private: | 214 | private: |
194 | class Private; | 215 | class Private; |
195 | Private *d; | 216 | Private *d; |
196 | }; | 217 | }; |
197 | 218 | ||
198 | 219 | ||
199 | } | 220 | } |
200 | } | 221 | } |
201 | 222 | ||
202 | #endif // OPCMCIASYSTEM_H | 223 | #endif // OPCMCIASYSTEM_H |