caret.h
上传用户:hzhsqp
上传日期:2007-01-06
资源大小:1600k
文件大小:5k
- /*
- * caret.h
- *
- * Text editor caret description.
- *
- * Portable Windows Library
- *
- * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.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.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * The Original Code is Portable Windows Library.
- *
- * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
- *
- * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
- * All Rights Reserved.
- *
- * Contributor(s): ______________________________________.
- *
- * $Log: caret.h,v $
- * Revision 1.14 1999/03/10 03:49:51 robertj
- * More documentation adjustments.
- *
- * Revision 1.13 1999/03/09 08:01:47 robertj
- * Changed comments for doc++ support (more to come).
- *
- * Revision 1.12 1998/09/23 06:22:57 robertj
- * Added open source copyright license.
- *
- * Revision 1.11 1995/06/17 11:12:20 robertj
- * Documentation update.
- *
- * Revision 1.10 1995/06/04 12:42:45 robertj
- * Redesign of caret driver functions (made a lot more common).
- *
- * Revision 1.9 1995/03/14 12:41:02 robertj
- * Updated documentation to use HTML codes.
- *
- * Revision 1.8 1994/11/26 03:44:23 robertj
- * Documentation.
- *
- * Revision 1.7 1994/08/23 11:32:52 robertj
- * Oops
- *
- * Revision 1.6 1994/08/22 00:46:48 robertj
- * Added pragma fro GNU C++ compiler.
- *
- * Revision 1.5 1994/06/25 11:55:15 robertj
- * Unix version synchronisation.
- *
- * Revision 1.4 1994/01/03 04:42:23 robertj
- * Mass changes to common container classes and interactors etc etc etc.
- *
- * Revision 1.3 1993/08/21 01:50:33 robertj
- * Made Clone() function optional, default will assert if called.
- *
- * Revision 1.2 1993/07/14 12:49:16 robertj
- * Fixed RCS keywords.
- *
- */
- #define _PCARET
- #ifdef __GNUC__
- #pragma interface
- #endif
- class PInteractor;
- /**A class representing a caret indicator for text input. A caret is used to
- indicate where the current insertion point is in a line of text.
- */
- class PCaret : public PContainer
- {
- PCONTAINERINFO(PCaret, PContainer);
- public:
- /**Create the default caret. This consists of a single vertical line.
- */
- PCaret();
- /**Create a block caret of the specified dimensions.
- */
- PCaret(
- PDIMENSION dx, /// Width of the caret block.
- PDIMENSION dy /// Height of the caret block.
- );
- PCaret(
- const PDim & dim /// Width & height of the caret block.
- );
- /**@name Overrides from class PObject */
- /**Get whether the caret object is of the same size as the current caret.
- @return
- #EqualTo# if they are of the same size,
- #GreaterThan# otherwise.
- */
- virtual Comparison Compare(
- const PObject & obj /// Object to compare
- ) const;
- /**@name New functions for class */
- /**Set the dimensions of the caret to the width and height specified.
- */
- void SetDimensions(
- PDIMENSION dx, /// Width of the caret block.
- PDIMENSION dy /// Height of the caret block.
- );
- void SetDimensions(
- const PDim & dim /// Width & height of the caret block.
- );
- /**Activate the caret displaying it in the interactor.
- Note that the user does not normally call this function. It is called
- by the Ref{PInteractor} class when it gains the focus.
- */
- void Activate(
- PInteractor * activator, /// Interactor activating the caret.
- BOOL display /// Display caret.
- );
- /**Deactivate the caret removing it from the interactor.
- Note that the user does not normally call this function. It is called
- by the Ref{PInteractor} class when it loses the focus.
- */
- void Deactivate(
- PInteractor * activator /// Interactor activating the caret.
- );
- /**Show the caret displaying it in the interactor, if it is active.
- Note that the user does not normally call this function. It is called
- by the Ref{PInteractor} class when it shows the caret.
- */
- void Show(
- PInteractor * activator /// Interactor activating the caret.
- );
- /**Hide the caret removing it from the interactor, if it is active.
- Note that the user does not normally call this function. It is called
- by the Ref{PInteractor} class when it hides the caret.
- */
- void Hide(
- PInteractor * activator /// Interactor activating the caret.
- );
- /**Set the position of the physical caret, if it is active.
- Note that the user does not normally call this function. It is called
- by the Ref{PInteractor} class for example when the
- Ref{PInteractor::SetCaretPos()} function is called.
- */
- void SetPosition(
- PInteractor * activator /// Interactor activating the caret.
- );
- protected:
- /**@name Member variables; */
- /** Size of the caret. */
- PDim caretSize;
- private:
- // Overrides from class PContainer
- virtual BOOL SetSize(PINDEX newSize);
- #ifdef DOC_PLUS_PLUS
- };
- #endif
- // Class declaration continued in platform specific header file ///////////////