Back to index

lightning-sunbird  0.9+nobinonly
nsULE.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00002  * XPCTL : nsULE.h
00003  *
00004  * ***** BEGIN LICENSE BLOCK *****
00005  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00006  *
00007  * The contents of this file are subject to the Mozilla Public License Version
00008  * 1.1 (the "License"); you may not use this file except in compliance with
00009  * the License. You may obtain a copy of the License at
00010  * http://www.mozilla.org/MPL/
00011  *
00012  * Software distributed under the License is distributed on an "AS IS" basis,
00013  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00014  * for the specific language governing rights and limitations under the
00015  * License.
00016  *
00017  * The Original Code is mozilla.org code. The Initial Developer of the Original Code is Sun Microsystems, Inc.  Portions created by SUN are Copyright (C) 2000 SUN Microsystems, Inc. All Rights Reserved.
00018  *
00019  * The Initial Developer of the Original Code is
00020  * Sun Microsystems, Inc.
00021  * Portions created by the Initial Developer are Copyright (C) 2000
00022  * the Initial Developer. All Rights Reserved.
00023  *
00024  * Contributor(s):
00025  *   Prabhat Hegde (prabhat.hegde@sun.com)
00026  *
00027  * Alternatively, the contents of this file may be used under the terms of
00028  * either of the GNU General Public License Version 2 or later (the "GPL"),
00029  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00030  * in which case the provisions of the GPL or the LGPL are applicable instead
00031  * of those above. If you wish to allow use of your version of this file only
00032  * under the terms of either the GPL or the LGPL, and not to allow others to
00033  * use your version of this file under the terms of the MPL, indicate your
00034  * decision by deleting the provisions above and replace them with the notice
00035  * and other provisions required by the GPL or the LGPL. If you do not delete
00036  * the provisions above, a recipient may use your version of this file under
00037  * the terms of any one of the MPL, the GPL or the LGPL.
00038  *
00039  * ***** END LICENSE BLOCK ***** */
00040 #ifndef nsULE_H
00041 #define nsULE_H
00042 
00043 #include "nscore.h"
00044 #include "prtypes.h"
00045 
00046 #include "nsCtlCIID.h"
00047 #include "nsILE.h"
00048 
00049 #include "pango-types.h"
00050 #include "pango-glyph.h"
00051 
00052 /* Class nsULE : Declaration */
00053 class nsULE : public nsILE {
00054 public:
00055   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ULE_IID)
00056   NS_DEFINE_STATIC_CID_ACCESSOR(NS_ULE_CID)
00057   NS_DECL_ISUPPORTS
00058 
00059   nsULE(void);
00060   virtual ~nsULE(void);
00061 
00062   // Public Methods of nsULE - Used to handle CTL operations including
00063   // A> API used to generate Presentation Forms based on supported fonts
00064   // B> API used by common text operations such as cursor positioning
00065   //    and selection
00066 
00067   NS_IMETHOD NeedsCTLFix(const PRUnichar         *aString,
00068                          const PRInt32           aBeg,
00069                          const PRInt32           aEnd,
00070                          PRBool                  *aCTLNeeded);
00071 
00072   NS_IMETHOD GetPresentationForm(const PRUnichar *aString,
00073                                  PRUint32        aLength,
00074                                  const char      *aFontCharset,
00075                                  char            *aGlyphs,
00076                                  PRSize          *aOutLength,
00077                                  PRBool          aIsWide = PR_FALSE);
00078 
00079   NS_IMETHOD PrevCluster(const PRUnichar         *aString,
00080                          PRUint32                aLength,
00081                          const PRInt32           aIndex,
00082                          PRInt32                 *aPrevOffset);
00083 
00084   NS_IMETHOD NextCluster(const PRUnichar         *aString,
00085                          PRUint32                aLength,
00086                          const PRInt32           aIndex,
00087                          PRInt32                 *aNextOffset);
00088 
00089   NS_IMETHOD GetRangeOfCluster(const PRUnichar   *aString,
00090                                PRUint32          aLength,
00091                                const PRInt32     aIndex,
00092                                PRInt32           *aStart,
00093                                PRInt32           *aEnd);
00094 
00095  private:
00096   const char* GetDefaultFont(const PRUnichar);
00097   PRInt32     GetGlyphInfo(const PRUnichar*, PRInt32,
00098                            PangoliteGlyphString*,
00099                            const char* = (const char*)NULL);
00100 };
00101 #endif /* !nsULE_H */