Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXComposeContext.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                         C o m p o s e - C o n t e x t                         *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2005,2009 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (at your option) any later version.                                           *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 *********************************************************************************
00021 * $Id: FXComposeContext.h,v 1.14 2009/01/06 13:07:22 fox Exp $                  *
00022 ********************************************************************************/
00023 #ifndef FXCOMPOSECONTEXT_H
00024 #define FXCOMPOSECONTEXT_H
00025 
00026 #ifndef FXID_H
00027 #include "FXId.h"
00028 #endif
00029 
00030 namespace FX {
00031 
00032 
00033 class FXApp;
00034 class FXWindow;
00035 class FXFont;
00036 
00037 /**
00038 * Compose Context manages the state of an input method
00039 * if input method support is enabled.
00040 */
00041 class FXAPI FXComposeContext : public FXId {
00042   FXDECLARE(FXComposeContext)
00043 protected:
00044   FXWindow  *window;            // Window we belong to
00045   FXSelector message;           // Message to send it
00046 private:
00047 #ifndef WIN32
00048   void* fontset;
00049   static int  editStartCallback(void*,FXComposeContext*,void*);
00050   static void editDoneCallback(void*,FXComposeContext*,void*);
00051   static void editDrawCallback(void*,FXComposeContext*,void*);
00052   static void editCaretCallback(void*,FXComposeContext*,void*);
00053   static void statusStartCallback(void*,FXComposeContext*,void*);
00054   static void statusDoneCallback(void*,FXComposeContext*,void*);
00055   static void statusDrawCallback(void*,FXComposeContext*,void*);
00056 #endif
00057 protected:
00058   FXComposeContext();
00059 private:
00060   FXComposeContext(const FXComposeContext&);
00061   FXComposeContext &operator=(const FXComposeContext&);
00062 public:
00063 
00064   /// Construct compose context for given window
00065   FXComposeContext(FXApp* a,FXWindow* win=NULL,FXSelector sel=0);
00066 
00067   /// Create resource
00068   virtual void create();
00069 
00070   /// Destroy resource
00071   virtual void destroy();
00072 
00073   /// Focus in
00074   void focusIn();
00075 
00076   /// Focus out
00077   void focusOut();
00078 
00079   /// Set the font
00080   void setFont(FXFont* fnt);
00081 
00082   /// Set the spot
00083   void setSpot(FXint x,FXint y);
00084 
00085   /// Set the area
00086   void setArea(FXint x,FXint y,FXint w,FXint h);
00087 
00088   /// Translate key event
00089   FXString translateEvent(FXRawEvent& event);
00090 
00091   /// Destructor
00092   virtual ~FXComposeContext();
00093   };
00094 
00095 }
00096 
00097 #endif

Copyright © 1997-2009 Jeroen van der Zijp