1168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat/* 2168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * Copyright (C) 2008 The Android Open Source Project 3168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * 4168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * Licensed under the Apache License, Version 2.0 (the "License"); 5168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * you may not use this file except in compliance with the License. 6168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * You may obtain a copy of the License at 7168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * 8168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * http://www.apache.org/licenses/LICENSE-2.0 9168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * 10168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * Unless required by applicable law or agreed to in writing, software 11168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * distributed under the License is distributed on an "AS IS" BASIS, 12168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * See the License for the specific language governing permissions and 14168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat * limitations under the License. 15168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat */ 16168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat#ifndef __FRAMEWORK_CMD_HANDLER_H 17168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat#define __FRAMEWORK_CMD_HANDLER_H 18168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat 19b7286aa02e1e554a1ef21a957fabe593f05c1260Mathias Agopian#include "List.h" 20168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat 21fa644ffe944c01a9b00f8d7676d58394fabee285San Mehatclass SocketClient; 22168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat 23168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehatclass FrameworkCommand { 24168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehatprivate: 25168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat const char *mCommand; 26168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat 27168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehatpublic: 28168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat 29168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat FrameworkCommand(const char *cmd); 30168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat virtual ~FrameworkCommand() { } 31168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat 32c73a3a5771a2d29d1bae666bfde12f751d66fc96San Mehat virtual int runCommand(SocketClient *c, int argc, char **argv) = 0; 33168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat 34168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat const char *getCommand() { return mCommand; } 35168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat}; 36168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat 37b7286aa02e1e554a1ef21a957fabe593f05c1260Mathias Agopiantypedef android::sysutils::List<FrameworkCommand *> FrameworkCommandCollection; 38168415b822cae1f8b54ef09c41c11a9b97b87f40San Mehat#endif 39