InputHost.h revision 2e7f0146a04fe2dbe5ca0389752709e235c64acc
16f783602c05c519238200fed55b0afa097737ca1Michael Wright/*
26f783602c05c519238200fed55b0afa097737ca1Michael Wright * Copyright (C) 2015 The Android Open Source Project
36f783602c05c519238200fed55b0afa097737ca1Michael Wright *
46f783602c05c519238200fed55b0afa097737ca1Michael Wright * Licensed under the Apache License, Version 2.0 (the "License");
56f783602c05c519238200fed55b0afa097737ca1Michael Wright * you may not use this file except in compliance with the License.
66f783602c05c519238200fed55b0afa097737ca1Michael Wright * You may obtain a copy of the License at
76f783602c05c519238200fed55b0afa097737ca1Michael Wright *
86f783602c05c519238200fed55b0afa097737ca1Michael Wright *      http://www.apache.org/licenses/LICENSE-2.0
96f783602c05c519238200fed55b0afa097737ca1Michael Wright *
106f783602c05c519238200fed55b0afa097737ca1Michael Wright * Unless required by applicable law or agreed to in writing, software
116f783602c05c519238200fed55b0afa097737ca1Michael Wright * distributed under the License is distributed on an "AS IS" BASIS,
126f783602c05c519238200fed55b0afa097737ca1Michael Wright * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
136f783602c05c519238200fed55b0afa097737ca1Michael Wright * See the License for the specific language governing permissions and
146f783602c05c519238200fed55b0afa097737ca1Michael Wright * limitations under the License.
156f783602c05c519238200fed55b0afa097737ca1Michael Wright */
166f783602c05c519238200fed55b0afa097737ca1Michael Wright
176f783602c05c519238200fed55b0afa097737ca1Michael Wright#ifndef ANDROID_INPUT_HOST_H
186f783602c05c519238200fed55b0afa097737ca1Michael Wright#define ANDROID_INPUT_HOST_H
196f783602c05c519238200fed55b0afa097737ca1Michael Wright
206f783602c05c519238200fed55b0afa097737ca1Michael Wright#include <vector>
216f783602c05c519238200fed55b0afa097737ca1Michael Wright
226f783602c05c519238200fed55b0afa097737ca1Michael Wright#include <hardware/input.h>
236f783602c05c519238200fed55b0afa097737ca1Michael Wright#include <utils/RefBase.h>
246f783602c05c519238200fed55b0afa097737ca1Michael Wright#include <utils/String8.h>
256f783602c05c519238200fed55b0afa097737ca1Michael Wright#include <utils/StrongPointer.h>
266f783602c05c519238200fed55b0afa097737ca1Michael Wright
276f783602c05c519238200fed55b0afa097737ca1Michael Wright#include "InputDriver.h"
286f783602c05c519238200fed55b0afa097737ca1Michael Wright
296f783602c05c519238200fed55b0afa097737ca1Michael Wrightnamespace android {
306f783602c05c519238200fed55b0afa097737ca1Michael Wright
316f783602c05c519238200fed55b0afa097737ca1Michael Wrightclass InputDriverInterface;
326f783602c05c519238200fed55b0afa097737ca1Michael Wright
332e7f0146a04fe2dbe5ca0389752709e235c64accTim Kilbournclass InputHostInterface : public virtual RefBase {
346f783602c05c519238200fed55b0afa097737ca1Michael Wrightprotected:
356f783602c05c519238200fed55b0afa097737ca1Michael Wright    InputHostInterface() = default;
366f783602c05c519238200fed55b0afa097737ca1Michael Wright    virtual ~InputHostInterface() = default;
376f783602c05c519238200fed55b0afa097737ca1Michael Wright
386f783602c05c519238200fed55b0afa097737ca1Michael Wrightpublic:
396f783602c05c519238200fed55b0afa097737ca1Michael Wright
406f783602c05c519238200fed55b0afa097737ca1Michael Wright    virtual void registerInputDriver(InputDriverInterface* driver) = 0;
416f783602c05c519238200fed55b0afa097737ca1Michael Wright
426f783602c05c519238200fed55b0afa097737ca1Michael Wright    virtual void dump(String8& result) = 0;
436f783602c05c519238200fed55b0afa097737ca1Michael Wright};
446f783602c05c519238200fed55b0afa097737ca1Michael Wright
456f783602c05c519238200fed55b0afa097737ca1Michael Wrightclass InputHost : public InputHostInterface {
466f783602c05c519238200fed55b0afa097737ca1Michael Wrightpublic:
476f783602c05c519238200fed55b0afa097737ca1Michael Wright    InputHost() = default;
486f783602c05c519238200fed55b0afa097737ca1Michael Wright
496f783602c05c519238200fed55b0afa097737ca1Michael Wright    virtual void registerInputDriver(InputDriverInterface* driver) override;
506f783602c05c519238200fed55b0afa097737ca1Michael Wright
516f783602c05c519238200fed55b0afa097737ca1Michael Wright    virtual void dump(String8& result) override;
526f783602c05c519238200fed55b0afa097737ca1Michael Wright
536f783602c05c519238200fed55b0afa097737ca1Michael Wrightprivate:
546f783602c05c519238200fed55b0afa097737ca1Michael Wright    std::vector<sp<InputDriverInterface>> mDrivers;
556f783602c05c519238200fed55b0afa097737ca1Michael Wright};
566f783602c05c519238200fed55b0afa097737ca1Michael Wright
576f783602c05c519238200fed55b0afa097737ca1Michael Wright} // namespace android
586f783602c05c519238200fed55b0afa097737ca1Michael Wright#endif // ANDRIOD_INPUT_HOST_H
59