1/* 2 * Copyright 2007-2009 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Copyright 1999 M.Kawamura 6 */ 7 8 9#ifndef CANNA_LOOPER_H 10#define CANNA_LOOPER_H 11 12 13#include <Messenger.h> 14#include <Font.h> 15#include <Looper.h> 16#include "CannaInterface.h" 17 18class CannaMethod; 19class KouhoWindow; 20class PaletteWindow; 21class BMenu; 22class BMessenger; 23 24extern Preferences gSettings; 25 26class CannaLooper : public BLooper { 27public: 28 CannaLooper(CannaMethod* method); 29 30 virtual void Quit(); 31 virtual void MessageReceived(BMessage* msg); 32 33 void EnqueueMessage(BMessage* msg); 34 status_t Init(); 35 status_t ReadSettings(char* basePath); 36 37 void SendInputStopped(); 38 void SendInputStarted(); 39 40private: 41 void _HandleKeyDown(BMessage* msg); 42 void _HandleLocationReply(BMessage* msg); 43 void _HandleMethodActivated(bool active); 44 void _ProcessResult(uint32 result); 45 void _ForceKakutei(); 46 47 CannaMethod* fOwner; 48 CannaInterface* fCanna; 49 BFont fKouhoFont; 50 KouhoWindow* fKouhoWindow; 51 PaletteWindow* fPaletteWindow; 52 BMenu* fMenu; 53}; 54 55#endif // CANNA_LOOPER_H 56