sgfonts.h

Go to the documentation of this file.
00001 // $Id: sgfonts.h 1282 2006-06-09 09:46:49Z alex $
00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00003 ================================XARAHEADERSTART===========================
00004  
00005                Xara LX, a vector drawing and manipulation program.
00006                     Copyright (C) 1993-2006 Xara Group Ltd.
00007        Copyright on certain contributions may be held in joint with their
00008               respective authors. See AUTHORS file for details.
00009 
00010 LICENSE TO USE AND MODIFY SOFTWARE
00011 ----------------------------------
00012 
00013 This file is part of Xara LX.
00014 
00015 Xara LX is free software; you can redistribute it and/or modify it
00016 under the terms of the GNU General Public License version 2 as published
00017 by the Free Software Foundation.
00018 
00019 Xara LX and its component source files are distributed in the hope
00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00022 See the GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License along
00025 with Xara LX (see the file GPL in the root directory of the
00026 distribution); if not, write to the Free Software Foundation, Inc., 51
00027 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00028 
00029 
00030 ADDITIONAL RIGHTS
00031 -----------------
00032 
00033 Conditional upon your continuing compliance with the GNU General Public
00034 License described above, Xara Group Ltd grants to you certain additional
00035 rights. 
00036 
00037 The additional rights are to use, modify, and distribute the software
00038 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00039 library and any other such library that any version of Xara LX relased
00040 by Xara Group Ltd requires in order to compile and execute, including
00041 the static linking of that library to XaraLX. In the case of the
00042 "CDraw" library, you may satisfy obligation under the GNU General Public
00043 License to provide source code by providing a binary copy of the library
00044 concerned and a copy of the license accompanying it.
00045 
00046 Nothing in this section restricts any of the rights you have under
00047 the GNU General Public License.
00048 
00049 
00050 SCOPE OF LICENSE
00051 ----------------
00052 
00053 This license applies to this program (XaraLX) and its constituent source
00054 files only, and does not necessarily apply to other Xara products which may
00055 in part share the same code base, and are subject to their own licensing
00056 terms.
00057 
00058 This license does not apply to files in the wxXtra directory, which
00059 are built into a separate library, and are subject to the wxWindows
00060 license contained within that directory in the file "WXXTRA-LICENSE".
00061 
00062 This license does not apply to the binary libraries (if any) within
00063 the "libs" directory, which are subject to a separate license contained
00064 within that directory in the file "LIBS-LICENSE".
00065 
00066 
00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00068 ----------------------------------------------
00069 
00070 Subject to the terms of the GNU Public License (see above), you are
00071 free to do whatever you like with your modifications. However, you may
00072 (at your option) wish contribute them to Xara's source tree. You can
00073 find details of how to do this at:
00074   http://www.xaraxtreme.org/developers/
00075 
00076 Prior to contributing your modifications, you will need to complete our
00077 contributor agreement. This can be found at:
00078   http://www.xaraxtreme.org/developers/contribute/
00079 
00080 Please note that Xara will not accept modifications which modify any of
00081 the text between the start and end of this header (marked
00082 XARAHEADERSTART and XARAHEADEREND).
00083 
00084 
00085 MARKS
00086 -----
00087 
00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00089 designs are registered or unregistered trademarks, design-marks, and/or
00090 service marks of Xara Group Ltd. All rights in these marks are reserved.
00091 
00092 
00093       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00094                         http://www.xara.com/
00095 
00096 =================================XARAHEADEREND============================
00097  */
00098 // SGFonts.h - the FontsSGallery (Fonts SuperGallery) class
00099 
00100 #ifndef INC_SGFONTS
00101 #define INC_SGFONTS
00102 
00103 #ifndef EXCLUDE_GALS
00104 
00105 //#include "sgallery.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00106 //#include "sgscan.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00107 #include "sglib.h"
00108 #include "dragbmp.h"
00109 #include "sgdrag.h"
00110 #include "fontbase.h"
00111 
00112 // LibraryGallery
00113 #include "sglbase.h"
00114 
00115 class Document;
00116 class SuperGallery;
00117 class String_64;
00118 class String_256;
00119 class KernelBitmap;
00120 class SGDisplayNode;
00121 class DocCoord;
00122 class Msg;
00123 class SGDisplayGroup;
00124 class PathName;
00125 class NodeRenderableInk;
00126 class List;
00127 class OpDescriptor;     
00128 
00129 /***********************************************************************************************
00130 
00131 >   class SGFontsGroup : public SGDisplayGroup
00132 
00133     Author:     Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
00134     Created:    15/2/95
00135     Purpose:    This is a display tree group specifically for the fonts gallery - it disables
00136                 various documenty things, and provides overrides for the group text
00137     SeeAlso:    SuperGallery; SGDisplayGroup;
00138 
00139 ***********************************************************************************************/
00140 
00141 class CCAPI SGFontsGroup : public SGDisplayGroup
00142 {
00143     CC_DECLARE_DYNAMIC(SGFontsGroup);
00144 
00145 public:
00146     SGFontsGroup(SuperGallery *ParentGal,
00147                     Document *ParentDoc = NULL, Library *ParentLib = NULL,
00148                     String_64 *TText = NULL);
00149 
00150     virtual void ReadGroupTitle(void);
00151 
00152     virtual BOOL HandleEvent(SGEventType EventType, void *EventInfo, SGMiscInfo *MiscInfo);
00153 
00154     virtual BOOL GetBubbleHelp(DocCoord *MousePos, String_256 *Result);
00155 
00156     virtual BOOL GetStatusLineHelp(DocCoord *MousePos, String_256 *Result);
00157 
00158     virtual BOOL CanVirtualise(void);
00159 };
00160                      
00161 /***********************************************************************************************
00162 
00163 >   class SGDisplayPreviewFonts : public SGDisplayItem
00164 
00165     Author:     Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
00166     Created:    03/02/95
00167     Purpose:    This is the base-class for the installed font items in the fonts gallery.
00168                 An instance of this class should never be created, instead SGTTFItem and SGATMItem's
00169                 should be used.
00170 
00171     SeeAlso:    FontsSGallery; SuperGallery; SGDisplayItem
00172 
00173 ***********************************************************************************************/
00174 
00175 class CCAPI SGDisplayPreviewFonts : public SGDisplayItem
00176 {
00177     CC_DECLARE_DYNAMIC(SGDisplayPreviewFonts);
00178 
00179 public:
00180     SGDisplayPreviewFonts();
00181     ~SGDisplayPreviewFonts();
00182 
00183     virtual BOOL HandleEvent(SGEventType EventType, void *EventInfo,
00184                              SGMiscInfo *MiscInfo);
00185 
00186     void DragWasReallyAClick(SGMouseInfo *Mouse, SGMiscInfo *MiscInfo);
00187     
00188 protected:  // Internal handlers
00189 
00190     // Determines item size for the current DisplayMode and calculates FormatRect
00191     virtual void CalculateMyRect(SGFormatInfo *FormatInfo, SGMiscInfo *MiscInfo);
00192 
00193     // Redraws the item into the current FormatRect
00194     virtual void HandleRedraw(SGRedrawInfo *RedrawInfo, SGMiscInfo *MiscInfo);
00195 
00196     // Draw a thumbnail for this item
00197     virtual BOOL DrawThumb(RenderRegion *Renderer, SGRedrawInfo *RedrawInfo,
00198             SGMiscInfo *MiscInfo, DocRect *Rectangle, BOOL Background = FALSE);
00199 
00200     // Draw the text for this item
00201     virtual void DrawItemText(RenderRegion *Renderer, SGRedrawInfo *RedrawInfo,
00202             SGMiscInfo *MiscInfo, DocRect *Rectangle, DocRect *BmpRect, BOOL Selected);
00203 
00204     void MoveAfter(SGDisplayNode *NodeToMove);
00205 
00206     void MoveBefore(SGDisplayNode *NodeToMove);
00207 
00208     BOOL GetBubbleHelp(DocCoord *MousePos, String_256 *Result);
00209 
00210     BOOL GetStatusLineHelp(DocCoord *MousePos, String_256 *Result);
00211 
00212 public:     // Specialisations of this class
00213 
00214     // Return the display type for the mode
00215     static LibDisplayType GetDisplayType(SGMiscInfo *MiscInfo);
00216 
00217     virtual void GetNameText(String_256 *Result);
00218     virtual void GetFullInfoText(String_256 *Result);
00219     virtual INT32 CompareTo(SGDisplayNode *Other, INT32 SortKey);
00220 
00221     virtual BOOL CreateThumbnail(KernelBitmap **Bitmap);
00222 
00223     KernelBitmap *GetDisplayedKernelBitmap(SGMiscInfo *MiscInfo, BOOL Background);
00224 
00225     inline String_64 *GetDisplayedTextDescription(void);
00226 
00227     // Get the thumbnail size details for a specific mode
00228     static BOOL GetThumbnailDetails(INT32 Mode, UINT32 *X, UINT32 *Y, String_256 *Text);
00229 
00230     // generic searching/sorting function
00231     virtual void GetKeyWords(String_256 *Result);
00232 
00233     // Draw the specified 'type icon' for the item
00234     static void DrawTypeIcon(SGRedrawInfo *RedrawInfo, SGMiscInfo *MiscInfo, DocRect *TypeRect, FontClass Type);
00235 
00236     // Is this item being used by any of the loaded documents ?
00237     BOOL IsFontBeingUsed(void);
00238 
00239 public:
00240 
00241     // Pointer to bitmap for this display item (these are stored in the thumb cache)
00242     KernelBitmap *FontBitmap;
00243     String_64 FontDescription;
00244 
00245     // Needed to reference the thumbnails in the cache (a bodge in other words)
00246     // Each time we recreate the list of installed fonts for the gallery we 
00247     // assign new IDs to the items.
00248     UINT32 ID;
00249 
00250     // The current display mode
00251     static INT32 DMode;
00252 
00253     // enum of which type of font item we are - saves doing iskindof's everywhere
00254     FontClass Type;
00255 
00256     // The cached logfont
00257     LOGFONT *CachedLogFont;
00258     INT32 IntLeading;
00259 
00260     // If set, draw a null bounding rect for this item, and don't use the bitmap
00261     BOOL Invalid;
00262 };
00263 
00264 /***********************************************************************************************
00265 
00266 >   class SGTTFItem : public SGDisplayPreviewFonts
00267 
00268     Author:     Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
00269     Created:    07/10/95
00270     Purpose:    A DisplayTree node for TrueType fonts in the Fonts SuperGallery
00271 
00272     SeeAlso:    FontsSGallery; SuperGallery; SGDisplayItem
00273 
00274 ***********************************************************************************************/
00275 
00276 class SGTTFItem : public SGDisplayPreviewFonts
00277 {
00278     CC_DECLARE_DYNAMIC(SGTTFItem);
00279 
00280 public:
00281     SGTTFItem();
00282     ~SGTTFItem();
00283 
00284     SGTTFItem(KernelBitmap *PreviewFontsToDisplay, String_64 *Name,
00285         INT32 IL = 0, PLOGFONT lpelf = NULL, UINT32 TheID = 0);
00286                             
00287     virtual void GetFullInfoText(String_256 *Result);
00288     virtual BOOL CreateThumbnail(KernelBitmap **Bitmap);
00289  };
00290 
00291 /***********************************************************************************************
00292 
00293 >   class SGATMItem : public SGDisplayPreviewFonts
00294 
00295     Author:     Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
00296     Created:    07/10/95
00297     Purpose:    A DisplayTree node for ATM fonts in the Fonts SuperGallery
00298 
00299     SeeAlso:    FontsSGallery; SuperGallery; SGDisplayItem
00300 
00301 ***********************************************************************************************/
00302 
00303 class SGATMItem : public SGDisplayPreviewFonts
00304 {
00305     CC_DECLARE_DYNAMIC(SGATMItem);
00306 
00307 public:
00308     SGATMItem();
00309     ~SGATMItem();
00310 
00311     SGATMItem(KernelBitmap *PreviewFontsToDisplay, String_64 *Name,
00312         INT32 IL = 0, PLOGFONT lpelf = NULL, UINT32 TheID = 0);
00313 
00314     virtual void GetFullInfoText(String_256 *Result);
00315     virtual BOOL CreateThumbnail(KernelBitmap **Bitmap);
00316 };
00317 
00318 /********************************************************************************************
00319 
00320 >   inline String_64 *SGDisplayPreviewFonts::GetDisplayedTextDescription(void)
00321 
00322     Author:     Richard_Millican (Xara Group Ltd) <camelotdev@xara.com> (Based on template code by Jason)
00323     Created:    03/02/95
00324 
00325     Returns:    A pointer to the Description string which this Display Item uses.
00326             
00327     Purpose:    To find the Text description for this object
00328 
00329 ********************************************************************************************/
00330 
00331 String_64 *SGDisplayPreviewFonts::GetDisplayedTextDescription(void)
00332 {
00333     return(&FontDescription);
00334 }
00335 
00336 /***********************************************************************************************
00337 
00338 >   class FontsSGallery : public LibraryGallery
00339 
00340     Author:     Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
00341     Created:    03/02/95
00342     Purpose:    The Fonts SuperGallery class
00343 
00344     Notes:      SuperGalleries are specced in a number of docs including
00345                     specs\sgallery.doc ("super" gallery extensions)
00346                     specs\propui.doc  (gallery basic ui)
00347                 There is also howtouse\sgallery.doc which describes creating a supergallery
00348 
00349     SeeAlso:    SuperGallery; SGDisplayFonts
00350 
00351 ***********************************************************************************************/
00352 
00353 class FontsSGallery : public LibraryGallery
00354 {
00355     CC_DECLARE_DYNCREATE(FontsSGallery)
00356 
00357 public:
00358     FontsSGallery();
00359     ~FontsSGallery();
00360 
00361     // TRUE if the SuperGallery is also a LibraryGallery & has no non-library groups
00362     virtual BOOL IsLibraryGalleryWithNonLibraryGroups(void) {return FALSE;};
00363 
00364 public:
00365 
00366     // SG Message centre
00367     virtual MsgResult Message(Msg* Message);
00368 
00369     // Install / Deinstall fonts
00370     BOOL InstallFonts(BOOL Copy);
00371     BOOL DeinstallFonts(BOOL Delete);       
00372 
00373     // Install / Deinstall font
00374     BOOL InstallFont(PathName *FontFile, String_256 *Description, BOOL Temp);
00375     BOOL DeinstallFont(String_256 *FontDesc, BOOL Delete, LOGFONT *LogFnt = NULL);
00376 
00377     // Install / Deinstall TTF font
00378     BOOL InstallTTFFont(PathName *FontFile, String_256 *Description, BOOL Temp);
00379     BOOL DeinstallTTFFont(String_256 *FontDesc, BOOL Delete);
00380  
00381     static BOOL GetWindowsFontDirectory(String_256 *Result);
00382 
00383     static UINT32 CALLBACK FileHook(HWND hDlg, UINT32 iMsg, UINT32 wParam, INT32 lParam);
00384 
00385     // Return the offset which to start the font drag
00386     static INT32 GetDragFontOffset(KernelBitmap *Bmp);
00387 
00388 public:
00389     // Library Galleries must override these
00390 
00391     // Can we create indexes ?
00392     virtual BOOL CanCreateIndexes(void);
00393 
00394     // Get various default bits 'n' pieces
00395     virtual BOOL GetDefaults(String_256 *DefaultIndex, String_256 *IndexDesc, SGLibType *Type);
00396 
00397     // Get the default CD directory name for the gallery
00398     virtual BOOL GetLibraryDirectoryName(String_256 *LibDirName);
00399 
00400     // Check the entry in the index.txt file with our gallery, and return TRUE if it's a match
00401     virtual BOOL CheckForIndexMatch(StringBase *Txt);
00402 
00403     // Return a Section name for this gallery...
00404     virtual void WorkOutSectionName(String_256 *Section);
00405 
00406     // Get the quiet status of the gallery
00407     virtual BOOL GetQuietStatus(void);
00408 
00409     // Set the quiet status of the gallery
00410     virtual void SetQuietStatus(BOOL Status);
00411 
00412     // Scan for location of default CD library
00413     virtual BOOL ScanForLocation(SGLibType Type, StringBase *Result);
00414 
00415     // Return gallery type
00416     virtual SGLibType GetGalleryType() { return SGLib_Font;}
00417 
00418     virtual String_256* GetDefaultLibraryPath() {return &DefaultLibraryPath;}
00419 
00420     void SelectionHasChanged(void);
00421 
00422 private:
00423 
00424     // Button greying functions
00425     void DoShadeGallery(BOOL ShadeIt);
00426     BOOL InstalledFontsSelected(void);
00427     INT32 LibraryFontsSelected(void);
00428 
00429     // callback routine to expand a family into the individual members
00430     static INT32 CALLBACK EnumInstalledFamily(ENUMLOGFONT FAR*lpelf, NEWTEXTMETRIC FAR* lpntm, INT32 FontType, LPARAM handle);
00431     
00432     // callback routine for windows to call for each installed font present
00433     static INT32 CALLBACK EnumInstalledFonts(ENUMLOGFONT FAR*lpelf, NEWTEXTMETRIC FAR* lpntm, INT32 FontType, LPARAM handle);
00434 
00435     // Can we support keywords ?
00436     virtual BOOL CanSearchKeywords(void);
00437 
00438     // Sort the installed group
00439     void SortInstalledFonts(void);
00440         
00441 protected:              // Overridden upcall methods
00442 
00443     // After opening the gallery - create the groups...
00444     virtual BOOL PreCreate(void);
00445 
00446     // Action code - called for various sg messages
00447     virtual BOOL ApplyAction(SGActionType Action);
00448 
00449     // Adds an item to the given library display group
00450     virtual SGDisplayItem *AddLibraryItem(SGDisplayGroup *LibraryGroup, Library *ParentLib,
00451                                             LibraryIndex ItemIndex, BOOL bNew = FALSE);
00452 
00453     // Gets a FOT filename from the registry / win.ini file, etc...
00454     BOOL GetFOTNameFromRegistry(String_256 *Desc, PathName *FOTFile);
00455 
00456     // Writes an FOT filename and its association in the registry / ini file, etc...
00457     BOOL SetFOTNameInRegistry(String_256 *Desc, PathName *FOTFile);
00458 
00459     // Returns the registry key where the font info is stored
00460     BOOL GetFontsKey(String_256 *Key);
00461 
00462     void HandleDragStart(DragMessage *DragMsg);
00463 
00464     // Override for creating font library groups rather than display groups
00465     virtual SGDisplayGroup *AddLibraryGroup(Library *LibraryToDisplay, INT32 NumItems);
00466 
00467     // Dragging fonts between sections
00468     SGDisplayItem *CopyDisplayItem(SGDisplayItem *SourceItem, 
00469                             SGDisplayGroup *DestGroup, SGDisplayItem *TargetPosition);
00470 
00471     // A group of fonts has finished its drag
00472     virtual void AllItemsCopied(SGDisplayGroup *DestGroup);
00473 
00474     virtual void ApplySortNow(BOOL ApplyToEntireList);
00475 
00476     static BOOL UseWin95FontInstallMethod();
00477 
00478 protected:
00479     
00480     // Creates a new subtree for the installed fonts
00481     void CreateNewSubtreeForInstalledFonts(SGFontsGroup *ExistingGroup = NULL);
00482 
00483     // Optionally kills the old library font groups and adds in new ones it can find for the path
00484     BOOL CreateNewSubtreeForLibraryFonts(PathName *LibPath, BOOL WipeOld = TRUE);
00485 
00486 
00487 public:         // Overridden Command interface (for Ops and menu support)
00488     virtual BOOL InitMenuCommands(void);
00489         // Called on startup to initialise any desired menu commands. Will make repeated calls
00490         // to InitMenuCommand(), below.
00491 
00492     virtual BOOL BuildCommandMenu(GalleryContextMenu *TheMenu, SGMenuID MenuID);
00493         // Builds the command menu for the given menu pop-up (over an item, or options button)
00494 
00495     virtual OpState GetCommandState(StringBase *CommandID, String_256 *ShadeReason);
00496         // Returns an OpState indicating the state of this command, much like an Op GetState
00497 
00498     virtual void DoCommand(StringBase *CommandID);
00499         // Attempts to "do" the given command. Should call down to the base class to handle
00500         // any commands it can't deal with.
00501 
00502 public:
00503     // Apply the currently selected (or dragged) font from the gallery, optionally installing it, etc...
00504     static BOOL ApplyFont(BOOL Dropping, SGDisplayNode *TheNode, NodeRenderableInk* pObjectHit = NULL);
00505 
00506     // Install a font via dragging - warn and give option of cancelling
00507     static BOOL InstallDraggedLibFont(FontsSGallery *TheGallery, SGLibDisplayItem *FontItem, String_64 *Desc);
00508 
00509     // Return true if a font description is found in the installed group
00510     static BOOL IsFontAlreadyInstalled(String_256 *FontDesc, FontClass Class = FC_UNDEFINED);
00511 
00512     // Return true and the logfont if the described font is found in the installed group
00513     static BOOL FindLogFont(String_256 *FontDesc, LOGFONT **lplplf, FontClass Class = FC_UNDEFINED);
00514 
00515     // Function to call on font change messages
00516     static void DoFontChange(void);
00517 
00518     // Change strings ending with ;BOLDITALIC to a displayable version...
00519     static void MakeBoldItalicReadable(String_256 *Desc);
00520 
00521 protected:
00522 
00523     // This could go in a base class
00524     void SortGallery(void);
00525 
00526     // This is special to the fonts gallery
00527     BOOL BrowseClicked(void);
00528 
00529 public:
00530     
00531     // The installed fonts group
00532     static SGFontsGroup *InsGroup;
00533 
00534 protected:
00535 
00536     // ID count for installed fonts - used by thumbnail cache and saving code
00537     UINT32 IDCount;
00538 
00539     // Flag to say whether second EnumFF added anything
00540     static BOOL AddedFonts;
00541 
00542     // Sort of font that we're trying to enumerate with EnumFontFamilies
00543     static FontClass EnumFontClass;
00544 
00545 public:
00546     // Installed fonts thumbnail preview object
00547     SGThumbs *InsCache;
00548 
00549     // For use by the callback function
00550     static FontsSGallery *ThisGallery;      
00551 
00552     // Where to find the default library
00553     static String_256 DefaultLibraryPath;
00554 
00555     // If true then we're in the middle of installing or deinstalling some fonts
00556     static BOOL DontUpdate;
00557 
00558     // For keeping the display modes constant when next loaded
00559     static INT32 DefaultDisplayMode;
00560 
00561     // For keeping the sort keys constant when next loaded
00562     static UINT32 DefaultSortKeys;
00563 
00564     // Deinstalling fonts option
00565     static BOOL DeleteTTFandFOTfiles;
00566 
00567     // Use this as the large display mode string (for the installed fonts)
00568     static String_256 LargeDisplayString;
00569 
00570     // Quiet status of the gallery
00571     static BOOL QuietStatus;
00572 
00573     // Multiple drag warning status
00574     static BOOL WarnAboutSectionDragging;
00575 
00576     // Multiple ATM drag warning status
00577     static BOOL WarnAboutMultipleATMDragging;
00578 
00579 };
00580 
00581 /******************************************************************************/
00582                    
00583 // Optoken for the display bitmap gallery operation
00584 #define OPTOKEN_DISPLAYFONTSGALLERY _T("DisplayFontsGallery")   
00585 
00586 /********************************************************************************************
00587 
00588 >   class OpDisplayFontsGallery: public Operation
00589 
00590     Author:     Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
00591     Created:    03/02/95
00592     Purpose:    Displays the fonts gallery. This op can be attached to a menu, button or keypress
00593     SeeAlso:    -
00594 
00595 ********************************************************************************************/
00596 
00597 class CCAPI OpDisplayFontsGallery: public Operation
00598 {         
00599     CC_DECLARE_DYNCREATE( OpDisplayFontsGallery );
00600 
00601 public:
00602     static BOOL     Init();             
00603     static OpState  GetState(String_256*, OpDescriptor*);       
00604     void            Do(OpDescriptor*);
00605 };  
00606 
00607 /********************************************************************************************
00608 
00609 >   class SGLibFontItem: public SGLibDisplayItem
00610 
00611     Author:     Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
00612     Created:    16/3/95
00613 
00614     Purpose:    A library font gallery item
00615     SeeAlso:    SGClipartItem
00616     
00617 ********************************************************************************************/
00618 
00619 class SGLibFontItem: public SGLibDisplayItem
00620 {         
00621     CC_DECLARE_DYNAMIC( SGLibFontItem );
00622     
00623 public:
00624 
00625     SGLibFontItem();
00626     ~SGLibFontItem();
00627 
00628     SGLibFontItem(LibraryIndex LibraryIndexToDisplay, BOOL bNew = FALSE);
00629 
00630     LibDisplayType GetDisplayType(SGMiscInfo *MiscInfo);
00631 
00632     INT32 GetTextWidth(SGFormatInfo *FormatInfo, SGMiscInfo *MiscInfo);
00633 
00634     void GetNameText(String_256 *Result);
00635     void GetFullInfoText(String_256 *Result);
00636 
00637     UINT32 GetFontID(void);
00638 
00639     virtual BOOL HandleEvent(SGEventType EventType, void *EventInfo,
00640                              SGMiscInfo *MiscInfo);
00641 
00642     virtual BOOL GetNameTextPtr(TCHAR **Result);
00643 
00644     // Determines item size for the current DisplayMode and calculates FormatRect
00645     virtual void CalculateMyRect(SGFormatInfo *FormatInfo, SGMiscInfo *MiscInfo);
00646 
00647     // Redraws the item into the current FormatRect
00648     virtual void HandleRedraw(SGRedrawInfo *RedrawInfo, SGMiscInfo *MiscInfo);
00649 
00650     // Returns the 'Type' for this library item
00651     FontClass GetType(void);
00652 
00653     // Override default library sorting routine to add a font-type comparator
00654     virtual INT32 CompareTo(SGDisplayNode *Other, INT32 SortKey);
00655 
00656     virtual BOOL GetThumbFileName(String_256* path);
00657 
00658 
00659 protected:
00660 
00661     void MoveAfter(SGDisplayNode *NodeToMove);
00662 
00663     void MoveBefore(SGDisplayNode *NodeToMove);
00664 
00665     BOOL GetBubbleHelp(DocCoord *MousePos, String_256 *Result);
00666 
00667     BOOL GetStatusLineHelp(DocCoord *MousePos, String_256 *Result);
00668 };
00669 
00670 #endif
00671 #endif
00672 

Generated on Sat Nov 10 03:48:54 2007 for Camelot by  doxygen 1.4.4