/* Copyright 1998 Acorn Computers Ltd
 *
 * 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 _tboxclass_h_
#define _tboxclass_h_

#include "toolbox.h"
#include "window.h"
#include "quit.h"
#include "menu.h"
#include "palchoose.h"
#include "walkth.h"

// List the Toolbox events we are interested in.
//
class MainMenu: public Menu
{
  void OnSelectionEvent( MenuSelectionEvent *selection, IdBlock *idb );
};

class WaitMessage
{
  public:

  int action_code;
  ObjectId waiting_object;
  WaitMessage  *next;

  WaitMessage(ObjectId w_obj, int a_code);
};

class MessageList
{
  WaitMessage *MessageObject;

  public:
  MessageList(void);
  ~MessageList(void);
  void RegisterWaitingForMessage(ObjectId w_obj, int a_code);
  void DeRegisterWaitingForMessage(ObjectId w_obj, int a_code);
  void DeRegisterWaitingForMessage(ObjectId w_obj);

  void FindAndImplimentMessageFunction(int action_code, WimpMessage *message);
};

class PalTask : public ToolboxTask
{
  private:
  MainMenu mIconMenu;
  PalchWin pal_choose;

  void DispatchEvent(int event);
  void OnAutoCreatedEvent( ToolboxObjectAutoCreatedEvent *auto_created, IdBlock *idb );

  void OnUserMessageEvent( WimpUserMessageEvent *user_message );
  void OnUserMessageRecordedEvent( WimpUserMessageRecordedEvent *user_message_recorded );
  void OnUserMessageAcknowledgeEvent( WimpUserMessageAcknowledgeEvent *user_message_acknowledge );

  public:
  MessageList user_message_list, recorded_message_list, acknowledge_message_list;

  PalTask(){};
  ~PalTask(){};
};

#endif
