2010-05-11 17:16:59 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _MTP_CLIENT_H
|
|
|
|
#define _MTP_CLIENT_H
|
|
|
|
|
2010-05-19 10:33:39 -04:00
|
|
|
#include "MtpTypes.h"
|
2010-05-11 17:16:59 -04:00
|
|
|
|
2010-05-14 10:10:36 -04:00
|
|
|
namespace android {
|
|
|
|
|
2010-05-11 17:16:59 -04:00
|
|
|
class MtpClient {
|
|
|
|
private:
|
2010-05-25 19:08:48 -04:00
|
|
|
MtpDeviceList mDeviceList;
|
|
|
|
bool mStarted;
|
2010-05-11 17:16:59 -04:00
|
|
|
|
|
|
|
public:
|
2010-05-25 19:08:48 -04:00
|
|
|
MtpClient();
|
2010-05-19 15:12:14 -04:00
|
|
|
virtual ~MtpClient();
|
2010-05-11 17:16:59 -04:00
|
|
|
|
2010-05-25 19:08:48 -04:00
|
|
|
bool start();
|
2010-05-11 17:16:59 -04:00
|
|
|
|
2010-05-25 19:08:48 -04:00
|
|
|
inline MtpDeviceList& getDeviceList() { return mDeviceList; }
|
|
|
|
MtpDevice* getDevice(int id);
|
2010-05-19 10:33:39 -04:00
|
|
|
|
2010-05-11 17:16:59 -04:00
|
|
|
|
2010-05-25 19:08:48 -04:00
|
|
|
virtual void deviceAdded(MtpDevice *device) = 0;
|
|
|
|
virtual void deviceRemoved(MtpDevice *device) = 0;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void usbDeviceAdded(const char *devname);
|
|
|
|
void usbDeviceRemoved(const char *devname);
|
|
|
|
static void usb_device_added(const char *devname, void* client_data);
|
|
|
|
static void usb_device_removed(const char *devname, void* client_data);
|
2010-05-11 17:16:59 -04:00
|
|
|
};
|
|
|
|
|
2010-05-14 10:10:36 -04:00
|
|
|
}; // namespace android
|
|
|
|
|
2010-05-11 17:16:59 -04:00
|
|
|
#endif // _MTP_CLIENT_H
|